forked from Github_Repos/cvw
More progress on debug.S, but it crashes in Spike
This commit is contained in:
parent
1bb5599806
commit
aba8b9a64b
1
.gitignore
vendored
1
.gitignore
vendored
@ -89,6 +89,7 @@ tests/custom/*/*/*.elf
|
|||||||
tests/custom/*/*/*.map
|
tests/custom/*/*/*.map
|
||||||
tests/custom/*/*/*.memfile
|
tests/custom/*/*/*.memfile
|
||||||
tests/custom/crt0/*.a
|
tests/custom/crt0/*.a
|
||||||
|
tests/custom/*/*.elf*
|
||||||
sim/sd_model.log
|
sim/sd_model.log
|
||||||
fpga/src/sdc/*
|
fpga/src/sdc/*
|
||||||
fpga/src/sdc.tar.gz
|
fpga/src/sdc.tar.gz
|
||||||
|
@ -2,26 +2,26 @@
|
|||||||
|
|
||||||
TARGET = debug
|
TARGET = debug
|
||||||
|
|
||||||
%.elf.memfile: %.elf %.elf.objdump.adr
|
$(TARGET).elf.memfile:$(TARGET).elf $(TARGET).elf.objdump.addr
|
||||||
riscv64-unknown-elf-elf2hex --bit-width $(if $(findstring rv64,$*),64,32) --input $< --output $@
|
riscv64-unknown-elf-elf2hex --bit-width $(if $(findstring rv64,$*),64,32) --input $< --output $@
|
||||||
|
|
||||||
%.elf.objdump.addr: %.elf.objdump
|
$(TARGET).elf.objdump.addr: $(TARGET).elf.objdump
|
||||||
extractFunctionRadix.sh $<
|
extractFunctionRadix.sh $<
|
||||||
|
|
||||||
$(TARGET).objdump: $(TARGET).elf
|
$(TARGET).elf.objdump: $(TARGET).elf
|
||||||
riscv64-unknown-elf-objdump -D $(TARGET).elf > $(TARGET).objdump
|
riscv64-unknown-elf-objdump -D $(TARGET).elf > $(TARGET).elf.objdump
|
||||||
|
|
||||||
$(TARGET).elf: $(TARGET).S Makefile
|
$(TARGET).elf: $(TARGET).S Makefile
|
||||||
riscv64-unknown-elf-gcc -g -o $(TARGET).elf -march=rv64gc -mabi=lp64 -mcmodel=medany \
|
riscv64-unknown-elf-gcc -g -o $(TARGET).elf -march=rv64gc -mabi=lp64 -mcmodel=medany \
|
||||||
-nostartfiles -T../../link/link.ld $(TARGET).S
|
-nostartfiles -T$(WALLY)/examples/link/link.ld $(TARGET).S
|
||||||
|
|
||||||
sim:
|
sim:
|
||||||
spike +signature=$(TARGET).signature.output +signature-granularity=8 $(TARGET)
|
spike --isa=rv64gc +signature=$(TARGET).signature.output +signature-granularity=8 $(TARGET).elf
|
||||||
diff --ignore-case $(TARGET).signature.output $(TARGET).reference_output || exit
|
diff --ignore-case $(TARGET).signature.output $(TARGET).reference_output || exit
|
||||||
echo "Signature matches! Success!"
|
echo "Signature matches! Success!"
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f $(TARGET).elf $(TARGET).objdump $(TARGET).objdump.adr %(TARGET).elf.memfile $(TARGET).signature.output
|
rm -f $(TARGET).elf $(TARGET).elf.*
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -3,13 +3,22 @@
|
|||||||
// Small code snippets for the purpose of debugging issues
|
// Small code snippets for the purpose of debugging issues
|
||||||
// SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
|
// SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
|
||||||
|
|
||||||
# openhwgroup/cvw Issue #55
|
.global rvtest_entry_point
|
||||||
li x1, 0x7ff0000000000001
|
rvtest_entry_point:
|
||||||
fmv.w.x f4, x1
|
|
||||||
li x1, 0x7ff8000000000000
|
|
||||||
fmv.w.x f9, x1
|
|
||||||
fsgnjx.s f12,f9,f4 # expected f 0xffffffff7fc00000
|
|
||||||
|
|
||||||
|
# openhwgroup/cvw Issue #55
|
||||||
|
la a6, begin_signature
|
||||||
|
la a7, rvtest_data
|
||||||
|
fadd.d ft0, ft1, ft2
|
||||||
|
fld f4, 0(a7)
|
||||||
|
fld f9, 8(a7)
|
||||||
|
# li x1, 0x7ff0000000000001
|
||||||
|
# sd x1, 0(a6)
|
||||||
|
# fmv.w.x f4, x1
|
||||||
|
# li x1, 0x7ff8000000000000
|
||||||
|
# fmv.w.x f9, x1
|
||||||
|
fsgnjx.s f12,f9,f4 # expected f 0xffffffff7fc00000
|
||||||
|
fsd f12, 0(a6)
|
||||||
|
|
||||||
#########################
|
#########################
|
||||||
# HTIF and signature
|
# HTIF and signature
|
||||||
@ -23,14 +32,20 @@ write_tohost:
|
|||||||
self_loop:
|
self_loop:
|
||||||
j self_loop # wait
|
j self_loop # wait
|
||||||
|
|
||||||
|
.align 6
|
||||||
.section .tohost
|
.section .tohost
|
||||||
tohost: # write to HTIF
|
tohost: # write to HTIF
|
||||||
.dword 0
|
.dword 0
|
||||||
fromhost:
|
fromhost:
|
||||||
.dword 0
|
.dword 0
|
||||||
|
|
||||||
|
.align 6
|
||||||
.data
|
.data
|
||||||
|
|
||||||
|
rvtest_data:
|
||||||
|
.dword 0x7ff0000000000001
|
||||||
|
.dword 0x7ff8000000000000
|
||||||
|
|
||||||
.EQU XLEN,64
|
.EQU XLEN,64
|
||||||
begin_signature:
|
begin_signature:
|
||||||
.fill 2*(XLEN/32),4,0xdeadbeef #
|
.fill 2*(XLEN/32),4,0xdeadbeef #
|
||||||
|
Loading…
Reference in New Issue
Block a user