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] Verify the MEM.READBACK feature #23322

Closed
nasahlpa opened this issue May 25, 2024 · 4 comments · Fixed by #24699
Closed

[sram_ctrl/dv] Verify the MEM.READBACK feature #23322

nasahlpa opened this issue May 25, 2024 · 4 comments · Fixed by #24699
Assignees
Labels
Component:DV DV issue: testbench, test case, etc. IP:sram_ctrl

Comments

@nasahlpa
Copy link
Member

Description

PR #23212 introduced the readback mode to the SRAM controller. However, currently, we do not test, whether this feature can mitigate bit flips introduced by FI.

@vogelpi vogelpi added Component:DV DV issue: testbench, test case, etc. IP:sram_ctrl labels May 25, 2024
@vogelpi vogelpi added this to the Earlgrey-PROD.M5 milestone May 25, 2024
@vogelpi
Copy link
Contributor

vogelpi commented Jun 4, 2024

This issue is about creating a sec_cm DV test for the readback feature. It would be nice to have but it will only cover a list of pre-defined signals fed into the test. What really counts for this feature is doing some kind of formal analysis, RTL simulation with automated FI or real FI on a chip / FPGA. All this seems out of scope for M5. I am thus assigning a lower priority to this one for now.

@vogelpi vogelpi added the Triage: deprioritize? temporary label for triage; issue could be deprioritized label Jun 27, 2024
@vogelpi
Copy link
Contributor

vogelpi commented Jun 27, 2024

I suggest moving this to M6 / M7 as we have more important things to do right now. This issue involves quite some effort.

@andreaskurth
Copy link
Contributor

Just discussed: We have high confidence in this feature, and this CM test would just check that the alerts are properly connected, which is also being checked in the netlist. --> M7

@andreaskurth andreaskurth removed the Triage: deprioritize? temporary label for triage; issue could be deprioritized label Jun 28, 2024
@nasahlpa
Copy link
Member Author

nasahlpa commented Jul 1, 2024

I have manually tested that the readback mechanism successfully detects a mismatch and triggers a fatal alert.

More specifically, I have changed this comparison:

assign rdback_chk_ok_unbuf = (rdback_data_exp_q == tl_sram_i.d_data);

to:

assign rdback_chk_ok_unbuf = (rdback_data_exp_q == ~tl_sram_i.d_data);

When starting the SRAM smoketest with:

./util/dvsim/dvsim.py hw/ip/sram_ctrl/dv/sram_ctrl_main_sim_cfg.hjson -i sram_ctrl_smoke --fixed-seed 1234 -t xcelium

I get:

UVM_ERROR @ 578601207 ps: (cip_base_scoreboard.sv:242) [uvm_test_top.env.scoreboard] Check failed expected_alert[alert_name].expected == 1 (0 [0x0] vs 1 [0x1]) alert fatal_error triggered unexpectedly

Which is the expected behavior.

@nasahlpa nasahlpa self-assigned this Sep 19, 2024
nasahlpa added a commit to nasahlpa/opentitan that referenced this issue Sep 27, 2024
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 added a commit to nasahlpa/opentitan that referenced this issue Sep 30, 2024
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 added a commit to nasahlpa/opentitan that referenced this issue Sep 30, 2024
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 added a commit to nasahlpa/opentitan that referenced this issue Oct 1, 2024
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 added a commit to nasahlpa/opentitan that referenced this issue Oct 1, 2024
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 added a commit to nasahlpa/opentitan that referenced this issue Oct 8, 2024
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 added a commit to nasahlpa/opentitan that referenced this issue Oct 8, 2024
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]>
vogelpi pushed a commit that referenced this issue Oct 8, 2024
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.

Signed-off-by: Pascal Nasahl <[email protected]>
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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants