diff --git a/.gitignore b/.gitignore index 5619adbf..2d1454e3 100644 --- a/.gitignore +++ b/.gitignore @@ -89,6 +89,7 @@ tests/custom/*/*/*.elf tests/custom/*/*/*.map tests/custom/*/*/*.memfile tests/custom/crt0/*.a +tests/custom/*/*.elf* sim/sd_model.log fpga/src/sdc/* fpga/src/sdc.tar.gz diff --git a/tests/custom/debug/Makefile b/tests/custom/debug/Makefile index 900f5b5e..9ee0b2e7 100644 --- a/tests/custom/debug/Makefile +++ b/tests/custom/debug/Makefile @@ -2,26 +2,26 @@ 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 $@ -%.elf.objdump.addr: %.elf.objdump +$(TARGET).elf.objdump.addr: $(TARGET).elf.objdump extractFunctionRadix.sh $< -$(TARGET).objdump: $(TARGET).elf - riscv64-unknown-elf-objdump -D $(TARGET).elf > $(TARGET).objdump +$(TARGET).elf.objdump: $(TARGET).elf + riscv64-unknown-elf-objdump -D $(TARGET).elf > $(TARGET).elf.objdump $(TARGET).elf: $(TARGET).S Makefile 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: - 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 echo "Signature matches! Success!" clean: - rm -f $(TARGET).elf $(TARGET).objdump $(TARGET).objdump.adr %(TARGET).elf.memfile $(TARGET).signature.output + rm -f $(TARGET).elf $(TARGET).elf.* diff --git a/tests/custom/debug/debug.S b/tests/custom/debug/debug.S index e493cab7..431a261e 100644 --- a/tests/custom/debug/debug.S +++ b/tests/custom/debug/debug.S @@ -3,13 +3,22 @@ // Small code snippets for the purpose of debugging issues // SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1 -# openhwgroup/cvw Issue #55 -li x1, 0x7ff0000000000001 -fmv.w.x f4, x1 -li x1, 0x7ff8000000000000 -fmv.w.x f9, x1 -fsgnjx.s f12,f9,f4 # expected f 0xffffffff7fc00000 +.global rvtest_entry_point +rvtest_entry_point: + # 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 @@ -23,14 +32,20 @@ write_tohost: self_loop: j self_loop # wait +.align 6 .section .tohost tohost: # write to HTIF .dword 0 fromhost: .dword 0 +.align 6 .data +rvtest_data: +.dword 0x7ff0000000000001 +.dword 0x7ff8000000000000 + .EQU XLEN,64 begin_signature: .fill 2*(XLEN/32),4,0xdeadbeef #