openvm_circuit::arch

Trait InstructionExecutor

Source
pub trait InstructionExecutor<F> {
    // Required methods
    fn execute(
        &mut self,
        instruction: Instruction<F>,
        from_state: ExecutionState<u32>,
    ) -> Result<ExecutionState<u32>>;
    fn get_opcode_name(&self, opcode: usize) -> String;
}

Required Methods§

Source

fn execute( &mut self, instruction: Instruction<F>, from_state: ExecutionState<u32>, ) -> Result<ExecutionState<u32>>

Runtime execution of the instruction, if the instruction is owned by the current instance. May internally store records of this call for later trace generation.

Source

fn get_opcode_name(&self, opcode: usize) -> String

For display purposes. From absolute opcode as usize, return the string name of the opcode if it is a supported opcode by the present executor.

Implementations on Foreign Types§

Source§

impl<F, C: InstructionExecutor<F>> InstructionExecutor<F> for Rc<RefCell<C>>

Source§

fn execute( &mut self, instruction: Instruction<F>, prev_state: ExecutionState<u32>, ) -> Result<ExecutionState<u32>>

Source§

fn get_opcode_name(&self, opcode: usize) -> String

Source§

impl<F, C: InstructionExecutor<F>> InstructionExecutor<F> for RefCell<C>

Source§

fn execute( &mut self, instruction: Instruction<F>, prev_state: ExecutionState<u32>, ) -> Result<ExecutionState<u32>>

Source§

fn get_opcode_name(&self, opcode: usize) -> String

Implementors§