@@ -348,7 +348,7 @@ async def test_write(dut):
348
348
# Check
349
349
protocol_status = (status >> 8 ) & 0xFF
350
350
assert protocol_status == 0
351
- assert data0 == 0xBBAA # 2 MSBs are reserved
351
+ assert data0 == 0xAA # 2 MSBs are reserved, 3rd MSB is W1C
352
352
assert data1 == 0x44332211
353
353
354
354
@@ -833,7 +833,7 @@ async def test_virtual_read(dut):
833
833
data , pec_ok = await recovery .command_read (VIRT_DYNAMIC_ADDR , cmd )
834
834
835
835
is_nack = data == None and pec_ok == None
836
- pec_ok = bool (pec_ok )
836
+ pec_ok = bool (pec_ok )
837
837
838
838
if is_nack :
839
839
dut ._log .info ("NACK" )
@@ -962,9 +962,12 @@ async def test_payload_available(dut):
962
962
# Initialize
963
963
i3c_controller , i3c_target , tb , recovery = await initialize (dut , timeout = 200 )
964
964
965
- fifo_size = dword2int (
966
- await tb .read_csr (tb .reg_map .I3C_EC .SECFWRECOVERYIF .INDIRECT_FIFO_STATUS_3 .base_addr , 4 )
967
- ) * 4 # Multiply by 4 to get bytes from dwords
965
+ fifo_size = (
966
+ dword2int (
967
+ await tb .read_csr (tb .reg_map .I3C_EC .SECFWRECOVERYIF .INDIRECT_FIFO_STATUS_3 .base_addr , 4 )
968
+ )
969
+ * 4
970
+ ) # Multiply by 4 to get bytes from dwords
968
971
969
972
# set regular device dynamic address
970
973
await i3c_controller .i3c_ccc_write (
@@ -1100,16 +1103,14 @@ async def test_indirect_fifo_reset_access(dut):
1100
1103
VIRT_DYNAMIC_ADDR , I3cRecoveryInterface .Command .INDIRECT_FIFO_DATA , tx_data_before_reset
1101
1104
)
1102
1105
1103
- # Clear FIFO (pointers too)
1104
- await recovery .command_write (
1105
- VIRT_DYNAMIC_ADDR , I3cRecoveryInterface .Command .INDIRECT_FIFO_CTRL , [0x00 , 0x01 , 0x00 , 0x00 ]
1106
- )
1106
+ # Wait until data propagates to Indirect FIFO
1107
+ await ClockCycles (tb .clk , tx_data_length )
1107
1108
1108
- # Clear FIFO reset
1109
+ # Clear FIFO (pointers too)
1109
1110
await tb .write_csr_field (
1110
1111
tb .reg_map .I3C_EC .SECFWRECOVERYIF .INDIRECT_FIFO_CTRL_0 .base_addr ,
1111
1112
tb .reg_map .I3C_EC .SECFWRECOVERYIF .INDIRECT_FIFO_CTRL_0 .RESET ,
1112
- 0xFF ,
1113
+ 0x1 ,
1113
1114
)
1114
1115
1115
1116
# Write data to indirect FIFO through the recovery interface
@@ -1227,13 +1228,6 @@ async def bfm_agent():
1227
1228
1228
1229
assert (wrptr , rdptr ) == (0 , 0 )
1229
1230
1230
- # Clear FIFO reset
1231
- await tb .write_csr_field (
1232
- tb .reg_map .I3C_EC .SECFWRECOVERYIF .INDIRECT_FIFO_CTRL_0 .base_addr ,
1233
- tb .reg_map .I3C_EC .SECFWRECOVERYIF .INDIRECT_FIFO_CTRL_0 .RESET ,
1234
- 0xFF ,
1235
- )
1236
-
1237
1231
# Send firmware chunks
1238
1232
xfer_size = 4
1239
1233
for data_ptr in range (0 , image_size , xfer_size * 4 ):
0 commit comments