Skip to main content

Engine

Struct Engine 

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

One assertion’s runtime state. A clone evaluates a step without touching the original (a trial run, e.g. a checker’s solution attempt, 17.7.2).

Implementations§

Source§

impl Engine

Source

pub fn sampled_row(&self) -> &[u128]

The row this step’s tick samples: the previous step’s final values.

Source

pub fn tick_row(&self) -> Cow<'_, [u128]>

The row Host::clock_ticked reads (see EngineConfig::tick_history): the sampled row, or with a history-reading clocking event the position row.

Source

pub fn set_sampled_words(&mut self, words: &[(usize, u128)])

Overrides words of the sampled row with their current values: an active free checker variable’s sampled value is its current one (17.7.2).

Source

pub fn new( cfg: EngineConfig, initial_row: Vec<u128>, ) -> Result<Self, EngineError>

Source

pub fn set_checking(&mut self, on: bool)

$asserton/$assertoff (20.11): whether a static assertion starts new attempts. A procedural one starts attempts only for instances that matured (Engine::activate); whether an instance is queued at all is decided where it is queued, so the flag does not hold back an instance already waiting for its clock.

Source

pub fn set_action_flags(&mut self, flags: u32)

The action flags attempts started from now on carry (see Event::flags).

Source

pub fn kill(&mut self)

$assertkill (20.11): aborts every executing attempt – they report nothing and run no action – and drops the matured instances still waiting to start. The statistics keep what they counted.

Source

pub fn kind(&self) -> AssertKind

Source

pub fn stats(&self) -> Stats

Source

pub fn live_set(&self) -> &[LeafId]

The live leaves the host must be able to answer Host::live for.

Source

pub fn end_of_step(&mut self, row: Vec<u128>)

The signal row of the end of the time step that just finished: the sampled values of the next one.

Source

pub fn end_of_step_with(&mut self, fill: impl FnOnce(&mut [u128]))

Self::end_of_step that has fill write the row in place (over zeros), which saves the allocation of a row per step.

Source

pub fn activate(&mut self, now: u64, values: Vec<i64>)

A procedural concurrent assertion instance matured in the Observed region of time step now (16.14.6), with the values it captured when the procedure reached it. When the leading clock ticked in this very step its attempt begins at once; otherwise the instance waits for the next tick. Call it before Engine::fire of the same step.

Source

pub fn activate_tagged(&mut self, now: u64, values: Vec<i64>, tag: u64)

Engine::activate with a tag the attempt’s Events carry back.

An AssertKind::Expect instance never starts in the step it was activated in, whether or not the leading clock ticked there: its first evaluation is on the subsequent clocking event (16.17).

Source

pub fn live_tuples(&self) -> usize

The number of captured-value tuples whose disable iff value the engine records (see EngineConfig::disable_mixed); bounded by the live instances, which a long run’s test observes.

Source

pub fn set_step(&mut self, id: u64, on: bool)

The Observed-region step at simulation time now. Returns the outcomes decided by it, in attempt-start order. Discards the attempt with ordinal id (VPI vpiAssertionKill, 39.5.2): it reports nothing; the assertion stays enabled. Whether it was pending. Turns step reporting for attempt id on or off (39.5.2 vpiAssertionEnableStep/vpiAssertionDisableStep). Reported steps are collected by Engine::take_steps.

Source

pub fn set_step_new(&mut self, on: bool)

Whether every attempt that starts from now on has its steps reported (39.5.2: stepping requested for an attempt start time not reached yet). The caller turns it off again after the time step.

Source

pub fn set_fail_leaf(&mut self, on: bool)

Whether a failure records the leaf it failed on (Engine::take_fail_leaves).

Source

pub fn take_started(&mut self) -> Vec<(u64, u64)>

With EngineConfig::future: the start times of the attempts started since the last call, by attempt ordinal (empty otherwise).

Source

pub fn take_steps(&mut self) -> Vec<StepRecord>

The steps reported since the last call.

Source

pub fn take_fail_leaves(&mut self) -> Vec<(u64, Option<LeafId>)>

The failures reported since the last call with the leaf each failed on (None when it read none), by attempt ordinal.

Source

pub fn kill_attempt(&mut self, id: u64) -> bool

Source

pub fn disabled_attempts(&self) -> &[(u64, Option<u64>)]

The ordinals of the attempts the last Engine::fire found disabled.

Source

pub fn fire( &mut self, host: &dyn Host, now: u64, ) -> Result<Vec<Event>, TraceError>

Trait Implementations§

Source§

impl Clone for Engine

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

Auto Trait Implementations§

§

impl !Freeze for Engine

§

impl !RefUnwindSafe for Engine

§

impl !Sync for Engine

§

impl Send for Engine

§

impl Unpin for Engine

§

impl UnsafeUnpin for Engine

§

impl UnwindSafe for Engine

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