Skip to main content

SimulationExecutor

Trait SimulationExecutor 

Source
pub trait SimulationExecutor {
    type Backend: SimBackend;

    // Required methods
    fn backend(&self) -> &Self::Backend;
    fn backend_mut(&mut self) -> &mut Self::Backend;
    fn eval_comb(&mut self) -> Result<(), SimulatorErrorCode>;
    fn eval_apply_ff_at(
        &mut self,
        event: <Self::Backend as SimBackend>::Event,
    ) -> Result<(), SimulatorErrorCode>;
    fn eval_only_ff_at(
        &mut self,
        event: <Self::Backend as SimBackend>::Event,
    ) -> Result<(), SimulatorErrorCode>;
    fn apply_ff_at(
        &mut self,
        event: <Self::Backend as SimBackend>::Event,
    ) -> Result<(), SimulatorErrorCode>;

    // Provided methods
    fn stage_external_event(
        &mut self,
        _event: <Self::Backend as SimBackend>::Event,
        _timestamp: u64,
    ) -> Result<(), SimulatorErrorCode> { ... }
    fn fire_external_event(
        &mut self,
        _event: <Self::Backend as SimBackend>::Event,
        _timestamp: u64,
    ) -> Result<(), SimulatorErrorCode> { ... }
    fn finish_timed_step(&mut self, _timestamp: u64) { ... }
}
Expand description

Backend execution hooks needed by the timed simulation engine.

The facade implements this contract to retain policy such as runtime-event decoration and waveform capture outside the backend-independent scheduler.

Required Associated Types§

Required Methods§

Source

fn backend(&self) -> &Self::Backend

Source

fn backend_mut(&mut self) -> &mut Self::Backend

Source

fn eval_comb(&mut self) -> Result<(), SimulatorErrorCode>

Source

fn eval_apply_ff_at( &mut self, event: <Self::Backend as SimBackend>::Event, ) -> Result<(), SimulatorErrorCode>

Source

fn eval_only_ff_at( &mut self, event: <Self::Backend as SimBackend>::Event, ) -> Result<(), SimulatorErrorCode>

Source

fn apply_ff_at( &mut self, event: <Self::Backend as SimBackend>::Event, ) -> Result<(), SimulatorErrorCode>

Provided Methods§

Source

fn stage_external_event( &mut self, _event: <Self::Backend as SimBackend>::Event, _timestamp: u64, ) -> Result<(), SimulatorErrorCode>

Snapshot external-component inputs immediately before an event domain evaluates its sequential logic.

Source

fn fire_external_event( &mut self, _event: <Self::Backend as SimBackend>::Event, _timestamp: u64, ) -> Result<(), SimulatorErrorCode>

Fire external-component hooks after the event domain commits and before the following combinational settle.

Source

fn finish_timed_step(&mut self, _timestamp: u64)

Called after the state for a simulation timestamp has stabilized.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§