sp1_recursion_core/chips/mem/
mod.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
pub mod constant;
pub mod variable;

pub use constant::MemoryChip as MemoryConstChip;
pub use variable::MemoryChip as MemoryVarChip;

use sp1_derive::AlignedBorrow;

use crate::Address;

pub const NUM_MEM_ACCESS_COLS: usize = core::mem::size_of::<MemoryAccessCols<u8>>();

/// Data describing in what manner to access a particular memory block.
#[derive(AlignedBorrow, Debug, Clone, Copy)]
#[repr(C)]
pub struct MemoryAccessColsChips<F: Copy> {
    /// The address to access.
    pub addr: Address<F>,
    /// The multiplicity which to read/write.
    /// "Positive" values indicate a write, and "negative" values indicate a read.
    pub mult: F,
}

/// Avoids cbindgen naming collisions.
pub type MemoryAccessCols<F> = MemoryAccessColsChips<F>;