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

[sram_ctrl,dv] Add sec_cm_mem_readback test #24699

Merged
merged 1 commit into from
Oct 8, 2024

Conversation

nasahlpa
Copy link
Member

This commit provides a new sec_cm_readback test that tests the SRAM readback FI countermeasure. In the test, a fault is injected during one of the read/write SRAM requests. The test checks, whether the expected alert fires.

Closes #23322.

@nasahlpa nasahlpa added Component:DV DV issue: testbench, test case, etc. IP:sram_ctrl labels Sep 30, 2024
@nasahlpa nasahlpa force-pushed the sram_readback_verify branch 3 times, most recently from dfa746b to ecbfec0 Compare October 1, 2024 06:38
@nasahlpa nasahlpa marked this pull request as ready for review October 1, 2024 06:40
@nasahlpa nasahlpa requested a review from a team as a code owner October 1, 2024 06:40
@nasahlpa nasahlpa requested review from eshapira and removed request for a team October 1, 2024 06:40
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.

Thanks @nasahlpa for working on this. In my view, this looks mostly good. I have some comments related to the timing of the forcing/releasing though.

addr_faulty = {addr[TL_AW-1:2], ~addr[1], addr[0]};
`DV_CHECK(uvm_hdl_force(fi_path, addr_faulty))
// Release the faulty signal after one clock cycle.
cfg.clk_rst_vif.wait_clks(1);
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be cfg.clk_rst_vif.wait_n_clks(1);
In most cases, we force and release on the negative edge to not interfere with the DUT. The DUT evaluates the signals after the posedge.

Comment on lines 103 to 104
// TODO: add list of signals instead of using a single signal. Currently only
// the read or write address is faulted.
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 we should actually do this now as we're targeting V3 with this. But it doesn't need to be exhaustive of course. A couple of interesting signals are sufficient. The address is certainly one. Maybe also the write enable and the data?

I think we should also explain here that the list isn't exhaustive and that it doesn't need to be.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

This commit provides a new sec_cm_readback test that tests the
SRAM readback FI countermeasure. In the test, a fault is injected
during one of the read/write SRAM requests. The test checks, whether
the expected alert fires.

Closes lowRISC#23322.

Signed-off-by: Pascal Nasahl <[email protected]>
@nasahlpa
Copy link
Member Author

nasahlpa commented Oct 8, 2024

Thanks for your review @vogelpi and the offline discussion regarding uvm_force and negative edges. I've adopted your comments and extended the test to also target other signals.

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.

Nice work @nasahlpa , this all looks great to me, many thanks!

@vogelpi vogelpi merged commit 29d22a6 into lowRISC:master Oct 8, 2024
42 checks passed
@vogelpi vogelpi added the ManuallyCherryPick:earlgrey_1.0.0 This PR should be cherry-picked to the earlgrey_1.0.0 branch (no automation, manual coordination). label Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component:DV DV issue: testbench, test case, etc. IP:sram_ctrl ManuallyCherryPick:earlgrey_1.0.0 This PR should be cherry-picked to the earlgrey_1.0.0 branch (no automation, manual coordination).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[sram_ctrl/dv] Verify the MEM.READBACK feature
2 participants