Skip to content

Add tests for Sspmp extension #1069

Open
ybc-alkaid wants to merge 2 commits intoriscv:devfrom
ybc-alkaid:dev
Open

Add tests for Sspmp extension #1069
ybc-alkaid wants to merge 2 commits intoriscv:devfrom
ybc-alkaid:dev

Conversation

@ybc-alkaid
Copy link
Copy Markdown
Member

This PR introduces basic tests for the RISC-V S-level Physical Memory Protection (SPMP) extension.

Here is a pre-built PDF of SPMP:
https://github.com/riscv/riscv-spmp/blob/main/rv-spmp-spec.pdf

Here is a pre-built PDF of riscv-privileged manual with SPMP:
https://github.com/riscv/riscv-spmp/releases/download/v0.8.18/riscv-privileged-with-spmp.pdf

Here is the pointer to the SPMP specification:
riscv/riscv-isa-manual#2573

Here is the Spike implementation supporting the tests:
riscv-software-src/riscv-isa-sim#2244

Here are the test logs:
https://drive.google.com/drive/folders/1MT65PQ7_RgEeZ8O90XkNR9AzX2AzLgIe?usp=drive_link

@jordancarlin
Copy link
Copy Markdown
Collaborator

Hi @ybc-alkaid. Thanks for your contribution. The riscv-arch-test repository recently migrated to ACT4 (version 4 of the test suite) and is no longer adding new extensions to the old 3.0 framework. Please review the guidelines in the Developer Guide for instructions on writing tests and coverpoints for the act4 framework. Unfortunately, there is likely to be some significant work involved in porting these tests.

Please reach out with any questions or documentation suggestions and let us know if you need help porting the tests.

@jjscheel
Copy link
Copy Markdown

@jordancarlin, @jamesbeyond, @UmerShahidengr, can you please do a preliminary review and let me know if this appears to be workable, i.e. yes work remains like porting to ACT4, but the coverage and quality of the tests appear to be reasonably complete.

@davidharrishmc
Copy link
Copy Markdown
Collaborator

This PR opens a bunch of great questions about what new extensions need in ACT.

There are 21 tests in this PR. At a high level, they look like good tests exercising the basic functions of SPMP.

There are a lot of things missing to fit into the ACT4 framework:

  • Human-readable spreadsheet testplan
  • Normative rules
  • SystemVerilog coverpoints
  • Mapping of normative rules onto coverpoints
  • Parameters
  • Porting tests to ACT4 framework in self-checking form
  • Support for Sail, Spike, QEMU
    • Chicken and egg problem here developing the simulator to produce the expected results

Also, the number of tests is much lower in this PR than in ACT4 PMP. It tests each feature individually, but lacks cross-products. It has RV64, but not yet RV32. On a cursory inspection, it seems it does not stress edge cases such as access size, misaligned accesses and accesses partially contained within a region. It does not stress interaction with other extensions, such as compressed, atomics, cache management ops, hypervisor, and vector. For example, the spec contains normative rules about when hypervisor is subject to SPMP checks, and that SPMP is mutually exclusive with virtual memory, that do not seem to be part of these tests.

This brings up important questions about how extensive tests should be for new extensions, and how to run them while simulator support is also evolving.

@jjscheel
Copy link
Copy Markdown

This PR opens a bunch of great questions about what new extensions need in ACT.

@davidharrishmc, I agree. Because ACT4 is now the main branch, we should being requesting PRs to meet our needs.

Porting tests to ACT4 framework in self-checking form

@UmerShahidengr, can you share the user documentation with @ybc-alkaid so that he know how to adjust his tests for the framework?

There are a lot of things missing to fit into the ACT4 framework:

  • Human-readable spreadsheet testplan
  • Normative rules
  • SystemVerilog coverpoints
  • Mapping of normative rules onto coverpoints
  • Parameters
    These we need to work through. We cannot tell if the 21 tests provide appropriate coverage without this. @davidharrishmc, @UmerShahidengr, @jamesbeyond, two questions:
  1. Are these items documented in the framework documentation which has already been written? If not, what documentation do we have?
  2. Who can work with @ybc-alkaid to improve the PR in this area?

@ybc-alkaid, these tests are important and we want to do the work properly. Thank you for your patience here.

@jordancarlin
Copy link
Copy Markdown
Collaborator

@jjscheel @ybc-alkaid Most of this is documented in the Developer Guide, but the documentation is still fairly new and we definitely need to add more to it. We will continue to expand it as we get questions and suggestions from contributors, but it should be a sufficient starting place.

Feel free to open issues or come to the ACT SIG meeting every other Thursday (including this week) if you have questions about any of it.

@rpsene
Copy link
Copy Markdown

rpsene commented Mar 17, 2026

This PR opens a bunch of great questions about what new extensions need in ACT.

There are 21 tests in this PR. At a high level, they look like good tests exercising the basic functions of SPMP.

There are a lot of things missing to fit into the ACT4 framework:

  • Human-readable spreadsheet testplan

  • Normative rules

  • SystemVerilog coverpoints

  • Mapping of normative rules onto coverpoints

  • Parameters

  • Porting tests to ACT4 framework in self-checking form

  • Support for Sail, Spike, QEMU

    • Chicken and egg problem here developing the simulator to produce the expected results

Also, the number of tests is much lower in this PR than in ACT4 PMP. It tests each feature individually, but lacks cross-products. It has RV64, but not yet RV32. On a cursory inspection, it seems it does not stress edge cases such as access size, misaligned accesses and accesses partially contained within a region. It does not stress interaction with other extensions, such as compressed, atomics, cache management ops, hypervisor, and vector. For example, the spec contains normative rules about when hypervisor is subject to SPMP checks, and that SPMP is mutually exclusive with virtual memory, that do not seem to be part of these tests.

This brings up important questions about how extensive tests should be for new extensions, and how to run them while simulator support is also evolving.

@davidharrishmc can you help us list the requirements to we can embed this in the spec dev process? @jordancarlin maybe you can also help here?

@ybc-alkaid
Copy link
Copy Markdown
Member Author

@jjscheel @rpsene @jordancarlin @davidharrishmc
Thanks for the help.
Can we separate requirements into freeze-essentials and others? We can prioritize essentials to meet the Q2 ratification deadline, while simultaneously working on the remaining requirements to comply with ACT4 standards.

@davidharrishmc
Copy link
Copy Markdown
Collaborator

davidharrishmc commented Mar 17, 2026 via email

@davidharrishmc
Copy link
Copy Markdown
Collaborator

davidharrishmc commented Mar 17, 2026 via email

@jjscheel
Copy link
Copy Markdown

So, @ybc-alkaid, your request is very valid: we need to decompose the full list that @davidharrishmc has posted into those items needed BEFORE any extension is becomes a part of a test plan. From that list, we can split that into 2 lists: those which are needed for Freeze and those which need to completed afterward.

Historically, ACT test required a coverpoints and tests in a PR. The whole test framework has changed and it been extended to support "validation" of the coverage by using Verilog coverpoints when used in the context of our certification processes.

The referenced document from @jordancarlin (Developer Guide) provides a great overview of the current framework. What we need to do is review it to ensure we've made clear what needs to be done for tests not yet in a Certificate.

I'd like to ask @UmerShahidengr to work with @jordancarlin and @davidharrishmc and @jamesbeyond to work on this and then provide specific guidance which we can work into the document as needed.

Does this sound like a reasonable plan to all?

@jordancarlin
Copy link
Copy Markdown
Collaborator

Most (if not all) of those steps are required whether an extension is currently part of a certificate or not. For example, the Sm tests have gone through all of these steps even though they are not currently part of a certificate. We definitely need to review which parts are needed for freeze, but I think that eventually all of these pieces will be needed for all extensions independent of certification.

@thomasroecker-maker
Copy link
Copy Markdown

The whole discussion sounds like that process and framework on compatibility test/framework isnt in very solid state. Appreciate the desire and efforts to get this better over time. However in order to keep operations ongoing, we need an RVI-accepted intermediate approach, which still allows us to drive standardization/specification work further.

@jordancarlin: Can we use one of the ACT-SIG session to align on the proceedings to be used, till all methodology and framework is readily defined?

So, @ybc-alkaid, your request is very valid: we need to decompose the full list that @davidharrishmc has posted into those items needed BEFORE any extension is becomes a part of a test plan. From that list, we can split that into 2 lists: those which are needed for Freeze and those which need to completed afterward.

Historically, ACT test required a coverpoints and tests in a PR. The whole test framework has changed and it been extended to support "validation" of the coverage by using Verilog coverpoints when used in the context of our certification processes.

The referenced document from @jordancarlin (Developer Guide) provides a great overview of the current framework. What we need to do is review it to ensure we've made clear what needs to be done for tests not yet in a Certificate.

I'd like to ask @UmerShahidengr to work with @jordancarlin and @davidharrishmc and @jamesbeyond to work on this and then provide specific guidance which we can work into the document as needed.

Does this sound like a reasonable plan to all?

@jordancarlin
Copy link
Copy Markdown
Collaborator

The whole discussion sounds like that process and framework on compatibility test/framework isnt in very solid state. Appreciate the desire and efforts to get this better over time. However in order to keep operations ongoing, we need an RVI-accepted intermediate approach, which still allows us to drive standardization/specification work further.

@jordancarlin: Can we use one of the ACT-SIG session to align on the proceedings to be used, till all methodology and framework is readily defined?

Let's discuss this at the next ACT SIG meeting on 4/2. I think we only have one other thing on the agenda at the moment.

@thomasroecker-maker
Copy link
Copy Markdown

thomasroecker-maker commented Mar 25, 2026

Let's discuss this at the next ACT SIG meeting on 4/2. I think we only have one other thing on the agenda at the moment.

Ok

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.

7 participants