Trait InstructionExecutor

Source
pub trait InstructionExecutor<F> {
    // Required methods
    fn execute(
        &mut self,
        memory: &mut MemoryController<F>,
        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, memory: &mut MemoryController<F>, 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, memory: &mut MemoryController<F>, 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, memory: &mut MemoryController<F>, instruction: &Instruction<F>, prev_state: ExecutionState<u32>, ) -> Result<ExecutionState<u32>>

Source§

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

Implementors§

Source§

impl<F, A, M> InstructionExecutor<F> for VmChipWrapper<F, A, M>
where F: PrimeField32, A: VmAdapterChip<F> + Send + Sync, M: VmCoreChip<F, A::Interface> + Send + Sync,

Source§

impl<F: PrimeField32> InstructionExecutor<F> for SystemExecutor<F>

Source§

impl<F: PrimeField32> InstructionExecutor<F> for PhantomChip<F>

impl<F: PrimeField32, const BLOCKS: usize, const BLOCK_SIZE: usize> InstructionExecutor<F> for Fp2AddSubChip<F, BLOCKS, BLOCK_SIZE>
where VmChipWrapper<F, Rv32VecHeapAdapterChip<F, 2, BLOCKS, BLOCKS, BLOCK_SIZE, BLOCK_SIZE>, FieldExpressionCoreChip>: InstructionExecutor<F>,

impl<F: PrimeField32, const BLOCKS: usize, const BLOCK_SIZE: usize> InstructionExecutor<F> for Fp2MulDivChip<F, BLOCKS, BLOCK_SIZE>
where VmChipWrapper<F, Rv32VecHeapAdapterChip<F, 2, BLOCKS, BLOCKS, BLOCK_SIZE, BLOCK_SIZE>, FieldExpressionCoreChip>: InstructionExecutor<F>,

impl<F: PrimeField32, const BLOCKS: usize, const BLOCK_SIZE: usize> InstructionExecutor<F> for ModularAddSubChip<F, BLOCKS, BLOCK_SIZE>
where VmChipWrapper<F, Rv32VecHeapAdapterChip<F, 2, BLOCKS, BLOCKS, BLOCK_SIZE, BLOCK_SIZE>, FieldExpressionCoreChip>: InstructionExecutor<F>,

impl<F: PrimeField32, const BLOCKS: usize, const BLOCK_SIZE: usize> InstructionExecutor<F> for ModularMulDivChip<F, BLOCKS, BLOCK_SIZE>
where VmChipWrapper<F, Rv32VecHeapAdapterChip<F, 2, BLOCKS, BLOCKS, BLOCK_SIZE, BLOCK_SIZE>, FieldExpressionCoreChip>: InstructionExecutor<F>,

impl<F: PrimeField32, const BLOCKS: usize, const BLOCK_SIZE: usize> InstructionExecutor<F> for EcAddNeChip<F, BLOCKS, BLOCK_SIZE>
where VmChipWrapper<F, Rv32VecHeapAdapterChip<F, 2, BLOCKS, BLOCKS, BLOCK_SIZE, BLOCK_SIZE>, FieldExpressionCoreChip>: InstructionExecutor<F>,

impl<F: PrimeField32, const BLOCKS: usize, const BLOCK_SIZE: usize> InstructionExecutor<F> for EcDoubleChip<F, BLOCKS, BLOCK_SIZE>
where VmChipWrapper<F, Rv32VecHeapAdapterChip<F, 1, BLOCKS, BLOCKS, BLOCK_SIZE, BLOCK_SIZE>, FieldExpressionCoreChip>: InstructionExecutor<F>,

impl<F: PrimeField32, const SBOX_REGISTERS: usize> InstructionExecutor<F> for NativePoseidon2Chip<F, SBOX_REGISTERS>

impl<F: PrimeField32, const BLOCKS: usize, const BLOCK_SIZE: usize> InstructionExecutor<F> for Fp12MulChip<F, BLOCKS, BLOCK_SIZE>
where VmChipWrapper<F, Rv32VecHeapAdapterChip<F, 2, BLOCKS, BLOCKS, BLOCK_SIZE, BLOCK_SIZE>, FieldExpressionCoreChip>: InstructionExecutor<F>,

impl<F: PrimeField32, const INPUT_BLOCKS1: usize, const INPUT_BLOCKS2: usize, const OUTPUT_BLOCKS: usize, const BLOCK_SIZE: usize> InstructionExecutor<F> for EcLineMulBy01234Chip<F, INPUT_BLOCKS1, INPUT_BLOCKS2, OUTPUT_BLOCKS, BLOCK_SIZE>
where VmChipWrapper<F, Rv32VecHeapTwoReadsAdapterChip<F, INPUT_BLOCKS1, INPUT_BLOCKS2, OUTPUT_BLOCKS, BLOCK_SIZE, BLOCK_SIZE>, FieldExpressionCoreChip>: InstructionExecutor<F>,

impl<F: PrimeField32, const INPUT_BLOCKS1: usize, const INPUT_BLOCKS2: usize, const OUTPUT_BLOCKS: usize, const BLOCK_SIZE: usize> InstructionExecutor<F> for EcLineMulBy02345Chip<F, INPUT_BLOCKS1, INPUT_BLOCKS2, OUTPUT_BLOCKS, BLOCK_SIZE>
where VmChipWrapper<F, Rv32VecHeapTwoReadsAdapterChip<F, INPUT_BLOCKS1, INPUT_BLOCKS2, OUTPUT_BLOCKS, BLOCK_SIZE, BLOCK_SIZE>, FieldExpressionCoreChip>: InstructionExecutor<F>,

impl<F: PrimeField32, const INPUT_BLOCKS1: usize, const INPUT_BLOCKS2: usize, const OUTPUT_BLOCKS: usize, const BLOCK_SIZE: usize> InstructionExecutor<F> for EvaluateLineChip<F, INPUT_BLOCKS1, INPUT_BLOCKS2, OUTPUT_BLOCKS, BLOCK_SIZE>
where VmChipWrapper<F, Rv32VecHeapTwoReadsAdapterChip<F, INPUT_BLOCKS1, INPUT_BLOCKS2, OUTPUT_BLOCKS, BLOCK_SIZE, BLOCK_SIZE>, FieldExpressionCoreChip>: InstructionExecutor<F>,

impl<F: PrimeField32, const INPUT_BLOCKS: usize, const OUTPUT_BLOCKS: usize, const BLOCK_SIZE: usize> InstructionExecutor<F> for EcLineMul013By013Chip<F, INPUT_BLOCKS, OUTPUT_BLOCKS, BLOCK_SIZE>
where VmChipWrapper<F, Rv32VecHeapAdapterChip<F, 2, INPUT_BLOCKS, OUTPUT_BLOCKS, BLOCK_SIZE, BLOCK_SIZE>, FieldExpressionCoreChip>: InstructionExecutor<F>,

impl<F: PrimeField32, const INPUT_BLOCKS: usize, const OUTPUT_BLOCKS: usize, const BLOCK_SIZE: usize> InstructionExecutor<F> for EcLineMul023By023Chip<F, INPUT_BLOCKS, OUTPUT_BLOCKS, BLOCK_SIZE>
where VmChipWrapper<F, Rv32VecHeapAdapterChip<F, 2, INPUT_BLOCKS, OUTPUT_BLOCKS, BLOCK_SIZE, BLOCK_SIZE>, FieldExpressionCoreChip>: InstructionExecutor<F>,

impl<F: PrimeField32, const INPUT_BLOCKS: usize, const OUTPUT_BLOCKS: usize, const BLOCK_SIZE: usize> InstructionExecutor<F> for MillerDoubleAndAddStepChip<F, INPUT_BLOCKS, OUTPUT_BLOCKS, BLOCK_SIZE>
where VmChipWrapper<F, Rv32VecHeapAdapterChip<F, 2, INPUT_BLOCKS, OUTPUT_BLOCKS, BLOCK_SIZE, BLOCK_SIZE>, FieldExpressionCoreChip>: InstructionExecutor<F>,

impl<F: PrimeField32, const INPUT_BLOCKS: usize, const OUTPUT_BLOCKS: usize, const BLOCK_SIZE: usize> InstructionExecutor<F> for MillerDoubleStepChip<F, INPUT_BLOCKS, OUTPUT_BLOCKS, BLOCK_SIZE>
where VmChipWrapper<F, Rv32VecHeapAdapterChip<F, 1, INPUT_BLOCKS, OUTPUT_BLOCKS, BLOCK_SIZE, BLOCK_SIZE>, FieldExpressionCoreChip>: InstructionExecutor<F>,