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,dv] Allow reset w/o CSR accesses complete #25843

Merged
merged 1 commit into from
Jan 17, 2025

Conversation

martin-velay
Copy link
Contributor

@martin-velay martin-velay commented Jan 10, 2025

  • This PR is a temporary fix to allow the reset to complete without waiting for complete CSR accesses. This is done by setting the flag can_reset_with_csr_accesses to 1 in the env_cfg file. Ideally, this should go away once the a better reset approach will be in place via a reset agent.
  • The approach here is to try to exit ASAP from all the tasks to skip the CSR accesses.

@martin-velay martin-velay marked this pull request as ready for review January 10, 2025 13:39
@martin-velay martin-velay requested a review from a team as a code owner January 10, 2025 13:39
@martin-velay martin-velay self-assigned this Jan 10, 2025
@martin-velay martin-velay added Component:DV DV issue: testbench, test case, etc. IP:hmac labels Jan 10, 2025
Copy link
Contributor

@rswarbrick rswarbrick left a comment

Choose a reason for hiding this comment

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

Hmm, I'm not sure that's quite going to work. I think that e.g. sar_stop_and_continue calls csr_spinwait. What happens if a reset appears when we're half-way through the call?

I think the fix is probably to make it so that each of the sar_* functions exit early if they see a reset, then exit early after they have completed.

@martin-velay
Copy link
Contributor Author

Hmm, I'm not sure that's quite going to work. I think that e.g. sar_stop_and_continue calls csr_spinwait. What happens if a reset appears when we're half-way through the call?

I think the fix is probably to make it so that each of the sar_* functions exit early if they see a reset, then exit early after they have completed.

@rswarbrick
If I am not wrong, the disable fork will kill all the descendants, which means all the sub-tasks/functions initiated by one of these process. Is it clearing your doubt?

@rswarbrick
Copy link
Contributor

I think that will run into the original problem that caused all of this "outstanding access" tracking in the first place. The problem is that killing a sequence in the middle of a CSR operation leaves things in an inconsistent state.

@martin-velay
Copy link
Contributor Author

I think that will run into the original problem that caused all of this "outstanding access" tracking in the first place. The problem is that killing a sequence in the middle of a CSR operation leaves things in an inconsistent state.

@rswarbrick, this fix is not linked to the "outstanding access" issue. The error seen here was something like: UVM_ERROR @ 540230991 ps: (hmac_scoreboard.sv:534) [uvm_test_top.env.scoreboard] Check failed item.d_data == csr.get_mirrored_value() (4 [0x4] vs 0 [0x0]) intr_state. Now this error is gone, but as you said maybe this will cause some "outstanding access". But I am not going to mix it with this PR.

@rswarbrick
Copy link
Contributor

Sorry: what I mean is that the processes in the fork will start CSR operations. If a reset happens to appear in the intervening time then the wait will complete in reset_thread and the disable fork will kill a sequence that's doing a TL access. This will cause things to come unstuck in rather confusing ways, which is why cip_base_vseq (without my flag) tries quite hard to avoid issuing the reset and killing the sequence when there is any TL operation in flight.

My proposed solution is a way to "complete the operation quickly". A lame temporary approach would be something like a delay just after the wait, which would let any pending CSR operation abort... (It's a bit lame though! I'm not keen! :-D)

@marcelocarvalhoLowRisc
Copy link
Contributor

I think this is a similar issue we had faced in the GPIO, during some rnd_reset_stress_all test.
#25657

@martin-velay martin-velay changed the title [hmac,dv] Kill S&R process when reset is asserted [hmac,dv] Allow reset w/o CSR accesses complete Jan 16, 2025
- This PR is a temporary fix to allow the reset to complete without
  waiting for complete CSR accesses. This is done by setting the flag
  can_reset_with_csr_accesses to 1 in the env_cfg file. Ideally, this
  should go away once the a better reset approach will be in place via
  a reset agent.
- The approach here is to try to exit ASAP from all the tasks to skip
  the CSR accesses.

Signed-off-by: Martin Velay <[email protected]>
@rswarbrick rswarbrick merged commit 9d19f92 into lowRISC:master Jan 17, 2025
21 of 24 checks passed
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:hmac
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants