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

[hmac,rtl/dv] DV synchronization and error handling fixes #23383

Merged
merged 1 commit into from
Jun 2, 2024

Conversation

gdessouky
Copy link
Contributor

This synchronizes the scoreboard checks for digest sizes 384 and 512, and once merged would close #22578. This also implements a minor RTL fix with the loading from the message FIFO for SHA-2 384/512; this has no impact on functionality and digests computation, but aligns reading the words from the FIFO (and thus depth and status throughout) with what would be expected. This also implements additional DV fixes for the error handling checks when simultaneous errors are triggered.

@gdessouky gdessouky requested a review from a team as a code owner May 29, 2024 21:05
@gdessouky gdessouky requested review from rswarbrick, andreaskurth and martin-velay and removed request for a team and rswarbrick May 29, 2024 21:05
Copy link
Contributor

@martin-velay martin-velay left a comment

Choose a reason for hiding this comment

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

I have few non-blocking comments. If the regression is passing, it could be merged IMO

hw/ip/hmac/dv/env/hmac_env_pkg.sv Outdated Show resolved Hide resolved
hw/ip/hmac/dv/env/hmac_env_pkg.sv Outdated Show resolved Hide resolved
hw/ip/hmac/dv/env/hmac_scoreboard.sv Outdated Show resolved Hide resolved
hw/ip/hmac/dv/env/hmac_scoreboard.sv Outdated Show resolved Hide resolved
cfg.clk_rst_vif.wait_clks((msg.size() % 4 || !legal_seq_c.constraint_mode()) ?
HMAC_KEY_PROCESS_CYCLES * 2 :
$urandom_range(0, HMAC_KEY_PROCESS_CYCLES * 2));
key_process_cycles * 2 :
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you add a comment to explain why this factor 2?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm still not entirely sure to be honest, I went down memory lane and git blame takes it back to this 1d1febc. It is a delay to avoid checking fifo_empty interrupt since it is hard to synchronize with the scoreboard and it is doubled since the prim_packer may also be holding more data. I haven't figured it out, I will rework the existing comment and add a TODO, so we can revisit it post M4.

Copy link
Contributor

@andreaskurth andreaskurth left a comment

Choose a reason for hiding this comment

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

RTL change LGTM. Thanks for this fix, @gdessouky!

@andreaskurth
Copy link
Contributor

@gdessouky: Did you run this through a regression (all block-level tests of HMAC, potentially with reduced reseed factor)? If so, could you please post the results?

@gdessouky
Copy link
Contributor Author

I've pushed now with minor fixes (thanks @martin-velay), and have run earlier the block-level regression with the results below, so it looks good to me (the V3 failing test was always failing).

Stage Name Tests Max Job Runtime Simulated Time Passing Total Pass Rate
V1 smoke hmac_smoke 23.400s 7.698ms 50 50 100.00 %
V1 csr_hw_reset hmac_csr_hw_reset 1.130s 129.165us 5 5 100.00 %
V1 csr_rw hmac_csr_rw 1.040s 31.560us 20 20 100.00 %
V1 csr_bit_bash hmac_csr_bit_bash 16.260s 2.925ms 5 5 100.00 %
V1 csr_aliasing hmac_csr_aliasing 13.690s 642.978us 5 5 100.00 %
V1 csr_mem_rw_with_rand_reset hmac_csr_mem_rw_with_rand_reset 26.258m 487.283ms 20 20 100.00 %
V1 regwen_csr_and_corresponding_lockable_csr hmac_csr_rw 1.040s 31.560us 20 20 100.00 %
hmac_csr_aliasing 13.690s 642.978us 5 5 100.00 %
V1 TOTAL 105 105 100.00 %
V2 long_msg hmac_long_msg 3.305m 8.385ms 50 50 100.00 %
V2 back_pressure hmac_back_pressure 1.246m 2.600ms 50 50 100.00 %
V2 test_vectors hmac_test_sha_vectors 13.911m 31.462ms 50 50 100.00 %
hmac_test_hmac_vectors 1.630s 111.568us 50 50 100.00 %
V2 burst_wr hmac_burst_wr 1.872m 6.401ms 50 50 100.00 %
V2 datapath_stress hmac_datapath_stress 18.994m 17.812ms 50 50 100.00 %
V2 error hmac_error 5.088m 80.630ms 50 50 100.00 %
V2 wipe_secret hmac_wipe_secret 2.405m 14.358ms 50 50 100.00 %
V2 stress_all hmac_stress_all 1.424h 504.547ms 50 50 100.00 %
V2 alert_test hmac_alert_test 0.580s 16.487us 50 50 100.00 %
V2 intr_test hmac_intr_test 0.620s 14.688us 50 50 100.00 %
V2 tl_d_oob_addr_access hmac_tl_errors 5.350s 217.389us 20 20 100.00 %
V2 tl_d_illegal_access hmac_tl_errors 5.350s 217.389us 20 20 100.00 %
V2 tl_d_outstanding_access hmac_csr_hw_reset 1.130s 129.165us 5 5 100.00 %
hmac_csr_rw 1.040s 31.560us 20 20 100.00 %
hmac_csr_aliasing 13.690s 642.978us 5 5 100.00 %
hmac_same_csr_outstanding 3.090s 731.453us 20 20 100.00 %
V2 tl_d_partial_access hmac_csr_hw_reset 1.130s 129.165us 5 5 100.00 %
hmac_csr_rw 1.040s 31.560us 20 20 100.00 %
hmac_csr_aliasing 13.690s 642.978us 5 5 100.00 %
hmac_same_csr_outstanding 3.090s 731.453us 20 20 100.00 %
V2 TOTAL 590 590 100.00 %
V2S tl_intg_err hmac_sec_cm 1.010s 486.022us 5 5 100.00 %
hmac_tl_intg_err 5.980s 255.352us 20 20 100.00 %
V2S sec_cm_bus_integrity hmac_tl_intg_err 5.980s 255.352us 20 20 100.00 %
V2S TOTAL 25 25 100.00 %
V3 write_config_and_secret_key_during_msg_wr hmac_smoke 23.400s 7.698ms 50 50 100.00 %
V3 stress_all_with_rand_reset hmac_stress_all_with_rand_reset 2.293h 824.201ms 8 200 4.00 %
V3 TOTAL 8 200 4.00 %
TOTAL 728 920 79.13 %

This synchronizes the scoreboard checks for digest sizes
384 and 512, and implements a fix with the loading from
the message FIFO. This also implements DV fixes
for the error handling checks when simultaneous errors
are triggered.

Signed-off-by: Ghada Dessouky <[email protected]>
@andreaskurth andreaskurth merged commit 01a2089 into lowRISC:master Jun 2, 2024
31 checks passed
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.

[hmac/dv] CSR read check commented out in scoreboard
3 participants