user-sample.c v2 optimizations: - Pre-fire DMA Ch0 load at loop tail to overlap fully with IP compute - Inline wait_matmul_done/wait_dma_done to eliminate function call overhead - Inline DMA register writes, skip redundant STATUS_BUSY_BIT check - Replace g%2 with XOR bank toggle (bank ^= 1) - Cache volatile pointers in locals (ch0, ch1, mat_status, mat_ctrl) Makefile: bump -O2 to -O3
13 lines
332 B
Makefile
13 lines
332 B
Makefile
TARGET = user-sample
|
|
|
|
MATMUL_GROUP_NUM ?= 5000
|
|
CFLAGS += -O3 -g -DMATMUL_GROUP_NUM=$(MATMUL_GROUP_NUM)
|
|
|
|
C_SRCS := $(wildcard ./*.c )
|
|
|
|
OBJDIR = obj
|
|
COMMON_DIR = ../../bsp
|
|
GCC_DIR=../../../toolchains/loongson-gnu-toolchain-8.3-x86_64-loongarch32r-linux-gnusf-v2.0
|
|
PICOLIBC_DIR=../../../toolchains/picolibc
|
|
include ../../bsp/common.mk
|