@@ -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