#![allow(non_camel_case_types)]

use strum_macros::EnumIter;

/// Offsets for Poseidon hash user logic core.
#[derive(Debug, Copy, Clone, EnumIter)]
pub enum INGO_POSEIDON_ADDR {
    ADDR_HIF2CPU_C_IMAGE_ID = 0x0,
    ADDR_HIF2CPU_C_IMAGE_PARAMTERS = 0x4,
    ADDR_CPU2HIF_C_MERKLE_TREE_HEIGHT = 0x8,
    ADDR_CPU2HIF_C_MERKLE_TREE_START_LAYER = 0xc,
    ADDR_CPU2HIF_C_INITIALIZATION_MODE = 0x10,
    ADDR_HIF2CPU_C_NOF_ELEMENTS_PENDING_ON_DMA_FIFO = 0x14,
    ADDR_HIF2CPU_C_NOF_RESULTS_PENDING_ON_DMA_FIFO = 0x18,
    ADDR_HIF2CPU_C_MAX_RECORDED_PENDING_RESULTS = 0x1c,
    ADDR_HIF2CPU_C_NOF_CLOCKS_SPENT_ON_CURRENT_TASK_LO = 0x20,
    ADDR_HIF2CPU_C_NOF_CLOCKS_SPENT_ON_CURRENT_TASK_HI = 0x24,
    ADDR_HIF2CPU_C_LAST_HASH_ID_SENT_TO_RING = 0x28,
    ADDR_HIF2CPU_C_LAST_ELEMENT_ID_SENT_TO_RING = 0x2c,
    ADDR_HIF2CPU_C_LAST_HASH_ID_SENT_TO_HOST = 0x30,
    ADDR_HIF2CPU_C_LAST_LAYER_IDX_SENT_TO_HOST = 0x34,
    ADDR_HIF2CPU_C_RING_NODE_ALMOST_FULL = 0x38,
    ADDR_HIF2CPU_C_NOF_CLOCKS_PASSED_FROM_LAST_RING_TRANSMIT_LO = 0x3c,
    ADDR_HIF2CPU_C_NOF_CLOCKS_PASSED_FROM_LAST_RING_TRANSMIT_HI = 0x40,
    ADDR_HIF2CPU_C_PROGRAM_MEMORY_INITIALIZATION_COUNTER = 0x44,
}

impl From<INGO_POSEIDON_ADDR> for u64 {
    fn from(addr: INGO_POSEIDON_ADDR) -> Self {
        addr as u64
    }
}
