mirror of
https://github.com/openhwgroup/cvw
synced 2025-02-11 06:05:49 +00:00
37 lines
1.3 KiB
Makefile
37 lines
1.3 KiB
Makefile
CEXT := c
|
|
CPPEXT := cpp
|
|
AEXT := s
|
|
SEXT := S
|
|
SRCEXT := \([$(CEXT)$(AEXT)$(SEXT)]\|$(CPPEXT)\)
|
|
#SRCS = $(wildcard *.S)
|
|
#PROGS = $(patsubst %.S,%,$(SRCS))
|
|
SRCDIR = .
|
|
SRCEXT = S
|
|
SOURCES ?= $(shell find $(SRCDIR) -type f -regex ".*\.$(SRCEXT)" | sort)
|
|
OBJEXT = elf
|
|
OBJECTS := $(SOURCES:.$(SEXT)=.$(OBJEXT))
|
|
|
|
all: $(OBJECTS)
|
|
|
|
elf.o.objdump: %.elf
|
|
|
|
# Change many things if bit width isn't 64
|
|
%.elf: $(SRCDIR)/%.$(SEXT) WALLY-init-lib.h Makefile
|
|
riscv64-unknown-elf-gcc -E -Wall -g -o $*.s -march=rv64gqc_zfa_zba_zbb_zbc_zbs_zfh_zicboz_zicbop_zicbom_zbkb_zbkx_zknd_zkne_zknh -mabi=lp64 -mcmodel=medany -nostartfiles -T../../examples/link/link.ld $<
|
|
riscv64-unknown-elf-as -g -o $*.o -march=rv64gqc_zfa_zba_zbb_zbc_zbs_zfh_zicboz_zicbop_zicbom_zbkb_zbkx_zknd_zkne_zknh -mabi=lp64 $*.s
|
|
riscv64-unknown-elf-gcc -g -o $@ -mabi=lp64 -mcmodel=medany -nostartfiles -T../../examples/link/link.ld $*.o
|
|
riscv64-unknown-elf-objdump -S -D $@ > $@.objdump
|
|
riscv64-unknown-elf-elf2hex --bit-width 64 --input $@ --output $@.memfile
|
|
extractFunctionRadix.sh $@.objdump
|
|
|
|
sim: %.elf
|
|
spike +signature=%.signature.output +signature-granularity=8 %.elf
|
|
diff --ignore-case %.signature.output %.reference_output || exit
|
|
echo "Signature matches! Success!"
|
|
|
|
clean:
|
|
rm -f *.elf *.objdump *.signature.output *.addr *.lab *.memfile *.o *.s
|
|
|
|
|
|
|