@@ -240,8 +240,8 @@ async def test_decoder(dut, test_cases, block_type):
240
240
241
241
scoreboard = Scoreboard (dut )
242
242
243
- terminate = Event ()
244
- set_termination_event (monitor_notify , terminate , 1 )
243
+ assert_notify = Event ()
244
+ set_termination_event (monitor_notify , assert_notify , 1 )
245
245
246
246
cpu = AxiMaster (csr_bus , dut .clk , dut .rst )
247
247
@@ -251,24 +251,27 @@ async def test_decoder(dut, test_cases, block_type):
251
251
mem_size = MAX_ENCODED_FRAME_SIZE_B
252
252
ibuf_addr = 0x0
253
253
obuf_addr = mem_size // 2
254
+ assert_expected_output = Event ()
254
255
GenerateFrame (i + 1 , block_type , encoded .name )
255
256
expected_decoded_frame = get_decoded_frame_bytes (encoded )
256
257
print ("Expected decoded frame: {}" .format (expected_decoded_frame ))
257
258
expected_output_packets = generate_expected_output (expected_decoded_frame )
258
259
print ("Expected output: {}" .format (expected_output_packets ))
260
+ set_termination_event (monitor_output , assert_expected_output , len (expected_output_packets ))
259
261
scoreboard .add_interface (monitor_output , expected_output_packets )
260
262
encoded .close ()
261
263
memory = AxiRamFromFile (bus = memory_bus , clock = dut .clk , reset = dut .rst , path = encoded .name , size = mem_size )
262
264
memory .hexdump (0 , mem_size )
263
265
await configure_decoder (cpu , ibuf_addr , obuf_addr )
264
266
await start_decoder (cpu )
265
267
##await mock_decoder(dut, memory, memory_bus, csr, csr_bus, encoded.name, obuf_addr)
266
- #await terminate.wait()
267
- #await wait_for_idle(cpu)
268
+ await assert_notify .wait ()
269
+ await assert_expected_output .wait ()
270
+ await wait_for_idle (cpu )
268
271
#decoded_frame = memory.read(obuf_addr, memory.size-obuf_addr)
269
272
#assert decoded_frame == expected_decoded_frame
270
273
271
- await ClockCycles (dut .clk , 5000 )
274
+ await ClockCycles (dut .clk , 20 )
272
275
273
276
@cocotb .test (timeout_time = 50 , timeout_unit = "ms" )
274
277
async def zstd_csr_test (dut ):
0 commit comments