Skip to content

Commit

Permalink
make some fields public so we can do serde
Browse files Browse the repository at this point in the history
  • Loading branch information
luffykai committed Feb 21, 2025
1 parent 5645aaf commit d29e607
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions crates/vm/src/arch/extensions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,9 @@ pub struct VmInventory<E, P> {
#[derive(Clone, Serialize, Deserialize)]
pub struct VmInventoryState {
/// Executor states in order
executors: Vec<Vec<u8>>,
pub executors: Vec<Vec<u8>>,
/// Periphery states in order
periphery: Vec<Vec<u8>>,
pub periphery: Vec<Vec<u8>>,
}

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
Expand Down Expand Up @@ -479,8 +479,8 @@ pub struct VmChipComplex<F: PrimeField32, E, P> {

#[derive(Clone, Serialize, Deserialize)]
pub struct VmChipComplexState<F> {
base: SystemBaseState<F>,
inventory: VmInventoryState,
pub base: SystemBaseState<F>,
pub inventory: VmInventoryState,
}

/// The base [VmChipComplex] with only system chips.
Expand Down
12 changes: 6 additions & 6 deletions crates/vm/src/system/memory/paged_vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ use serde::{Deserialize, Serialize};
use crate::arch::MemoryConfig;

/// (address_space, pointer)
pub(crate) type Address = (u32, u32);
pub(crate) const PAGE_SIZE: usize = 1 << 12;
pub type Address = (u32, u32);
pub const PAGE_SIZE: usize = 1 << 12;

#[derive(Debug, Clone, Serialize, Deserialize)]
pub(crate) struct PagedVec<T, const PAGE_SIZE: usize> {
pages: Vec<Option<Vec<T>>>,
pub struct PagedVec<T, const PAGE_SIZE: usize> {
pub pages: Vec<Option<Vec<T>>>,
}

// ------------------------------------------------------------------
Expand Down Expand Up @@ -229,8 +229,8 @@ impl<T: Clone, const PAGE_SIZE: usize> Iterator for PagedVecIter<'_, T, PAGE_SIZ

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct AddressMap<T, const PAGE_SIZE: usize> {
paged_vecs: Vec<PagedVec<T, PAGE_SIZE>>,
as_offset: u32,
pub paged_vecs: Vec<PagedVec<T, PAGE_SIZE>>,
pub as_offset: u32,
}

impl<T: Clone + Default, const PAGE_SIZE: usize> Default for AddressMap<T, PAGE_SIZE> {
Expand Down

0 comments on commit d29e607

Please sign in to comment.