Skip to content

Commit

Permalink
feat/guest-example: remove Platform program_data
Browse files Browse the repository at this point in the history
  • Loading branch information
Aurélien Nicolas committed Nov 18, 2024
1 parent e3aa83d commit 9211c7a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 14 deletions.
15 changes: 1 addition & 14 deletions ceno_emul/src/platform.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,6 @@ impl Platform {
(self.rom_start()..=self.rom_end()).contains(&addr)
}

// TODO figure out proper region for program_data
pub const fn program_data_start(&self) -> Addr {
0x4000_0000
}

pub const fn program_data_end(&self) -> Addr {
0x5000_0000 - 1
}

// TODO figure out a proper region for public io
pub const fn public_io_start(&self) -> Addr {
0x3000_1000
Expand Down Expand Up @@ -86,10 +77,6 @@ impl Platform {
(self.public_io_start()..=self.public_io_end()).contains(&addr)
}

pub fn is_program_data(&self, addr: Addr) -> bool {
(self.program_data_start()..=self.program_data_end()).contains(&addr)
}

/// Virtual address of a register.
pub const fn register_vma(&self, index: RegIdx) -> Addr {
// Register VMAs are aligned, cannot be confused with indices, and readable in hex.
Expand All @@ -110,7 +97,7 @@ impl Platform {
// Permissions.

pub fn can_read(&self, addr: Addr) -> bool {
self.is_rom(addr) || self.is_ram(addr) || self.is_pub_io(addr) || self.is_program_data(addr)
self.is_rom(addr) || self.is_ram(addr) || self.is_pub_io(addr)
}

pub fn can_write(&self, addr: Addr) -> bool {
Expand Down
1 change: 1 addition & 0 deletions ceno_zkvm/examples/fibonacci_elf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ fn main() {
ram_end: 0xffff_ffff,
unsafe_ecall_nop: true,
};
// The stack section is not mentioned in ELF headers, so we repeat the constant STACK_TOP here.
const STACK_TOP: u32 = 0x0020_0400;
const STACK_SIZE: u32 = 256;
let mut mem_padder = MemPadder::new(sp1_platform.ram_start()..=sp1_platform.ram_end());
Expand Down
1 change: 1 addition & 0 deletions ceno_zkvm/examples/riscv_opcodes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ fn main() {

let reg_init = MmuConfig::<E>::initial_registers();

// RAM is not used in this program, but it must have a particular size at the moment.
let mem_init = MemPadder::init_mem(mem_addresses, MmuConfig::<E>::static_mem_len(), &[]);

let init_public_io = |values: &[Word]| {
Expand Down

0 comments on commit 9211c7a

Please sign in to comment.