@@ -41,10 +41,8 @@ async def write_read_test(dut, pkt_count=1000, item_width_min=1, item_width_max=
4141
4242 addr_width = len (tb .stream_in .bus .WR_ADDR [0 ])
4343
44- cocotb .log .info ("-------------------------------------Write and immediate read---------------------------------" )
45-
46- for transaction in random_packets (item_width_min , item_width_max , pkt_count ):
47- cocotb .log .info (f"generated transaction: { transaction .hex ()} " )
44+ for i , transaction in enumerate (random_packets (item_width_min , item_width_max , pkt_count )):
45+ #cocotb.log.info(f"generated transaction: {transaction.hex()}")
4846
4947 address = randint (0 , (2 ** addr_width - 1 )- (len (transaction )* 8 ))
5048
@@ -53,11 +51,14 @@ async def write_read_test(dut, pkt_count=1000, item_width_min=1, item_width_max=
5351 tb .ref_ram .write (address , transaction ) # writting transaction to reference RAM
5452
5553 output = await tb .stream_in .read (address , len (transaction ), parallel = parallel_read )
56- cocotb .log .info (f"received transaction: { output .hex ()} " )
54+ # cocotb.log.info(f"received transaction: {output.hex()}")
5755
5856 if output != transaction :
5957 raise TestFailure (f"Expected { transaction .hex ()} , got { output .hex ()} " )
6058
59+ if i % 100 == 0 :
60+ cocotb .log .info (f"Processed requests { i } /{ pkt_count } ." )
61+
6162 cocotb .log .info ("--------------------Comparing end state of reference RAM and simulated RAM--------------------" )
6263
6364 for i in range (2 ** addr_width ):
@@ -72,19 +73,23 @@ async def write_read_test(dut, pkt_count=1000, item_width_min=1, item_width_max=
7273
7374@cocotb .test ()
7475async def test_simple (dut ):
76+ "Serial write and read"
7577 await write_read_test (dut )
7678
7779
7880@cocotb .test ()
7981async def test_parallel_write (dut ):
82+ "Parallel write, serial read"
8083 await write_read_test (dut , parallel_write = True )
8184
8285
8386@cocotb .test ()
8487async def test_parallel_read (dut ):
88+ "Serial write, parallel read"
8589 await write_read_test (dut , parallel_read = True )
8690
8791
8892@cocotb .test ()
8993async def test_parallel_write_read (dut ):
94+ "Parallel write and read"
9095 await write_read_test (dut , parallel_write = True , parallel_read = True )
0 commit comments