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 b1078df
Show file tree
Hide file tree
Showing 2 changed files with 2 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/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 b1078df

Please sign in to comment.