2023-02-04 16:18:55 +00:00
|
|
|
# SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
|
|
|
|
|
|
|
|
TARGET = debug
|
|
|
|
|
2023-02-04 17:59:22 +00:00
|
|
|
$(TARGET).elf.memfile:$(TARGET).elf $(TARGET).elf.objdump.addr
|
2023-02-04 16:18:55 +00:00
|
|
|
riscv64-unknown-elf-elf2hex --bit-width $(if $(findstring rv64,$*),64,32) --input $< --output $@
|
|
|
|
|
2023-02-04 17:59:22 +00:00
|
|
|
$(TARGET).elf.objdump.addr: $(TARGET).elf.objdump
|
2023-02-04 16:18:55 +00:00
|
|
|
extractFunctionRadix.sh $<
|
|
|
|
|
2023-02-04 17:59:22 +00:00
|
|
|
$(TARGET).elf.objdump: $(TARGET).elf
|
|
|
|
riscv64-unknown-elf-objdump -D $(TARGET).elf > $(TARGET).elf.objdump
|
2023-02-04 16:18:55 +00:00
|
|
|
|
2023-02-04 16:31:47 +00:00
|
|
|
$(TARGET).elf: $(TARGET).S Makefile
|
2023-02-04 16:18:55 +00:00
|
|
|
riscv64-unknown-elf-gcc -g -o $(TARGET).elf -march=rv64gc -mabi=lp64 -mcmodel=medany \
|
2023-02-04 17:59:22 +00:00
|
|
|
-nostartfiles -T$(WALLY)/examples/link/link.ld $(TARGET).S
|
2023-02-04 16:18:55 +00:00
|
|
|
|
|
|
|
sim:
|
2023-02-04 17:59:22 +00:00
|
|
|
spike --isa=rv64gc +signature=$(TARGET).signature.output +signature-granularity=8 $(TARGET).elf
|
2023-02-04 16:18:55 +00:00
|
|
|
diff --ignore-case $(TARGET).signature.output $(TARGET).reference_output || exit
|
|
|
|
echo "Signature matches! Success!"
|
|
|
|
|
|
|
|
clean:
|
2023-02-04 17:59:22 +00:00
|
|
|
rm -f $(TARGET).elf $(TARGET).elf.*
|
2023-02-04 16:18:55 +00:00
|
|
|
|
|
|
|
|
|
|
|
|