Skip to content

Converted pmpsm and pmpzca tests for ACT4#948

Open
hamza-1821 wants to merge 38 commits intoriscv:act4from
hamza-1821:act4-work
Open

Converted pmpsm and pmpzca tests for ACT4#948
hamza-1821 wants to merge 38 commits intoriscv:act4from
hamza-1821:act4-work

Conversation

@hamza-1821
Copy link
Contributor

@hamza-1821 hamza-1821 commented Feb 18, 2026

This PR has both rv32 and rv64 tests for pmpsm and pmpzca

@hamza-1821 hamza-1821 changed the title pushing pmpsm and pmpzca tests pushing pmpsm and pmpzca tests for ACT$ Feb 18, 2026
@hamza-1821 hamza-1821 changed the title pushing pmpsm and pmpzca tests for ACT$ pushing pmpsm and pmpzca tests for ACT4 Feb 18, 2026
@jordancarlin jordancarlin added the ACT4 Issues or PRs applicable to ACT4 label Feb 20, 2026
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.

Beyond the labels that need to be updated, it looks like there are a few outstanding issues with the configuration settings.

Also, have you checked coverage with this version of the tests (by running make coverage --jobs $(nproc) and checking the report in work/sail-rv{32/64}-max/reports)? It looks like right now it won't run the PMP coverage because the directory name doesn't match the coverage file. The PMPSm tests need to be in a PMPSm directory so they get run against the PMPSm covergroups. Same for PMPZca tests in a PMPZca directory.

@UmerShahidengr
Copy link
Collaborator

@hamza-1821 you are getting a conflict, and CI is still failing

@hamza-1821
Copy link
Contributor Author

@hamza-1821 you are getting a conflict, and CI is still failing

yes, haven't pushed the latest changes yet. That will resolve CI issue. Still working on it.

jordancarlin and others added 7 commits February 28, 2026 14:17
At this point, the repo holds a number of different projects that all
require different people to review things. To make organizing this
easier, add issue templates that automatically apply labels for common
types of issues:
- CTP bugs/suggestions
- CRD bugs/suggestions
- Test framework bugs
- Test bugs
- Feature requests

---------

Signed-off-by: Jordan Carlin <jordanmcarlin@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Umer Shahid <umer.shahid@10xengineers.ai>
Co-authored-by: Umer Shahid <umer.shahid@10xengineers.ai>
Signed-off-by: Hamza <humza.ali1821@gmail.com>
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 haven't reviewed most of the tests, but here are more structural comments. Also still need the test directory structure to be recategorized so that coverage works.


// Test case strings for reporting
canary_mismatch: .string "Testcase signature canary mismatch!"
test_1_str: .string "\"test: 1; cp: cp_pmpm64_lw\""
Copy link
Collaborator

Choose a reason for hiding this comment

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

Fine to defer this to a follow-up PR after this one is merged, but the test strings should include the covergroup and bin in addition just the coverpoint. That will probably require the VERIFICATION_RWX macro to include the TEST_CASE number argument as part of the debug string (similar to what is already done for the labels).

@UmerShahidengr
Copy link
Collaborator

@hamza-1821 Clang CI was running for almost 2hours, I have cancelled that. CI was stuck at Sm-00.S test.
I cant seem to find anything in this PR which should keep it stuck. Can you check why it is hanging?
CC: @jordancarlin

RVTEST_BEGIN

#define NOP 0x13
#define g (1<<(RVMODEL_PMP_GRAIN+2))
Copy link
Collaborator

Choose a reason for hiding this comment

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

g will be the same for all tests. Might make sense to define it once in a more central location.

Comment on lines +59 to +62
sw a4, 0(a5) // word-level store test
nop
nop
RVTEST_SIGUPD(x2, x5, x4, a4, \TEST_CASE\()_1, test_1_str) // Signature update
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do we need 2 nop in all of these? If it traps, doesn't it just skip the next instruction? So only one nop should be needed.

Comment on lines +52 to +72
// Loop to SET ALL pmpaddr REGs to zeros
.set pmpaddri, CSR_PMPADDR0
.rept RVMODEL_NUM_PMPS
csrw pmpaddri, x0
.set pmpaddri, pmpaddri+1
.endr

li t0, -1
// Loop to SET ALL pmpaddr REGs to ones
.set pmpaddri, CSR_PMPADDR0
.rept RVMODEL_NUM_PMPS
csrw pmpaddri, t0
.set pmpaddri, pmpaddri+1
.endr

// Loop to SET ALL pmpcfg REGs to zero
.set pmpcfgi, CSR_PMPCFG0
.rept RVMODEL_NUM_PMPS/4
csrw pmpcfgi , x0
.set pmpcfgi, pmpcfgi+1
.endr
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is all missing self-checking.

Copy link
Collaborator

Choose a reason for hiding this comment

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

This loop is applied only to initialise all pmp-regs to zero, so self-checking is not required here.

Copy link
Collaborator

Choose a reason for hiding this comment

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

It sets all of the pmpaddr CSRs to zeros and then ones, which is listed in the header as one of the things this test is checking.

.endif

slli t2, t2, 1
bnez t2, 9b
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we decided that we don't want tests to have loops in them. @davidharrishmc thoughts on this one since it is not coming from a Python generator?

Copy link
Collaborator

Choose a reason for hiding this comment

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

We've gone to a ton of work to remove loops because it is hard to report failures when there are loops. If it is practical to remove this loop as well, I'd prefer to do so.

# REQUIRED_EXTENSIONS: ['I','Zca','Smpmp']
# params:
# MXLEN: 32
# MARCH: rv32ic_zicsr
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we use zca instead of c in the march string here? Applies to all Zca tests.

@hamza-1821 hamza-1821 changed the title pushing pmpsm and pmpzca tests for ACT4 Converted pmpsm and pmpzca tests for ACT4 Mar 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ACT4 Issues or PRs applicable to ACT4

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants