Skip to content

WIP: Create a backwards compatible flow for xo/xclbin generation with Calyx-AXI-wrapper #2267

New issue

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

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

Already on GitHub? Sign in to your account

Draft
wants to merge 85 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
253dfac
add case statement support for ComponentBuilders
nathanielnrn Jun 19, 2024
64edeb2
add runt tests
nathanielnrn Jun 19, 2024
0798490
make channels for the subordinate controller
nathanielnrn Jun 20, 2024
dbb5bd4
WIP: read controller. All channels exist
nathanielnrn Jun 20, 2024
94e19ec
change case to return a par block instead of automatically adding to …
nathanielnrn Jun 20, 2024
669febd
Merge branch 'case-statements' into xilinx-subordinate
nathanielnrn Jun 20, 2024
3d0b022
WIP AXI subordinate controller
nathanielnrn Jun 20, 2024
5f65833
Queues: use case statements in FIFO control (#2171)
anshumanmohan Jun 21, 2024
ea71a0a
improve naming of equalities and add name functions to some classes i…
nathanielnrn Jun 21, 2024
1ba2147
runt tests
nathanielnrn Jun 21, 2024
8e16087
Merge branch 'case-statements' of github.com:calyxir/calyx into case-…
nathanielnrn Jun 21, 2024
98f3842
apply black
nathanielnrn Jun 21, 2024
03e3a14
Merge branch 'main' into case-statements
nathanielnrn Jun 21, 2024
7028a82
Merge branch 'case-statements' into xilinx-subordinate
nathanielnrn Jun 21, 2024
82acb17
remove extra print
nathanielnrn Jun 21, 2024
6c2ced1
runt tests
nathanielnrn Jun 21, 2024
c2dc415
Merge branch 'main' into case-statements
nathanielnrn Jun 21, 2024
c56a5a9
Merge branch 'case-statements' into xilinx-subordinate
nathanielnrn Jun 21, 2024
c968a9e
print out signals when possible for case statement signals
nathanielnrn Jun 21, 2024
a8f2ac6
Merge branch 'case-statements' of github.com:calyxir/calyx into case-…
nathanielnrn Jun 21, 2024
8bdd84c
Merge branch 'case-statements' into xilinx-subordinate
nathanielnrn Jun 21, 2024
0ec3e33
might have working axi-controller. TODO: hoko up with overall wrapper
nathanielnrn Jun 21, 2024
9b2740a
remove unused function from port attribute PR
nathanielnrn Jun 21, 2024
99f215a
Controller is largely done
nathanielnrn Jun 21, 2024
590bdef
work on controller and hook up to dynamic axi
nathanielnrn Jun 24, 2024
b9b23d4
generator updates wip
nathanielnrn Jul 9, 2024
8d98db2
fud2 update variable names
nathanielnrn Jul 9, 2024
0e38f1f
Add init invokes to ar,aw and w channels
nathanielnrn Jul 11, 2024
adfdfa6
AddAXI manager to axi_test and writing to the control register
nathanielnrn Jul 11, 2024
298fe12
WIP do mnaual ref hoisting. Problem with signal names
nathanielnrn Jul 14, 2024
13d1b46
wip on ref ports only assigning to ports actually used
nathanielnrn Jul 20, 2024
b357ea4
WIP compile invoke only needed ports. TODO: add static assignments toowq
nathanielnrn Jul 21, 2024
18faa30
WIP: add static assignments to the limited ref assignments in groups
nathanielnrn Jul 21, 2024
f76267f
Update compile-invoke tests
nathanielnrn Jul 21, 2024
7521403
Merge branch 'main' into limited-ref-ports
nathanielnrn Jul 21, 2024
570ed43
clippy and formatting
nathanielnrn Jul 21, 2024
bf55adf
more formatting
nathanielnrn Jul 21, 2024
795ff21
update axi runt tests
nathanielnrn Jul 21, 2024
5a1389f
Merge branch 'main' into xilinx-subordinate
nathanielnrn Jul 21, 2024
161b5dc
Merge branch 'limited-ref-ports' into xilinx-subordinate
nathanielnrn Jul 21, 2024
8f0f878
fud2 formatting
nathanielnrn Jul 21, 2024
92faa81
add writes to base addresses
nathanielnrn Jul 21, 2024
274ff9c
get rid of added debug statements
nathanielnrn Jul 21, 2024
b6aa6a6
improve comments
nathanielnrn Jul 22, 2024
875ac06
Merge branch 'limited-ref-ports' into xilinx-subordinate
nathanielnrn Jul 22, 2024
48e9e82
add nested while loops to subordinate controller
nathanielnrn Jul 22, 2024
69acafc
Fix memory mapping addresses in axi_test
nathanielnrn Jul 24, 2024
f07321a
thread through ap_done for early termination of all groups in the con…
nathanielnrn Jul 24, 2024
ea6ecd8
rename axi_generator to use underscore
nathanielnrn Jul 27, 2024
867ba7f
dynamic axi-generator typo
nathanielnrn Jul 27, 2024
e189e23
add an xml_generator from a `.yxi` file
nathanielnrn Jul 27, 2024
921b2eb
add link to spec
nathanielnrn Jul 27, 2024
f2ae5e1
revert name change axi_generator
nathanielnrn Jul 27, 2024
5e4a469
runt tests for new xml generator
nathanielnrn Jul 27, 2024
d599694
change gen_xo (in fud2 dir) toplevel from 'Toplevel' to 'wrapper'
nathanielnrn Jul 31, 2024
9217873
simplify axi fud2 invocation
nathanielnrn Jul 31, 2024
a2dd6be
formatting in fud2/lib.rs
nathanielnrn Jul 31, 2024
b4c738e
WIP to allow creation of .xo from calyx file using new calyx-axi-wrapper
nathanielnrn Aug 1, 2024
1b610f3
Merge branch 'main' into xml-fud2
nathanielnrn Aug 1, 2024
39ecf5e
Merge branch 'xilinx-subordinate' into xml-fud2
nathanielnrn Aug 1, 2024
b9a2a50
wip get verilog to xo fud2 invocation working. TODO: Figure out why g…
nathanielnrn Aug 1, 2024
9dcbc14
get vitis invocation to start correctly
nathanielnrn Aug 1, 2024
996aadc
change kernel root to expect 'wrapper' toplevel name instead of 'Topl…
nathanielnrn Aug 1, 2024
5d4f2d0
change gen_xo.tcl associate_bus_interface clock from 'ap_clk' to 'clk'
nathanielnrn Aug 1, 2024
9eac833
add a todo
nathanielnrn Aug 1, 2024
058c259
remove stray merge conflict from lib.rs
nathanielnrn Aug 1, 2024
adbf430
xclrun: Remove timeout parameter
sampsyo Aug 4, 2024
6a21a67
Merge branch 'main' into xml-fud2
nathanielnrn Dec 26, 2024
0a02e0b
change wrapper to Toplevel in gen_xo.tcl and have dynamic memory addr…
nathanielnrn Dec 26, 2024
4a21275
merge of axi generator renaming
nathanielnrn Dec 31, 2024
05c4789
Merge branch 'main' into xml-fud2
nathanielnrn Dec 31, 2024
213be88
revert axi.rhai changes
nathanielnrn Dec 31, 2024
9333cf0
Merge branch 'main' into xml-fud2
nathanielnrn Dec 31, 2024
f6ccafc
add ap_clk @clk designation
nathanielnrn Dec 31, 2024
0b6c63e
use ap_clk with @clk attribute
nathanielnrn Jan 2, 2025
a0f7522
add trailing semicolon to sed command to make compatible with bsd sed
nathanielnrn Jan 2, 2025
4b37ad3
rename clk to ap_clk in cocotb testbench for sake of xilinx/old veril…
nathanielnrn Jan 2, 2025
2d8f529
update fud2 snapshot
nathanielnrn Jan 2, 2025
1e8336b
update dynamic tests to work to expect new ap_clk toplevel signal
nathanielnrn Jan 2, 2025
e5b7692
remove extra ap_clk insertion in for loop
nathanielnrn Jan 2, 2025
ae18b9b
update axi read-compute-write to expect ap_clk signal
nathanielnrn Jan 2, 2025
787cb21
Merge branch 'ap-clk-changes' into xml-fud2
nathanielnrn Jan 2, 2025
24bf507
revert gen_xo.tcl to look for ap_clk signal, making single script com…
nathanielnrn Jan 2, 2025
a5e858a
remove extra ap_clk ports in axi_generator.py
nathanielnrn Jan 2, 2025
f8a968d
Merge branch 'main' into xml-fud2
nathanielnrn Jan 4, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions fud/fud/xclrun.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,8 @@ def run(xclbin: Path, data: Mapping[str, Any]) -> Dict[str, Any]:
buffer.sync_to_device()

# Run the kernel.
kernel = getattr(ol, list(ol.ip_dict)[0]) # Like ol.Toplevel_1
# XXX(nathanielnrn) 2022-07-19: timeout is not currently used anywhere in
# generated verilog code, passed in because kernel.xml is generated to
# expect it as an argument
timeout = 1000
kernel.call(timeout, *buffers)
kernel = getattr(ol, list(ol.ip_dict)[0]) # Like ol.wrapper_1
kernel.call(*buffers)

# Collect the output data.
for buf in buffers:
Expand Down
1 change: 1 addition & 0 deletions fud2/scripts/calyx.rhai
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ fn calyx_setup(e) {
"calyx-cider",
"$calyx-exe -l $calyx-lib-path $cider-calyx-passes $args $in > $out",
);
e.rule("copy", "cp $in $out");
}

op(
Expand Down
4 changes: 3 additions & 1 deletion fud2/scripts/cocotb-axi.rhai
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ fn cocotb_setup(e) {
e.rule("copy", "cp $in $out");
// This cleans up the extra `make` cruft, leaving what is in between `{` and `}.`
e.rule(
"cleanup-cocotb", `sed -n '/Output:/,/make\[1\]/{/Output:/d;/make\[1\]/d;p}' $in > $out`
"cleanup-cocotb", `sed -n '/Output:/,/make\[1\]/{/Output:/d;/make\[1\]/d;p;}' $in > $out`
);
}

Expand All @@ -49,6 +49,8 @@ op(
c::verilog_noverify,
cocotb_axi,
|e, input, output| {
// Cocotb wants files relative to the location of the makefile.
// This is annoying to calculate on the fly, so we just copy necessary files to the build directory
e.build_cmd(
["Makefile"],
"copy",
Expand Down
59 changes: 55 additions & 4 deletions fud2/scripts/xilinx.rhai
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import "calyx" as c;
// import "calyx" as c;
import "axi" as axi;
import "rtl_sim" as sim;
import "testbench" as tb;

let xo = state("xo", ["xo"]);
let xclbin = state("xclbin", ["xclbin"]);

fn default_xml_generator() {
"$calyx-base/yxi/xml/xml_generator.py";
}
fn xilinx_setup(e) {
// Locations for Vivado and Vitis installations.
e.config_var("vivado-dir", "xilinx.vivado");
Expand All @@ -28,12 +32,16 @@ fn xilinx_setup(e) {
"$vitis-dir/bin/v++ -g -t $xilinx-mode --platform $platform --save-temps --profile.data all:all:all --profile.exec all:all:all -lo $out $in"
);
e.arg("pool", "console");

// Generate a kernel.xml from a yxi file.
e.config_var_or("xml-generator", "xml.generator", default_xml_generator());
e.rule("gen-kernel-xml", "$python $xml-generator $in > $out");
};

op(
"xo",
[c::calyx_setup, xilinx_setup],
c::calyx_state,
[axi::c::calyx_setup, xilinx_setup],
axi::c::calyx_state,
xo,
|e, input, output| {
// Emit the Verilog itself in "synthesis mode."
Expand All @@ -60,7 +68,50 @@ op(
"get-ports.py",
],
);
},
}
);

// Assumes that verilog was generated with the `--synthesis` flag.
// `-p external` can also be used, but is not necesary for designs using `ref` memories.
op(
"verilog-to-xo",
[axi::c::calyx_setup, xilinx_setup],
axi::c::verilog_state,
xo,
|e, input, output | {
let file_name = input.split("/")[-1];
let sv_file_name = file_name;
sv_file_name.replace(`v`, `sv`);
let yxi_file = e.config_val("yxi.file");
let yxi_path = e.external_path(yxi_file);

e.build_cmd(
["kernel.xml"],
"gen-kernel-xml",
[yxi_path],
["$xml-generator"],
);

e.build_cmd(
[sv_file_name],
"copy",
[input],
[],
);

e.build_cmd(
[output],
"gen-xo",
[],
[
sv_file_name,
yxi_path,
"gen_xo.tcl",
"get-ports.py",
"kernel.xml",
],
);
}
);

op("xclbin", [xilinx_setup], xo, xclbin, |e, input, output| {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ rule make-cocotb
rule copy
command = cp $in $out
rule cleanup-cocotb
command = sed -n '/Output:/,/make\[1\]/{/Output:/d;/make\[1\]/d;p}' $in > $out
command = sed -n '/Output:/,/make\[1\]/{/Output:/d;/make\[1\]/d;p;}' $in > $out

build Makefile: copy $cocotb-makefile-dir/Makefile
build axi_test.py: copy $cocotb-makefile-dir/axi_test.py
Expand Down
Loading
Loading