2022-06-17 01:05:06 +00:00
|
|
|
arch_dir = ../../addins/riscv-arch-test
|
2022-06-29 19:23:40 +00:00
|
|
|
wally_dir = ../wally-riscv-arch-test
|
2022-06-18 03:53:15 +00:00
|
|
|
work_dir = ./riscof_work
|
2022-06-29 19:23:40 +00:00
|
|
|
work = ./work
|
|
|
|
arch_workdir = $(work)/riscv-arch-test
|
|
|
|
wally_workdir = $(work)/wally-riscv-arch-test
|
|
|
|
|
2022-06-17 01:05:06 +00:00
|
|
|
current_dir = $(shell pwd)
|
2022-06-17 22:07:16 +00:00
|
|
|
XLEN ?= 64
|
2022-06-17 01:05:06 +00:00
|
|
|
|
2022-07-14 00:01:07 +00:00
|
|
|
all: root build_arch #build_wally memfile
|
2022-06-17 01:05:06 +00:00
|
|
|
|
2022-06-29 19:23:40 +00:00
|
|
|
root:
|
2022-06-17 01:05:06 +00:00
|
|
|
mkdir -p $(work_dir)
|
2022-06-29 19:23:40 +00:00
|
|
|
mkdir -p $(work)
|
|
|
|
mkdir -p $(arch_workdir)
|
|
|
|
mkdir -p $(wally_workdir)
|
2022-06-17 22:07:16 +00:00
|
|
|
sed 's,{0},$(current_dir),g;s,{1},$(XLEN)$(if $(findstring 64,$(XLEN)),gc,imc),g' config.ini > config$(XLEN).ini
|
2022-06-29 19:23:40 +00:00
|
|
|
|
2022-07-21 19:47:51 +00:00
|
|
|
fsd_fld_tempfix:
|
|
|
|
# this is a temporary fix, there's a typo on the rv64i_m/D/src/d_fsd-align-01.S and rv64i_m/D/src/d_fld-align-01.S tests
|
|
|
|
# https://github.com/riscv-non-isa/riscv-arch-test/issues/266
|
|
|
|
find ../../addins/riscv-arch-test/riscv-test-suite -type f -name "*fld*.S" | xargs -I{} sed -i 's,regex(\.\*32\.\*),regex(\.\*64\.\*),g' {}
|
|
|
|
find ../../addins/riscv-arch-test/riscv-test-suite -type f -name "*fsd*.S" | xargs -I{} sed -i 's,regex(\.\*32\.\*),regex(\.\*64\.\*),g' {}
|
|
|
|
|
|
|
|
build_arch: fsd_fld_tempfix
|
2022-06-18 03:53:15 +00:00
|
|
|
riscof run --work-dir=$(work_dir) --config=config$(XLEN).ini --suite=$(arch_dir)/riscv-test-suite/ --env=$(arch_dir)/riscv-test-suite/env --no-browser
|
2022-06-29 19:23:40 +00:00
|
|
|
rm -rf $(arch_workdir)/rv$(XLEN)i_m
|
|
|
|
mv -f $(work_dir)/rv$(XLEN)i_m $(arch_workdir)/
|
|
|
|
|
|
|
|
build_wally:
|
|
|
|
riscof --verbose debug run --work-dir=$(work_dir) --config=config$(XLEN).ini --suite=$(wally_dir)/riscv-test-suite/ --env=$(wally_dir)/riscv-test-suite/env --no-browser --no-dut-run
|
|
|
|
rm -rf $(wally_workdir)/rv$(XLEN)i_m
|
|
|
|
mv -f $(work_dir)/rv$(XLEN)i_m $(wally_workdir)/
|
|
|
|
|
|
|
|
memfile:
|
|
|
|
find $(work) -type f -name "*.elf" | grep "rv64i_m" | while read f; do riscv64-unknown-elf-elf2hex --bit-width 64 --input "$$f" --output "$$f.memfile"; done
|
|
|
|
find $(work) -type f -name "*.elf" | grep "rv32i_m" | while read f; do riscv64-unknown-elf-elf2hex --bit-width 32 --input "$$f" --output "$$f.memfile"; done
|
|
|
|
find $(work) -type f -name "*.elf.objdump" | while read f; do extractFunctionRadix.sh $$f; done
|
2022-06-17 22:07:16 +00:00
|
|
|
|
2022-06-17 01:05:06 +00:00
|
|
|
clean:
|
|
|
|
rm -f config64.ini
|
|
|
|
rm -f config32.ini
|
|
|
|
rm -rf $(work_dir)
|
2022-06-29 19:23:40 +00:00
|
|
|
rm -rf $(wally_workdir)
|
|
|
|
rm -rf $(arch_workdir)
|