Skip to main content

DesignImage

Struct DesignImage 

Source
pub struct DesignImage {
Show 27 fields pub abi_version: u32, pub tick_exp: i32, pub x_initial_zero: bool, pub templates: Vec<TemplateImage>, pub instances: Vec<InstanceImage>, pub foreign: Vec<ForeignImage>, pub x_windows: Vec<XWindow>, pub wires: Vec<WireImage>, pub groups: Vec<GroupImage>, pub networks: Vec<NetworkImage>, pub symbols: Vec<String>, pub kernels: Vec<KernelImage>, pub fork_table: Vec<SpawnSpec>, pub fork_branches: Vec<ForkBranchImage>, pub wait_table: Vec<WaitTableEntry>, pub strings: Vec<Vec<u8>>, pub collections: Vec<FrozenData>, pub classes: Vec<TemplateSnapshot>, pub dump_signals: Vec<DumpSignalImage>, pub stmt_cov: Option<Vec<StmtSiteImage>>, pub fsms: Vec<FsmImage>, pub dpi: DpiImage, pub verif: VerifImage, pub timing: TimingImage, pub randomize: Vec<u8>, pub native_nets: Vec<u8>, pub vpi: Vec<u8>,
}
Expand description

Everything a runner needs to assemble and run one design.

Fields§

§abi_version: u32

sv_sim_abi::SV_SIM_ABI_VERSION the kernels were compiled against.

§tick_exp: i32

The scheduler tick exponent (1e<tick_exp> seconds), which %t defaults to.

§x_initial_zero: bool

Build default for --x-initial-zero.

§templates: Vec<TemplateImage>§instances: Vec<InstanceImage>§foreign: Vec<ForeignImage>§x_windows: Vec<XWindow>§wires: Vec<WireImage>

Port connection wires, in registration order.

§groups: Vec<GroupImage>

Resolved net groups (resolvers register in group order, switch networks first).

§networks: Vec<NetworkImage>§symbols: Vec<String>

Every function name the image refers to by index.

§kernels: Vec<KernelImage>§fork_table: Vec<SpawnSpec>§fork_branches: Vec<ForkBranchImage>§wait_table: Vec<WaitTableEntry>§strings: Vec<Vec<u8>>

Every interned string but "", in id order (crate::strings::snapshot). A string’s id is baked into machine code and into cells’ initial values, so the runner re-interns these first, in this order.

§collections: Vec<FrozenData>

Every constant collection (crate::collections::frozen_snapshot), the same way: entry i is handle (1 << 32) | (i + 1).

§classes: Vec<TemplateSnapshot>

Every class template’s runtime metadata (crate::objects::template_snapshot), by ascending template id. Registered with the object heap before the design runs, so release, copy, $cast and the cycle collector see the same classes they saw in the process that built the image.

§dump_signals: Vec<DumpSignalImage>

Every dumpable signal, in the order $dumpvars numbers them.

§stmt_cov: Option<Vec<StmtSiteImage>>

Some(defining module name of each statement site) when the code was generated with statement-coverage probes (build-aot --coverage, LRM 40.2.1 a); None otherwise.

§fsms: Vec<FsmImage>

The FSMs the 40.4 pragmas name, one per instance (LRM 40.2.1 c).

§dpi: DpiImage

The design’s DPI-C imports and exports.

§verif: VerifImage

Assertions, checker free variables and sampled-value guards.

§timing: TimingImage

Timing options and the timing plan (primitives, specify, timing checks, SDF).

§randomize: Vec<u8>

The constraint solver’s programs and randomize() call-site specs (crate::constraints::registry::snapshot), opaque here; empty for a design that never randomizes.

§native_nets: Vec<u8>

The resolvers no GroupImage describes (user-defined nettypes, unpacked-array nets), opaque here: its typed codec lives in sv-sim-exec::usernets, which owns the code that runs it. Empty for a design with none.

§vpi: Vec<u8>

The VPI object model (sv-sim-bin vpi::model::VpiModel::encode: objects, handle relations, properties, expression nodes, name indexes), opaque here; empty for an image built without VPI. Present so a design runs the same user VPI libraries under the AOT runner as under the JIT, with no slang at run time.

Implementations§

Source§

impl DesignImage

Source

pub fn encode(&self) -> Vec<u8> ⓘ

The image’s deterministic encoding.

Source

pub fn decode(bytes: &[u8]) -> Result<DesignImage, ImageError>

Decodes and cross-checks an image (every index must land in its table).

Source

pub fn validate(&self) -> Result<(), ImageError>

Every reference in the image lands in its table.

Source§

impl DesignImage

Source

pub fn empty(abi_version: u32) -> Self

An image with no content (for tests and as a builder’s start).

Source

pub fn intern(&mut self, name: &str) -> u32

Interns name, returning its index in Self::symbols.

Source

pub fn symbol(&self, index: u32) -> Option<&str>

The name behind a symbol index.

Source

pub fn bank(&self) -> Option<InstanceId>

The synthetic driver-contribution bank, if the design has one.

Source

pub fn layout_of(&self, key: &TemplateKey) -> Option<&StateLayout>

The layout of key’s template.

Trait Implementations§

Source§

impl Clone for DesignImage

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for DesignImage

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for DesignImage

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for DesignImage

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

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

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, 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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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 = !

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

fn try_from(value: U) -> Result<T, !>

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

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

Source§

fn vzip(self) -> V