Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[csrng/rtl] csrng move cmd checks into the cmd stage #22906

Merged
merged 1 commit into from
May 7, 2024

Conversation

h-filali
Copy link

@h-filali h-filali commented Apr 30, 2024

Please see the commit message for a description.

I ran a regression with 0.1 multiplier and a few more tests than usual are failing (~5 more than expected).

I didn't have time to debug all of them but I think this PR is ready to at least be looked at.

depends on #22883

Copy link
Contributor

@vogelpi vogelpi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good module to the rebase once #22883 is merged. The change makes a lot of sense and it simplifies the code. Thanks @h-filali !

@@ -47,7 +47,7 @@ This process repeats until the `glen` field value has been matched.
Because each request is pipelined, requests from other `cmd_stage` blocks can be processed before the original generate command is completely done.
This provides some interleaving of commands since a generate command can be programmed to take a very long time.

When sending an unsupported or illegal command, `CS_MAIN_SM_ALERT` will be triggered, but there will be no status response or indication of which app the error occurred in.
When sending an unsupported or illegal command, `CMD_STAGE_INVALID_ACMD_ALERT` will be triggered, but there will be no status response or indication of which app the error occurred in.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the status response is still sent out on the corresponding app interface...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I renamed the alert because it doesn't come from the main SM anymore. I think maybe we can discuss this in person.

// Here we send an illegal command to CSRNG to check that cs_main_sm_alert is triggered.
// Sending an illegal command does not get a response from CSRNG.
// Here we send an illegal command to CSRNG to check that CMD_STAGE_INVALID_ACMD_ALERT is
// triggered. Sending an illegal command does not get a response from CSRNG.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we ack the command and flag an error in the status signal?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's discuss in person.

hw/ip/csrng/rtl/csrng_cmd_stage.sv Outdated Show resolved Hide resolved
@h-filali h-filali force-pushed the csrng-move-cmd-checks branch 2 times, most recently from 0c82155 to 95da1c1 Compare May 6, 2024 07:04
@h-filali
Copy link
Author

h-filali commented May 6, 2024

@vogelpi thanks for reviewing. I rebased and addressed your comments. Let's discuss some points in person and then commence from there.

@h-filali h-filali force-pushed the csrng-move-cmd-checks branch 5 times, most recently from 2b16016 to 8ee1c9d Compare May 7, 2024 09:51
Having the command checks in the main SM doesn't make a lot of sense.
This causes a lot of issues including a hang condition inside the cmd stage
in case of generate commands with cmd len greater than 1. For this reason
it is best to not even start processing commands that violate our checks.

Signed-off-by: Hakim Filali <[email protected]>
@vogelpi vogelpi marked this pull request as ready for review May 7, 2024 22:22
@vogelpi vogelpi requested review from a team as code owners May 7, 2024 22:22
@vogelpi vogelpi requested review from matutem and timothytrippel and removed request for a team May 7, 2024 22:22
@vogelpi
Copy link
Contributor

vogelpi commented May 7, 2024

Thanks for rebasing @h-filali . I am merging this and for addressing the feedback on the implementation. The remaining comments relate to code comments and we can discuss this next week. I am merging this.

@vogelpi vogelpi merged commit b9e0388 into lowRISC:master May 7, 2024
32 checks passed
@h-filali h-filali deleted the csrng-move-cmd-checks branch October 7, 2024 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants