cvw/benchmarks/coremark/Makefile

46 lines
2.0 KiB
Makefile
Raw Normal View History

2022-07-18 23:10:22 +00:00
# Wally Coremark Makefile
# Daniel Torres & David Harris 28 July 2022
2023-02-04 12:29:27 +00:00
# SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
2022-07-18 23:10:22 +00:00
2021-11-29 21:33:01 +00:00
PORT_DIR = $(CURDIR)/riscv64-baremetal
cmbase=../../addins/coremark
2023-05-16 20:46:20 +00:00
work_dir= ../benchmarks/coremark/work
XLEN ?=64
2021-11-29 21:33:01 +00:00
sources=$(cmbase)/core_main.c $(cmbase)/core_list_join.c $(cmbase)/coremark.h \
$(cmbase)/core_matrix.c $(cmbase)/core_state.c $(cmbase)/core_util.c \
$(PORT_DIR)/core_portme.h $(PORT_DIR)/core_portme.c $(PORT_DIR)/core_portme.mak \
$(PORT_DIR)/crt.S $(PORT_DIR)/encoding.h $(PORT_DIR)/util.h $(PORT_DIR)/syscalls.c
ABI := $(if $(findstring "64","$(XLEN)"),lp64,ilp32)
2023-05-16 20:46:20 +00:00
ARCH := rv$(XLEN)gc
PORT_CFLAGS = -g -mabi=$(ABI) -march=$(ARCH) -static -falign-functions=16 \
-mbranch-cost=1 -DSKIP_DEFAULT_MEMSET -mtune=sifive-3-series -O3 -finline-functions -falign-jumps=4 \
-fno-delete-null-pointer-checks -fno-rename-registers --param=loop-max-datarefs-for-datadeps=0 \
-funroll-all-loops --param=uninlined-function-insns=8 -fno-tree-vrp -fwrapv -fipa-pta \
-nostdlib -nostartfiles -ffreestanding -mstrict-align \
2022-07-18 23:48:13 +00:00
-DTOTAL_DATA_SIZE=2000 -DMAIN_HAS_NOARGC=1 -DPERFORMANCE_RUN=1 -DITERATIONS=10 -DXLEN=$(XLEN)
all: $(work_dir)/coremark.bare.riscv.elf.memfile
run:
2023-02-04 12:38:41 +00:00
(cd ../../sim && (time vsim -c -do "do wally-batch.do rv$(XLEN)gc coremark" 2>&1 | tee $(work_dir)/coremark.sim.log))
2023-05-16 20:46:20 +00:00
# cd ../benchmarks/coremark/
# KMG: added post processing script to give out branch miss proportion along with other stats to the coremark test
python3 coremark-postprocess.py
2021-11-29 21:33:01 +00:00
$(work_dir)/coremark.bare.riscv.elf.memfile: $(work_dir)/coremark.bare.riscv
riscv64-unknown-elf-objdump -D $< > $<.elf.objdump
riscv64-unknown-elf-elf2hex --bit-width $(XLEN) --input $< --output $@
extractFunctionRadix.sh $<.elf.objdump
2021-11-19 04:23:55 +00:00
$(work_dir)/coremark.bare.riscv: $(sources) Makefile
2023-05-16 20:46:20 +00:00
make -C $(cmbase) PORT_DIR=$(PORT_DIR) compile RISCV=$(RISCV) XCFLAGS="$(PORT_CFLAGS)"
2022-07-18 23:48:13 +00:00
mkdir -p $(work_dir)
mv $(cmbase)/coremark.bare.riscv $(work_dir)
2021-11-19 04:23:55 +00:00
.PHONY: clean
clean:
rm -f $(work_dir)/*
2022-07-18 23:48:13 +00:00