Skip to content

S and U tests at 100% coverage in Sail#1013

Open
davidharrishmc wants to merge 15 commits intoriscv:act4from
davidharrishmc:SU
Open

S and U tests at 100% coverage in Sail#1013
davidharrishmc wants to merge 15 commits intoriscv:act4from
davidharrishmc:SU

Conversation

@davidharrishmc
Copy link
Collaborator

Does not match Spike yet because of parameters
No self-checking trap handler yet available

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.py and U.py added as new privileged extension test generators for S-mode and U-mode
  • Sm.py simplified: removed check_reg allocation, signal writes, and register cleanup from _generate_priv_inst_tests; added test_{count}: labels for trap-handler use
  • csr.py updated to skip MODE bits (bits 60-63 for RV64, bit 31 for RV32) when walking ones in satp; skip walking zeros for satp entirely
  • S_coverage.svh updated: adds mret bin to privinstrs, removes the redundant cp_mret_s cross coverage, and adds cp_csr_ro cross 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

@davidharrishmc davidharrishmc marked this pull request as draft February 27, 2026 21:46
Copy link
Collaborator

@jordancarlin jordancarlin left a comment

Choose a reason for hiding this comment

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

Still need to review S, but here are comments on the rest.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

@davidharrishmc davidharrishmc marked this pull request as ready for review February 28, 2026 15:12
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