pub trait ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError = CustomErrorPlaceholder>where
Self: Instruction,{
// Required method
fn execute(
self,
regs: &mut Regs,
ext_state: &mut ExtState,
memory: &mut Memory,
program_counter: &mut PC,
system_instruction_handler: &mut InstructionHandler,
) -> Result<ControlFlow<()>, ExecutionError<<<Self as Instruction>::Reg as Register>::Type, CustomError>>;
// Provided methods
fn prepare_csr_read<C>(
csrs: &C,
csr_index: u16,
raw_value: <<Self as Instruction>::Reg as Register>::Type,
output_value: &mut <<Self as Instruction>::Reg as Register>::Type,
) -> Result<bool, CsrError<CustomError>>
where C: Csrs<Self::Reg, CustomError> { ... }
fn prepare_csr_write<C>(
csrs: &mut C,
csr_index: u16,
write_value: <<Self as Instruction>::Reg as Register>::Type,
output_value: &mut <<Self as Instruction>::Reg as Register>::Type,
) -> Result<bool, CsrError<CustomError>>
where C: Csrs<Self::Reg, CustomError> { ... }
}Expand description
Trait for executable instructions
Required Methods§
Sourcefn execute(
self,
regs: &mut Regs,
ext_state: &mut ExtState,
memory: &mut Memory,
program_counter: &mut PC,
system_instruction_handler: &mut InstructionHandler,
) -> Result<ControlFlow<()>, ExecutionError<<<Self as Instruction>::Reg as Register>::Type, CustomError>>
fn execute( self, regs: &mut Regs, ext_state: &mut ExtState, memory: &mut Memory, program_counter: &mut PC, system_instruction_handler: &mut InstructionHandler, ) -> Result<ControlFlow<()>, ExecutionError<<<Self as Instruction>::Reg as Register>::Type, CustomError>>
Execute instruction.
Instructions might place additional constraints on ExtState to require additional
registers or other resources. If no such constraint is used, () can be used as a
placeholder.
Provided Methods§
Sourcefn prepare_csr_read<C>(
csrs: &C,
csr_index: u16,
raw_value: <<Self as Instruction>::Reg as Register>::Type,
output_value: &mut <<Self as Instruction>::Reg as Register>::Type,
) -> Result<bool, CsrError<CustomError>>where
C: Csrs<Self::Reg, CustomError>,
fn prepare_csr_read<C>(
csrs: &C,
csr_index: u16,
raw_value: <<Self as Instruction>::Reg as Register>::Type,
output_value: &mut <<Self as Instruction>::Reg as Register>::Type,
) -> Result<bool, CsrError<CustomError>>where
C: Csrs<Self::Reg, CustomError>,
Prepare CSR read.
This method is called on each extension one by one with the raw_value (contents of the
corresponding CSR register) and initially zero-initialized output_value. In return value
every extension can accept (Ok(true)), ignore (Ok(false)) or reject (Err(CsrError))
read request. For accepted reads the extension must update output_value accordingly, which
will be the value used by the Zicsr extension handler.
Some extensions will just copy raw_value to output value, others will copy only some bits
or zero some bits of the raw_value, as required by the specification.
If no extension returns Ok(true), the read operation is implicitly rejected as illegal
access.
Sourcefn prepare_csr_write<C>(
csrs: &mut C,
csr_index: u16,
write_value: <<Self as Instruction>::Reg as Register>::Type,
output_value: &mut <<Self as Instruction>::Reg as Register>::Type,
) -> Result<bool, CsrError<CustomError>>where
C: Csrs<Self::Reg, CustomError>,
fn prepare_csr_write<C>(
csrs: &mut C,
csr_index: u16,
write_value: <<Self as Instruction>::Reg as Register>::Type,
output_value: &mut <<Self as Instruction>::Reg as Register>::Type,
) -> Result<bool, CsrError<CustomError>>where
C: Csrs<Self::Reg, CustomError>,
Prepare CSR write.
This method is called on each extension one by one with write_value being prepared by the
Zicsr extension handler. In return value every extension can accept (Ok(true)), ignore
(Ok(false)) or reject (Err(CsrError)) write request. For accepted writes the extension
must update output_value accordingly, which will be written to the corresponding CSR
register.
Some extensions will just copy write_value to output value, others will copy some bits or
zero some bits of the write_value, as required by the specification.
If no extension returns Ok(true), the write operation is implicitly rejected as illegal
access.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementations on Foreign Types§
§impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for Rv32BInstruction<Reg>where
Reg: Register<Type = u32>,
Regs: RegisterFile<Reg>,
impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for Rv32BInstruction<Reg>where
Reg: Register<Type = u32>,
Regs: RegisterFile<Reg>,
fn execute( self, regs: &mut Regs, _ext_state: &mut ExtState, _memory: &mut Memory, _program_counter: &mut PC, _system_instruction_handler: &mut InstructionHandler, ) -> Result<ControlFlow<()>, ExecutionError<Reg::Type, CustomError>>
§impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for Rv32Instruction<Reg>where
Reg: Register<Type = u32>,
Regs: RegisterFile<Reg>,
Memory: VirtualMemory,
PC: ProgramCounter<Reg::Type, Memory, CustomError>,
InstructionHandler: SystemInstructionHandler<Reg, Regs, Memory, PC, CustomError>,
impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for Rv32Instruction<Reg>where
Reg: Register<Type = u32>,
Regs: RegisterFile<Reg>,
Memory: VirtualMemory,
PC: ProgramCounter<Reg::Type, Memory, CustomError>,
InstructionHandler: SystemInstructionHandler<Reg, Regs, Memory, PC, CustomError>,
fn execute( self, regs: &mut Regs, _ext_state: &mut ExtState, memory: &mut Memory, program_counter: &mut PC, system_instruction_handler: &mut InstructionHandler, ) -> Result<ControlFlow<()>, ExecutionError<Reg::Type, CustomError>>
§impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for Rv32MInstruction<Reg>where
Reg: Register<Type = u32>,
Regs: RegisterFile<Reg>,
impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for Rv32MInstruction<Reg>where
Reg: Register<Type = u32>,
Regs: RegisterFile<Reg>,
fn execute( self, regs: &mut Regs, _ext_state: &mut ExtState, _memory: &mut Memory, _program_counter: &mut PC, _system_instruction_handler: &mut InstructionHandler, ) -> Result<ControlFlow<()>, ExecutionError<Reg::Type, CustomError>>
§impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for Rv32ZbaInstruction<Reg>where
Reg: Register<Type = u32>,
Regs: RegisterFile<Reg>,
impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for Rv32ZbaInstruction<Reg>where
Reg: Register<Type = u32>,
Regs: RegisterFile<Reg>,
fn execute( self, regs: &mut Regs, _ext_state: &mut ExtState, _memory: &mut Memory, _program_counter: &mut PC, _system_instruction_handler: &mut InstructionHandler, ) -> Result<ControlFlow<()>, ExecutionError<Reg::Type, CustomError>>
§impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for Rv32ZbbInstruction<Reg>where
Reg: Register<Type = u32>,
Regs: RegisterFile<Reg>,
impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for Rv32ZbbInstruction<Reg>where
Reg: Register<Type = u32>,
Regs: RegisterFile<Reg>,
fn execute( self, regs: &mut Regs, _ext_state: &mut ExtState, _memory: &mut Memory, _program_counter: &mut PC, _system_instruction_handler: &mut InstructionHandler, ) -> Result<ControlFlow<()>, ExecutionError<Reg::Type, CustomError>>
§impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for Rv32ZbcInstruction<Reg>where
Reg: Register<Type = u32>,
Regs: RegisterFile<Reg>,
impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for Rv32ZbcInstruction<Reg>where
Reg: Register<Type = u32>,
Regs: RegisterFile<Reg>,
fn execute( self, regs: &mut Regs, _ext_state: &mut ExtState, _memory: &mut Memory, _program_counter: &mut PC, _system_instruction_handler: &mut InstructionHandler, ) -> Result<ControlFlow<()>, ExecutionError<Reg::Type, CustomError>>
§impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for Rv32ZbkbInstruction<Reg>where
Reg: Register<Type = u32>,
Regs: RegisterFile<Reg>,
impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for Rv32ZbkbInstruction<Reg>where
Reg: Register<Type = u32>,
Regs: RegisterFile<Reg>,
fn execute( self, regs: &mut Regs, _ext_state: &mut ExtState, _memory: &mut Memory, _program_counter: &mut PC, _system_instruction_handler: &mut InstructionHandler, ) -> Result<ControlFlow<()>, ExecutionError<Reg::Type, CustomError>>
§impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for Rv32ZbkcInstruction<Reg>where
Reg: Register<Type = u32>,
Regs: RegisterFile<Reg>,
impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for Rv32ZbkcInstruction<Reg>where
Reg: Register<Type = u32>,
Regs: RegisterFile<Reg>,
fn execute( self, regs: &mut Regs, _ext_state: &mut ExtState, _memory: &mut Memory, _program_counter: &mut PC, _system_instruction_handler: &mut InstructionHandler, ) -> Result<ControlFlow<()>, ExecutionError<Reg::Type, CustomError>>
§impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for Rv32ZbkxInstruction<Reg>where
Reg: Register<Type = u32>,
Regs: RegisterFile<Reg>,
impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for Rv32ZbkxInstruction<Reg>where
Reg: Register<Type = u32>,
Regs: RegisterFile<Reg>,
fn execute( self, regs: &mut Regs, _ext_state: &mut ExtState, _memory: &mut Memory, _program_counter: &mut PC, _system_instruction_handler: &mut InstructionHandler, ) -> Result<ControlFlow<()>, ExecutionError<Reg::Type, CustomError>>
§impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for Rv32ZbsInstruction<Reg>where
Reg: Register<Type = u32>,
Regs: RegisterFile<Reg>,
impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for Rv32ZbsInstruction<Reg>where
Reg: Register<Type = u32>,
Regs: RegisterFile<Reg>,
fn execute( self, regs: &mut Regs, _ext_state: &mut ExtState, _memory: &mut Memory, _program_counter: &mut PC, _system_instruction_handler: &mut InstructionHandler, ) -> Result<ControlFlow<()>, ExecutionError<Reg::Type, CustomError>>
§impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for Rv32ZcaInstruction<Reg>where
Reg: Register<Type = u32>,
Regs: RegisterFile<Reg>,
Memory: VirtualMemory,
PC: ProgramCounter<Reg::Type, Memory, CustomError>,
InstructionHandler: SystemInstructionHandler<Reg, Regs, Memory, PC, CustomError>,
impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for Rv32ZcaInstruction<Reg>where
Reg: Register<Type = u32>,
Regs: RegisterFile<Reg>,
Memory: VirtualMemory,
PC: ProgramCounter<Reg::Type, Memory, CustomError>,
InstructionHandler: SystemInstructionHandler<Reg, Regs, Memory, PC, CustomError>,
fn execute( self, regs: &mut Regs, _ext_state: &mut ExtState, memory: &mut Memory, program_counter: &mut PC, system_instruction_handler: &mut InstructionHandler, ) -> Result<ControlFlow<()>, ExecutionError<Reg::Type, CustomError>>
§impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for Rv32ZcbInstruction<Reg>where
Reg: Register<Type = u32>,
Regs: RegisterFile<Reg>,
Memory: VirtualMemory,
PC: ProgramCounter<Reg::Type, Memory, CustomError>,
InstructionHandler: SystemInstructionHandler<Reg, Regs, Memory, PC, CustomError>,
impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for Rv32ZcbInstruction<Reg>where
Reg: Register<Type = u32>,
Regs: RegisterFile<Reg>,
Memory: VirtualMemory,
PC: ProgramCounter<Reg::Type, Memory, CustomError>,
InstructionHandler: SystemInstructionHandler<Reg, Regs, Memory, PC, CustomError>,
fn execute( self, regs: &mut Regs, _ext_state: &mut ExtState, memory: &mut Memory, _program_counter: &mut PC, _system_instruction_handler: &mut InstructionHandler, ) -> Result<ControlFlow<()>, ExecutionError<Reg::Type, CustomError>>
§impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for Rv32ZcmpInstruction<Reg>where
Reg: ZcmpRegister<Type = u32>,
Regs: RegisterFile<Reg>,
Memory: VirtualMemory,
PC: ProgramCounter<Reg::Type, Memory, CustomError>,
InstructionHandler: SystemInstructionHandler<Reg, Regs, Memory, PC, CustomError>,
impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for Rv32ZcmpInstruction<Reg>where
Reg: ZcmpRegister<Type = u32>,
Regs: RegisterFile<Reg>,
Memory: VirtualMemory,
PC: ProgramCounter<Reg::Type, Memory, CustomError>,
InstructionHandler: SystemInstructionHandler<Reg, Regs, Memory, PC, CustomError>,
fn execute( self, regs: &mut Regs, _ext_state: &mut ExtState, memory: &mut Memory, program_counter: &mut PC, _system_instruction_handler: &mut InstructionHandler, ) -> Result<ControlFlow<()>, ExecutionError<Reg::Type, CustomError>>
§impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for Rv32ZknInstruction<Reg>where
Reg: Register<Type = u32>,
Regs: RegisterFile<Reg>,
impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for Rv32ZknInstruction<Reg>where
Reg: Register<Type = u32>,
Regs: RegisterFile<Reg>,
fn execute( self, regs: &mut Regs, _ext_state: &mut ExtState, _memory: &mut Memory, _program_counter: &mut PC, _system_instruction_handler: &mut InstructionHandler, ) -> Result<ControlFlow<()>, ExecutionError<Reg::Type, CustomError>>
§impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for Rv32ZkndInstruction<Reg>where
Reg: Register<Type = u32>,
Regs: RegisterFile<Reg>,
impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for Rv32ZkndInstruction<Reg>where
Reg: Register<Type = u32>,
Regs: RegisterFile<Reg>,
fn execute( self, regs: &mut Regs, _ext_state: &mut ExtState, _memory: &mut Memory, _program_counter: &mut PC, _system_instruction_handler: &mut InstructionHandler, ) -> Result<ControlFlow<()>, ExecutionError<Reg::Type, CustomError>>
§impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for Rv32ZkneInstruction<Reg>where
Reg: Register<Type = u32>,
Regs: RegisterFile<Reg>,
impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for Rv32ZkneInstruction<Reg>where
Reg: Register<Type = u32>,
Regs: RegisterFile<Reg>,
fn execute( self, regs: &mut Regs, _ext_state: &mut ExtState, _memory: &mut Memory, _program_counter: &mut PC, _system_instruction_handler: &mut InstructionHandler, ) -> Result<ControlFlow<()>, ExecutionError<Reg::Type, CustomError>>
§impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for Rv32ZknhInstruction<Reg>where
Reg: Register<Type = u32>,
Regs: RegisterFile<Reg>,
impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for Rv32ZknhInstruction<Reg>where
Reg: Register<Type = u32>,
Regs: RegisterFile<Reg>,
fn execute( self, regs: &mut Regs, _ext_state: &mut ExtState, _memory: &mut Memory, _program_counter: &mut PC, _system_instruction_handler: &mut InstructionHandler, ) -> Result<ControlFlow<()>, ExecutionError<Reg::Type, CustomError>>
§impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for Rv32ZmmulInstruction<Reg>where
Reg: Register<Type = u32>,
Regs: RegisterFile<Reg>,
impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for Rv32ZmmulInstruction<Reg>where
Reg: Register<Type = u32>,
Regs: RegisterFile<Reg>,
fn execute( self, regs: &mut Regs, _ext_state: &mut ExtState, _memory: &mut Memory, _program_counter: &mut PC, _system_instruction_handler: &mut InstructionHandler, ) -> Result<ControlFlow<()>, ExecutionError<Reg::Type, CustomError>>
§impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for Rv64BInstruction<Reg>where
Reg: Register<Type = u64>,
Regs: RegisterFile<Reg>,
impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for Rv64BInstruction<Reg>where
Reg: Register<Type = u64>,
Regs: RegisterFile<Reg>,
fn execute( self, regs: &mut Regs, _ext_state: &mut ExtState, _memory: &mut Memory, _program_counter: &mut PC, _system_instruction_handler: &mut InstructionHandler, ) -> Result<ControlFlow<()>, ExecutionError<Reg::Type, CustomError>>
§impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for Rv64Instruction<Reg>where
Reg: Register<Type = u64>,
Regs: RegisterFile<Reg>,
Memory: VirtualMemory,
PC: ProgramCounter<Reg::Type, Memory, CustomError>,
InstructionHandler: SystemInstructionHandler<Reg, Regs, Memory, PC, CustomError>,
impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for Rv64Instruction<Reg>where
Reg: Register<Type = u64>,
Regs: RegisterFile<Reg>,
Memory: VirtualMemory,
PC: ProgramCounter<Reg::Type, Memory, CustomError>,
InstructionHandler: SystemInstructionHandler<Reg, Regs, Memory, PC, CustomError>,
fn execute( self, regs: &mut Regs, _ext_state: &mut ExtState, memory: &mut Memory, program_counter: &mut PC, system_instruction_handler: &mut InstructionHandler, ) -> Result<ControlFlow<()>, ExecutionError<Reg::Type, CustomError>>
§impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for Rv64MInstruction<Reg>where
Reg: Register<Type = u64>,
Regs: RegisterFile<Reg>,
impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for Rv64MInstruction<Reg>where
Reg: Register<Type = u64>,
Regs: RegisterFile<Reg>,
fn execute( self, regs: &mut Regs, _ext_state: &mut ExtState, _memory: &mut Memory, _program_counter: &mut PC, _system_instruction_handler: &mut InstructionHandler, ) -> Result<ControlFlow<()>, ExecutionError<Reg::Type, CustomError>>
§impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for Rv64ZbaInstruction<Reg>where
Reg: Register<Type = u64>,
Regs: RegisterFile<Reg>,
impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for Rv64ZbaInstruction<Reg>where
Reg: Register<Type = u64>,
Regs: RegisterFile<Reg>,
fn execute( self, regs: &mut Regs, _ext_state: &mut ExtState, _memory: &mut Memory, _program_counter: &mut PC, _system_instruction_handler: &mut InstructionHandler, ) -> Result<ControlFlow<()>, ExecutionError<Reg::Type, CustomError>>
§impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for Rv64ZbbInstruction<Reg>where
Reg: Register<Type = u64>,
Regs: RegisterFile<Reg>,
impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for Rv64ZbbInstruction<Reg>where
Reg: Register<Type = u64>,
Regs: RegisterFile<Reg>,
fn execute( self, regs: &mut Regs, _ext_state: &mut ExtState, _memory: &mut Memory, _program_counter: &mut PC, _system_instruction_handler: &mut InstructionHandler, ) -> Result<ControlFlow<()>, ExecutionError<Reg::Type, CustomError>>
§impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for Rv64ZbcInstruction<Reg>where
Reg: Register<Type = u64>,
Regs: RegisterFile<Reg>,
impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for Rv64ZbcInstruction<Reg>where
Reg: Register<Type = u64>,
Regs: RegisterFile<Reg>,
fn execute( self, regs: &mut Regs, _ext_state: &mut ExtState, _memory: &mut Memory, _program_counter: &mut PC, _system_instruction_handler: &mut InstructionHandler, ) -> Result<ControlFlow<()>, ExecutionError<Reg::Type, CustomError>>
§impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for Rv64ZbkbInstruction<Reg>where
Reg: Register<Type = u64>,
Regs: RegisterFile<Reg>,
impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for Rv64ZbkbInstruction<Reg>where
Reg: Register<Type = u64>,
Regs: RegisterFile<Reg>,
fn execute( self, regs: &mut Regs, _ext_state: &mut ExtState, _memory: &mut Memory, _program_counter: &mut PC, _system_instruction_handler: &mut InstructionHandler, ) -> Result<ControlFlow<()>, ExecutionError<Reg::Type, CustomError>>
§impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for Rv64ZbkcInstruction<Reg>where
Reg: Register<Type = u64>,
Regs: RegisterFile<Reg>,
impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for Rv64ZbkcInstruction<Reg>where
Reg: Register<Type = u64>,
Regs: RegisterFile<Reg>,
fn execute( self, regs: &mut Regs, _ext_state: &mut ExtState, _memory: &mut Memory, _program_counter: &mut PC, _system_instruction_handler: &mut InstructionHandler, ) -> Result<ControlFlow<()>, ExecutionError<Reg::Type, CustomError>>
§impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for Rv64ZbkxInstruction<Reg>where
Reg: Register<Type = u64>,
Regs: RegisterFile<Reg>,
impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for Rv64ZbkxInstruction<Reg>where
Reg: Register<Type = u64>,
Regs: RegisterFile<Reg>,
fn execute( self, regs: &mut Regs, _ext_state: &mut ExtState, _memory: &mut Memory, _program_counter: &mut PC, _system_instruction_handler: &mut InstructionHandler, ) -> Result<ControlFlow<()>, ExecutionError<Reg::Type, CustomError>>
§impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for Rv64ZbsInstruction<Reg>where
Reg: Register<Type = u64>,
Regs: RegisterFile<Reg>,
impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for Rv64ZbsInstruction<Reg>where
Reg: Register<Type = u64>,
Regs: RegisterFile<Reg>,
fn execute( self, regs: &mut Regs, _ext_state: &mut ExtState, _memory: &mut Memory, _program_counter: &mut PC, _system_instruction_handler: &mut InstructionHandler, ) -> Result<ControlFlow<()>, ExecutionError<Reg::Type, CustomError>>
§impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for Rv64ZcaInstruction<Reg>where
Reg: Register<Type = u64>,
Regs: RegisterFile<Reg>,
Memory: VirtualMemory,
PC: ProgramCounter<Reg::Type, Memory, CustomError>,
InstructionHandler: SystemInstructionHandler<Reg, Regs, Memory, PC, CustomError>,
impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for Rv64ZcaInstruction<Reg>where
Reg: Register<Type = u64>,
Regs: RegisterFile<Reg>,
Memory: VirtualMemory,
PC: ProgramCounter<Reg::Type, Memory, CustomError>,
InstructionHandler: SystemInstructionHandler<Reg, Regs, Memory, PC, CustomError>,
fn execute( self, regs: &mut Regs, _ext_state: &mut ExtState, memory: &mut Memory, program_counter: &mut PC, system_instruction_handler: &mut InstructionHandler, ) -> Result<ControlFlow<()>, ExecutionError<Reg::Type, CustomError>>
§impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for Rv64ZcbInstruction<Reg>where
Reg: Register<Type = u64>,
Regs: RegisterFile<Reg>,
Memory: VirtualMemory,
PC: ProgramCounter<Reg::Type, Memory, CustomError>,
InstructionHandler: SystemInstructionHandler<Reg, Regs, Memory, PC, CustomError>,
impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for Rv64ZcbInstruction<Reg>where
Reg: Register<Type = u64>,
Regs: RegisterFile<Reg>,
Memory: VirtualMemory,
PC: ProgramCounter<Reg::Type, Memory, CustomError>,
InstructionHandler: SystemInstructionHandler<Reg, Regs, Memory, PC, CustomError>,
fn execute( self, regs: &mut Regs, _ext_state: &mut ExtState, memory: &mut Memory, _program_counter: &mut PC, _system_instruction_handler: &mut InstructionHandler, ) -> Result<ControlFlow<()>, ExecutionError<Reg::Type, CustomError>>
§impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for Rv64ZcmpInstruction<Reg>where
Reg: ZcmpRegister<Type = u64>,
Regs: RegisterFile<Reg>,
Memory: VirtualMemory,
PC: ProgramCounter<Reg::Type, Memory, CustomError>,
InstructionHandler: SystemInstructionHandler<Reg, Regs, Memory, PC, CustomError>,
impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for Rv64ZcmpInstruction<Reg>where
Reg: ZcmpRegister<Type = u64>,
Regs: RegisterFile<Reg>,
Memory: VirtualMemory,
PC: ProgramCounter<Reg::Type, Memory, CustomError>,
InstructionHandler: SystemInstructionHandler<Reg, Regs, Memory, PC, CustomError>,
fn execute( self, regs: &mut Regs, _ext_state: &mut ExtState, memory: &mut Memory, program_counter: &mut PC, _system_instruction_handler: &mut InstructionHandler, ) -> Result<ControlFlow<()>, ExecutionError<Reg::Type, CustomError>>
§impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for Rv64ZknInstruction<Reg>where
Reg: Register<Type = u64>,
Regs: RegisterFile<Reg>,
impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for Rv64ZknInstruction<Reg>where
Reg: Register<Type = u64>,
Regs: RegisterFile<Reg>,
fn execute( self, regs: &mut Regs, _ext_state: &mut ExtState, _memory: &mut Memory, _program_counter: &mut PC, _system_instruction_handler: &mut InstructionHandler, ) -> Result<ControlFlow<()>, ExecutionError<Reg::Type, CustomError>>
§impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for Rv64ZkndInstruction<Reg>where
Reg: Register<Type = u64>,
Regs: RegisterFile<Reg>,
impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for Rv64ZkndInstruction<Reg>where
Reg: Register<Type = u64>,
Regs: RegisterFile<Reg>,
fn execute( self, regs: &mut Regs, _ext_state: &mut ExtState, _memory: &mut Memory, _program_counter: &mut PC, _system_instruction_handler: &mut InstructionHandler, ) -> Result<ControlFlow<()>, ExecutionError<Reg::Type, CustomError>>
§impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for Rv64ZkneInstruction<Reg>where
Reg: Register<Type = u64>,
Regs: RegisterFile<Reg>,
impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for Rv64ZkneInstruction<Reg>where
Reg: Register<Type = u64>,
Regs: RegisterFile<Reg>,
fn execute( self, regs: &mut Regs, _ext_state: &mut ExtState, _memory: &mut Memory, _program_counter: &mut PC, _system_instruction_handler: &mut InstructionHandler, ) -> Result<ControlFlow<()>, ExecutionError<Reg::Type, CustomError>>
§impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for Rv64ZknhInstruction<Reg>where
Reg: Register<Type = u64>,
Regs: RegisterFile<Reg>,
impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for Rv64ZknhInstruction<Reg>where
Reg: Register<Type = u64>,
Regs: RegisterFile<Reg>,
fn execute( self, regs: &mut Regs, _ext_state: &mut ExtState, _memory: &mut Memory, _program_counter: &mut PC, _system_instruction_handler: &mut InstructionHandler, ) -> Result<ControlFlow<()>, ExecutionError<Reg::Type, CustomError>>
§impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for Rv64ZmmulInstruction<Reg>where
Reg: Register<Type = u64>,
Regs: RegisterFile<Reg>,
impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for Rv64ZmmulInstruction<Reg>where
Reg: Register<Type = u64>,
Regs: RegisterFile<Reg>,
fn execute( self, regs: &mut Regs, _ext_state: &mut ExtState, _memory: &mut Memory, _program_counter: &mut PC, _system_instruction_handler: &mut InstructionHandler, ) -> Result<ControlFlow<()>, ExecutionError<Reg::Type, CustomError>>
§impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for ZicondInstruction<Reg>where
Reg: Register,
Regs: RegisterFile<Reg>,
impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for ZicondInstruction<Reg>where
Reg: Register,
Regs: RegisterFile<Reg>,
fn execute( self, regs: &mut Regs, _ext_state: &mut ExtState, _memory: &mut Memory, _program_counter: &mut PC, _system_instruction_handler: &mut InstructionHandler, ) -> Result<ControlFlow<()>, ExecutionError<Reg::Type, CustomError>>
§impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for ZicsrInstruction<Reg>where
Reg: Register,
Regs: RegisterFile<Reg>,
ExtState: Csrs<Reg, CustomError>,
impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for ZicsrInstruction<Reg>where
Reg: Register,
Regs: RegisterFile<Reg>,
ExtState: Csrs<Reg, CustomError>,
fn execute( self, regs: &mut Regs, ext_state: &mut ExtState, _memory: &mut Memory, _program_counter: &mut PC, _system_instruction_handler: &mut InstructionHandler, ) -> Result<ControlFlow<()>, ExecutionError<Reg::Type, CustomError>>
§impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for Zve64xInstruction<Reg>where
Reg: Register,
Regs: RegisterFile<Reg>,
ExtState: VectorRegistersExt<Reg, CustomError> + Csrs<Reg, CustomError>,
[(); { _ }]:,
PC: ProgramCounter<Reg::Type, Memory, CustomError>,
CustomError: Debug,
Memory: VirtualMemory,
impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError> for Zve64xInstruction<Reg>where
Reg: Register,
Regs: RegisterFile<Reg>,
ExtState: VectorRegistersExt<Reg, CustomError> + Csrs<Reg, CustomError>,
[(); { _ }]:,
PC: ProgramCounter<Reg::Type, Memory, CustomError>,
CustomError: Debug,
Memory: VirtualMemory,
§fn prepare_csr_read<C>(
_csrs: &C,
csr_index: u16,
raw_value: Reg::Type,
output_value: &mut Reg::Type,
) -> Result<bool, CsrError<CustomError>>where
C: Csrs<Self::Reg, CustomError>,
fn prepare_csr_read<C>(
_csrs: &C,
csr_index: u16,
raw_value: Reg::Type,
output_value: &mut Reg::Type,
) -> Result<bool, CsrError<CustomError>>where
C: Csrs<Self::Reg, CustomError>,
Validate reads to vector CSRs from Zicsr instructions.
All vector CSRs are accessible from unprivileged code (U-mode). Reads are pass-through: the raw value stored in the CSR is the output value.
§fn prepare_csr_write<C>(
csrs: &mut C,
csr_index: u16,
write_value: Reg::Type,
output_value: &mut Reg::Type,
) -> Result<bool, CsrError<CustomError>>where
C: Csrs<Self::Reg, CustomError>,
fn prepare_csr_write<C>(
csrs: &mut C,
csr_index: u16,
write_value: Reg::Type,
output_value: &mut Reg::Type,
) -> Result<bool, CsrError<CustomError>>where
C: Csrs<Self::Reg, CustomError>,
Validate, sanitize, and mirror writes to vector CSRs from Zicsr instructions.
Enforces WARL semantics and vcsr mirroring:
vl,vtype,vlenbare read-only: writes are rejectedvxsat: only bit 0 is writable; mirrors intovcsr[0]vxrm: only bits[1:0]are writable; mirrors intovcsr[2:1]vcsr: only bits[2:0]are writable; mirrors intovxsatandvxrmvstart: full XLEN write allowed (WARL, implementation may restrict range)