PMP grain test fixes

This commit is contained in:
David Harris 2025-05-27 03:23:00 -07:00
parent b01fe7a38b
commit e86620f3d0
7 changed files with 13 additions and 9 deletions

View file

@ -317,7 +317,6 @@ class bcolors:
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
def addTests(testList, sim, coverStr, configs):
sim_logdir = f"{regressionDir}/{sim}/logs/"
for test in testList:

View file

@ -17,7 +17,7 @@ main:
// Configuration
# | Reg | pmpaddr | pmpcfg | L | A | X | W | R | Comments
# |0 | 0x2000003f | 0x83 | 1 | 00 | 0 | 1 | 1 | 0
# |0 | 0x20000040 | 0x83 | 1 | 00 | 0 | 1 | 1 | 0
# |1 | 0x2000007f | 0x8b | 1 | 01 | 0 | 1 | 1 | 1
# |2 | 0x200000be | 0x93 | 1 | 10 | 0 | 1 | 1 | 2
# |3 | 0x2000011e | 0x9b | 1 | 11 | 0 | 1 | 1 | 3
@ -34,7 +34,10 @@ main:
# |14 | 0x200003be | 0x10 | 0 | 10 | 0 | 0 | 0 | 14
# |15 | 0x2000041e | 0x18 | 0 | 11 | 0 | 0 | 0 | 15
# configure the pmp address of register 0 in mode 0
li t5, 536870975
# changed from 2000003F to 20000040 5/22/25 david_harris@hmc.edu
# to prevent access fault to trap handler when grain size is large
# may result in lower coverage.
li t5, 0x20000040
csrw pmpaddr0, t5
# configure the pmp address of register 1 in mode 1
@ -101,6 +104,7 @@ csrw pmpaddr15, t5
# write pmpcfg0, output 0x191109019b938b83
li t4, 1806234828062034819
csrw pmpcfg0, t4
csrr t5, pmpcfg0
# write pmpcfg2, output 0x181008001c140c04
li t4, 1733894653101739012
@ -923,6 +927,7 @@ li t4, 1806234828062034819
csrw pmpcfg2, t4
// Testing
// END Configuration and Testing Starting at Register: 8

View file

@ -10,7 +10,7 @@
},
"memory": {
"pmp": {
"grain": 0,
"grain": 4,
"count": 16
},
"misaligned": {

View file

@ -10,7 +10,7 @@
},
"memory": {
"pmp": {
"grain": 0,
"grain": 4,
"count": 16
},
"misaligned": {

View file

@ -28,6 +28,6 @@ hart0:
- Unchanged
PMP:
implemented: True
pmp-grain: 0
pmp-grain: 4
pmp-count: 16
pmp-writable: 12

View file

@ -30,6 +30,6 @@ hart0:
- Unchanged
PMP:
implemented: True
pmp-grain: 0
pmp-grain: 4
pmp-count: 16
pmp-writable: 12

View file

@ -117,8 +117,8 @@ test_cases:
.4byte 0x80100010, 0x600DAA, read32_test # read correct value out
# test read and write fault on region with no access
.4byte 0x80100208, 0x600D15, write32_test # Write fault on no-access range (PMP6)
.4byte 0x80100208, 0x600D15, read32_test # read fault on no-access range (PMP6)
.4byte 0x80100208, 0x600D17, write32_test # Write fault on no-access range (PMP4)
.4byte 0x80100208, 0x600D17, read32_test # read fault on no-access range (PMP4)
# test jalr to region with X=0 causes access fault
.4byte 0x80100020, 0xbad, executable_test # execute fault on no-execute range (PMP2)