pub trait ExecutableInstruction<Regs, Env, Memory, PC>where
Self: ExecutableInstructionOperands + ExecutableInstructionCsr<Env>,{
// Required method
fn execute(
self,
rs1rs2_values: Rs1Rs2OperandValues<<<Self::Hart as HartConfig>::Reg as Register>::Type>,
regs: &mut Regs,
env: &mut Env,
memory: &mut Memory,
program_counter: &PC,
) -> ExecutionResult<<Self::Hart as HartConfig>::Reg>;
}Expand description
Trait for executable instructions
Required Methods§
Sourcefn execute(
self,
rs1rs2_values: Rs1Rs2OperandValues<<<Self::Hart as HartConfig>::Reg as Register>::Type>,
regs: &mut Regs,
env: &mut Env,
memory: &mut Memory,
program_counter: &PC,
) -> ExecutionResult<<Self::Hart as HartConfig>::Reg>
fn execute( self, rs1rs2_values: Rs1Rs2OperandValues<<<Self::Hart as HartConfig>::Reg as Register>::Type>, regs: &mut Regs, env: &mut Env, memory: &mut Memory, program_counter: &PC, ) -> ExecutionResult<<Self::Hart as HartConfig>::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.
program_counter is read-only. Instructions say where execution goes next with
ExecutionResult::Branch or ExecutionResult::Jump.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".