Skip to content

Commit

Permalink
[otbn,dv] Teach model to allow RMA requests when idle
Browse files Browse the repository at this point in the history
Signed-off-by: Rupert Swarbrick <[email protected]>
  • Loading branch information
rswarbrick committed Jul 5, 2024
1 parent f88f3e5 commit 1bbe554
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions hw/ip/otbn/dv/otbnsim/sim/sim.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,13 +185,18 @@ def _step_idle(self, verbose: bool) -> StepRes:
if should_zero and new_zero:
self.state.ext_regs.write('INSN_CNT', 0, True)

# If we are IDLE and rma_req is not a valid lc_ctrl signal, we expect a
# MUBI error inside the machine which causes us to jump to the locked
# state.
if not is_locked:
if self.state.rma_req == LcTx.INVALID:
self.state.set_fsm_state(FsmState.LOCKED)
self.state.ext_regs.write('STATUS', Status.LOCKED, True)
# If we are IDLE and rma_req is not a valid lc_ctrl signal, we
# expect a MUBI error inside the machine which causes us to jump to
# the locked state.
if self.state.rma_req == LcTx.INVALID and not is_locked:
self.state.set_fsm_state(FsmState.LOCKED)
self.state.ext_regs.write('STATUS', Status.LOCKED, True)

# If we are IDLE and get an RMA request, we want to start a secure
# wipe, which will eventually put us into the LOCKED state.
if self.state.rma_req == LcTx.ON and not is_locked:
self.state.ext_regs.write('STATUS', Status.BUSY_SEC_WIPE_INT, True)
self.state.set_fsm_state(FsmState.WIPING_BAD)

if self.state.init_sec_wipe_is_running():
# Wait for the URND seed. If there is some genuine state to wipe
Expand Down

0 comments on commit 1bbe554

Please sign in to comment.