Skip to main content

InterpreterState

Struct InterpreterState 

Source
pub struct InterpreterState<Reg, ExtState, Memory, IF, InstructionHandler, CustomError = CustomErrorPlaceholder>
where Reg: Register, [(); Reg::N]:,
{ pub regs: Registers<Reg>, pub ext_state: ExtState, pub memory: Memory, pub instruction_fetcher: IF, pub system_instruction_handler: InstructionHandler, pub custom_error: PhantomData<CustomError>, }
Expand description

Base interpreter state

Fields§

§regs: Registers<Reg>

General purpose registers

§ext_state: ExtState

Extended state.

Extensions might use this to place additional constraints on ExtState to require additional registers or other resources. If no such extension is used, () can be used as a placeholder.

§memory: Memory

Memory

§instruction_fetcher: IF

Instruction fetcher

§system_instruction_handler: InstructionHandler

System instruction handler

§custom_error: PhantomData<CustomError>

Custom error phantom data

Trait Implementations§

Source§

impl<Reg, ExtState: Debug, Memory: Debug, IF: Debug, InstructionHandler: Debug, CustomError: Debug> Debug for InterpreterState<Reg, ExtState, Memory, IF, InstructionHandler, CustomError>
where Reg: Register + Debug, [(); Reg::N]:,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
§

impl<Reg, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<InterpreterState<Reg, ExtState, Memory, PC, InstructionHandler, CustomError>, CustomError> for Rv32BInstruction<Reg>
where Reg: Register<Type = u32>, [(); Reg::N]:,

§

fn execute( self, state: &mut InterpreterState<Reg, ExtState, Memory, PC, InstructionHandler, CustomError>, ) -> Result<ControlFlow<()>, ExecutionError<Reg::Type, CustomError>>

Execute instruction
Source§

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. Read more
Source§

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. Read more
§

impl<Reg, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<InterpreterState<Reg, ExtState, Memory, PC, InstructionHandler, CustomError>, CustomError> for Rv32Instruction<Reg>
where Reg: Register<Type = u32>, [(); Reg::N]:, Memory: VirtualMemory, PC: ProgramCounter<Reg::Type, Memory, CustomError>, InstructionHandler: SystemInstructionHandler<Reg, Memory, PC, CustomError>,

§

fn execute( self, state: &mut InterpreterState<Reg, ExtState, Memory, PC, InstructionHandler, CustomError>, ) -> Result<ControlFlow<()>, ExecutionError<Reg::Type, CustomError>>

Execute instruction
Source§

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. Read more
Source§

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. Read more
§

impl<Reg, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<InterpreterState<Reg, ExtState, Memory, PC, InstructionHandler, CustomError>, CustomError> for Rv32MInstruction<Reg>
where Reg: Register<Type = u32>, [(); Reg::N]:,

§

fn execute( self, state: &mut InterpreterState<Reg, ExtState, Memory, PC, InstructionHandler, CustomError>, ) -> Result<ControlFlow<()>, ExecutionError<Reg::Type, CustomError>>

Execute instruction
Source§

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. Read more
Source§

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. Read more
§

impl<Reg, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<InterpreterState<Reg, ExtState, Memory, PC, InstructionHandler, CustomError>, CustomError> for Rv32ZbaInstruction<Reg>
where Reg: Register<Type = u32>, [(); Reg::N]:,

§

fn execute( self, state: &mut InterpreterState<Reg, ExtState, Memory, PC, InstructionHandler, CustomError>, ) -> Result<ControlFlow<()>, ExecutionError<Reg::Type, CustomError>>

Execute instruction
Source§

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. Read more
Source§

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. Read more
§

impl<Reg, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<InterpreterState<Reg, ExtState, Memory, PC, InstructionHandler, CustomError>, CustomError> for Rv32ZbbInstruction<Reg>
where Reg: Register<Type = u32>, [(); Reg::N]:,

§

fn execute( self, state: &mut InterpreterState<Reg, ExtState, Memory, PC, InstructionHandler, CustomError>, ) -> Result<ControlFlow<()>, ExecutionError<Reg::Type, CustomError>>

Execute instruction
Source§

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. Read more
Source§

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. Read more
§

impl<Reg, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<InterpreterState<Reg, ExtState, Memory, PC, InstructionHandler, CustomError>, CustomError> for Rv32ZbcInstruction<Reg>
where Reg: Register<Type = u32>, [(); Reg::N]:,

§

fn execute( self, state: &mut InterpreterState<Reg, ExtState, Memory, PC, InstructionHandler, CustomError>, ) -> Result<ControlFlow<()>, ExecutionError<Reg::Type, CustomError>>

Execute instruction
Source§

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. Read more
Source§

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. Read more
§

impl<Reg, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<InterpreterState<Reg, ExtState, Memory, PC, InstructionHandler, CustomError>, CustomError> for Rv32ZbkcInstruction<Reg>
where Reg: Register<Type = u32>, [(); Reg::N]:,

§

fn execute( self, state: &mut InterpreterState<Reg, ExtState, Memory, PC, InstructionHandler, CustomError>, ) -> Result<ControlFlow<()>, ExecutionError<Reg::Type, CustomError>>

Execute instruction
Source§

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. Read more
Source§

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. Read more
§

impl<Reg, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<InterpreterState<Reg, ExtState, Memory, PC, InstructionHandler, CustomError>, CustomError> for Rv32ZbsInstruction<Reg>
where Reg: Register<Type = u32>, [(); Reg::N]:,

§

fn execute( self, state: &mut InterpreterState<Reg, ExtState, Memory, PC, InstructionHandler, CustomError>, ) -> Result<ControlFlow<()>, ExecutionError<Reg::Type, CustomError>>

Execute instruction
Source§

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. Read more
Source§

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. Read more
§

impl<Reg, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<InterpreterState<Reg, ExtState, Memory, PC, InstructionHandler, CustomError>, CustomError> for Rv32ZknhInstruction<Reg>
where Reg: Register<Type = u32>, [(); Reg::N]:,

§

fn execute( self, state: &mut InterpreterState<Reg, ExtState, Memory, PC, InstructionHandler, CustomError>, ) -> Result<ControlFlow<()>, ExecutionError<Reg::Type, CustomError>>

Execute instruction
Source§

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. Read more
Source§

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. Read more
§

impl<Reg, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<InterpreterState<Reg, ExtState, Memory, PC, InstructionHandler, CustomError>, CustomError> for Rv32ZmmulInstruction<Reg>
where Reg: Register<Type = u32>, [(); Reg::N]:,

§

fn execute( self, state: &mut InterpreterState<Reg, ExtState, Memory, PC, InstructionHandler, CustomError>, ) -> Result<ControlFlow<()>, ExecutionError<Reg::Type, CustomError>>

Execute instruction
Source§

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. Read more
Source§

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. Read more
§

impl<Reg, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<InterpreterState<Reg, ExtState, Memory, PC, InstructionHandler, CustomError>, CustomError> for Rv64BInstruction<Reg>
where Reg: Register<Type = u64>, [(); Reg::N]:,

§

fn execute( self, state: &mut InterpreterState<Reg, ExtState, Memory, PC, InstructionHandler, CustomError>, ) -> Result<ControlFlow<()>, ExecutionError<Reg::Type, CustomError>>

Execute instruction
Source§

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. Read more
Source§

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. Read more
§

impl<Reg, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<InterpreterState<Reg, ExtState, Memory, PC, InstructionHandler, CustomError>, CustomError> for Rv64Instruction<Reg>
where Reg: Register<Type = u64>, [(); Reg::N]:, Memory: VirtualMemory, PC: ProgramCounter<Reg::Type, Memory, CustomError>, InstructionHandler: SystemInstructionHandler<Reg, Memory, PC, CustomError>,

§

fn execute( self, state: &mut InterpreterState<Reg, ExtState, Memory, PC, InstructionHandler, CustomError>, ) -> Result<ControlFlow<()>, ExecutionError<Reg::Type, CustomError>>

Execute instruction
Source§

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. Read more
Source§

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. Read more
§

impl<Reg, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<InterpreterState<Reg, ExtState, Memory, PC, InstructionHandler, CustomError>, CustomError> for Rv64MInstruction<Reg>
where Reg: Register<Type = u64>, [(); Reg::N]:,

§

fn execute( self, state: &mut InterpreterState<Reg, ExtState, Memory, PC, InstructionHandler, CustomError>, ) -> Result<ControlFlow<()>, ExecutionError<Reg::Type, CustomError>>

Execute instruction
Source§

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. Read more
Source§

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. Read more
§

impl<Reg, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<InterpreterState<Reg, ExtState, Memory, PC, InstructionHandler, CustomError>, CustomError> for Rv64ZbaInstruction<Reg>
where Reg: Register<Type = u64>, [(); Reg::N]:,

§

fn execute( self, state: &mut InterpreterState<Reg, ExtState, Memory, PC, InstructionHandler, CustomError>, ) -> Result<ControlFlow<()>, ExecutionError<Reg::Type, CustomError>>

Execute instruction
Source§

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. Read more
Source§

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. Read more
§

impl<Reg, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<InterpreterState<Reg, ExtState, Memory, PC, InstructionHandler, CustomError>, CustomError> for Rv64ZbbInstruction<Reg>
where Reg: Register<Type = u64>, [(); Reg::N]:,

§

fn execute( self, state: &mut InterpreterState<Reg, ExtState, Memory, PC, InstructionHandler, CustomError>, ) -> Result<ControlFlow<()>, ExecutionError<Reg::Type, CustomError>>

Execute instruction
Source§

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. Read more
Source§

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. Read more
§

impl<Reg, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<InterpreterState<Reg, ExtState, Memory, PC, InstructionHandler, CustomError>, CustomError> for Rv64ZbcInstruction<Reg>
where Reg: Register<Type = u64>, [(); Reg::N]:,

§

fn execute( self, state: &mut InterpreterState<Reg, ExtState, Memory, PC, InstructionHandler, CustomError>, ) -> Result<ControlFlow<()>, ExecutionError<Reg::Type, CustomError>>

Execute instruction
Source§

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. Read more
Source§

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. Read more
§

impl<Reg, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<InterpreterState<Reg, ExtState, Memory, PC, InstructionHandler, CustomError>, CustomError> for Rv64ZbkcInstruction<Reg>
where Reg: Register<Type = u64>, [(); Reg::N]:,

§

fn execute( self, state: &mut InterpreterState<Reg, ExtState, Memory, PC, InstructionHandler, CustomError>, ) -> Result<ControlFlow<()>, ExecutionError<Reg::Type, CustomError>>

Execute instruction
Source§

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. Read more
Source§

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. Read more
§

impl<Reg, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<InterpreterState<Reg, ExtState, Memory, PC, InstructionHandler, CustomError>, CustomError> for Rv64ZbsInstruction<Reg>
where Reg: Register<Type = u64>, [(); Reg::N]:,

§

fn execute( self, state: &mut InterpreterState<Reg, ExtState, Memory, PC, InstructionHandler, CustomError>, ) -> Result<ControlFlow<()>, ExecutionError<Reg::Type, CustomError>>

Execute instruction
Source§

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. Read more
Source§

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. Read more
§

impl<Reg, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<InterpreterState<Reg, ExtState, Memory, PC, InstructionHandler, CustomError>, CustomError> for Rv64ZknhInstruction<Reg>
where Reg: Register<Type = u64>, [(); Reg::N]:,

§

fn execute( self, state: &mut InterpreterState<Reg, ExtState, Memory, PC, InstructionHandler, CustomError>, ) -> Result<ControlFlow<()>, ExecutionError<Reg::Type, CustomError>>

Execute instruction
Source§

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. Read more
Source§

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. Read more
§

impl<Reg, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<InterpreterState<Reg, ExtState, Memory, PC, InstructionHandler, CustomError>, CustomError> for Rv64ZmmulInstruction<Reg>
where Reg: Register<Type = u64>, [(); Reg::N]:,

§

fn execute( self, state: &mut InterpreterState<Reg, ExtState, Memory, PC, InstructionHandler, CustomError>, ) -> Result<ControlFlow<()>, ExecutionError<Reg::Type, CustomError>>

Execute instruction
Source§

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. Read more
Source§

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. Read more
§

impl<Reg, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<InterpreterState<Reg, ExtState, Memory, PC, InstructionHandler, CustomError>, CustomError> for ZicsrInstruction<Reg>
where Reg: Register, [(); Reg::N]:, ExtState: Csrs<Reg, CustomError>,

§

fn execute( self, state: &mut InterpreterState<Reg, ExtState, Memory, PC, InstructionHandler, CustomError>, ) -> Result<ControlFlow<()>, ExecutionError<Reg::Type, CustomError>>

Execute instruction
Source§

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. Read more
Source§

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. Read more
§

impl<Reg, ExtState, Memory, PC, InstructionHandler, CustomError> ExecutableInstruction<InterpreterState<Reg, ExtState, Memory, PC, InstructionHandler, CustomError>, CustomError> for Zve64xInstruction<Reg>
where Reg: Register, [(); Reg::N]:, 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>,

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>,

Validate, sanitize, and mirror writes to vector CSRs from Zicsr instructions.

Enforces WARL semantics and vcsr mirroring:

  • vl, vtype, vlenb are read-only: writes are rejected
  • vxsat: only bit 0 is writable; mirrors into vcsr[0]
  • vxrm: only bits [1:0] are writable; mirrors into vcsr[2:1]
  • vcsr: only bits [2:0] are writable; mirrors into vxsat and vxrm
  • vstart: full XLEN write allowed (WARL, implementation may restrict range)
§

fn execute( self, state: &mut InterpreterState<Reg, ExtState, Memory, PC, InstructionHandler, CustomError>, ) -> Result<ControlFlow<()>, ExecutionError<Reg::Type, CustomError>>

Execute instruction

Auto Trait Implementations§

§

impl<Reg, ExtState, Memory, IF, InstructionHandler, CustomError> Freeze for InterpreterState<Reg, ExtState, Memory, IF, InstructionHandler, CustomError>
where ExtState: Freeze, Memory: Freeze, IF: Freeze, InstructionHandler: Freeze, <Reg as Register>::Type: Freeze,

§

impl<Reg, ExtState, Memory, IF, InstructionHandler, CustomError> RefUnwindSafe for InterpreterState<Reg, ExtState, Memory, IF, InstructionHandler, CustomError>
where ExtState: RefUnwindSafe, Memory: RefUnwindSafe, IF: RefUnwindSafe, InstructionHandler: RefUnwindSafe, CustomError: RefUnwindSafe, <Reg as Register>::Type: RefUnwindSafe,

§

impl<Reg, ExtState, Memory, IF, InstructionHandler, CustomError> Send for InterpreterState<Reg, ExtState, Memory, IF, InstructionHandler, CustomError>
where ExtState: Send, Memory: Send, IF: Send, InstructionHandler: Send, CustomError: Send,

§

impl<Reg, ExtState, Memory, IF, InstructionHandler, CustomError> Sync for InterpreterState<Reg, ExtState, Memory, IF, InstructionHandler, CustomError>
where ExtState: Sync, Memory: Sync, IF: Sync, InstructionHandler: Sync, CustomError: Sync,

§

impl<Reg, ExtState, Memory, IF, InstructionHandler, CustomError> Unpin for InterpreterState<Reg, ExtState, Memory, IF, InstructionHandler, CustomError>
where ExtState: Unpin, Memory: Unpin, IF: Unpin, InstructionHandler: Unpin, CustomError: Unpin, <Reg as Register>::Type: Unpin,

§

impl<Reg, ExtState, Memory, IF, InstructionHandler, CustomError> UnsafeUnpin for InterpreterState<Reg, ExtState, Memory, IF, InstructionHandler, CustomError>
where ExtState: UnsafeUnpin, Memory: UnsafeUnpin, IF: UnsafeUnpin, InstructionHandler: UnsafeUnpin, <Reg as Register>::Type: UnsafeUnpin,

§

impl<Reg, ExtState, Memory, IF, InstructionHandler, CustomError> UnwindSafe for InterpreterState<Reg, ExtState, Memory, IF, InstructionHandler, CustomError>
where ExtState: UnwindSafe, Memory: UnwindSafe, IF: UnwindSafe, InstructionHandler: UnwindSafe, CustomError: UnwindSafe, <Reg as Register>::Type: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.