diff --git a/testbench/tests.vh b/testbench/tests.vh index 8e327caf..49c94680 100644 --- a/testbench/tests.vh +++ b/testbench/tests.vh @@ -54,8 +54,10 @@ string tvpaths[] = '{ "vm64check", "pmp", "pmpcfg", + "pmpcfg1", + "pmpcfg2", "tlbKP" - + }; string coremark[] = '{ diff --git a/tests/coverage/pmpcfg.S b/tests/coverage/pmpcfg.S index bb696152..d65f810e 100644 --- a/tests/coverage/pmpcfg.S +++ b/tests/coverage/pmpcfg.S @@ -1,4 +1,7 @@ -// pmpcfg supplemental +// pmpcfg part 1 +// Kevin Wan, kewan@hmc.edu, 4/18/2023 +// locks each pmpXcfg bit field in order, from X = 15 to X = 0, with the A[1:0] field set to TOR. +// See the next part in pmpcfg1.S #include "WALLY-init-lib.h" main: @@ -16,6 +19,8 @@ main: csrw pmpcfg2, t0 li t0, 0x8800 csrw pmpcfg2, t0 + li t0, 0x88 + csrw pmpcfg2, t0 li t0, 0x8800000000000000 csrw pmpcfg0, t0 li t0, 0x88000000000000 @@ -30,4 +35,5 @@ main: csrw pmpcfg0, t0 li t0, 0x8800 csrw pmpcfg0, t0 + j done diff --git a/tests/coverage/pmpcfg1.S b/tests/coverage/pmpcfg1.S new file mode 100644 index 00000000..96264c55 --- /dev/null +++ b/tests/coverage/pmpcfg1.S @@ -0,0 +1,48 @@ +// another set of pmpcfg tests. A new file is made because pmpcfg register fields are +// locked forever after writing 1 to the lock bit for the first time. + +// Kevin Wan, kewan@hmc.edu, 4/13/2023 +// This set tests locking the pmpXcfg fields in descending order again, without setting the TOR bits. +// for the other part of the tests, see pmpcfg.S + +#include "WALLY-init-lib.h" +main: + li t0, 0x800 + csrw pmpcfg0, t0 + li t0, 0x8000000 + csrw pmpcfg0, t0 + + li t0, 0x8000000000000000 + csrw pmpcfg2, t0 + li t0, 0x80000000000000 + csrw pmpcfg2, t0 + li t0, 0x800000000000 + csrw pmpcfg2, t0 + li t0, 0x8000000000 + csrw pmpcfg2, t0 + li t0, 0x80000000 + csrw pmpcfg2, t0 + li t0, 0x800000 + csrw pmpcfg2, t0 + li t0, 0x8000 + csrw pmpcfg2, t0 + li t0, 0x80 + csrw pmpcfg2, t0 + li t0, 0x8000000000000000 + csrw pmpcfg0, t0 + li t0, 0x80000000000000 + csrw pmpcfg0, t0 + li t0, 0x800000000000 + csrw pmpcfg0, t0 + li t0, 0x8000000000 + csrw pmpcfg0, t0 + li t0, 0x80000000 + csrw pmpcfg0, t0 + li t0, 0x800000 + csrw pmpcfg0, t0 + li t0, 0x8000 + csrw pmpcfg0, t0 + + + + j done \ No newline at end of file diff --git a/tests/coverage/pmpcfg2.S b/tests/coverage/pmpcfg2.S new file mode 100644 index 00000000..5966e3cd --- /dev/null +++ b/tests/coverage/pmpcfg2.S @@ -0,0 +1,12 @@ +// pmpcfg part 3 +// Kevin Wan, kewan@hmc.edu, 4/18/2023 +// locks each pmpXcfg bit field in order, from X = 15 to X = 0, with the A[1:0] field set to TOR. +// See the next part in pmpcfg1.S + +#include "WALLY-init-lib.h" +main: + li t0, 0x80 + csrw pmpcfg0, t0 + + + j done \ No newline at end of file diff --git a/tests/coverage/priv.S b/tests/coverage/priv.S index 94b7cd0e..5e187866 100644 --- a/tests/coverage/priv.S +++ b/tests/coverage/priv.S @@ -189,6 +189,7 @@ main: li t1, -1 csrw mcounteren, t1 + # Go to supervisor mode li a0, 1 ecall