Skip to content

Commit 0a02e0b

Browse files
committed
change wrapper to Toplevel in gen_xo.tcl and have dynamic memory address bases in axi_test.py
1 parent 6a21a67 commit 0a02e0b

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

fud2/rsrc/gen_xo.tcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,4 @@ ipx::save_core [ipx::current_core]
4646
close_project -delete
4747

4848
# Package the project as an .xo file.
49-
package_xo -xo_path ${xoname} -kernel_name wrapper -ip_directory ${path_to_packaged} -kernel_xml ./kernel.xml
49+
package_xo -xo_path ${xoname} -kernel_name Toplevel -ip_directory ${path_to_packaged} -kernel_xml ./kernel.xml

yxi/axi-calyx/cocotb/axi_test.py

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -89,19 +89,22 @@ async def run_kernel_test(toplevel, data_path: str):
8989

9090
# Finish when ap_done is high or 100 us of simulation have passed.
9191
timeout = 5000
92-
#Base addresses for memories
93-
await tb.control_manager.write(0x0010, encode([0x0],4))
94-
await tb.control_manager.write(0x0014, encode([0x0],4))
95-
await tb.control_manager.write(0x0018, encode([0x0],4))
96-
await tb.control_manager.write(0x001C, encode([0x0],4))
97-
await tb.control_manager.write(0x0020, encode([0x0],4))
98-
await tb.control_manager.write(0x0024, encode([0x0],4))
92+
# Base addresses for memories
93+
# The od verilog wrapper seemed to be ok with base addresses of 0x0000
94+
# for every memory, so trying that here.
95+
# Xilinx spec has the first argument offset at 0x0010
96+
# Note this differs from the old verilog testrunner because we assume no
97+
# timeout argument with the new calyx wrapper.
98+
register_offset = 0x0010
99+
for mem in data_map.keys():
100+
await tb.control_manager.write(register_offset, encode([0x0],4))
101+
register_offset += 4
102+
await tb.control_manager.write(register_offset, encode([0x0],4))
103+
register_offset += 4
99104
#Assert ap_start by writing 1 to 0x0000
100105
await tb.control_manager.write(0x0000, encode([0x1],1))
101106
await with_timeout(RisingEdge(toplevel.done), timeout, "us")
102107

103-
104-
105108

106109
# Get data from ram
107110
mems: list[str] = list(data_map.keys())

0 commit comments

Comments
 (0)