2024-09-29 21:05:28 +00:00
|
|
|
.SECONDEXPANSION:
|
|
|
|
|
|
|
|
MAKEFLAGS += --output-sync --no-print-directory
|
|
|
|
nproc := $(shell nproc --ignore=1)
|
|
|
|
|
|
|
|
# Directories
|
|
|
|
arch_dir := $(WALLY)/addins/riscv-arch-test
|
|
|
|
wally_dir := $(WALLY)/tests/wally-riscv-arch-test
|
|
|
|
work_dir := ./riscof_work
|
|
|
|
work := ./work
|
|
|
|
arch_workdir := $(work)/riscv-arch-test
|
|
|
|
wally_workdir := $(work)/wally-riscv-arch-test
|
|
|
|
current_dir := $(shell pwd)
|
|
|
|
|
|
|
|
# General make rules
|
|
|
|
.PHONY: all riscv-arch-test wally-riscv-arch-test quad64 clean
|
|
|
|
all: riscv-arch-test wally-riscv-arch-test
|
|
|
|
riscv-arch-test: arch32e arch32 arch64
|
|
|
|
wally-riscv-arch-test: wally32 wally64
|
|
|
|
|
|
|
|
# Generate config.ini files
|
|
|
|
config%.ini: config.ini
|
|
|
|
sed 's,{0},$(current_dir),g;s,{1},$(patsubst %64,%64gc,$(patsubst %32,%32gc,$*)),g;s,{2},$(nproc),g' config.ini > $@
|
|
|
|
|
|
|
|
# Generate riscv-arch-test targets
|
|
|
|
arch%: config$$*.ini | $(work_dir) $(arch_workdir)
|
|
|
|
riscof run --work-dir=$(work_dir)/$@ --config=$< --suite=$(arch_dir)/riscv-test-suite/ --env=$(arch_dir)/riscv-test-suite/env --no-browser
|
2024-09-30 00:24:08 +00:00
|
|
|
$(MAKE) -f makefile-memfile WORKDIR=$(work_dir)/$@ BITWIDTH=$(patsubst %32e,%32,$*)
|
2024-09-29 21:05:28 +00:00
|
|
|
rsync -a $(work_dir)/$@/rv*/* $(arch_workdir)/rv$(patsubst %64,%64i,$(patsubst %32,%32i,$*))_m || echo "error suppressed"
|
|
|
|
|
|
|
|
# Generate wally-riscv-arch-test targets
|
|
|
|
wally%: config$$*.ini | $(work_dir) $(wally_workdir)
|
|
|
|
riscof run --work-dir=$(work_dir)/$@ --config=$< --suite=$(wally_dir)/riscv-test-suite/ --env=$(wally_dir)/riscv-test-suite/env --no-browser --no-dut-run
|
|
|
|
$(MAKE) -f makefile-memfile WORKDIR=$(work_dir)/$@
|
|
|
|
rsync -a $(work_dir)/$@/rv*/* $(wally_workdir)/rv$(patsubst %64,%64i,$(patsubst %32,%32i,$*))_m || echo "error suppressed"
|
|
|
|
|
|
|
|
quad64: config64.ini $(wally_dir)/riscv-test-suite/rv64i_m/Q/riscv-ctg/tests | $(work_dir)
|
|
|
|
riscof run --work-dir=$(work_dir)/$@ --config=$< --suite=$(wally_dir)/riscv-test-suite/rv64i_m/Q/riscv-ctg/tests/ --env=$(wally_dir)/riscv-test-suite/env
|
|
|
|
$(MAKE) -f makefile-memfile WORKDIR=$(work_dir)/$@
|
2022-06-17 22:07:16 +00:00
|
|
|
|
2022-06-17 01:05:06 +00:00
|
|
|
clean:
|
2024-09-29 21:05:28 +00:00
|
|
|
rm -f config??*.ini
|
2022-06-17 01:05:06 +00:00
|
|
|
rm -rf $(work_dir)
|
2022-06-29 19:23:40 +00:00
|
|
|
rm -rf $(wally_workdir)
|
2022-07-25 23:23:10 +00:00
|
|
|
rm -rf $(arch_workdir)
|
2024-08-07 09:19:05 +00:00
|
|
|
rm -rf $(submodule_wor_dir)
|
2024-09-29 21:05:28 +00:00
|
|
|
|
|
|
|
$(work_dir) $(arch_workdir) $(wally_workdir):
|
|
|
|
mkdir -p $@
|