Skip to content

Commit

Permalink
update the debugger path and remove old interp
Browse files Browse the repository at this point in the history
  • Loading branch information
EclecticGriffin committed Jul 12, 2024
1 parent c560483 commit 3583c5e
Showing 1 changed file with 7 additions and 48 deletions.
55 changes: 7 additions & 48 deletions fud2/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -512,8 +512,8 @@ pub fn build_driver(bld: &mut DriverBuilder) {
);

// Interpreter.
let debug = bld.state("debug", &[]); // A pseudo-state.
// A pseudo-state for cider input
let debug = bld.state("cider-debug", &[]); // A pseudo-state.
// A pseudo-state for cider input
let cider_state = bld.state("cider", &[]);

let cider_setup = bld.setup("Cider interpreter", |e| {
Expand All @@ -528,30 +528,11 @@ pub fn build_driver(bld: &mut DriverBuilder) {
"$calyx-base/target/debug/cider-data-converter",
)?;
e.rule(
"cider",
"$cider-exe -l $calyx-base --raw --data data.json $in > $out",
)?;
e.rule(
"cider-debug",
"$cider-exe -l $calyx-base --data data.json $in debug || true",
"run-cider-debug",
"$cider-exe -l $calyx-base --data data.dump $in debug || true",
)?;
e.arg("pool", "console")?;

// TODO Can we reduce the duplication around and `$python`?
e.rsrc("interp-dat.py")?;
e.config_var_or("python", "python", "python3")?;
e.rule("dat-to-interp", "$python interp-dat.py --to-interp $in")?;
e.rule(
"interp-to-dat",
"$python interp-dat.py --from-interp $in $sim_data > $out",
)?;
e.build_cmd(
&["data.json"],
"dat-to-interp",
&["$sim_data"],
&["interp-dat.py"],
)?;

e.rule(
"run-cider",
"$cider-exe -l $calyx-base --data data.dump $in > $out",
Expand Down Expand Up @@ -584,28 +565,6 @@ pub fn build_driver(bld: &mut DriverBuilder) {
},
);

bld.op(
"interp",
&[
sim_setup,
standalone_testbench_setup,
calyx_setup,
cider_setup,
],
calyx,
dat,
|e, input, output| {
let out_file = "interp_out.json";
e.build_cmd(&[out_file], "cider", &[input[0]], &["data.json"])?;
e.build_cmd(
&[output[0]],
"interp-to-dat",
&[out_file],
&["$sim_data", "interp-dat.py"],
)?;
Ok(())
},
);
bld.op(
"cider",
&[sim_setup, calyx_setup, cider_setup],
Expand All @@ -629,7 +588,7 @@ pub fn build_driver(bld: &mut DriverBuilder) {
},
);
bld.op(
"debug",
"cider-debug",
&[
sim_setup,
standalone_testbench_setup,
Expand All @@ -641,9 +600,9 @@ pub fn build_driver(bld: &mut DriverBuilder) {
|e, input, output| {
e.build_cmd(
&[output[0]],
"cider-debug",
"run-cider-debug",
&[input[0]],
&["data.json"],
&["data.dump"],
)?;
Ok(())
},
Expand Down

0 comments on commit 3583c5e

Please sign in to comment.