Converted pmpsm and pmpzca tests for ACT4#948
Converted pmpsm and pmpzca tests for ACT4#948hamza-1821 wants to merge 38 commits intoriscv:act4from
Conversation
77ae973 to
a6fda36
Compare
jordancarlin
left a comment
There was a problem hiding this comment.
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.
|
@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. |
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>
jordancarlin
left a comment
There was a problem hiding this comment.
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\"" |
There was a problem hiding this comment.
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).
|
@hamza-1821 Clang CI was running for almost 2hours, I have cancelled that. CI was stuck at Sm-00.S test. |
| RVTEST_BEGIN | ||
|
|
||
| #define NOP 0x13 | ||
| #define g (1<<(RVMODEL_PMP_GRAIN+2)) |
There was a problem hiding this comment.
g will be the same for all tests. Might make sense to define it once in a more central location.
| sw a4, 0(a5) // word-level store test | ||
| nop | ||
| nop | ||
| RVTEST_SIGUPD(x2, x5, x4, a4, \TEST_CASE\()_1, test_1_str) // Signature update |
There was a problem hiding this comment.
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.
| // 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 |
There was a problem hiding this comment.
This is all missing self-checking.
There was a problem hiding this comment.
This loop is applied only to initialise all pmp-regs to zero, so self-checking is not required here.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Can we use zca instead of c in the march string here? Applies to all Zca tests.
Signed-off-by: Umer Shahid <umer@riscv.org>
This PR has both rv32 and rv64 tests for pmpsm and pmpzca