Skip to content

Commit

Permalink
Less spam when running e2e
Browse files Browse the repository at this point in the history
This avoids spam like the following going on for thousands of lines:

```
 INFO e2e: Running on platform Ceno Platform { rom: 536870912..538373056, prog_data: {536870912, [...]
 ```
  • Loading branch information
matthiasgoergens committed Jan 8, 2025
1 parent c1b2a7c commit 5eda52c
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
23 changes: 22 additions & 1 deletion ceno_emul/src/platform.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use std::{collections::BTreeSet, ops::Range};
use core::fmt::{self, Formatter};
use std::{collections::BTreeSet, fmt::Display, ops::Range};

use crate::addr::{Addr, RegIdx};

Expand All @@ -19,6 +20,26 @@ pub struct Platform {
pub unsafe_ecall_nop: bool,
}

impl Display for Platform {
fn fmt(&self, f: &mut Formatter) -> fmt::Result {
let prog_data: Option<Range<Addr>> = match (self.prog_data.first(), self.prog_data.last()) {
(Some(first), Some(last)) => Some(*first..*last),
_ => None,
};
write!(
f,
"Platform {{ rom: {:?}, prog_data: {:?}, stack: {:?}, heap: {:?}, public_io: {:?}, hints: {:?}, unsafe_ecall_nop: {} }}",
self.rom,
prog_data,
self.stack,
self.heap,
self.public_io,
self.hints,
self.unsafe_ecall_nop
)
}
}

pub const CENO_PLATFORM: Platform = Platform {
rom: 0x2000_0000..0x3000_0000,
prog_data: BTreeSet::new(),
Expand Down
2 changes: 1 addition & 1 deletion ceno_zkvm/src/bin/e2e.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ fn main() {
args.heap_size,
pub_io_size,
);
tracing::info!("Running on platform {:?} {:?}", args.platform, platform);
tracing::info!("Running on platform {:?} {}", args.platform, platform);
tracing::info!(
"Stack: {} bytes. Heap: {} bytes.",
args.stack_size,
Expand Down

0 comments on commit 5eda52c

Please sign in to comment.