Skip to content

Commit

Permalink
optimism: basic logging in place
Browse files Browse the repository at this point in the history
now needs to compute the right data :-)
  • Loading branch information
rbonichon committed Oct 31, 2023
1 parent 896c8e8 commit 05a6cd4
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions optimism/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@ hex = "0.4.3"
regex = "1.10.2"
libflate = "2"
base64 = "0.21.5"
log = "0.4.20"
11 changes: 11 additions & 0 deletions optimism/src/mips/witness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use crate::{
};
use ark_ff::Field;
use std::array;
use log::{info};

pub const NUM_GLOBAL_LOOKUP_TERMS: usize = 1;
pub const NUM_DECODING_LOOKUP_TERMS: usize = 2;
Expand Down Expand Up @@ -97,6 +98,7 @@ impl<Fp: Field> Env<Fp> {

pub fn step(&mut self, config: VmConfiguration) {
self.pp_info(config.info_at);

// TODO
self.halt = true;
}
Expand All @@ -114,6 +116,15 @@ impl<Fp: Field> Env<Fp> {
fn pp_info(& self, at: StepFrequency) {
if self.at(at) {
println!("Info");
let elapsed = 1.0;
let step = self.instruction_counter;
let pc = self.instruction_pointer;
let insn = 0xffffff;
let ips = 0.0 / elapsed;
let pages = self.memory.len();
let mem = 0;
let name = "unsupported";
info!("processing step {} pc {} insn {} ips {} page {} mem {} name {}", step, pc, insn, ips, pages, mem, name);
}
}
}

0 comments on commit 05a6cd4

Please sign in to comment.