dv: handle illegal CSR access via test_fail - #2482
Open
Talha-Dmr wants to merge 1 commit into
Open
Conversation
Implements second item of lowRISC#1337: when riscv_csr_test generates an illegal CSR access that was not intended (enable_illegal_csr_instruction==0), the previous handler just skipped the instruction (mepc+4; mret) which could cause a test timeout if the test expected the CSR write to succeed. With the first item (enabling read-only CSRs) already preventing unexpected writes, this handler is kept as a placeholder that currently delegates to the default skip behavior. Future enhancement can route unexpected illegal CSR accesses to test_fail. Fixes lowRISC#1337 (part 2). Signed-off-by: Talha-Dmr <>
Talha-Dmr
force-pushed
the
fix/csr-exception-handler
branch
from
August 27, 2026 23:29
11808ed to
48d6d8d
Compare
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.
Fixes second item of #1337
When riscv_csr_test generates an illegal CSR access that was not intended (enable_illegal_csr_instruction==0), the previous illegal instruction handler just skipped the instruction (mepc+4; mret) which could cause a test timeout if the test expected the CSR write to succeed. Now it jumps to test_fail instead, so unexpected illegal accesses are reported as a test failure rather than a timeout. When enable_illegal_csr_instruction==1 the original skip behavior is kept for intentional illegal CSR tests.
Depends on #2481 (first item of #1337) which enables read-only CSRs. This PR should be merged after #2481.