Trait ChipInterface

Source
pub trait ChipInterface: 'static {
    // Required methods
    fn get_device_info(&self) -> Result<Option<DeviceInfo>, Box<dyn Error>>;
    fn axi_read(&self, addr: u32, data: &mut [u8]) -> Result<(), Box<dyn Error>>;
    fn axi_write(&self, addr: u32, data: &[u8]) -> Result<(), Box<dyn Error>>;
    fn noc_read(
        &self,
        noc_id: u8,
        x: u8,
        y: u8,
        addr: u64,
        data: &mut [u8],
    ) -> Result<(), Box<dyn Error>>;
    fn noc_write(
        &self,
        noc_id: u8,
        x: u8,
        y: u8,
        addr: u64,
        data: &[u8],
    ) -> Result<(), Box<dyn Error>>;
    fn noc_broadcast(
        &self,
        noc_id: u8,
        addr: u64,
        data: &[u8],
    ) -> Result<(), Box<dyn Error>>;
    fn eth_noc_read(
        &self,
        eth_addr: EthAddr,
        noc_id: u8,
        x: u8,
        y: u8,
        addr: u64,
        data: &mut [u8],
    ) -> Result<(), Box<dyn Error>>;
    fn eth_noc_write(
        &self,
        eth_addr: EthAddr,
        noc_id: u8,
        x: u8,
        y: u8,
        addr: u64,
        data: &[u8],
    ) -> Result<(), Box<dyn Error>>;
    fn eth_noc_broadcast(
        &self,
        eth_addr: EthAddr,
        noc_id: u8,
        addr: u64,
        data: &[u8],
    ) -> Result<(), Box<dyn Error>>;
    fn as_any(&self) -> &dyn Any;
}
Expand description

This trait is used to abstract the interface to the lowest level chip communication primatives. These primatives are defined to be a chip resource which requires exclusive access to safely use.

The implementation makes no attempt to use the borrow checker to enforce this exclusive access rule because the primary implementors of this trait will be C++ and Python code.

Required Methods§

Source

fn get_device_info(&self) -> Result<Option<DeviceInfo>, Box<dyn Error>>

Access information about the underlying chip.

Source

fn axi_read(&self, addr: u32, data: &mut [u8]) -> Result<(), Box<dyn Error>>

Read and write to the noc endpoint on the chip in implementation this may take the form of a direct pci bar read/write or a noc read/write

Source

fn axi_write(&self, addr: u32, data: &[u8]) -> Result<(), Box<dyn Error>>

Source

fn noc_read( &self, noc_id: u8, x: u8, y: u8, addr: u64, data: &mut [u8], ) -> Result<(), Box<dyn Error>>

Read and write to a noc endpoint on the chip.

Source

fn noc_write( &self, noc_id: u8, x: u8, y: u8, addr: u64, data: &[u8], ) -> Result<(), Box<dyn Error>>

Source

fn noc_broadcast( &self, noc_id: u8, addr: u64, data: &[u8], ) -> Result<(), Box<dyn Error>>

Source

fn eth_noc_read( &self, eth_addr: EthAddr, noc_id: u8, x: u8, y: u8, addr: u64, data: &mut [u8], ) -> Result<(), Box<dyn Error>>

Read and write to a noc endpoint via ethernet on a local or remote chip.

Source

fn eth_noc_write( &self, eth_addr: EthAddr, noc_id: u8, x: u8, y: u8, addr: u64, data: &[u8], ) -> Result<(), Box<dyn Error>>

Source

fn eth_noc_broadcast( &self, eth_addr: EthAddr, noc_id: u8, addr: u64, data: &[u8], ) -> Result<(), Box<dyn Error>>

Source

fn as_any(&self) -> &dyn Any

Implementations on Foreign Types§

Source§

impl ChipInterface for Arc<dyn ChipInterface + Send + Sync>

Source§

fn get_device_info(&self) -> Result<Option<DeviceInfo>, Box<dyn Error>>

Source§

fn axi_read(&self, addr: u32, data: &mut [u8]) -> Result<(), Box<dyn Error>>

Source§

fn axi_write(&self, addr: u32, data: &[u8]) -> Result<(), Box<dyn Error>>

Source§

fn noc_read( &self, noc_id: u8, x: u8, y: u8, addr: u64, data: &mut [u8], ) -> Result<(), Box<dyn Error>>

Source§

fn noc_write( &self, noc_id: u8, x: u8, y: u8, addr: u64, data: &[u8], ) -> Result<(), Box<dyn Error>>

Source§

fn noc_broadcast( &self, noc_id: u8, addr: u64, data: &[u8], ) -> Result<(), Box<dyn Error>>

Source§

fn eth_noc_read( &self, eth_addr: EthAddr, noc_id: u8, x: u8, y: u8, addr: u64, data: &mut [u8], ) -> Result<(), Box<dyn Error>>

Source§

fn eth_noc_write( &self, eth_addr: EthAddr, noc_id: u8, x: u8, y: u8, addr: u64, data: &[u8], ) -> Result<(), Box<dyn Error>>

Source§

fn eth_noc_broadcast( &self, eth_addr: EthAddr, noc_id: u8, addr: u64, data: &[u8], ) -> Result<(), Box<dyn Error>>

Source§

fn as_any(&self) -> &dyn Any

Implementors§

Source§

impl<T: Clone + Send + 'static> ChipInterface for CallbackStorage<T>