Repository navigation
Fix the riscv_dret_test - #2338
Merged
Merged
Conversation
rswarbrick
reviewed
Dec 2, 2025
rswarbrick
left a comment
Contributor
There was a problem hiding this comment.
Thanks for the careful explanation (I'd have struggled to understand what was going on without it!). This looks good to me (modulo a nitty comment about long lines)
The test checked for the exception handler to launch and then waited for the core to flush its pipeline. However, the flush happened immediately after the exception, which led the test to miss the first exception handler and the `check_priv_mode` to fail, since the check only executed after the flush leaving the exception handlers. This also means that on later executions, we were not checking the exception handlers as we go, but instead, the exception handler from the exception before. Accordingly, this test only failed if Ibex initially started in USER mode. Otherwise, it was anyways always in MACHINE mode
SamuelRiedel
force-pushed
the
dret-test
branch
from
December 2, 2025 11:38
e8d011a to
ce9552f
Compare
rswarbrick
approved these changes
Dec 3, 2025
rswarbrick
left a comment
Contributor
There was a problem hiding this comment.
Looks great (and thanks for the explanation!)
12 of 13 tasks
This was referenced Apr 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The test checked for the exception handler to launch and then waited for the core to flush its pipeline. However, the flush happened immediately after the exception, which led the test to miss the first exception handler and the
check_priv_modeto fail, since the check only executed after the flush leaving the exception handlers. This also means that on later executions, we were not checking the exception handlers as we go, but instead, the exception handler from the exception before. Accordingly, this test only failed if Ibex initially started in USER mode. Otherwise, it was anyway always in MACHINE mode.The failure in the nightly regression are all due to:
Alternatively, I tried using a fork/join to check for entering the exception handler and the flush independently. This also works, but is an overkill IMO, because the flush will always be instant and communicating that the exception handler starts will always take a few cycles after the flush completed.