Skip to content

Commit 5e8ff91

Browse files
authored
[fud2] AXI wrapper script cleanup & unified python names (#2384)
The WIP [PR that tries to get an `yxi` powered end to end xilinx tools workflow up and running](#2267) ballooned into a beast and has gotten pretty stale. This is me trying to break things down into parts and slowly get everything merged. This changes the `*axi_generator.py` files to use underscores, which is needed for proper importing afaict. Also snuck in formatting changes to `dynamic_axi_generator.py`. These are pretty minor changes so going to merge when tests pass.
1 parent e0b02ed commit 5e8ff91

File tree

5 files changed

+117
-91
lines changed

5 files changed

+117
-91
lines changed

fud2/scripts/axi.rhai

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ fn wrapper_setup(e) {
2424
let dynamic =
2525
e.config_constrained_or("dynamic", ["true", "false"], "false");
2626
let generator_path = if dynamic == "true" {
27-
"$calyx-base/yxi/axi-calyx/dynamic-axi-generator.py"
27+
"$calyx-base/yxi/axi-calyx/dynamic_axi_generator.py"
2828
} else {
29-
"$calyx-base/yxi/axi-calyx/axi-generator.py"
29+
"$calyx-base/yxi/axi-calyx/axi_generator.py"
3030
};
3131
e.config_var_or("axi-generator", "axi.generator", generator_path);
3232
e.config_var_or("python", "python", "python3");
@@ -36,6 +36,8 @@ fn wrapper_setup(e) {
3636
// Define a simple `combine` rule that just concatenates any numer of files.
3737
e.rule("combine", "cat $in > $out");
3838

39+
// Removes imports and `external` primitive blocks added by passes by removing
40+
// everything up until the first line containing `component main`
3941
e.rule(
4042
"remove-imports",
4143
"sed '1,/component main/{/component main/!d; }' $in > $out",

fud2/tests/snapshots/tests__test@plan_axi-wrapped.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ yxi = $calyx-base/target/debug/yxi
2222
rule yxi
2323
command = $yxi -l $calyx-base $in > $out
2424

25-
axi-generator = $calyx-base/yxi/axi-calyx/axi-generator.py
25+
axi-generator = $calyx-base/yxi/axi-calyx/axi_generator.py
2626
python = python3
2727
rule gen-axi
2828
command = $python $axi-generator $in > $out

runt.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ cmd = """
6868

6969
[[tests]]
7070
name = "fud2 yxi invocation"
71-
paths = ["yxi/tests/ref-mems-vec-add.futil"]
71+
paths = ["yxi/tests/yxi-tool/ref-mems-vec-add.futil"]
7272
cmd = """
7373
fud2 {} --from calyx --to yxi
7474
"""
@@ -604,14 +604,14 @@ fud e {} -s verilog.cycle_limit 500 \
604604
name = "calyx-py read-write-compute AXI wrapper generation"
605605
paths = ["yxi/tests/axi/read-compute-write/*.yxi"]
606606
cmd = """
607-
python3 yxi/axi-calyx/axi-generator.py {}
607+
python3 yxi/axi-calyx/axi_generator.py {}
608608
"""
609609

610610
[[tests]]
611611
name = "calyx-py dynamic AXI wrapper generation"
612612
paths = ["yxi/tests/axi/dynamic/*.yxi"]
613613
cmd = """
614-
python3 yxi/axi-calyx/dynamic-axi-generator.py {}
614+
python3 yxi/axi-calyx/dynamic_axi_generator.py {}
615615
"""
616616

617617
#Ignore fud2 stderr for now due to ninja nondeterminism
@@ -681,4 +681,4 @@ make --silent -B TEST_PATH={} COCOTB_LOG_LEVEL=CRITICAL |\
681681
make clean && \
682682
rm -f results.xml
683683
684-
"""
684+
"""

yxi/axi-calyx/axi-generator.py renamed to yxi/axi-calyx/axi_generator.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# The *original* axi generator which implement a read-compute-write sequence
2+
# to get data in and out of the computational kernel.
3+
# A `dynamic_axi_generator` also exists
4+
15
from calyx.builder import (
26
Builder,
37
add_comp_ports,

0 commit comments

Comments
 (0)