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
|
2023-06-07 03:12:13 +00:00
|
|
|
cmbase= $(WALLY)/addins/coremark
|
|
|
|
work_dir= $(WALLY)/benchmarks/coremark/work
|
2024-04-17 10:15:20 +00:00
|
|
|
XLEN ?=32
|
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)
|
2024-04-17 11:01:25 +00:00
|
|
|
ARCH := rv$(XLEN)im_zicsr_zba_zbb_zbs
|
2024-04-24 11:41:25 +00:00
|
|
|
CONFIG := rv$(XLEN)gc
|
2023-06-09 16:37:09 +00:00
|
|
|
#ARCH := rv$(XLEN)gc
|
2024-01-07 02:55:57 +00:00
|
|
|
#ARCH := rv$(XLEN)imc_zicsr
|
2023-06-09 16:37:09 +00:00
|
|
|
#ARCH := rv$(XLEN)im_zicsr
|
|
|
|
#ARCH := rv$(XLEN)i_zicsr
|
2024-01-07 02:55:57 +00:00
|
|
|
|
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
|
|
|
|
|
2024-04-24 11:41:25 +00:00
|
|
|
run: $(work_dir)/coremark.bare.riscv.elf.memfile
|
2024-04-20 19:44:44 +00:00
|
|
|
# time wsim rv$(XLEN)gc coremark --sim verilator 2>&1 | tee $(work_dir)/coremark.sim.log
|
2024-04-24 11:41:25 +00:00
|
|
|
time wsim ${CONFIG} coremark 2>&1 | tee $(work_dir)/coremark.sim.log
|
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
|
2024-09-30 06:14:19 +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:
|
2024-09-30 06:14:19 +00:00
|
|
|
$(MAKE) -C $(cmbase) 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
|
|
|
|