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§
Sourcefn get_device_info(&self) -> Result<Option<DeviceInfo>, Box<dyn Error>>
fn get_device_info(&self) -> Result<Option<DeviceInfo>, Box<dyn Error>>
Access information about the underlying chip.
Sourcefn axi_read(&self, addr: u32, data: &mut [u8]) -> Result<(), Box<dyn Error>>
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
fn axi_write(&self, addr: u32, data: &[u8]) -> Result<(), Box<dyn Error>>
Sourcefn noc_read(
&self,
noc_id: u8,
x: u8,
y: u8,
addr: u64,
data: &mut [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>>
Read and write to a noc endpoint on the chip.
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>>
Sourcefn 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_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.