2022-06-17 01:05:06 +00:00
|
|
|
arch_dir = ../../addins/riscv-arch-test
|
|
|
|
work_dir = "./riscof_work"
|
|
|
|
current_dir = $(shell pwd)
|
2022-06-17 22:07:16 +00:00
|
|
|
XLEN ?= 64
|
2022-06-17 01:05:06 +00:00
|
|
|
|
2022-06-17 22:07:16 +00:00
|
|
|
all: build
|
2022-06-17 01:05:06 +00:00
|
|
|
|
2022-06-17 22:07:16 +00:00
|
|
|
build:
|
2022-06-17 01:05:06 +00:00
|
|
|
mkdir -p $(work_dir)
|
|
|
|
mkdir -p work
|
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
|
|
|
|
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 --no-dut-run
|
|
|
|
mv $(work_dir)/rv$(XLEN)i_m work/
|
|
|
|
|
|
|
|
# buildold:
|
|
|
|
# mkdir -p $(work_dir)
|
|
|
|
# mkdir -p work
|
|
|
|
# sed 's,{0},$(current_dir),g;s,{1},32imc,g' config.ini > config32.ini
|
|
|
|
# sed 's,{0},$(current_dir),g;s,{1},64gc,g' config.ini > config64.ini
|
|
|
|
# riscof run --work-dir=$(work_dir) --config=config32.ini --suite=$(arch_dir)/riscv-test-suite/ --env=$(arch_dir)/riscv-test-suite/env --no-browser --no-dut-run
|
|
|
|
# mv -r $(work_dir)/rv32i_m work/
|
|
|
|
# riscof run --work-dir=$(work_dir) --config=config64.ini --suite=$(arch_dir)/riscv-test-suite/ --env=$(arch_dir)/riscv-test-suite/env --no-browser --no-dut-run
|
|
|
|
# mv -r $(work_dir)/rv64i_m work/
|
|
|
|
|
|
|
|
# no-dut-run? do we want to run spike?
|
2022-06-17 01:05:06 +00:00
|
|
|
# sed >> config64.ini
|
|
|
|
# (cd $(arch_dir) && riscof validateyaml --config=config.ini)
|
|
|
|
# (cd $(arch_dir) && riscof --verbose info arch-test --clone)
|
|
|
|
# (cd $(arch_dir) && riscof testlist --config=config.ini --suite=riscv-arch-test/riscv-test-suite/ --env=riscv-arch-test/riscv-test-suite/env)
|
|
|
|
# sed -i 's/riscv{.}-unknown-/riscv64-unknown-/g' $(arch_dir)/spike/riscof_spike.py
|
|
|
|
# sed -i 's/riscv{.}-unknown-/riscv64-unknown-/g' $(arch_dir)/sail_cSim/riscof_sail_cSim.py
|
|
|
|
|
2022-06-17 22:07:16 +00:00
|
|
|
# memfile:
|
|
|
|
# sleep 1
|
|
|
|
# # find work/rv*/*/ -type f -name "*ref.elf" | while read f; do riscv64-unknown-elf-objdump -S -D "$$f" > "$$f.objdump"; echo $$f; done
|
|
|
|
# find work/rv32*/*/ -type f -name "*ref.elf" | while read f; do riscv64-unknown-elf-elf2hex --bit-width 32 --input "$$f" --output "$$f.memfile"; done
|
|
|
|
# find work/rv64*/*/ -type f -name "*ref.elf" | while read f; do riscv64-unknown-elf-elf2hex --bit-width 64 --input "$$f" --output "$$f.memfile"; done
|
|
|
|
# find work/rv*/*/ -type f -name "*.objdump" | while read f; do extractFunctionRadix.sh $$f; done
|
2022-06-17 01:05:06 +00:00
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f config64.ini
|
|
|
|
rm -f config32.ini
|
|
|
|
rm -rf $(work_dir)
|
|
|
|
rm -rf work
|