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
|
2022-07-07 23:11:02 +00:00
|
|
|
cmbase=../../addins/coremark
|
2023-05-16 20:46:20 +00:00
|
|
|
work_dir= ../benchmarks/coremark/work
|
2022-07-06 23:43:57 +00:00
|
|
|
XLEN ?=64
|
2021-11-29 21:33:01 +00:00
|
|
|
sources=$(cmbase)/core_main.c $(cmbase)/core_list_join.c $(cmbase)/coremark.h \
|
2022-07-08 21:25:52 +00:00
|
|
|
$(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
|
2022-07-19 02:58:07 +00:00
|
|
|
PORT_CFLAGS = -g -mabi=$(ABI) -march=$(ARCH) -static -falign-functions=16 \
|
2022-07-19 20:17:02 +00:00
|
|
|
-mbranch-cost=1 -DSKIP_DEFAULT_MEMSET -mtune=sifive-3-series -O3 -finline-functions -falign-jumps=4 \
|
2022-07-08 21:25:52 +00:00
|
|
|
-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)
|
2022-07-08 21:25:52 +00:00
|
|
|
|
|
|
|
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/
|
2022-09-26 04:51:04 +00:00
|
|
|
# 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
|
|
|
|
2022-06-13 23:23:57 +00:00
|
|
|
$(work_dir)/coremark.bare.riscv.elf.memfile: $(work_dir)/coremark.bare.riscv
|
2022-02-02 00:25:03 +00:00
|
|
|
riscv64-unknown-elf-objdump -D $< > $<.elf.objdump
|
2022-07-06 23:43:57 +00:00
|
|
|
riscv64-unknown-elf-elf2hex --bit-width $(XLEN) --input $< --output $@
|
2022-02-02 00:25:03 +00:00
|
|
|
extractFunctionRadix.sh $<.elf.objdump
|
2021-11-19 04:23:55 +00:00
|
|
|
|
2022-06-13 23:23:57 +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)
|
2022-06-13 23:23:57 +00:00
|
|
|
mv $(cmbase)/coremark.bare.riscv $(work_dir)
|
2021-11-19 04:23:55 +00:00
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
|
|
|
|
clean:
|
2022-06-13 23:23:57 +00:00
|
|
|
rm -f $(work_dir)/*
|
2022-07-08 21:25:52 +00:00
|
|
|
|
2022-07-18 23:48:13 +00:00
|
|
|
|