这是indexloc提供的服务,不要输入任何密码
Skip to content

[hmac,dv/rtl] Fix HMAC DV scoreboard synchronization #23220

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

Merged
merged 2 commits into from
May 23, 2024

Conversation

gdessouky
Copy link
Contributor

@gdessouky gdessouky commented May 21, 2024

This PR will only have 2 commits to review once this PR #23108 is merged. This introduces changes in the HMAC DV to enable do_read_check that was commented out #22578 and achieve synchronization with how the FIFO is verified vs the CSRs being read and compared but only for SHA-2 256. I have disabled do_read_check in the meantime to keep the constraints unreleased on the digest sizes and key lengths, until I fix the synchronization issues for 384/512. With this PR, the block test hmac_error and hmac_stress_all still fail, but have been root-caused and will be fixed in upcoming PRs.

@gdessouky gdessouky requested a review from a team as a code owner May 21, 2024 12:00
@gdessouky gdessouky requested review from rswarbrick, andreaskurth and martin-velay and removed request for a team and rswarbrick May 21, 2024 12:00
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.

Nothing fatal, just some stuffs to be arranged and cleaned

// TODO: check if we need this block at this point
// update_err_intr_code(SwInvalidConfig);
// hash_start is blocked from HMAC because of invalid config
// hmac_start = 1'b0;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why have you added these lines to keep them commented out? Is there a reason in the future or is it just an oversight?

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 might need them for the future, I have shrunk it down to one TODO line in my upcoming push, this should be fine for the time being while the DV is still stabilizing to help document some WIP.

if (digest_idx % 2) begin
`DV_CHECK_NE(real_digest_val, exp_digest[digest_idx-1])
// Update new digest data to the exp_digest variable.
` uvm_info(`gfn, $sformatf("updating digest to read value after wiping 0x%0h",
Copy link
Contributor

Choose a reason for hiding this comment

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

  • On several places you have a back-tick followed by an extra space, which is not needed
  • verify alignment

if (ral.intr_state.hmac_done.get_mirrored_value() == 1) break;
// break if hmac is done or if invalid config error is triggered
if (ral.intr_state.hmac_done.get_mirrored_value() == 1 ||
(ral.intr_state.hmac_err.get_mirrored_value() == 1 &&
Copy link
Contributor

Choose a reason for hiding this comment

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

Indentation should be reviewed

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 in second-to-last commit LGTM; I'll let others review the DV changes :-) Thx @gdessouky

@gdessouky gdessouky force-pushed the hmac_dv_fixes branch 2 times, most recently from 6650850 to ecaad66 Compare May 22, 2024 09:27
@gdessouky
Copy link
Contributor Author

Thanks @martin-velay and @andreaskurth, addressed the DV cosmetics in my push now. Hoping for green soon!

@gdessouky gdessouky force-pushed the hmac_dv_fixes branch 3 times, most recently from 72a5c3e to 6499811 Compare May 22, 2024 11:09
Signed-off-by: Ghada Dessouky <gdessouky@google.com>
@gdessouky
Copy link
Contributor Author

Please don't merge this one since it constrains the digest sizes again and I want their smoke checks enabled for upcoming RTL PRs. I'll push shortly here to release the constraints while disabling do_read_check for the time being, so it doesn't break on the new digest sizes.

This fixes DV synchronization checks for SHA-2 256
such that all CSRs and predictions match. This also fixes
FIFO checks according to the FIFO changes implemented to adapt to
multiple digest sizes, and disables do_read_check to be able to
release the constraints on digest size and key length
until synchronization issues are fixed for 384 and 512.

Signed-off-by: Ghada Dessouky <gdessouky@google.com>
martin-velay added a commit to martin-velay/opentitan that referenced this pull request May 23, 2024
  - this fix will be in a coming PR by Ghada lowRISC#23220

Signed-off-by: Martin Velay <mvelay@lowrisc.org>
@andreaskurth
Copy link
Contributor

Just discussed out-of-band with @gdessouky: it's fine to merge now (the comment above this one is not up-to-date anymore).

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.

3 participants