Struct rvsim::Interp [−][src]
The interpeter.
This struct simply combines a CpuState
, Memory
and Clock
. An Interp
instance can be
fleeting, and doesn’t need to be kept around if the virtual CPU is paused, for example.
Fields
state: &'s mut CpuState
The CPU state.
mem: &'m mut M
The memory implementation.
clock: &'c mut C
The clock implementation.
Implementations
impl<'s, 'm, 'c, M: 'm + Memory, C: 'c + Clock> Interp<'s, 'm, 'c, M, C>
[src]
pub fn new(state: &'s mut CpuState, mem: &'m mut M, clock: &'c mut C) -> Self
[src]
Create a new interpreter.
pub fn run(&mut self) -> (CpuError, Option<Op>)
[src]
Run continuously until execution stops, starting at the current PC address.
Returns the stop reason and the instruction that caused the virtual CPU to stop. The
instruction may be None
if it failed to load or parse.
pub fn step(&mut self) -> Result<Op, (CpuError, Option<Op>)>
[src]
Step a single instruction, fetching it from the current PC address.
Returns the parsed instruction that was executed. When the instruction stops the virtual
CPU, additionally returns the stop reason. In the latter case, the instruction may be
None
if it failed to load or parse.
Auto Trait Implementations
impl<'s, 'm, 'c, M, C> RefUnwindSafe for Interp<'s, 'm, 'c, M, C> where
C: RefUnwindSafe,
M: RefUnwindSafe,
C: RefUnwindSafe,
M: RefUnwindSafe,
impl<'s, 'm, 'c, M, C> Send for Interp<'s, 'm, 'c, M, C> where
C: Send,
M: Send,
C: Send,
M: Send,
impl<'s, 'm, 'c, M, C> Sync for Interp<'s, 'm, 'c, M, C> where
C: Sync,
M: Sync,
C: Sync,
M: Sync,
impl<'s, 'm, 'c, M, C> Unpin for Interp<'s, 'm, 'c, M, C>
impl<'s, 'm, 'c, M, C> !UnwindSafe for Interp<'s, 'm, 'c, M, C>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,