Skip to main content

Sim

Struct Sim 

Source
pub struct Sim { /* private fields */ }
Expand description

Simulator state for one FrozenHir circuit.

Implementations§

Source§

impl Sim

Source

pub fn new(hir: FrozenHir) -> Self

Source

pub fn with_engine(hir: FrozenHir, engine: TickEngine) -> Self

Source

pub fn engine(&self) -> TickEngine

Source

pub fn enable_vcd(&mut self, path: impl AsRef<Path>) -> Result<()>

Source

pub fn enable_fst(&mut self, path: impl AsRef<Path>) -> Result<(), FstError>

Optional FST: still dumps VCD, then converts with vcd2fst (AD-24).

Source

pub fn enable_fst_with( &mut self, path: impl AsRef<Path>, converter: impl AsRef<Path>, ) -> Result<(), FstError>

Same as enable_fst with an explicit converter (tests / RHDL_VCD2FST).

Source

pub fn finish_waves(&mut self) -> Result<(), FstError>

Flush VCD and, if FST was requested, run the documented converter.

Source

pub fn set_inputs(&mut self, inputs: PortValues)

Source

pub fn ports(&self) -> &PortValues

Source

pub fn tick(&mut self)

One rising edge of the module Clock (AD-15). Driven by FrozenHir assigns.

Source

pub fn coverage_report(&self) -> String

Source

pub fn coverage(&self) -> &Coverage

Borrow the live coverage recorder (FR105/FR109/FR114).

Source

pub fn write_coverage_artifacts( &self, out_dir: &Path, ) -> Result<(PathBuf, PathBuf)>

Write FR114 coverage.lcov + coverage.html under out_dir.

Source

pub fn register_fsm_states<I, S>(&mut self, fsm: &str, states: I)
where I: IntoIterator<Item = S>, S: Into<String>,

Register FSM state labels for FR109 / C3 state-visit coverage.

Source

pub fn sample_state_visit(&mut self, fsm: &str, state: &str)

Record a visit to an FSM state (after Self::register_fsm_states).

Source

pub fn settle(&mut self)

Recompute combinational nets from current ports/regs without a clock edge.

Use after Self::set_inputs when sequential logic samples same-cycle enables derived from inputs (e.g. wr_en && !full).

Auto Trait Implementations§

§

impl Freeze for Sim

§

impl RefUnwindSafe for Sim

§

impl Send for Sim

§

impl Sync for Sim

§

impl Unpin for Sim

§

impl UnsafeUnpin for Sim

§

impl UnwindSafe for Sim

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