Skip to content

Commit

Permalink
unbreak the fud2 tests again
Browse files Browse the repository at this point in the history
  • Loading branch information
EclecticGriffin committed Jul 15, 2024
1 parent ec9758b commit 42d9766
Show file tree
Hide file tree
Showing 3 changed files with 103 additions and 2 deletions.
51 changes: 51 additions & 0 deletions fud2/tests/snapshots/tests__test@calyx_cider-debug.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
source: fud2/tests/tests.rs
description: "emit request: calyx -> cider-debug"
---
build-tool = fud2
rule get-rsrc
command = $build-tool get-rsrc $out

python = python3
build json-dat.py: get-rsrc
rule hex-data
command = $python json-dat.py --from-json $in $out
rule json-data
command = $python json-dat.py --to-json $out $in
sim_data = /test/data.json
datadir = sim_data
build $datadir: hex-data $sim_data | json-dat.py
rule sim-run
command = ./$bin +DATA=$datadir +CYCLE_LIMIT=$cycle-limit $args > $out
cycle-limit = 500000000

calyx-base = /test/calyx
calyx-exe = $calyx-base/target/debug/calyx
args =
rule calyx
command = $calyx-exe -l $calyx-base -b $backend $args $in > $out
rule calyx-pass
command = $calyx-exe -l $calyx-base -p $pass $args $in > $out
flags = -p none
rule calyx-with-flags
command = $calyx-exe -l $calyx-base $flags $args $in > $out

build tb.sv: get-rsrc

cider-exe = $calyx-base/target/debug/cider
cider-converter = $calyx-base/target/debug/cider-data-converter
rule run-cider-debug
command = $cider-exe -l $calyx-base --data data.dump $in debug || true
pool = console
rule run-cider
command = $cider-exe -l $calyx-base --data data.dump $in > $out
rule dump-to-interp
command = $cider-converter --to cider $in > $out
rule interp-to-dump
command = $cider-converter --to json $in > $out
build data.dump: dump-to-interp $sim_data | $cider-converter

build cider-input.futil: calyx-with-flags _from_stdin_calyx.futil
build _to_stdout_cider-debug: run-cider-debug pseudo_cider | data.dump

default _to_stdout_cider-debug
50 changes: 50 additions & 0 deletions fud2/tests/snapshots/tests__test@calyx_cider_dat.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
source: fud2/tests/tests.rs
description: "emit request: calyx -> dat through cider"
---
build-tool = fud2
rule get-rsrc
command = $build-tool get-rsrc $out

python = python3
build json-dat.py: get-rsrc
rule hex-data
command = $python json-dat.py --from-json $in $out
rule json-data
command = $python json-dat.py --to-json $out $in
sim_data = /test/data.json
datadir = sim_data
build $datadir: hex-data $sim_data | json-dat.py
rule sim-run
command = ./$bin +DATA=$datadir +CYCLE_LIMIT=$cycle-limit $args > $out
cycle-limit = 500000000

calyx-base = /test/calyx
calyx-exe = $calyx-base/target/debug/calyx
args =
rule calyx
command = $calyx-exe -l $calyx-base -b $backend $args $in > $out
rule calyx-pass
command = $calyx-exe -l $calyx-base -p $pass $args $in > $out
flags = -p none
rule calyx-with-flags
command = $calyx-exe -l $calyx-base $flags $args $in > $out

cider-exe = $calyx-base/target/debug/cider
cider-converter = $calyx-base/target/debug/cider-data-converter
rule run-cider-debug
command = $cider-exe -l $calyx-base --data data.dump $in debug || true
pool = console
rule run-cider
command = $cider-exe -l $calyx-base --data data.dump $in > $out
rule dump-to-interp
command = $cider-converter --to cider $in > $out
rule interp-to-dump
command = $cider-converter --to json $in > $out
build data.dump: dump-to-interp $sim_data | $cider-converter

build cider-input.futil: calyx-with-flags _from_stdin_calyx.futil
build interp_out.dump: run-cider cider-input.futil | data.dump
build _to_stdout_dat.json: interp-to-dump interp_out.dump | $sim_data $cider-converter

default _to_stdout_dat.json
4 changes: 2 additions & 2 deletions fud2/tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,8 @@ fn sim_tests() {
#[test]
fn cider_tests() {
let driver = test_driver();
request(&driver, "calyx", "dat", &["interp"]).test(&driver);
request(&driver, "calyx", "debug", &[]).test(&driver);
request(&driver, "calyx", "dat", &["cider"]).test(&driver);
request(&driver, "calyx", "cider-debug", &[]).test(&driver);
}

#[test]
Expand Down

0 comments on commit 42d9766

Please sign in to comment.