Skip to content

Commit

Permalink
benchmarks/coremark: apply SEED_METHOD/MEM_METHOD update
Browse files Browse the repository at this point in the history
Signed-off-by: haopengxiang <[email protected]>
  • Loading branch information
haopengxiang committed Aug 26, 2023
1 parent 512af7f commit 639be61
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 3 deletions.
35 changes: 35 additions & 0 deletions benchmarks/coremark/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,41 @@ config COREMARK_STACKSIZE
int "CoreMark task stack size"
default 4096

config COREMARK_SEED_METHOD
int "Coremark Seed Method"
default 2
---help---
Set Coremark Seed Method:
0: SEED_ARG
1: SEED_FUNC
2: SEED_VOLATILE

config COREMARK_MEM_METHOD
int "Coremark Memory Method"
default 1
---help---
Set Coremark Memory Method:
0: MEM_STATIC
1: MEM_MALLOC
2: MEM_STACK

config COREMARK_MEM_LOCATION
string "Coremark memory location string"
default "Defined by the NuttX configuration"
---help---
Set Coremark Memory Location:
0: GLOBAL
1: HEAP
2: STACK

config COREMARK_DEBUG
int "Coremark Core Debug"
default 0
---help---
Enable the Core Debug:
0: Disable
1: Enable

config COREMARK_PRINT_ARGS
bool "Print CoreMark arguments when executing"
default n
Expand Down
24 changes: 21 additions & 3 deletions benchmarks/coremark/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,32 @@ else
COREMARK_PRINT_ARGS = 0
endif

CFLAGS += ${DEFINE_PREFIX}USE_PTHREAD ${DEFINE_PREFIX}PERFORMANCE_RUN=1
CFLAGS += ${DEFINE_PREFIX}MULTITHREAD=$(COREMARK_NTHREADS)
ifeq ($(CONFIG_COREMARK_MEM_METHOD), 1)
CONFIG_COREMARK_MEM_LOCATION = "HEAP"
else ifeq ($(CONFIG_COREMARK_MEM_METHOD), 2)
CONFIG_COREMARK_MEM_LOCATION = "STACK"
else
CONFIG_COREMARK_MEM_LOCATION = "GLOBAL"
endif

CFLAGS += ${DEFINE_PREFIX}CALLGRIND_RUN=0
CFLAGS += ${DEFINE_PREFIX}COMPILER_REQUIRES_SORT_RETURN=0
CFLAGS += ${DEFINE_PREFIX}CORE_DEBUG=$(CONFIG_COREMARK_DEBUG)
CFLAGS += ${DEFINE_PREFIX}FLAGS_STR=\""$(ARCHOPTIMIZATION)\""
CFLAGS += ${DEFINE_PREFIX}MEM_LOCATION=$(CONFIG_COREMARK_MEM_LOCATION)
CFLAGS += ${DEFINE_PREFIX}MEM_METHOD=$(CONFIG_COREMARK_MEM_METHOD)
CFLAGS += ${DEFINE_PREFIX}MICA=0
CFLAGS += ${DEFINE_PREFIX}MULTITHREAD=$(COREMARK_NTHREADS)
CFLAGS += ${DEFINE_PREFIX}PERFORMANCE_RUN=1
CFLAGS += ${DEFINE_PREFIX}PRINT_ARGS=$(COREMARK_PRINT_ARGS)
CFLAGS += ${DEFINE_PREFIX}MEM_LOCATION=\"Stack\"
CFLAGS += ${DEFINE_PREFIX}SEED_METHOD=$(CONFIG_COREMARK_SEED_METHOD)
CFLAGS += ${DEFINE_PREFIX}USE_CLOCK=1
CFLAGS += ${DEFINE_PREFIX}USE_PTHREAD

ifeq ($(CONFIG_COREMARK_ITERATIONS_OVERRIDE),y)
CFLAGS += ${DEFINE_PREFIX}ITERATIONS=$(CONFIG_COREMARK_ITERATIONS_COUNT)
else
CFLAGS += ${DEFINE_PREFIX}ITERATIONS=0
endif

CSRCS += core_list_join.c
Expand Down

0 comments on commit 639be61

Please sign in to comment.