Trait libnoentiendo::cpu::Cpu

source ·
pub trait Cpu {
    // Required methods
    fn reset(&mut self);
    fn attach_trace_handler(&mut self, trace: Box<dyn TraceHandler>);
    fn get_cycle_count(&self) -> u64;
    fn tick(&mut self) -> u8;
    fn cleanup(&mut self) -> Result<(), &str>;
}

Required Methods§

source

fn reset(&mut self)

Reset this CPU, clearing internal state.

source

fn attach_trace_handler(&mut self, trace: Box<dyn TraceHandler>)

Attach the given handler to receive trace events from this CPU.

source

fn get_cycle_count(&self) -> u64

Return the number of cycles elapsed since the system last reset.

source

fn tick(&mut self) -> u8

Execute a single instruction. Return the number of cycles elapsed.

source

fn cleanup(&mut self) -> Result<(), &str>

Clean up any resources used by this CPU.

Implementors§