Skip to content

Commit

Permalink
chore: using WordAddr type for addr in testing
Browse files Browse the repository at this point in the history
  • Loading branch information
KimiWu123 committed Sep 13, 2024
1 parent ebe4bdf commit 2bf7172
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions ceno_zkvm/src/instructions/riscv/mul.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ impl<E: ExtensionField> Instruction<E> 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;
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 2bf7172

Please sign in to comment.