Struct lc3_ensemble::sim::SimFlags

source ·
pub struct SimFlags {
    pub strict: bool,
    pub use_real_halt: bool,
    pub machine_init: MachineInitStrategy,
    pub debug_frames: bool,
}
Expand description

Configuration flags for Simulator.

These can be modified after the Simulator is created with Simulator::new and their effects should still apply.

Read the field descriptions for more details.

Fields§

§strict: bool

Whether strict mode is enabled.

Strict mode adds additional integrity checks to the simulator, such as verifying initialization state is normal for provided data.

§use_real_halt: bool

Whether to use the real HALT trap.

There are two implementations of HALT within Simulator:

  • virtual HALT: On execution of HALT or TRAP x25, the simulator is automatically halted before executing any true TRAP routine.
  • real HALT: On execution of HALT or TRAP x25, the TRAP routine for HALT implemented in the OS is run and executed as usual.

Real HALT is useful for maintaining integrity to the LC-3 ISA, whereas virtual HALT preserves the state of the machine prior to calling the OS’s HALT routine.

§machine_init: MachineInitStrategy

The creation strategy for uninitialized Words.

This is used to initialize the mem and reg_file fields.

§debug_frames: bool

Whether to store debugging information about call frames.

This flag only goes into effect after a Simulator::new or Simulator::reset call.

Trait Implementations§

source§

impl Clone for SimFlags

source§

fn clone(&self) -> SimFlags

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for SimFlags

source§

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

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

impl Default for SimFlags

source§

fn default() -> Self

The default flags.

They are defined as follows:

  • strict: false
  • use_real_halt: false
  • machine_init: default MachineInitStrategy
  • debug_frames: false
source§

impl PartialEq for SimFlags

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for SimFlags

source§

impl Eq for SimFlags

source§

impl StructuralPartialEq for SimFlags

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> CloneToUninit for T
where T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> CloneToUninit for T
where T: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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> ToOwned for T
where T: Clone,

§

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

§

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

§

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