Skip to content

Commit ad33ed3

Browse files
authored
Merge pull request #536 from eiji-y/check_svnapot
If Svnapot is not implemented, skip the test.
2 parents 67e7759 + 9f053a8 commit ad33ed3

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

isa/rv64ssvnapot/napot.S

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ RVTEST_CODE_BEGIN
121121
# Do a store to MY_VA
122122
li a0, MY_VA
123123
li a1, 42
124+
napot_store:
124125
sw a1, (a0)
125126

126127
# Clear MPRV
@@ -153,6 +154,16 @@ RVTEST_CODE_BEGIN
153154
.align 2
154155
.global mtvec_handler
155156
mtvec_handler:
157+
# Skip if Svnapot is not implemented.
158+
csrr t5, mcause
159+
li t6, CAUSE_STORE_PAGE_FAULT
160+
bne t5, t6, die
161+
csrr t5, mepc
162+
la t6, napot_store
163+
bne t5, t6, die
164+
csrr t5, mtval
165+
li t6, MY_VA
166+
beq t5, t6, pass
156167
die:
157168
RVTEST_FAIL
158169

0 commit comments

Comments
 (0)