Skip to content

Commit

Permalink
construct simulator
Browse files Browse the repository at this point in the history
  • Loading branch information
ekiwi committed Nov 21, 2023
1 parent c9136e4 commit 9bdf16f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
5 changes: 3 additions & 2 deletions examples/sim.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,12 @@ fn main() {
}

let input_name_to_ref: HashMap<String, usize> = HashMap::from_iter(
sys.get_signals(|s| s.kind == ir::SignalKind::Input)
sys.get_signals(|s| s.kind == SignalKind::Input)
.iter()
.enumerate()
.map(|(idx, (e, _))| (e.get_symbol_name(&ctx).unwrap().to_string(), idx)),
);

println!("{:?}", input_name_to_ref);

let sim = libpatron::sim::interpreter::Interpreter::new(&ctx, &sys);
}
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ extern crate lazy_static;
pub mod btor2;
pub mod ir;
pub mod mc;
mod sim;
pub mod sim;
2 changes: 1 addition & 1 deletion src/sim/interpreter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// released under BSD 3-Clause License
// author: Kevin Laeufer <[email protected]>

use super::values::{ScalarValue, ValueStore};
use crate::ir::*;
use crate::sim::{ScalarValue, ValueStore};

/// Specifies how to initialize states that do not have
#[derive(Debug, PartialEq, Copy, Clone)]
Expand Down
2 changes: 0 additions & 2 deletions src/sim/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,3 @@ mod values;
// released under BSD 3-Clause License
// author: Kevin Laeufer <[email protected]>
pub mod interpreter;

pub use values::{ArrayValue, ScalarValue, ScalarValueRef, Value, ValueRef, ValueStore};

0 comments on commit 9bdf16f

Please sign in to comment.