pub trait ChipComms {
Show 13 methods
// Required methods
fn axi_translate(&self, addr: &str) -> Result<AxiData, AxiError>;
fn axi_read(
&self,
chip_if: &dyn ChipInterface,
addr: u64,
data: &mut [u8],
) -> Result<(), Box<dyn Error>>;
fn axi_write(
&self,
chip_if: &dyn ChipInterface,
addr: u64,
data: &[u8],
) -> Result<(), Box<dyn Error>>;
fn noc_read(
&self,
chip_if: &dyn ChipInterface,
noc_id: u8,
x: u8,
y: u8,
addr: u64,
data: &mut [u8],
) -> Result<(), Box<dyn Error>>;
fn noc_write(
&self,
chip_if: &dyn ChipInterface,
noc_id: u8,
x: u8,
y: u8,
addr: u64,
data: &[u8],
) -> Result<(), Box<dyn Error>>;
fn noc_broadcast(
&self,
chip_if: &dyn ChipInterface,
noc_id: u8,
addr: u64,
data: &[u8],
) -> Result<(), Box<dyn Error>>;
// Provided methods
fn noc_read32(
&self,
chip_if: &dyn ChipInterface,
noc_id: u8,
x: u8,
y: u8,
addr: u64,
) -> Result<u32, Box<dyn Error>> { ... }
fn noc_write32(
&self,
chip_if: &dyn ChipInterface,
noc_id: u8,
x: u8,
y: u8,
addr: u64,
value: u32,
) -> Result<(), Box<dyn Error>> { ... }
fn noc_broadcast32(
&self,
chip_if: &dyn ChipInterface,
noc_id: u8,
addr: u64,
value: u32,
) -> Result<(), Box<dyn Error>> { ... }
fn axi_read32(
&self,
chip_if: &dyn ChipInterface,
addr: u64,
) -> Result<u32, Box<dyn Error>> { ... }
fn axi_write32(
&self,
chip_if: &dyn ChipInterface,
addr: u64,
value: u32,
) -> Result<(), Box<dyn Error>> { ... }
fn axi_sread32(
&self,
chip_if: &dyn ChipInterface,
addr: &str,
) -> Result<u32, Box<dyn Error>> { ... }
fn axi_swrite32(
&self,
chip_if: &dyn ChipInterface,
addr: &str,
value: u32,
) -> Result<(), Box<dyn Error>> { ... }
}
Expand description
This is a generic trait which defines the high level chip communication primatives. It’s functions allow for the reading and writing of data to arbirary noc endpoints on any chip with the details of how the endpoint is accessed abstracted away.
For the ARC endpoint special functions are defined because unlike most noc endpoints the ARC addresses are mapped into the pci BAR address space.
Required Methods§
Sourcefn axi_translate(&self, addr: &str) -> Result<AxiData, AxiError>
fn axi_translate(&self, addr: &str) -> Result<AxiData, AxiError>
Translate a String path into the corresponding AXI address.
Sourcefn axi_read(
&self,
chip_if: &dyn ChipInterface,
addr: u64,
data: &mut [u8],
) -> Result<(), Box<dyn Error>>
fn axi_read( &self, chip_if: &dyn ChipInterface, addr: u64, data: &mut [u8], ) -> Result<(), Box<dyn Error>>
Read and write to the NOC using AXI address gotten from axi_translate
.
fn axi_write( &self, chip_if: &dyn ChipInterface, addr: u64, data: &[u8], ) -> Result<(), Box<dyn Error>>
Sourcefn noc_read(
&self,
chip_if: &dyn ChipInterface,
noc_id: u8,
x: u8,
y: u8,
addr: u64,
data: &mut [u8],
) -> Result<(), Box<dyn Error>>
fn noc_read( &self, chip_if: &dyn ChipInterface, noc_id: u8, x: u8, y: u8, addr: u64, data: &mut [u8], ) -> Result<(), Box<dyn Error>>
Read and write to a noc endpoint, this could be a local or remote chip.
fn noc_write( &self, chip_if: &dyn ChipInterface, noc_id: u8, x: u8, y: u8, addr: u64, data: &[u8], ) -> Result<(), Box<dyn Error>>
fn noc_broadcast( &self, chip_if: &dyn ChipInterface, noc_id: u8, addr: u64, data: &[u8], ) -> Result<(), Box<dyn Error>>
Provided Methods§
Sourcefn noc_read32(
&self,
chip_if: &dyn ChipInterface,
noc_id: u8,
x: u8,
y: u8,
addr: u64,
) -> Result<u32, Box<dyn Error>>
fn noc_read32( &self, chip_if: &dyn ChipInterface, noc_id: u8, x: u8, y: u8, addr: u64, ) -> Result<u32, Box<dyn Error>>
Convenience functions for reading and writing 32 bit values.