Skip to content

Commit 31daca4

Browse files
zdebanosacassis
authored andcommitted
benchmarks/cyclictest: the rt-tests cyclictest NuttX Port
Despite the existence of the patch in benchmarks/rt-tests, this commit adds the NuttX Official cyclictest utility. The main difference is the introduction of different waiting methods next to POSIX clock_nanosleep: - The thread can wait for a g_waitsem, posted by board_timerhook() if CONFIG_SYSTEMTICK_HOOK is defined. Since the semaphore is only one, only one thread can wait. - The thread can wait for a Timer Device to timeout. The timer's timeout determines the waiting time of the thread. Since the timer is only one, again, only one thread can wait. The user can measure the elapsed time using clock_gettime or the timer device itself. The different waiting and measuring methods were introduced because NuttX, by default, does not offer fine measuring capabilities using POSIX time functions (as of Feb 25). Signed-off-by: Stepan Pressl <[email protected]>
1 parent 8fcff3e commit 31daca4

File tree

5 files changed

+1229
-0
lines changed

5 files changed

+1229
-0
lines changed

benchmarks/cyclictest/CMakeLists.txt

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# ##############################################################################
2+
# apps/benchmarks/cyclictest/CMakeLists.txt
3+
#
4+
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
5+
# license agreements. See the NOTICE file distributed with this work for
6+
# additional information regarding copyright ownership. The ASF licenses this
7+
# file to you under the Apache License, Version 2.0 (the "License"); you may not
8+
# use this file except in compliance with the License. You may obtain a copy of
9+
# the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16+
# License for the specific language governing permissions and limitations under
17+
# the License.
18+
#
19+
# ##############################################################################
20+
21+
if(CONFIG_BENCHMARK_CYCLICTEST)
22+
23+
# ############################################################################
24+
# Config and Fetch Coremark application
25+
# ############################################################################
26+
27+
set(CYCLICTEST_DIR ${CMAKE_CURRENT_LIST_DIR})
28+
29+
# ############################################################################
30+
# Sources
31+
# ############################################################################
32+
33+
set(CSRCS ${CYCLICTEST_DIR}/cyclictest.c)
34+
35+
# ############################################################################
36+
# Applications Configuration
37+
# ############################################################################
38+
39+
nuttx_add_application(
40+
NAME
41+
cyclictest
42+
PRIORITY
43+
${CONFIG_CYCLICTEST_PRIORITY}
44+
STACKSIZE
45+
${CONFIG_CYCLICTEST_STACKSIZE}
46+
MODULE
47+
${CONFIG_BENCHMARK_CYCLICTEST}
48+
COMPILE_FLAGS
49+
${CFLAGS}
50+
SRCS
51+
${CSRCS}
52+
INCLUDE_DIRECTORIES
53+
${INCDIR})
54+
55+
endif()

benchmarks/cyclictest/Kconfig

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#
2+
# For a description of the syntax of this configuration file,
3+
# see the file kconfig-language.txt in the NuttX tools repository.
4+
#
5+
6+
menuconfig BENCHMARK_CYCLICTEST
7+
bool "Cyclictest"
8+
default n
9+
---help---
10+
Enable the cyclictest application.
11+
12+
if BENCHMARK_CYCLICTEST
13+
14+
config BENCHMARK_CYCLICTEST_PROGNAME
15+
string "Cyclictest App Name"
16+
default "cyclictest"
17+
---help---
18+
This is the name of the program that will be used when the NSH ELF
19+
program is installed.
20+
21+
config BENCHMARK_CYCLICTEST_PRIORITY
22+
int "Cyclictest task priority"
23+
default 100
24+
25+
config BENCHMARK_CYCLICTEST_STACKSIZE
26+
int "Cyclictest task stack size"
27+
default 4096
28+
29+
endif # BENCHMARK_CYCLICTEST

benchmarks/cyclictest/Make.defs

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
############################################################################
2+
# apps/benchmarks/cyclictest/Make.defs
3+
#
4+
# Licensed to the Apache Software Foundation (ASF) under one or more
5+
# contributor license agreements. See the NOTICE file distributed with
6+
# this work for additional information regarding copyright ownership. The
7+
# ASF licenses this file to you under the Apache License, Version 2.0 (the
8+
# "License"); you may not use this file except in compliance with the
9+
# License. You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16+
# License for the specific language governing permissions and limitations
17+
# under the License.
18+
#
19+
############################################################################
20+
21+
ifneq ($(CONFIG_BENCHMARK_CYCLICTEST),)
22+
CONFIGURED_APPS += $(APPDIR)/benchmarks/cyclictest
23+
endif

benchmarks/cyclictest/Makefile

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
############################################################################
2+
# apps/benchmarks/cyclictest/Makefile
3+
#
4+
# Licensed to the Apache Software Foundation (ASF) under one or more
5+
# contributor license agreements. See the NOTICE file distributed with
6+
# this work for additional information regarding copyright ownership. The
7+
# ASF licenses this file to you under the Apache License, Version 2.0 (the
8+
# "License"); you may not use this file except in compliance with the
9+
# License. You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16+
# License for the specific language governing permissions and limitations
17+
# under the License.
18+
#
19+
############################################################################
20+
21+
include $(APPDIR)/Make.defs
22+
23+
# spinlock_bench application
24+
25+
############################################################################
26+
# Applications Configuration
27+
############################################################################
28+
29+
MODULE = $(CONFIG_BENCHMARK_CYCLICTEST)
30+
31+
PROGNAME += $(CONFIG_BENCHMARK_CYCLICTEST_PROGNAME)
32+
PRIORITY += $(CONFIG_BENCHMARK_CYCLICTEST_PRIORITY)
33+
STACKSIZE += $(CONFIG_BENCHMARK_CYCLICTEST_STACKSIZE)
34+
35+
MAINSRC += cyclictest.c
36+
37+
# Build with WebAssembly when CONFIG_INTERPRETERS_WAMR is enabled
38+
39+
include $(APPDIR)/Application.mk

0 commit comments

Comments
 (0)