From 4e5bb4f004dba4ecc18560bb2afe2baad2a1a43c Mon Sep 17 00:00:00 2001 From: Patrick Date: Fri, 11 Oct 2024 10:19:02 +0200 Subject: [PATCH] embench runs --- benchies.md | 5 +++++ benchies/embench/CMakeLists.txt | 1 + benchies/embench/prj.conf | 4 ++-- benchies/embench/src/bench.c | 2 +- benchies/embench/src/main.c | 2 ++ benchies/embench/src/support.h | 2 +- 6 files changed, 12 insertions(+), 4 deletions(-) diff --git a/benchies.md b/benchies.md index 571fb40940..dea1ad0044 100644 --- a/benchies.md +++ b/benchies.md @@ -15,3 +15,8 @@ LTO && !CFI -> ~ 3650000 KFLOPS !LTO && !CFI -> ~ 3650000 KFLOPS mibench -> not implemented for zephyr and no reason to suspect result differ from linpack + +embench: +LTO && CFI -> ~ 906.4 ms +LTO && !CFI -> ~ 853.3 ms +!LTO && !CFI -> ~ 934.1 ms diff --git a/benchies/embench/CMakeLists.txt b/benchies/embench/CMakeLists.txt index b24b8c5250..7bc2f18540 100644 --- a/benchies/embench/CMakeLists.txt +++ b/benchies/embench/CMakeLists.txt @@ -4,4 +4,5 @@ cmake_minimum_required(VERSION 3.20.0) find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) project(blinky) +#add_compile_definitions(DEBUG) target_sources(app PRIVATE src/main.c src/bench.c) diff --git a/benchies/embench/prj.conf b/benchies/embench/prj.conf index 0c48afbef4..836d4e21f4 100644 --- a/benchies/embench/prj.conf +++ b/benchies/embench/prj.conf @@ -1,8 +1,8 @@ CONFIG_GPIO=y #CONFIG_ASAN=y -#CONFIG_CFI=y +CONFIG_CFI=y CONFIG_LLVM_USE_LLD=y -#CONFIG_LTO=y +CONFIG_LTO=y #CONFIG_DEBUG=y #CONFIG_DEBUG_INFO=y diff --git a/benchies/embench/src/bench.c b/benchies/embench/src/bench.c index 1aa1bd427e..9234d70757 100644 --- a/benchies/embench/src/bench.c +++ b/benchies/embench/src/bench.c @@ -14,7 +14,7 @@ #include "support.h" -#define LOCAL_SCALE_FACTOR 51 +#define LOCAL_SCALE_FACTOR 50 /* BEEBS heap is just an array */ /* MSG_SIZE * 2 + ((((MSG_SIZE+8)/64 + 1) * 64) - 8) + 64 */ diff --git a/benchies/embench/src/main.c b/benchies/embench/src/main.c index 90234e5fe3..1be9729ac3 100644 --- a/benchies/embench/src/main.c +++ b/benchies/embench/src/main.c @@ -13,6 +13,7 @@ #include "support.h" #include +#include int __attribute__((used)) main(int argc __attribute__((unused)), char *argv[] __attribute__((unused))) @@ -35,6 +36,7 @@ int __attribute__((used)) main(int argc __attribute__((unused)), correct = verify_benchmark(result); puts("returning"); + exit(0);; return (!correct); } /* main () */ diff --git a/benchies/embench/src/support.h b/benchies/embench/src/support.h index 1fce309f34..641cadf590 100644 --- a/benchies/embench/src/support.h +++ b/benchies/embench/src/support.h @@ -20,7 +20,7 @@ #endif //#define DEBUG -#define CPU_MHZ 1 +#define CPU_MHZ 5000 #define WARMUP_HEAT 1000 /* Include board support header if we have one */