@@ -165,16 +165,39 @@ async def test_write_read_burst(dut):
165
165
166
166
assert received_data == test_data , "Received data does not match sent data!"
167
167
168
+ tb .log .info ("Test finished!" )
168
169
169
- @cocotb .test (skip = True )
170
- async def test_read_burst_collision_with_write (dut ):
170
+
171
+ @cocotb .test ()
172
+ async def test_write_burst_collision_with_read (dut ):
171
173
tb , data_len , test_data = await initialize (dut )
172
174
173
175
fifo_addr = tb .reg_map .I3C_EC .SECFWRECOVERYIF .INDIRECT_FIFO_DATA .base_addr
174
176
177
+ # Time in clock cycles to perform single dword write
178
+ single_write_cycles = 3
179
+
180
+ async def writer ():
181
+ await with_timeout (tb .axi_m .write_dwords (fifo_addr , test_data , burst = AxiBurstType .FIXED ), 1 , "us" )
182
+
183
+ async def reader (return_data ):
184
+ return_data .extend (await with_timeout (tb .axi_m .read_dwords (fifo_addr , count = data_len , burst = AxiBurstType .FIXED ), 1 , "us" ))
185
+
186
+ received_data = []
187
+ half_write_timer = ClockCycles (tb .clk , data_len * single_write_cycles // 2 )
188
+
189
+ w = cocotb .start_soon (writer ())
190
+ await half_write_timer
191
+ r = cocotb .start_soon (reader (received_data ))
192
+ await Combine (w , r )
193
+
194
+ assert received_data == test_data , "Received data does not match sent data!"
195
+
196
+ tb .log .info ("Test finished!" )
197
+
175
198
176
199
@cocotb .test (skip = True )
177
- async def test_write_burst_collision_with_read (dut ):
200
+ async def test_read_burst_collision_with_write (dut ):
178
201
tb , data_len , test_data = await initialize (dut )
179
202
180
203
fifo_addr = tb .reg_map .I3C_EC .SECFWRECOVERYIF .INDIRECT_FIFO_DATA .base_addr
0 commit comments