use serde::{Deserialize, Serialize};
use sp1_derive::{AlignedBorrow, IntoShape};
use sp1_hypercube::Word;
use crate::operations::U16toU8Operation;
#[derive(AlignedBorrow, Default, Debug, Clone, Copy)]
#[repr(C)]
pub struct MemoryAccessTimestamp<T> {
pub prev_high: T,
pub prev_low: T,
pub compare_low: T,
pub diff_low_limb: T,
pub diff_high_limb: T,
}
#[derive(AlignedBorrow, Default, Debug, Clone, Copy)]
#[repr(C)]
pub struct MemoryAccessCols<T> {
pub prev_value: Word<T>,
pub access_timestamp: MemoryAccessTimestamp<T>,
}
#[derive(AlignedBorrow, Default, Debug, Clone, Copy)]
#[repr(C)]
pub struct MemoryAccessColsU8<T> {
pub memory_access: MemoryAccessCols<T>,
pub prev_value_u8: U16toU8Operation<T>,
}
#[derive(AlignedBorrow, Default, Debug, Clone, Copy, Serialize, Deserialize, IntoShape)]
#[repr(C)]
pub struct RegisterAccessTimestamp<T> {
pub prev_low: T,
pub diff_low_limb: T,
}
#[derive(AlignedBorrow, Default, Debug, Clone, Copy, Serialize, Deserialize, IntoShape)]
#[repr(C)]
pub struct RegisterAccessCols<T> {
pub prev_value: Word<T>,
pub access_timestamp: RegisterAccessTimestamp<T>,
}
#[derive(AlignedBorrow, Default, Debug, Clone, Copy)]
#[repr(C)]
pub struct PageProtAccessCols<T> {
pub prev_prot_bitmap: T,
pub access_timestamp: MemoryAccessTimestamp<T>,
}