2022-02-03 01:15:11 +00:00
|
|
|
ROOT := ../..
|
|
|
|
SUFFIX := work
|
|
|
|
ARCHDIR := $(ROOT)/addins/riscv-arch-test
|
|
|
|
WALLYDIR:= $(ROOT)/tests/wally-riscv-arch-test
|
|
|
|
IMPERASDIR := $(ROOT)/tests/imperas-riscv-tests
|
2022-02-03 14:32:48 +00:00
|
|
|
ALLDIRS := $(ARCHDIR)/$(SUFFIX) $(WALLYDIR)/$(SUFFIX) $(IMPERASDIR)/$(SUFFIX)
|
2022-02-03 01:15:11 +00:00
|
|
|
|
|
|
|
ELFFILES ?= $(shell find $(ALLDIRS) -type f -regex ".*\.elf")
|
|
|
|
MEMFILES ?= $(ELFFILES:.elf=.elf.memfile)
|
|
|
|
ADDRFILES ?= $(ELFFILES:.elf=.elf.objdump.addr)
|
|
|
|
|
|
|
|
print:
|
|
|
|
echo "files in $(ALLDIRS) are $(ELFFILES)."
|
|
|
|
echo "memfiles are $(MEMFILES)"
|
|
|
|
|
2022-02-03 14:32:48 +00:00
|
|
|
.PHONY: all wally-sim-files
|
|
|
|
all: wally-sim-files
|
2022-02-03 01:15:11 +00:00
|
|
|
|
|
|
|
wally-sim-files: $(MEMFILES) $(ADDRFILES)
|
|
|
|
echo "$@"
|
|
|
|
|
|
|
|
# notes to self on how this works.
|
|
|
|
# The find command locates all of the *.elf files in directory DIR1. A list of .memfiles and
|
|
|
|
# .addr files are generated from the .elf. These are used as targets.
|
|
|
|
# % is a wildcard in a make target which is then referenced as % in the depenecies and $*
|
|
|
|
# in the recipe.
|
|
|
|
# because elf2hex requires a bit width we use findstring to figure out if the compiled directory
|
|
|
|
# is XLEN=64 or 32. This is hacky and will likely break in the future.
|
|
|
|
# the .addr is a separate target so make can split into more jobs and more parallism.
|
|
|
|
%.elf.memfile: %.elf
|
2022-02-03 06:00:15 +00:00
|
|
|
riscv64-unknown-elf-elf2hex --bit-width $(if $(findstring rv64,$*),64,32) --input $< --output $@
|
2022-02-03 01:15:11 +00:00
|
|
|
|
|
|
|
%.elf.objdump.addr: %.elf.objdump
|
|
|
|
extractFunctionRadix.sh $<
|
|
|
|
|
2022-02-03 14:32:48 +00:00
|
|
|
.PHONY: clean
|
|
|
|
clean:
|