Skip to main content

SystemInstructionHandler

Trait SystemInstructionHandler 

Source
pub trait SystemInstructionHandler<Reg, Memory, PC, CustomError = CustomErrorPlaceholder>
where Reg: Register, [(); Reg::N]:,
{ // Required method fn handle_ecall( &mut self, regs: &mut Registers<Reg>, memory: &mut Memory, program_counter: &mut PC, ) -> Result<ControlFlow<()>, ExecutionError<Reg::Type, CustomError>>; // Provided methods fn handle_fence(&mut self, pred: u8, succ: u8) { ... } fn handle_fence_tso(&mut self) { ... } fn handle_ebreak( &mut self, regs: &mut Registers<Reg>, memory: &mut Memory, pc: Reg::Type, ) { ... } }
Expand description

Custom handler for system instructions ecall and ebreak

Required Methods§

Source

fn handle_ecall( &mut self, regs: &mut Registers<Reg>, memory: &mut Memory, program_counter: &mut PC, ) -> Result<ControlFlow<()>, ExecutionError<Reg::Type, CustomError>>

Handle an ecall instruction

Provided Methods§

Source

fn handle_fence(&mut self, pred: u8, succ: u8)

Handle a fence instruction

Source

fn handle_fence_tso(&mut self)

Handle a fence.tso instruction

Source

fn handle_ebreak( &mut self, regs: &mut Registers<Reg>, memory: &mut Memory, pc: Reg::Type, )

Handle an ebreak instruction.

NOTE: the program counter here is the current value, meaning it is already incremented past the instruction itself.

Implementors§