From b629c732e550b6e495646ac26ce81896c0cc0733 Mon Sep 17 00:00:00 2001 From: Sergio Mazzola Date: Wed, 6 Sep 2023 16:35:28 +0200 Subject: [PATCH] [software] JOURNAL: Fix matmul_qlr_5 param and optionally disable fixed QLR regs --- software/apps/systolic/matmul_qlr_5/main.c | 2 +- software/runtime/runtime.mk | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/software/apps/systolic/matmul_qlr_5/main.c b/software/apps/systolic/matmul_qlr_5/main.c index a3606da6a..4d2aa4a62 100644 --- a/software/apps/systolic/matmul_qlr_5/main.c +++ b/software/apps/systolic/matmul_qlr_5/main.c @@ -29,7 +29,7 @@ // Settings #define TOPOLOGY 1 -#define VERIFY_OUTPUT 0 +#define VERIFY_OUTPUT 1 #define PRINTF_MATRIX 0 #define PRINTF_VERBOSE 0 diff --git a/software/runtime/runtime.mk b/software/runtime/runtime.mk index 53b757b57..09d4d0aaf 100644 --- a/software/runtime/runtime.mk +++ b/software/runtime/runtime.mk @@ -109,11 +109,17 @@ RISCV_WARNINGS += -Wunused-variable -Wconversion -Wall -Wextra # -Werror RISCV_FLAGS_COMMON_TESTS ?= -march=$(RISCV_ARCH) -mabi=$(RISCV_ABI) -I$(ROOT_DIR) -I$(HALIDE_INCLUDE) -static RISCV_FLAGS_COMMON ?= $(RISCV_FLAGS_COMMON_TESTS) -g -std=gnu99 -O3 -fno-builtin-memcpy -fno-builtin-memset -ffast-math -fno-common -fno-builtin-printf $(DEFINES) $(RISCV_WARNINGS) RISCV_FLAGS_GCC ?= -mcmodel=medany -Wa,-march=$(RISCV_ARCH_AS) -mtune=mempool -fno-tree-loop-distribute-patterns # -falign-loops=32 -falign-jumps=32 +# Disable reservation of x5, x6, x7, x28 for the QLR (reservation active by default, unless QLR hardware is not employed) +# This achieves higher performance if you have to compile software not using QLR, but the hardware parameter for QLR is enabled +disable_qlr_fix_reg ?= 0 +ifeq ($(disable_qlr_fix_reg), 0) ifeq ($(shell test $(qlr_fifo_size) -gt 0; echo $$?),0) RISCV_FLAGS_GCC += -ffixed-x5 -ffixed-x6 -ffixed-x7 -ffixed-x28 endif +endif RISCV_FLAGS_LLVM ?= -mcmodel=small -mcpu=mempool-rv32 -mllvm -misched-topdown + ifeq ($(COMPILER),gcc) RISCV_CCFLAGS += $(RISCV_FLAGS_GCC) $(RISCV_FLAGS_COMMON) RISCV_CXXFLAGS += $(RISCV_CCFLAGS)