cvw/tests/custom/debug/debug.S

84 lines
2.0 KiB
ArmAsm
Raw Normal View History

2023-02-04 16:18:55 +00:00
// debug.S
// David_Harris@hmc.edu 4 February 2023
// Small code snippets for the purpose of debugging issues
// SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
.global rvtest_entry_point
rvtest_entry_point:
2023-02-15 14:42:38 +00:00
lui t0, 0x02 # turn on Floating point and XS
2023-02-06 23:38:57 +00:00
csrs mstatus, t0
la a6, begin_signature
la a7, rvtest_data
2023-02-15 14:42:38 +00:00
# openhwgroup/cvw Issue #55
fld f4, 0(a7)
fld f9, 8(a7)
2023-02-15 14:42:38 +00:00
fsgnjx.s f12,f9,f4 # expected f 0xffffffff7fc00000, hdl has been giving fff8000000000000
fsd f12, 0(a6)
2023-02-04 16:18:55 +00:00
2023-02-15 14:42:38 +00:00
# openhwgroup/cvw Issue #56
2023-02-21 17:33:36 +00:00
fld f4, 16(a7) # cfa695b1047553b1
2023-02-15 14:42:38 +00:00
fld f14, 24(a7)
fsgnjx.s f10,f4,f14 # expected f 0xffffffff7fc00000, hdl has been giving 0xcfa695b1047553b1
2023-02-21 17:33:36 +00:00
fsd f19, 16(a6)
2023-02-15 14:42:38 +00:00
# openhwgroup/cvw Issue #57
fld f0, 32(a7)
fld f15, 40(a7)
fsgnjx.s f30,f0,f15 # expected f 0xfffffffffb3754ef, hdl has been giving 0xffffffff7b3754ef
2023-02-21 17:33:36 +00:00
fsd f30, 24(a6)
2023-02-15 14:42:38 +00:00
# openhwgroup/cvw Issue #58
fld f14, 48(a7)
fclass.s x2, f14 # expected 0x0000000000000200, hdl had been giving 0x0000000000000220
2023-02-21 17:33:36 +00:00
sd x2, 32(a6)
2023-02-15 14:42:38 +00:00
# fsgnjx.s, fclass.s, fsgnjn.s, fsgnj.s, fneg.s, fabs.s, fmv.s all treat inputs as dp rather than sp
2023-02-21 17:33:36 +00:00
#openhwgroup/cvw Issue #65 #expected 0xffffffffffffffff, hdl had been giving 0x00000000ffffffff
fld f17, 56(a7)
fmv.x.s x30, f17
sd x30, 40(a6)
2023-02-15 14:42:38 +00:00
2023-02-04 16:18:55 +00:00
#########################
# HTIF and signature
#########################
write_tohost:
la t1, tohost
li t0, 1 # 1 for success, 3 for failure
sd t0, 0(t1) # send success code
self_loop:
j self_loop # wait
.align 6
2023-02-04 16:18:55 +00:00
.section .tohost
tohost: # write to HTIF
.dword 0
fromhost:
.dword 0
.align 6
2023-02-04 16:18:55 +00:00
.data
rvtest_data:
.dword 0x7ff0000000000001
.dword 0x7ff8000000000000
2023-02-15 14:42:38 +00:00
.dword 0xcfa695b1047553b1
.dword 0xffffffff7fc00000
.dword 0xfffffffffb3754ef
.dword 0x7fefffffffffffff
2023-02-21 17:33:36 +00:00
.dword 0x00000000ffffffff
2023-02-04 16:18:55 +00:00
.EQU XLEN,64
begin_signature:
2023-02-15 14:42:38 +00:00
.fill 8*(XLEN/32),4,0xdeadbeef #
2023-02-04 16:18:55 +00:00
end_signature:
# Initialize stack with room for 512 bytes
.bss
.space 512
topofstack: