Skip to content

Commit 4278c4f

Browse files
committed
bypass: assert payload_available on image activation
Signed-off-by: Karol Gugala <[email protected]>
1 parent d778b6e commit 4278c4f

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

src/recovery/recovery_executor.sv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,7 @@ module recovery_executor
840840
// The payload_available signal must reset if recovery FIFO indicates empty.
841841
logic payload_high_en, bypass_xfer_done;
842842
assign payload_high_en = bypass_i3c_core_i ?
843-
(bypass_xfer_done | hwif_socmgmt_i.REC_INTF_CFG.REC_PAYLOAD_DONE.value) :
843+
(bypass_xfer_done | hwif_socmgmt_i.REC_INTF_CFG.REC_PAYLOAD_DONE.value | image_activated_o) :
844844
fifo_xfer_done;
845845
assign bypass_xfer_done = (state_q == FifoWrite) & (state_d == Done);
846846

verification/cocotb/top/lib_i3c_top/test_bypass.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,12 +428,18 @@ async def test_image_activated(dut):
428428
tb = await initialize(dut)
429429

430430
image_activated = dut.xi3c_wrapper.recovery_image_activated_o
431+
payload_available = dut.xi3c_wrapper.recovery_payload_available_o
431432

432433
# Check if image_activated is deasserted
433434
assert not bool(
434435
image_activated.value
435436
), "Upon initialization image_activated should be deasserted"
436437

438+
# Check if payload_available is deasserted
439+
assert not bool(
440+
payload_available.value
441+
), "Upon initialization payload_availablei should be deasserted"
442+
437443
# Write 0xF to byte 2 of RECOVERY_CTRL
438444
await tb.write_csr_field(
439445
tb.reg_map.I3C_EC.SOCMGMTIF.REC_INTF_REG_W1C_ACCESS.base_addr,
@@ -447,6 +453,14 @@ async def test_image_activated(dut):
447453
image_activated.value
448454
), "Upon writing 0xF to RECOVERY_CTRL byte 2 image_activated should be asserted"
449455

456+
# payload_available is asserted one clk cycle after image activation
457+
await RisingEdge(tb.clk)
458+
# Check if payload_available is asserted
459+
assert bool(
460+
payload_available.value
461+
), "Upon writing 0xF to RECOVERY_CTRL byte 2 payload_available should be asserted"
462+
463+
450464
# Write 0xFF to byte 2 of RECOVERY_CTRL from the HCI side
451465
await tb.write_csr_field(
452466
tb.reg_map.I3C_EC.SECFWRECOVERYIF.RECOVERY_CTRL.base_addr,

0 commit comments

Comments
 (0)