diff --git a/openvm/src/powdr_extension/chip.rs b/openvm/src/powdr_extension/chip.rs index 241fb3b8b..3210d3d6d 100644 --- a/openvm/src/powdr_extension/chip.rs +++ b/openvm/src/powdr_extension/chip.rs @@ -44,20 +44,20 @@ use powdr_autoprecompiles::{ }; use serde::{Deserialize, Serialize}; -pub struct PowdrChip { +pub struct PowdrChip> { pub name: String, pub opcode: PowdrOpcode, /// An "executor" for this chip, based on the original instructions in the basic block - pub executor: PowdrExecutor, - pub air: Arc>, + pub executor: PowdrExecutor, + pub air: Arc>, _marker: std::marker::PhantomData, } -impl PowdrChip { +impl> PowdrChip { pub(crate) fn new( - precompile: PowdrPrecompile, - original_airs: OriginalAirs, - memory: Arc>>, + precompile: PowdrPrecompile, + original_airs: OriginalAirs, + memory: Arc>>, base_config: ExtendedVmConfig, periphery: PowdrPeripheryInstances, ) -> Self { @@ -77,11 +77,11 @@ impl PowdrChip { } } -impl InstructionExecutor for PowdrChip { +impl> InstructionExecutor for PowdrChip { fn execute( &mut self, - memory: &mut MemoryController, - instruction: &Instruction, + memory: &mut MemoryController, + instruction: &Instruction, from_state: ExecutionState, ) -> ExecutionResult> { let &Instruction { opcode, .. } = instruction; @@ -97,7 +97,7 @@ impl InstructionExecutor for PowdrChip { } } -impl ChipUsageGetter for PowdrChip { +impl> ChipUsageGetter for PowdrChip { fn air_name(&self) -> String { format!("powdr_air_for_opcode_{}", self.opcode.global_opcode()).to_string() } @@ -110,7 +110,7 @@ impl ChipUsageGetter for PowdrChip { } } -impl Chip for PowdrChip, A> +impl>> Chip for PowdrChip where Val: PrimeField32, A: Adapter< diff --git a/openvm/src/powdr_extension/plonk/chip.rs b/openvm/src/powdr_extension/plonk/chip.rs index e6c9cb2bf..163c7785e 100644 --- a/openvm/src/powdr_extension/plonk/chip.rs +++ b/openvm/src/powdr_extension/plonk/chip.rs @@ -37,22 +37,21 @@ use powdr_autoprecompiles::Apc; use super::air::PlonkAir; -pub struct PlonkChip { +pub struct PlonkChip> { name: String, opcode: PowdrOpcode, - air: Arc>, - executor: PowdrExecutor, - apc: Arc>>, + air: Arc>, + executor: PowdrExecutor, + apc: Arc>>, bus_map: BusMap, - _marker: std::marker::PhantomData, } -impl PlonkChip { +impl> PlonkChip { #[allow(dead_code)] pub(crate) fn new( - precompile: PowdrPrecompile, - original_airs: OriginalAirs, - memory: Arc>>, + precompile: PowdrPrecompile, + original_airs: OriginalAirs, + memory: Arc>>, base_config: ExtendedVmConfig, periphery: PowdrPeripheryInstances, bus_map: BusMap, @@ -76,16 +75,15 @@ impl PlonkChip { executor, bus_map, apc, - _marker: std::marker::PhantomData, } } } -impl InstructionExecutor for PlonkChip { +impl> InstructionExecutor for PlonkChip { fn execute( &mut self, - memory: &mut MemoryController, - instruction: &Instruction, + memory: &mut MemoryController, + instruction: &Instruction, from_state: ExecutionState, ) -> ExecutionResult> { let &Instruction { opcode, .. } = instruction; @@ -101,7 +99,7 @@ impl InstructionExecutor for PlonkChip { } } -impl ChipUsageGetter for PlonkChip { +impl> ChipUsageGetter for PlonkChip { fn air_name(&self) -> String { format!("powdr_plonk_air_for_opcode_{}", self.opcode.global_opcode()).to_string() } @@ -114,7 +112,7 @@ impl ChipUsageGetter for PlonkChip { } } -impl Chip for PlonkChip, A> +impl>> Chip for PlonkChip where Val: PrimeField32, A: Adapter< diff --git a/openvm/src/powdr_extension/vm.rs b/openvm/src/powdr_extension/vm.rs index 380210baf..16e7431f4 100644 --- a/openvm/src/powdr_extension/vm.rs +++ b/openvm/src/powdr_extension/vm.rs @@ -100,8 +100,8 @@ pub enum PowdrExecutor< AirId = String, > + 'static, > { - Powdr(PowdrChip), - Plonk(PlonkChip), + Powdr(PowdrChip), + Plonk(PlonkChip), } impl PowdrExecutor