Skip to main content

Blackhole

Struct Blackhole 

Source
pub struct Blackhole {
    pub chip_if: Arc<dyn ChipInterface + Send + Sync>,
    pub arc_if: Arc<dyn ChipComms + Send + Sync>,
    pub message_queue: OnceCell<MessageQueue<8>>,
    pub eth_locations: [EthCore; 14],
    pub eth_addrs: EthAddresses,
    /* private fields */
}

Fields§

§chip_if: Arc<dyn ChipInterface + Send + Sync>§arc_if: Arc<dyn ChipComms + Send + Sync>§message_queue: OnceCell<MessageQueue<8>>§eth_locations: [EthCore; 14]§eth_addrs: EthAddresses

Implementations§

Source§

impl Blackhole

Source

pub fn init_eth_addrs(&mut self) -> Result<(), PlatformError>

Source

pub fn get_if<T: ChipInterface>(&self) -> Option<&T>

Source

pub fn arc_fw_init_status(&self) -> Option<ArcFwInitStatus>

Source

pub fn check_arc_msg_safe(&self) -> bool

Source

pub fn spi_write(&self, addr: u32, value: &[u8]) -> Result<(), Box<dyn Error>>

Source

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

Source

pub fn get_local_chip_coord(&self) -> Result<EthAddr, PlatformError>

Source

pub fn get_boot_fs_tables_spi_read( &self, tag_name: &str, ) -> Result<Option<(u32, TtBootFsFd)>, Box<dyn Error>>

Source

pub fn decode_boot_fs_table( &self, tag_name: &str, ) -> Result<HashMap<String, Value>, Box<dyn Error>>

Source

pub fn encode_and_write_boot_fs_table( &self, hashmap: HashMap<String, Value>, tag_name: &str, ) -> Result<(), Box<dyn Error>>

Trait Implementations§

Source§

impl ChipImpl for Blackhole

Source§

fn update_init_state( &mut self, status: &mut InitStatus, ) -> Result<ChipInitResult, PlatformError>

Update the initialization state of the chip. The primary purpose of this function is to tell the caller when it is safe to starting interacting with the chip. Read more
Source§

fn get_arch(&self) -> Arch

Returns the current arch of the chip, can be used to avoid needing to ducktype when downcasting.
Source§

fn arc_msg(&self, msg: ArcMsgOptions) -> Result<ArcMsgOk, PlatformError>

Send an arc_msg to the underlying chip.
Source§

fn get_neighbouring_chips(&self) -> Result<Vec<NeighbouringChip>, PlatformError>

Get a list of neighbouring chips. Will return an empty list for gs and up to four chips for wh.
Source§

fn as_any(&self) -> &dyn Any

Convenience function to downcast to a concrete type.
Source§

fn get_telemetry(&self) -> Result<Telemetry, PlatformError>

Get telemetry information from the chip. The information is not cached, so should not be called repeatedly.
Source§

fn get_device_info(&self) -> Result<Option<DeviceInfo>, PlatformError>

Get information about the underlying chip transport. This is a hack to get the physical id of the chip.
Source§

impl Clone for Blackhole

Source§

fn clone(&self) -> Blackhole

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl HlComms for &Blackhole

Source§

fn comms_obj(&self) -> (&dyn ChipComms, &dyn ChipInterface)

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_multicast( &self, noc_id: u8, start: (u8, u8), end: (u8, 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 noc_read32( &self, noc_id: u8, x: u8, y: u8, addr: u64, ) -> Result<u32, Box<dyn Error>>

Source§

fn noc_write32( &self, noc_id: u8, x: u8, y: u8, addr: u64, value: u32, ) -> Result<(), Box<dyn Error>>

Source§

fn noc_broadcast32( &self, noc_id: u8, addr: u64, value: u32, ) -> Result<(), Box<dyn Error>>

Source§

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

Source§

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

Source§

fn axi_read32(&self, addr: u64) -> Result<u32, Box<dyn Error>>

Source§

fn axi_write32(&self, addr: u64, value: u32) -> Result<(), Box<dyn Error>>

Source§

impl HlComms for Blackhole

Source§

fn comms_obj(&self) -> (&dyn ChipComms, &dyn ChipInterface)

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_multicast( &self, noc_id: u8, start: (u8, u8), end: (u8, 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 noc_read32( &self, noc_id: u8, x: u8, y: u8, addr: u64, ) -> Result<u32, Box<dyn Error>>

Source§

fn noc_write32( &self, noc_id: u8, x: u8, y: u8, addr: u64, value: u32, ) -> Result<(), Box<dyn Error>>

Source§

fn noc_broadcast32( &self, noc_id: u8, addr: u64, value: u32, ) -> Result<(), Box<dyn Error>>

Source§

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

Source§

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

Source§

fn axi_read32(&self, addr: u64) -> Result<u32, Box<dyn Error>>

Source§

fn axi_write32(&self, addr: u64, value: u32) -> Result<(), Box<dyn Error>>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> HlCommsInterface for T
where T: HlComms,

Source§

fn axi_translate(&self, addr: impl AsRef<str>) -> Result<AxiData, AxiError>

Source§

fn axi_read_field<'a>( &self, addr: &AxiData, value: &'a mut [u8], ) -> Result<&'a [u8], PlatformError>

Source§

fn axi_write_field( &self, addr: &AxiData, value: &[u8], ) -> Result<(), PlatformError>

Source§

fn axi_sread<'a>( &self, addr: impl AsRef<str>, value: &'a mut [u8], ) -> Result<&'a [u8], PlatformError>

Source§

fn axi_sread_to_vec( &self, addr: impl AsRef<str>, ) -> Result<Vec<u8>, PlatformError>

Source§

fn axi_sread32(&self, addr: impl AsRef<str>) -> Result<u32, PlatformError>

Source§

fn axi_swrite( &self, addr: impl AsRef<str>, value: &[u8], ) -> Result<(), PlatformError>

Source§

fn axi_swrite32( &self, addr: impl AsRef<str>, value: u32, ) -> Result<(), PlatformError>

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.