diff --git a/Cargo.lock b/Cargo.lock index cce03e950..b1113d391 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -67,55 +67,6 @@ dependencies = [ "libc", ] -[[package]] -name = "anstream" -version = "0.6.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" -dependencies = [ - "anstyle", - "anstyle-parse", - "anstyle-query", - "anstyle-wincon", - "colorchoice", - "is_terminal_polyfill", - "utf8parse", -] - -[[package]] -name = "anstyle" -version = "1.0.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" - -[[package]] -name = "anstyle-parse" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" -dependencies = [ - "utf8parse", -] - -[[package]] -name = "anstyle-query" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" -dependencies = [ - "windows-sys 0.52.0", -] - -[[package]] -name = "anstyle-wincon" -version = "3.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" -dependencies = [ - "anstyle", - "windows-sys 0.52.0", -] - [[package]] name = "anyhow" version = "1.0.80" @@ -249,29 +200,6 @@ version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" -[[package]] -name = "bindgen" -version = "0.68.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "726e4313eb6ec35d2730258ad4e15b547ee75d6afaa1361a922e78e59b7d8078" -dependencies = [ - "bitflags 2.4.2", - "cexpr", - "clang-sys", - "lazy_static", - "lazycell", - "log", - "peeking_take_while", - "prettyplease", - "proc-macro2", - "quote", - "regex", - "rustc-hash", - "shlex", - "syn 2.0.87", - "which", -] - [[package]] name = "bit-set" version = "0.5.3" @@ -320,25 +248,6 @@ dependencies = [ "generic-array", ] -[[package]] -name = "btor2i" -version = "0.1.0" -dependencies = [ - "bitvec", - "btor2tools", - "clap 4.5.20", - "num-bigint", - "num-integer", - "num-traits", - "tempfile", - "thiserror", -] - -[[package]] -name = "btor2tools" -version = "1.1.0" -source = "git+https://github.com/obhalerao/btor2tools.rs#8d34a0dc96b447fb008ffbb6f15d1ec947eaefb8" - [[package]] name = "bon" version = "2.3.0" @@ -359,7 +268,7 @@ dependencies = [ "ident_case", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.87", ] [[package]] @@ -687,17 +596,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "clang-sys" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" -dependencies = [ - "glob", - "libc", - "libloading", -] - [[package]] name = "clap" version = "2.34.0" @@ -709,46 +607,6 @@ dependencies = [ "unicode-width", ] -[[package]] -name = "clap" -version = "4.5.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97f376d85a664d5837dbae44bf546e6477a679ff6610010f17276f686d867e8" -dependencies = [ - "clap_builder", - "clap_derive", -] - -[[package]] -name = "clap_builder" -version = "4.5.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19bc80abd44e4bed93ca373a0704ccbd1b710dc5749406201bb018272808dc54" -dependencies = [ - "anstream", - "anstyle", - "clap_lex", - "strsim 0.11.1", -] - -[[package]] -name = "clap_derive" -version = "4.5.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab" -dependencies = [ - "heck 0.5.0", - "proc-macro2", - "quote", - "syn 2.0.87", -] - -[[package]] -name = "clap_lex" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" - [[package]] name = "clipboard-win" version = "4.5.0" @@ -760,12 +618,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "colorchoice" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" - [[package]] name = "component_cells" version = "0.7.1" @@ -1512,12 +1364,6 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" -[[package]] -name = "heck" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" - [[package]] name = "hermit-abi" version = "0.1.19" @@ -1695,12 +1541,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "is_terminal_polyfill" -version = "1.70.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" - [[package]] name = "itertools" version = "0.10.5" @@ -1814,6 +1654,15 @@ dependencies = [ "url", ] +[[package]] +name = "lz4_flex" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75761162ae2b0e580d7e7c390558127e5f01b4194debd6221fd8c207fc80e3f5" +dependencies = [ + "twox-hash", +] + [[package]] name = "makemake" version = "0.1.3" @@ -1825,15 +1674,6 @@ dependencies = [ "paste", ] -[[package]] -name = "lz4_flex" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75761162ae2b0e580d7e7c390558127e5f01b4194debd6221fd8c207fc80e3f5" -dependencies = [ - "twox-hash", -] - [[package]] name = "manifest-dir-macros" version = "0.1.18" @@ -2244,16 +2084,6 @@ dependencies = [ "unicode-segmentation", ] -[[package]] -name = "prettyplease" -version = "0.2.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" -dependencies = [ - "proc-macro2", - "syn 2.0.87", -] - [[package]] name = "proc-macro2" version = "1.0.89" @@ -2898,7 +2728,7 @@ version = "0.25.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23dc1fa9ac9c169a78ba62f0b841814b7abae11bdd047b9c58f893439e309ea0" dependencies = [ - "heck 0.4.1", + "heck", "proc-macro2", "quote", "rustversion", diff --git a/interp/src/lib.rs b/interp/src/lib.rs index 34b3d98a9..6c6afe53b 100644 --- a/interp/src/lib.rs +++ b/interp/src/lib.rs @@ -8,3 +8,6 @@ pub mod serialization; mod tests; pub mod flatten; + +// ethan: griffin ok'd this +pub use baa::{BitVecOps, BitVecValue}; diff --git a/tools/calyx-ffi/src/backend/cider.rs b/tools/calyx-ffi/src/backend/cider.rs index 9f7e3438d..f2f548742 100644 --- a/tools/calyx-ffi/src/backend/cider.rs +++ b/tools/calyx-ffi/src/backend/cider.rs @@ -1,12 +1,13 @@ use calyx_ir::Context; use interp::{ + configuration::RuntimeConfig, flatten::{ flat_ir, structures::{ context::Context as CiderContext, environment::Simulator, }, }, - values::Value, + BitVecOps, BitVecValue, }; use std::rc::Rc; @@ -18,23 +19,30 @@ impl CiderFFIBackend { pub fn from(ctx: &Context, _name: &'static str) -> Self { // TODO(ethan, maybe griffin): use _name to select the component somehow let ctx = flat_ir::translate(ctx); - let simulator = Simulator::build_simulator(Rc::new(ctx), &None) - .expect("we live on the edge"); + let simulator = Simulator::build_simulator( + Rc::new(ctx), + &None, + &None, + RuntimeConfig::default(), + ) + .expect("we live on the edge"); Self { simulator } } pub fn write_port(&mut self, name: &'static str, value: u64) { - if name == "go" { + if name == "go" || name == "reset" { return; } - self.simulator.pin_value(name, Value::from(value, 64)); + self.simulator + .pin_value(name, BitVecValue::from_u64(value, 64)); } pub fn read_port(&self, name: &'static str) -> u64 { self.simulator .lookup_port_from_string(&String::from(name)) .expect("wrong port name") - .as_u64() + .to_u64() + .expect("type was not u64") } pub fn step(&mut self) { @@ -75,7 +83,7 @@ macro_rules! cider_ffi_backend { true }; (@tick $dut:ident; $($input:ident),*; $($output:ident),*) => { - println!("cider_ffi_backend tick"); + // println!("cider_ffi_backend tick"); let cider = unsafe { $dut.user_data.assume_init_mut() }; $( cider.write_port(stringify!($input), $dut.$input); @@ -86,7 +94,7 @@ macro_rules! cider_ffi_backend { )* }; (@go $dut:ident; $($input:ident),*; $($output:ident),*) => { - println!("cider_ffi_backend go"); + // println!("cider_ffi_backend go"); let cider = unsafe { $dut.user_data.assume_init_mut() }; $( cider.write_port(stringify!($input), $dut.$input);