mirror of
https://github.com/openhwgroup/cvw
synced 2025-02-11 06:05:49 +00:00
Restored to original WALLY-init-lib beause new flavor is moved to cvw-arch-verif and the old is needed for PMP code coverage
This commit is contained in:
parent
8e6170cc83
commit
4251f0c6a2
@ -28,12 +28,6 @@
|
|||||||
// The PMP tests are sensitive to the exact addresses in this code, so unfortunately
|
// The PMP tests are sensitive to the exact addresses in this code, so unfortunately
|
||||||
// modifying anything breaks those tests.
|
// modifying anything breaks those tests.
|
||||||
|
|
||||||
// Provides simple firmware services through ecall. Place argument in a0 and issue ecall:
|
|
||||||
// 0: change to user mode
|
|
||||||
// 1: change to supervisor mode
|
|
||||||
// 3: change to machine mode
|
|
||||||
// 4: terminate program
|
|
||||||
|
|
||||||
.section .text.init
|
.section .text.init
|
||||||
.global rvtest_entry_point
|
.global rvtest_entry_point
|
||||||
|
|
||||||
@ -77,7 +71,7 @@ trap_handler:
|
|||||||
|
|
||||||
interrupt: # must be a timer interrupt
|
interrupt: # must be a timer interrupt
|
||||||
li t0, -1 # set mtimecmp to biggest number so it doesnt interrupt again
|
li t0, -1 # set mtimecmp to biggest number so it doesnt interrupt again
|
||||||
li t1, 0x02004000 # MTIMECMP in CLINT
|
li t1, 0x02004000 # MTIMECMP in CLIN
|
||||||
sd t0, 0(t1)
|
sd t0, 0(t1)
|
||||||
csrw stimecmp, t0 # sets stimecmp to big number so it doesnt interrupt
|
csrw stimecmp, t0 # sets stimecmp to big number so it doesnt interrupt
|
||||||
li t0, 32
|
li t0, 32
|
||||||
@ -134,18 +128,6 @@ write_tohost:
|
|||||||
self_loop:
|
self_loop:
|
||||||
j self_loop # wait
|
j self_loop # wait
|
||||||
|
|
||||||
// utility routines
|
|
||||||
|
|
||||||
# put a 1 in msb of a0 (position XLEN-1); works for both RV32 and RV64
|
|
||||||
setmsb:
|
|
||||||
li a0, 0x80000000 # 1 in bit 31
|
|
||||||
slli a1, a0, 1 # check if register is wider than 31 bits
|
|
||||||
beqz a1, setmsbdone # yes, a0 has 1 in bit 31
|
|
||||||
slli a0, a0, 16 # no: shift a0 to have 1 inn bit 63
|
|
||||||
slli a0, a0, 16 # use two shifts of 16 bits each to be compatible with compiling either RV32 or 64
|
|
||||||
setmsbdone:
|
|
||||||
ret # return to calller
|
|
||||||
|
|
||||||
.section .tohost
|
.section .tohost
|
||||||
tohost: # write to HTIF
|
tohost: # write to HTIF
|
||||||
.dword 0
|
.dword 0
|
||||||
@ -157,9 +139,6 @@ begin_signature:
|
|||||||
.fill 6*(XLEN/32),4,0xdeadbeef #
|
.fill 6*(XLEN/32),4,0xdeadbeef #
|
||||||
end_signature:
|
end_signature:
|
||||||
|
|
||||||
scratch:
|
|
||||||
.fill 4,4,0x0
|
|
||||||
|
|
||||||
# Initialize stack with room for 512 bytes
|
# Initialize stack with room for 512 bytes
|
||||||
.bss
|
.bss
|
||||||
.space 512
|
.space 512
|
||||||
|
Loading…
Reference in New Issue
Block a user