cvw/tests/riscof/Makefile
2022-06-16 18:05:06 -07:00

34 lines
1.7 KiB
Makefile

arch_dir = ../../addins/riscv-arch-test
work_dir = "./riscof_work"
current_dir = $(shell pwd)
all: clone memfile
clone:
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=config64.ini --suite=$(arch_dir)/riscv-test-suite/ --env=$(arch_dir)/riscv-test-suite/env
cp -r $(work_dir)/rv64i_m work/
riscof run --work-dir=$(work_dir) --config=config32.ini --suite=$(arch_dir)/riscv-test-suite/ --env=$(arch_dir)/riscv-test-suite/env
cp -r $(work_dir)/rv32i_m work/
# 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
memfile:
sleep 1
find work/rv*/*/ -type f -name "*ref.elf" | while read f; do riscv64-unknown-elf-objdump -S -D "$$f" > "$$f.objdump"; 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
clean:
rm -f config64.ini
rm -f config32.ini
rm -rf $(work_dir)
rm -rf work