Better default flags for CoreMark

This commit is contained in:
Luke Wren 2024-06-02 10:25:07 +01:00
parent a38981f989
commit a9ba69f4dd
2 changed files with 7 additions and 5 deletions

View File

@ -2,7 +2,8 @@ APP := coremark
MAX_CYCLES := 100000000
CROSS_PREFIX ?= riscv32-unknown-elf-
TBDIR ?= ../tb_cxxrtl
TBEXEC ?= ../tb_cxxrtl/tb
TBDIR := $(dir $(abspath $(TBEXEC)))
###############################################################################
@ -13,10 +14,10 @@ TBDIR ?= ../tb_cxxrtl
all: run
run: $(APP).bin
$(TBDIR)/tb --bin $(APP).bin --cycles $(MAX_CYCLES)
$(TBEXEC) --bin $(APP).bin --cycles $(MAX_CYCLES)
waves: $(APP).bin
$(TBDIR)/tb $(APP).bin $(APPNAME)_run.vcd --cycles $(MAX_CYCLES)
$(TBEXEC) $(APP).bin $(APPNAME)_run.vcd --cycles $(MAX_CYCLES)
view: run
gtkwave $(APP)_run.vcd

View File

@ -19,14 +19,15 @@
# Use this flag to define how to to get an executable (e.g -o)
OUTFLAG= -o
MARCH = rv32imac_zicsr_zba_zbb_zbs
MARCH = rv32ima_zicsr_zba_zbb_zbs_zbkb
CROSS_PREFIX = riscv32-unknown-elf-
CC = $(CROSS_PREFIX)gcc
LD = $(CROSS_PREFIX)gcc
AS = $(CROSS_PREFIX)gcc
PORT_CFLAGS = -O3 -g -march=$(MARCH)
# If compressed instructions are enabled, you also want: -falign-functions=4 -falign-jumps=4 -falign-loops=4
PORT_CFLAGS = -O3 -g -march=$(MARCH) -mbranch-cost=1 -funroll-all-loops --param max-inline-insns-auto=200 -finline-limit=10000 -fno-code-hoisting -fno-if-conversion2
FLAGS_STR = "$(PORT_CFLAGS) $(XCFLAGS) $(XLFLAGS) $(LFLAGS_END)"
CFLAGS = $(PORT_CFLAGS) -I$(PORT_DIR) -I. -DFLAGS_STR=\"$(FLAGS_STR)\"