pub trait ExecutableInstruction<Regs, Env, Memory, PC>where
Self: ExecutableInstructionOperands + ExecutableInstructionCsr<Env>,{
// Required method
fn execute(
self,
rs1rs2_values: Rs1Rs2OperandValues<<Self::Reg as Register>::Type>,
regs: &mut Regs,
env: &mut Env,
memory: &mut Memory,
program_counter: &mut PC,
) -> ExecutionResult<Self::Reg>;
}Expand description
Trait for executable instructions
Required Methods§
Sourcefn execute(
self,
rs1rs2_values: Rs1Rs2OperandValues<<Self::Reg as Register>::Type>,
regs: &mut Regs,
env: &mut Env,
memory: &mut Memory,
program_counter: &mut PC,
) -> ExecutionResult<Self::Reg>
fn execute( self, rs1rs2_values: Rs1Rs2OperandValues<<Self::Reg as Register>::Type>, regs: &mut Regs, env: &mut Env, memory: &mut Memory, program_counter: &mut PC, ) -> ExecutionResult<Self::Reg>
Execute instruction.
Instructions might place additional constraints on Env to require additional registers,
handlers (like SystemInstructionHandler) or other resources. If no such constraint is
used, () can be used as a placeholder.
On success ExecutionResult::Continue { rd: rd, value: rd_value } is returned, which will
be written into the register file. In most cases this is the only register that needs to
be written. If no value needs to be written, ExecutionResult::ContinueNoWrite should be
returned, which skips the register file write entirely.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".