mirror of
https://github.com/openhwgroup/cvw.git
synced 2025-04-22 21:08:08 -04:00
Privilege test improvements
This commit is contained in:
parent
da53f240d3
commit
ab82bb397c
1 changed files with 26 additions and 0 deletions
|
@ -36,4 +36,30 @@ main:
|
|||
addi t0, zero, 0
|
||||
csrr t0, stimecmp
|
||||
|
||||
# CSR coverage
|
||||
csrw scause, zero
|
||||
csrw stval, zero
|
||||
csrw scounteren, zero
|
||||
csrw satp, zero
|
||||
|
||||
# satp write with mstatus.TVM = 1
|
||||
bseti t0, zero, 20
|
||||
csrs mstatus, t0
|
||||
csrw satp, zero
|
||||
|
||||
# STIMECMP from S mode
|
||||
li t0, 1
|
||||
ecall # enter S-mode
|
||||
csrw stimecmp, zero
|
||||
li t0, 3
|
||||
ecall # return to M-mode
|
||||
csrsi mcounteren, 2 # mcounteren_tm = 1
|
||||
li t0, 1
|
||||
ecall # supervisor mode again
|
||||
csrw stimecmp, zero
|
||||
li t0, 3
|
||||
ecall # machine mode again
|
||||
|
||||
|
||||
|
||||
j done
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue