From 08e986912c4eaa4a03ca57838452ce843260271b Mon Sep 17 00:00:00 2001 From: Luke Wren Date: Sat, 22 May 2021 11:18:56 +0100 Subject: [PATCH] Also fix RAW stall on JALR instructions, oops. Runs CoreMark and Dhrystone now --- hdl/hazard3_core.v | 8 ++++---- test/coremark/dist/barebones/core_portme.mak | 2 +- test/dhrystone/Makefile | 2 +- test/tb_cxxrtl/Makefile | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/hdl/hazard3_core.v b/hdl/hazard3_core.v index 07fd74d..05c8316 100644 --- a/hdl/hazard3_core.v +++ b/hdl/hazard3_core.v @@ -547,11 +547,11 @@ wire [W_ADDR-1:0] x_jump_target = x_taken_jump_target; // Be careful not to take branches whose comparisons depend on a load result -wire x_jump_req = - x_trap_enter || x_trap_exit || +wire x_jump_req = x_trap_enter || x_trap_exit || !x_stall_raw && ( d_branchcond == BCOND_ALWAYS || - d_branchcond == BCOND_ZERO && !x_alu_cmp && !x_stall_raw || - d_branchcond == BCOND_NZERO && x_alu_cmp && !x_stall_raw; + d_branchcond == BCOND_ZERO && !x_alu_cmp || + d_branchcond == BCOND_NZERO && x_alu_cmp +); assign f_jump_req = d_jump_req || x_jump_req; assign f_jump_target = x_jump_target; diff --git a/test/coremark/dist/barebones/core_portme.mak b/test/coremark/dist/barebones/core_portme.mak index 047ae1a..b12a31b 100755 --- a/test/coremark/dist/barebones/core_portme.mak +++ b/test/coremark/dist/barebones/core_portme.mak @@ -24,7 +24,7 @@ LD = riscv32-unknown-elf-gcc AS = riscv32-unknown-elf-gcc # Flag : CFLAGS # Use this flag to define compiler options. Note, you can add compiler options from the command line using XCFLAGS="other flags" -PORT_CFLAGS = -O3 -g +PORT_CFLAGS = -O3 -g -march=rv32imc -fno-common -funroll-loops -finline-functions --param max-inline-insns-auto=20 -falign-functions=4 -falign-jumps=4 -falign-loops=4 FLAGS_STR = "$(PORT_CFLAGS) $(XCFLAGS) $(XLFLAGS) $(LFLAGS_END)" CFLAGS = $(PORT_CFLAGS) -I$(PORT_DIR) -I. -DFLAGS_STR=\"$(FLAGS_STR)\" #Flag : LFLAGS_END diff --git a/test/dhrystone/Makefile b/test/dhrystone/Makefile index 0ca9e71..8ed9b58 100644 --- a/test/dhrystone/Makefile +++ b/test/dhrystone/Makefile @@ -1,6 +1,6 @@ SRCS := ../common/init.S src/dhrystone_main.c src/dhrystone.c src/util.c APP := dhrystone -CCFLAGS := -O3 -fno-inline -march=rv32i +CCFLAGS := -O3 -fno-inline -march=rv32im MAX_CYCLES := 1000000 include ../common/src_only_app.mk diff --git a/test/tb_cxxrtl/Makefile b/test/tb_cxxrtl/Makefile index e730ff8..709a7c5 100644 --- a/test/tb_cxxrtl/Makefile +++ b/test/tb_cxxrtl/Makefile @@ -4,8 +4,8 @@ CDEFINES := DUAL_PORT CPU_RESET_VECTOR := 32'hc0 EXTENSION_C := 1 EXTENSION_M := 1 -MULDIV_UNROLL := 1 -MUL_FAST := 0 +MULDIV_UNROLL := 2 +MUL_FAST := 1 REDUCED_BYPASS := 0 .PHONY: clean tb all