S and U tests at 100% coverage in Sail#1013
Open
davidharrishmc wants to merge 15 commits intoriscv:act4from
Open
S and U tests at 100% coverage in Sail#1013davidharrishmc wants to merge 15 commits intoriscv:act4from
davidharrishmc wants to merge 15 commits intoriscv:act4from
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds two new test generator files (S.py and U.py) for RISC-V supervisor-mode and user-mode privileged extension tests, modifies the machine-mode Sm.py to simplify the ecall/ebreak handling, extends csr.py to skip the MODE bit of satp during walking-ones tests, and updates S_coverage.svh to add mret to the supervisor-mode cp_sprivinst coverpoint and introduce cp_csr_ro coverage for supervisor-mode read-only CSR writes.
Changes:
S.pyandU.pyadded as new privileged extension test generators for S-mode and U-modeSm.pysimplified: removedcheck_regallocation, signal writes, and register cleanup from_generate_priv_inst_tests; addedtest_{count}:labels for trap-handler usecsr.pyupdated to skip MODE bits (bits 60-63 for RV64, bit 31 for RV32) when walking ones insatp; skip walking zeros forsatpentirelyS_coverage.svhupdated: addsmretbin toprivinstrs, removes the redundantcp_mret_scross coverage, and addscp_csr_rocross coverage for supervisor-mode read-only CSR write attempts
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
generators/testgen/src/testgen/priv/extensions/U.py |
New U-mode test generator for privileged instructions and CSR access/privilege tests |
generators/testgen/src/testgen/priv/extensions/S.py |
New S-mode test generator for ecall/ebreak/mret, sret, CSR access, and shadow register tests |
generators/testgen/src/testgen/priv/extensions/Sm.py |
Simplified ecall/ebreak tests to remove self-checking code pending trap handler support |
generators/testgen/src/testgen/asm/csr.py |
Added satp-specific logic to skip the MODE bit during walking-ones tests |
coverpoints/priv/S_coverage.svh |
Added mret to S-mode privinstrs, added cp_csr_ro coverpoint, removed cp_mret_s |
jordancarlin
requested changes
Feb 27, 2026
Collaborator
jordancarlin
left a comment
There was a problem hiding this comment.
Still need to review S, but here are comments on the rest.
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.
Does not match Spike yet because of parameters
No self-checking trap handler yet available