pub struct Cpu { /* private fields */ }
Expand description
Central Processing Unit able to execute a given instruction and to determine which instruction should be fetched and executed next
Implementations
sourceimpl Cpu
impl Cpu
sourcepub fn sim(
&mut self,
in_m: Signal16,
instruction: Signal16,
reset: Signal
) -> (Signal, Signal16, Signal15, Signal16)
pub fn sim(
&mut self,
in_m: Signal16,
instruction: Signal16,
reset: Signal
) -> (Signal, Signal16, Signal15, Signal16)
Carries out the simulation, taking as input:
in_m
: data from memoryinstruction
: fetched from ROMreset
: whether to set the program counter to zero
It returns the following:
write_m
: whether to write to memoryout_m
: data going to memoryaddress_m
: memory addresspc
: program counter
pub fn get_pc(&self) -> Signal16
pub fn get_address_m(&self) -> Signal15
pub fn get_out_m(&self) -> Signal16
pub fn get_write_m(&self) -> Signal
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Cpu
impl Send for Cpu
impl Sync for Cpu
impl Unpin for Cpu
impl UnwindSafe for Cpu
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more