Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[fud2] AXI wrapper script cleanup & unified python names #2384

Merged
merged 9 commits into from
Dec 31, 2024
6 changes: 4 additions & 2 deletions fud2/scripts/axi.rhai
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ fn wrapper_setup(e) {
let dynamic =
e.config_constrained_or("dynamic", ["true", "false"], "false");
let generator_path = if dynamic == "true" {
"$calyx-base/yxi/axi-calyx/dynamic-axi-generator.py"
"$calyx-base/yxi/axi-calyx/dynamic_axi_generator.py"
} else {
"$calyx-base/yxi/axi-calyx/axi-generator.py"
"$calyx-base/yxi/axi-calyx/axi_generator.py"
};
e.config_var_or("axi-generator", "axi.generator", generator_path);
e.config_var_or("python", "python", "python3");
Expand All @@ -36,6 +36,8 @@ fn wrapper_setup(e) {
// Define a simple `combine` rule that just concatenates any numer of files.
e.rule("combine", "cat $in > $out");

// Removes imports and `external` primitive blocks added by passes by removing
// everything up until the first line containing `component main`
e.rule(
"remove-imports",
"sed '1,/component main/{/component main/!d; }' $in > $out",
Expand Down
2 changes: 1 addition & 1 deletion fud2/tests/snapshots/tests__test@plan_axi-wrapped.snap
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ yxi = $calyx-base/target/debug/yxi
rule yxi
command = $yxi -l $calyx-base $in > $out

axi-generator = $calyx-base/yxi/axi-calyx/axi-generator.py
axi-generator = $calyx-base/yxi/axi-calyx/axi_generator.py
python = python3
rule gen-axi
command = $python $axi-generator $in > $out
Expand Down
8 changes: 4 additions & 4 deletions runt.toml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ cmd = """

[[tests]]
name = "fud2 yxi invocation"
paths = ["yxi/tests/ref-mems-vec-add.futil"]
paths = ["yxi/tests/yxi-tool/ref-mems-vec-add.futil"]
cmd = """
fud2 {} --from calyx --to yxi
"""
Expand Down Expand Up @@ -604,14 +604,14 @@ fud e {} -s verilog.cycle_limit 500 \
name = "calyx-py read-write-compute AXI wrapper generation"
paths = ["yxi/tests/axi/read-compute-write/*.yxi"]
cmd = """
python3 yxi/axi-calyx/axi-generator.py {}
python3 yxi/axi-calyx/axi_generator.py {}
"""

[[tests]]
name = "calyx-py dynamic AXI wrapper generation"
paths = ["yxi/tests/axi/dynamic/*.yxi"]
cmd = """
python3 yxi/axi-calyx/dynamic-axi-generator.py {}
python3 yxi/axi-calyx/dynamic_axi_generator.py {}
"""

#Ignore fud2 stderr for now due to ninja nondeterminism
Expand Down Expand Up @@ -681,4 +681,4 @@ make --silent -B TEST_PATH={} COCOTB_LOG_LEVEL=CRITICAL |\
make clean && \
rm -f results.xml

"""
"""
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# The *original* axi generator which implement a read-compute-write sequence
# to get data in and out of the computational kernel.
# A `dynamic_axi_generator` also exists

from calyx.builder import (
Builder,
add_comp_ports,
Expand Down
Loading
Loading