coverage improvements for mret when mpp = 3; update imperas config

This commit is contained in:
Jordan Carlin 2024-01-22 09:52:58 -08:00
parent 4936496bb9
commit 0c13e14bbf
2 changed files with 16 additions and 1 deletions

View file

@ -37,6 +37,8 @@
# SV39 and SV48 supported
--override cpu/Sv_modes=768
--override cpu/Svinval=T
# clarify
#--override refRoot/cpu/mtvec_sext=F

View file

@ -309,7 +309,20 @@ sretdone:
.word 0x102F8073
j done
# cover mret when mpp = 3 and mprv = 1
li a0, 3
ecall # enter machine mode
bseti t0, zero, 17
csrs mstatus, t0 # set MPRV
li t1, 0x00001800
csrs mstatus, t1 # set MPP=3
la t1, finished
csrr t0, mepc
csrw mepc, t1 # set mepc for mret to jump to
mret
finished: j done