Skip to content

Commit

Permalink
[software] JOURNAL: Fix matmul_qlr_5 param and optionally disable fix…
Browse files Browse the repository at this point in the history
…ed QLR regs
  • Loading branch information
sermazz committed Sep 6, 2023
1 parent 645ecb3 commit b629c73
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion software/apps/systolic/matmul_qlr_5/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

// Settings
#define TOPOLOGY 1
#define VERIFY_OUTPUT 0
#define VERIFY_OUTPUT 1
#define PRINTF_MATRIX 0
#define PRINTF_VERBOSE 0

Expand Down
6 changes: 6 additions & 0 deletions software/runtime/runtime.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b629c73

Please sign in to comment.