opentitan icon indicating copy to clipboard operation
opentitan copied to clipboard

[kmac] SW cmd during App operation triggers SwSequence error

Open udinator opened this issue 5 years ago • 7 comments

Hi Eunchan,

I'm testing a scenario where SW sends a random command (in this case CmdManualRun) to the KMAC during operation of the App interface, expecting that the RTL raises a ErrSwIssuedCmdInAppActive error.

However, I end up getting an ErrSwCmdSequence error from the RTL instead, which IMO is incorrect.

This is because the kmac_errchkr module processes the incoming SW cmd one cycle before sending it out to the rest of the IP (including kmac_app) .

The FSM remains in StIdle as app_active_i will be high, so the sequencing check logic sees a CmdManualRun while the FSM is still in Idle state and raises a ErrSwCmdSequence one cycle before the kmac_app has a chance to do anything.

I think the fix for this would be to only treat sequence errors as valid inside the kmac_errchkr if we are not in App mode, as the kmac_app will detect any SW commands sent during App operations.

WDYT?

udinator avatar Aug 12 '21 20:08 udinator

Hi @eunchan, could you take a look at this issue if you have time?

udinator avatar Sep 15 '21 22:09 udinator

OK Sorry for missed this! Let me take a look.

eunchan avatar Sep 16 '21 15:09 eunchan

I just read your description. It looks like the stimuli sent ManualRun without Start command. I expect that one could fall into both category. As the state machine won't move from StIdle to next states, the kmac_errchk logic only accepts Start command and hand over to kmac_app module.

The case we may see the ErrSwIssuedCmdInAppActive is when the SW sends Start command while the App Interface is active.

eunchan avatar Sep 16 '21 16:09 eunchan

ahh got it, so SwIssuedCmdInAppActive is specifically when SW sends Start command during App interface. Is it possible to update the specs to reflect this?

udinator avatar Sep 28 '21 23:09 udinator

Assigning @cindychip to ensure that the DV update actually works as intended, regression results are currently unavailable.

udinator avatar Oct 08 '21 00:10 udinator

@eunchan do you mind having a look at this? from what i remember this has also been addressed.

tjaychen avatar Feb 07 '22 21:02 tjaychen

Yep. Thanks for pinging me. This has been addressed. There's explicit errchk module to check the sequence.

eunchan avatar Feb 07 '22 23:02 eunchan