aboutsummaryrefslogtreecommitdiff
path: root/isa
diff options
context:
space:
mode:
authorEiji Yoshiya <eiji.x.yoshiya@gmail.com>2024-02-03 09:23:09 +0900
committerEiji Yoshiya <eiji.x.yoshiya@gmail.com>2024-02-03 09:26:12 +0900
commit9f053a87bc9ce3afbdaf5e808f98eed5a8229887 (patch)
tree98507ad25f7765ab73f2ed8d2e59d2a078f88891 /isa
parent67e775962321ef48f77e7ab5aa4f40ce3cf82b08 (diff)
downloadriscv-tests-9f053a87bc9ce3afbdaf5e808f98eed5a8229887.zip
riscv-tests-9f053a87bc9ce3afbdaf5e808f98eed5a8229887.tar.gz
riscv-tests-9f053a87bc9ce3afbdaf5e808f98eed5a8229887.tar.bz2
If Svnapot is not implemented, skip the test.
If Svnapot is not implemented, a page fault will occur when accessing a page with napot specified. In this case, let the test pass.
Diffstat (limited to 'isa')
-rw-r--r--isa/rv64ssvnapot/napot.S11
1 files changed, 11 insertions, 0 deletions
diff --git a/isa/rv64ssvnapot/napot.S b/isa/rv64ssvnapot/napot.S
index 92d2b49..fbc4014 100644
--- a/isa/rv64ssvnapot/napot.S
+++ b/isa/rv64ssvnapot/napot.S
@@ -121,6 +121,7 @@ RVTEST_CODE_BEGIN
# Do a store to MY_VA
li a0, MY_VA
li a1, 42
+napot_store:
sw a1, (a0)
# Clear MPRV
@@ -153,6 +154,16 @@ RVTEST_CODE_BEGIN
.align 2
.global mtvec_handler
mtvec_handler:
+ # Skip if Svnapot is not implemented.
+ csrr t5, mcause
+ li t6, CAUSE_STORE_PAGE_FAULT
+ bne t5, t6, die
+ csrr t5, mepc
+ la t6, napot_store
+ bne t5, t6, die
+ csrr t5, mtval
+ li t6, MY_VA
+ beq t5, t6, pass
die:
RVTEST_FAIL