opentitan icon indicating copy to clipboard operation
opentitan copied to clipboard

[kmac] Sending incorrect CmdDone resets FSM

Open udinator opened this issue 5 years ago • 2 comments

Hi Eunchan,

I'm seeing the scenario below:

Screenshot from 2021-06-04 14-06-38

In this, I've started a KMAC hash and have already sent in CmdStart and written the entire message into the msgfifo.

Instead of sending a CmdProcess, I send a CmdDone to check the error response - as you can see the KMAC detects this error correctly, however the kmac_app FSM is currently designed to unconditionally reset to Idle state whenever it sees a CmdDone regardless of an error response or not.

Due to this incorrect reset, the KMAC will hang and cannot finish the current operation.

I think it might be good for the kmac_errchkr module to output a cmd_valid_o signal (or something along those lines) to qualify that the SW command should actually be latched by the design - wdyt?

udinator avatar Jun 04 '21 21:06 udinator

Thanks Udi. This is indeed a bug. Your suggested solution looks good. Let me implement it and check the timing (I think only timing will matter with this solution).

eunchan avatar Jul 08 '21 23:07 eunchan

adding @cindychip for visibility.

udinator avatar Oct 08 '21 00:10 udinator