From 2bf71721d9a323aaae8bf18e669a96c559150028 Mon Sep 17 00:00:00 2001 From: KimiWu Date: Fri, 13 Sep 2024 14:19:46 +0800 Subject: [PATCH] chore: using WordAddr type for addr in testing --- ceno_zkvm/src/instructions/riscv/mul.rs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/ceno_zkvm/src/instructions/riscv/mul.rs b/ceno_zkvm/src/instructions/riscv/mul.rs index 8ce940da5..1a97e1b4b 100644 --- a/ceno_zkvm/src/instructions/riscv/mul.rs +++ b/ceno_zkvm/src/instructions/riscv/mul.rs @@ -225,7 +225,7 @@ impl Instruction for MulInstruction { #[cfg(test)] mod test { - use ceno_emul::{Change, ReadOp, StepRecord, WriteOp}; + use ceno_emul::{Change, ReadOp, StepRecord, WordAddr, WriteOp}; use goldilocks::GoldilocksExt2; use itertools::Itertools; use multilinear_extensions::mle::IntoMLEs; @@ -249,17 +249,17 @@ mod test { // values assignment let rs1 = Some(ReadOp { - addr: 1.into(), + addr: WordAddr::from(1), value: 11u32, previous_cycle: 2, }); let rs2 = Some(ReadOp { - addr: 2.into(), + addr: WordAddr::from(2), value: 2u32, previous_cycle: 2, }); let rd = Some(WriteOp { - addr: 3.into(), + addr: WordAddr::from(3), value: Change { before: 0u32, after: 22u32, @@ -303,17 +303,17 @@ mod test { // values assignment let rs1 = Some(ReadOp { - addr: 1.into(), + addr: WordAddr::from(1), value: u32::MAX / 2 + 1, // equals to 2^32 / 2 previous_cycle: 2, }); let rs2 = Some(ReadOp { - addr: 2.into(), + addr: WordAddr::from(2), value: 2u32, previous_cycle: 2, }); let rd = Some(WriteOp { - addr: 3.into(), + addr: WordAddr::from(3), value: Change { before: 0u32, after: 0u32, @@ -357,18 +357,18 @@ mod test { // values assignment let rs1 = Some(ReadOp { - addr: 0.into(), + addr: WordAddr::from(1), value: 4294901760u32, // equals [0, u16::MAX] previous_cycle: 2, }); let rs2 = Some(ReadOp { - addr: 1.into(), + addr: WordAddr::from(2), value: 4294901760u32, // equals [0, u16::MAX] previous_cycle: 2, }); // 429490176 * 429490176 % 2^32 = 0 let rd = Some(WriteOp { - addr: 2.into(), + addr: WordAddr::from(3), value: Change { before: 0u32, after: 1u32,