Skip to main content

RunConfig

Struct RunConfig 

Source
pub struct RunConfig {
    pub instct: i64,
    pub time_divisor: u32,
    pub fixed_update: bool,
    pub do_sleep: bool,
    pub single_step: bool,
    pub trace: Option<Box<dyn Write>>,
}
Expand description

Parameters that control the Emulator::run loop.

Fields§

§instct: i64

Maximum number of instructions to execute. -1 means unlimited.

§time_divisor: u32

Time divisor applied to wall-clock time before feeding the CLINT timer. 1 = real time. Values > 1 make the CPU appear slower, which is useful for deterministic testing (-l locks it to the instruction counter).

§fixed_update: bool

When true, the cycle counter is used as the time base instead of wall-clock time. Produces fully deterministic execution.

§do_sleep: bool

When true, the run loop calls Platform::mini_sleep during WFI to avoid burning host CPU. Disable with -p for maximum throughput.

§single_step: bool

When true, execute one instruction per loop iteration and call Emulator::dump_state after each one. Enabled by -s.

§trace: Option<Box<dyn Write>>

Optional writer for the compact execution trace (--trace <FILE>). When Some, every instruction is logged with the registers it modified.

Trait Implementations§

Source§

impl Default for RunConfig

Source§

fn default() -> Self

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