Skip to content

Commit

Permalink
samples: benchmarks: coremark: migrate to STM logging on nrf54h20dk
Browse files Browse the repository at this point in the history
The CoreMark sample now uses logging in the STM standalone mode for the
nRF54H20 DK target.

Ref: NCSDK-27517

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
  • Loading branch information
kapi-no committed Nov 5, 2024
1 parent 4fff330 commit e1ab7dc
Show file tree
Hide file tree
Showing 16 changed files with 95 additions and 31 deletions.
10 changes: 1 addition & 9 deletions samples/benchmarks/coremark/Kconfig.sysbuild
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,4 @@ config APP_CPUNET_RUN
config APP_CPUPPR_RUN
bool "Run the CoreMark benchmark on the PPR core"
depends on SUPPORT_PPRCORE
depends on !BOARD_NRF54H20DK || !APP_CPUNET_RUN
help
Due to the limited number of UART ports on the nRF54H20 DK, you can run the CoreMark
benchmark only on two cores at a time; application core and either radio core or PPR
core.

PPR code is run from RAM. You must use the "nordic-ppr" snippet for the application
core to be able to boot the PPR core. You need to provide the "coremark_SNIPPET=nordic"
build argument.
default y
7 changes: 0 additions & 7 deletions samples/benchmarks/coremark/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,6 @@ SB_CONFIG_APP_CPUPPR_RUN - Enable execution for the PPR core

.. note::
PPR code is run from RAM.
You must use the ``nordic-ppr`` snippet for the application core to be able to boot the PPR core.
Use the build argument ``coremark_SNIPPET=nordic-ppr``.
To build the sample with the execution for the PPR core enabled, run the following command:

.. code-block:: console
west build -b nrf54h20dk/nrf54h20/cpuapp -- -DSB_CONFIG_APP_CPUNET_RUN=n -DSB_CONFIG_APP_CPUPPR_RUN=y -Dcoremark_SNIPPET=nordic-ppr

Building and running
********************
Expand Down
6 changes: 6 additions & 0 deletions samples/benchmarks/coremark/boards/nrf52840dk_nrf52840.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#
# Copyright (c) 2024 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause

CONFIG_LOG_MODE_MINIMAL=y
6 changes: 6 additions & 0 deletions samples/benchmarks/coremark/boards/nrf52dk_nrf52832.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#
# Copyright (c) 2024 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause

CONFIG_LOG_MODE_MINIMAL=y
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause

CONFIG_SOC_NRF53_CPUNET_ENABLE=y

CONFIG_LOG_MODE_MINIMAL=y
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#
# Copyright (c) 2024 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause

CONFIG_LOG_MODE_MINIMAL=y
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,11 @@
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause

CONFIG_COREMARK_ITERATIONS=10000

# Kconfigs required for the STM standalone logging, imported from the nordic-log-stm snippet.
CONFIG_TEST_LOGGING_DEFAULTS=n
CONFIG_LOG_FRONTEND=y
CONFIG_LOG_FRONTEND_ONLY=y
CONFIG_LOG_FRONTEND_STMESP=y
CONFIG_LOG_FRONTEND_STMESP_FSC=y
CONFIG_UART_ASYNC_API=y
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,23 @@
owned-channels = <7>;
status = "okay";
};

/* DTS nodes required to run the cpuppr target. */
&cpuppr_vpr {
status = "okay";
};

&cpuppr_ram3x_region {
status = "okay";
};

/* DTS nodes required for the STM standalone logging, imported from the nordic-log-stm snippet. */
&tbm {
status = "okay";
};

&tddconf {
status = "okay";
etrsources = <(NRF_TDDCONF_SOURCE_STMMAINCORE | NRF_TDDCONF_SOURCE_STMPPR)>;
portconfig = <0>;
};
10 changes: 10 additions & 0 deletions samples/benchmarks/coremark/boards/nrf54h20dk_nrf54h20_cpuppr.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,13 @@
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause

CONFIG_COREMARK_ITERATIONS=500

# Disable the UART console Kconfig to make Kconfig configuration with the DTS configuration.
CONFIG_UART_CONSOLE=n

# Kconfigs required for the STM standalone logging, imported from the nordic-log-stm snippet.
CONFIG_TEST_LOGGING_DEFAULTS=n
CONFIG_LOG_FRONTEND=y
CONFIG_LOG_FRONTEND_ONLY=y
CONFIG_LOG_FRONTEND_STMESP=y
CONFIG_LOG_FRONTEND_STMESP_FSC=y
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,10 @@
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

/* Intentionally left empty to overwrite default app.overlay. */
/* Disable the default UART node for the pepper core, as logs are forwarded
* with STM and the application core UART. This setting also prevents access
* issues to the same UART instance from two or more different cores.
*/
&uart135 {
status = "disabled";
};
10 changes: 10 additions & 0 deletions samples/benchmarks/coremark/boards/nrf54h20dk_nrf54h20_cpurad.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,13 @@
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause

CONFIG_COREMARK_ITERATIONS=10000

# Disable the UART console Kconfig to make Kconfig configuration with the DTS configuration.
CONFIG_UART_CONSOLE=n

# Kconfigs required for the STM standalone logging, imported from the nordic-log-stm snippet.
CONFIG_TEST_LOGGING_DEFAULTS=n
CONFIG_LOG_FRONTEND=y
CONFIG_LOG_FRONTEND_ONLY=y
CONFIG_LOG_FRONTEND_STMESP=y
CONFIG_LOG_FRONTEND_STMESP_FSC=y
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,18 @@
owned-channels = <6>;
status = "okay";
};

/* Disable the default UART node for the radio core, as logs are forwarded
* with STM and the application core UART. This setting also prevents access
* issues to the same UART instance from two or more different cores.
*/
&uart135 {
status = "disabled";
};

/* DTS nodes required for the STM standalone logging, imported from the nordic-log-stm snippet. */
&tddconf {
status = "okay";
etrsources = <(NRF_TDDCONF_SOURCE_STMMAINCORE)>;
portconfig = <0>;
};
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause

CONFIG_COREMARK_ITERATIONS=4000

CONFIG_LOG_MODE_MINIMAL=y
1 change: 0 additions & 1 deletion samples/benchmarks/coremark/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ CONFIG_COMPILER_OPT="-O3"

# Config results output
CONFIG_LOG=y
CONFIG_LOG_MODE_MINIMAL=y
CONFIG_LOG_DEFAULT_LEVEL=0
CONFIG_CBPRINTF_FP_SUPPORT=y

Expand Down
12 changes: 0 additions & 12 deletions samples/benchmarks/coremark/sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,3 @@ tests:
- nrf54h20dk/nrf54h20/cpuapp
tags: ci_build sysbuild ci_samples_benchmarks
extra_args: EXTRA_CONF_FILE="prj_multiple_threads.conf"
sample.benchmark.coremark_ppr:
sysbuild: true
build_only: true
platform_allow:
- nrf54h20dk/nrf54h20/cpuapp
integration_platforms:
- nrf54h20dk/nrf54h20/cpuapp
tags: ci_build sysbuild ci_samples_benchmarks
extra_args:
SB_CONFIG_APP_CPUNET_RUN=n
SB_CONFIG_APP_CPUPPR_RUN=y
coremark_SNIPPET=nordic-ppr
3 changes: 2 additions & 1 deletion samples/benchmarks/coremark/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ static K_SEM_DEFINE(start_coremark, 0, 1);
static atomic_t coremark_in_progress;

/* Enforce synchronous logging as the sample doesn't flush logs. */
BUILD_ASSERT(IS_ENABLED(CONFIG_LOG_MODE_MINIMAL) || IS_ENABLED(CONFIG_LOG_MODE_IMMEDIATE),
BUILD_ASSERT(IS_ENABLED(CONFIG_LOG_MODE_MINIMAL) || IS_ENABLED(CONFIG_LOG_MODE_IMMEDIATE) ||
IS_ENABLED(CONFIG_LOG_FRONTEND_ONLY),
"Logs should be processed synchronously to avoid negative impact on the "
"benchamrk performance");

Expand Down

0 comments on commit e1ab7dc

Please sign in to comment.