From fa287f8e8ea4f9d8a583c11148ab01b382143c10 Mon Sep 17 00:00:00 2001 From: Huaqi Fang <578567190@qq.com> Date: Thu, 25 Jul 2024 16:06:53 +0800 Subject: [PATCH] application: add benchmark toolchain makefiles for hightec Test it like this hightec toolchain current 0.3.0 version code size still can be improved $ cat application/baremetal/benchmark/quick_bench.sh for case in coremark dhrystone whetstone; do pushd $case export SIMULATION=1 //export GDBREMOTE="whss6:23000" echo "Build $case for TOOLCHAIN=hightec" make TOOLCHAIN=hightec CORE=n300f DOWNLOAD=sram SILENT=1 clean all make TOOLCHAIN=hightec CORE=n300f DOWNLOAD=sram SILENT=1 upload sleep 10 echo "Build $case for TOOLCHAIN=nuclei_gnu" make TOOLCHAIN=nuclei_gnu CORE=n300f DOWNLOAD=sram SILENT=1 clean all make TOOLCHAIN=nuclei_gnu CORE=n300f DOWNLOAD=sram SILENT=1 upload sleep 10 popd done Signed-off-by: Huaqi Fang <578567190@qq.com> --- .../baremetal/benchmark/coremark/toolchain_hightec.mk | 2 ++ .../baremetal/benchmark/dhrystone/toolchain_hightec.mk | 7 +++++++ .../baremetal/benchmark/whetstone/toolchain_hightec.mk | 1 + 3 files changed, 10 insertions(+) create mode 100644 application/baremetal/benchmark/coremark/toolchain_hightec.mk create mode 100644 application/baremetal/benchmark/dhrystone/toolchain_hightec.mk create mode 100644 application/baremetal/benchmark/whetstone/toolchain_hightec.mk diff --git a/application/baremetal/benchmark/coremark/toolchain_hightec.mk b/application/baremetal/benchmark/coremark/toolchain_hightec.mk new file mode 100644 index 00000000..90c947e4 --- /dev/null +++ b/application/baremetal/benchmark/coremark/toolchain_hightec.mk @@ -0,0 +1,2 @@ +BENCH_FLAGS ?= -O3 -flto -falign-functions=4 -falign-loops=4 +LDFLAGS += -Wl,-mllvm,--align-all-nofallthru-blocks=2 diff --git a/application/baremetal/benchmark/dhrystone/toolchain_hightec.mk b/application/baremetal/benchmark/dhrystone/toolchain_hightec.mk new file mode 100644 index 00000000..43698aad --- /dev/null +++ b/application/baremetal/benchmark/dhrystone/toolchain_hightec.mk @@ -0,0 +1,7 @@ +ifeq ($(DHRY_MODE),ground) +BENCH_FLAGS ?= -Ofast -flto -fno-inline -fno-builtin-printf -funroll-loops -falign-functions=4 -falign-loops=4 +else ifeq ($(DHRY_MODE),best) +BENCH_FLAGS ?= -Ofast -flto -finline -fno-builtin-printf -funroll-loops -falign-functions=4 -falign-loops=4 -finline-functions +else ifeq ($(DHRY_MODE),inline) +BENCH_FLAGS ?= -O3 -flto -finline -fno-builtin-printf -funroll-loops -falign-functions=4 -falign-loops=4 -finline-functions +endif diff --git a/application/baremetal/benchmark/whetstone/toolchain_hightec.mk b/application/baremetal/benchmark/whetstone/toolchain_hightec.mk new file mode 100644 index 00000000..bb24c30e --- /dev/null +++ b/application/baremetal/benchmark/whetstone/toolchain_hightec.mk @@ -0,0 +1 @@ +BENCH_FLAGS ?= -Ofast -funroll-loops