Skip to main content

WImage

pub struct WImage {
Show 27 fields pub n_blocks: usize, pub n_params: usize, pub nreg: usize, pub blk_livein_ptr: Vec<u32>, pub blk_n_livein: Vec<u32>, pub blk_cell_ptr: Vec<u32>, pub blk_n_cells: Vec<u32>, pub blk_write_ptr: Vec<u32>, pub blk_n_writes: Vec<u32>, pub blk_term_kind: Vec<u32>, pub blk_t0: Vec<u32>, pub blk_t1: Vec<u32>, pub blk_top: Vec<u32>, pub blk_cdst: Vec<u32>, pub blk_cargc: Vec<u32>, pub blk_cargp: Vec<u32>, pub cell_kind: Vec<u32>, pub cell_code: Vec<u32>, pub cell_op0: Vec<u32>, pub cell_op1: Vec<u32>, pub cell_op2: Vec<u32>, pub cell_op3: Vec<u32>, pub wr_reg: Vec<u32>, pub wr_op: Vec<u32>, pub arg_op: Vec<u32>, pub liv_reg: Vec<u32>, pub konst: Vec<i64>,
}
Expand description

The flat, loadable image of a whole program: parallel per-field arrays the generic engine reads directly. Block b’s fields are blk_*[b]; its cells are cell_*[blk_cell_ptr[b] .. + blk_n_cells[b]]; and so on.

Fields§

§n_blocks: usize§n_params: usize§nreg: usize§blk_livein_ptr: Vec<u32>§blk_n_livein: Vec<u32>§blk_cell_ptr: Vec<u32>§blk_n_cells: Vec<u32>§blk_write_ptr: Vec<u32>§blk_n_writes: Vec<u32>§blk_term_kind: Vec<u32>§blk_t0: Vec<u32>§blk_t1: Vec<u32>§blk_top: Vec<u32>§blk_cdst: Vec<u32>§blk_cargc: Vec<u32>§blk_cargp: Vec<u32>§cell_kind: Vec<u32>§cell_code: Vec<u32>§cell_op0: Vec<u32>§cell_op1: Vec<u32>§cell_op2: Vec<u32>§cell_op3: Vec<u32>§wr_reg: Vec<u32>§wr_op: Vec<u32>§arg_op: Vec<u32>§liv_reg: Vec<u32>§konst: Vec<i64>

Implementations§

Source§

impl WImage

Source

pub fn hex_files(&self) -> Vec<(String, String)>

The $readmemh payloads for every field memory, as (memory-name, hex-lines) pairs. An EMPTY memory still emits one 0 line so $readmemh has a file to read (the engine never indexes an empty pool).

Source§

impl WImage

Source

pub fn wire_bytes(&self, params: &[i64]) -> Vec<u8> ⓘ

The exact byte stream a host sends OVER THE WIRE to the wpe_soc engine: for each of the 24 config memories (the hex_files order) a 2-byte big-endian entry count then that many big-endian words (4 bytes for the 23 u32 memories, 8 for konst), then a 2-byte param count + that many 8-byte params, then the IMAGE_GO marker. The on-chip loader FSM reproduces the identical config in on-chip memory — so the chip SYNTHESIZES the program it is handed. Single source of truth for both the iverilog host and the FPGA host.

Source

pub fn wire_bytes_preloaded(&self, params: &[i64], heap_init: &[i64]) -> Vec<u8> ⓘ

As Self::wire_bytes but with an optional HEAP PRE-LOAD segment — the streamed-weights path. heap_init is loaded into heap[0..heap_init.len()] before the run (the DATA-segment model), so loaded() (heap pointer 0) reads it; the engine seeds its bump allocator past the pre-load and clears only the runtime region. The segment is BACKWARD-COMPATIBLE and marker-delimited: when heap_init is empty the stream is byte-identical to wire_bytes (…params + IMAGE_GO); when non-empty, an IMAGE_HEAP marker after the params introduces a u16 word-count then that many u64 words, then the IMAGE_GO byte. So a non-streamed program’s wire format is unchanged (the loader sees IMAGE_GO right after the params) and only streamed programs carry the extra segment.

Trait Implementations§

Source§

impl Default for WImage

Source§

fn default() -> WImage

Returns the “default value” for a type. Read more

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
§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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, 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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,