-
Notifications
You must be signed in to change notification settings - Fork 1.4k
tests: benchmarks: Verify HPU feature temperature wakeups #18407
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
nordicjm
merged 1 commit into
nrfconnect:main
from
nordic-bami:implement_hpu_feature_temp_meas
Oct 31, 2024
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
tests/benchmarks/multicore/idle_hpu_temp_meas/CMakeLists.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| # | ||
| # Copyright (c) 2022 Nordic Semiconductor ASA | ||
| # | ||
| # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
| # | ||
|
|
||
| cmake_minimum_required(VERSION 3.20.0) | ||
|
|
||
| find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) | ||
|
|
||
| if(NOT SYSBUILD) | ||
| message(FATAL_ERROR | ||
| " This is a multi-image application that should be built using sysbuild.\n" | ||
| " Add --sysbuild argument to west build command to prepare all the images.") | ||
| endif() | ||
|
|
||
| project(idle_hpu_temp_meas) | ||
|
|
||
| target_sources(app PRIVATE src/main.c) |
10 changes: 10 additions & 0 deletions
10
tests/benchmarks/multicore/idle_hpu_temp_meas/Kconfig.sysbuild
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| # | ||
| # Copyright (c) 2023 Nordic Semiconductor ASA | ||
| # | ||
| # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
| # | ||
|
|
||
| source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" | ||
|
|
||
| config REMOTE_BOARD | ||
| string "The board used for remote target" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| CONFIG_PM=y | ||
| CONFIG_PM_S2RAM=y | ||
| CONFIG_PM_S2RAM_CUSTOM_MARKING=y | ||
| CONFIG_PM_DEVICE=y | ||
| CONFIG_PM_DEVICE_RUNTIME=y | ||
| CONFIG_POWEROFF=y | ||
|
|
||
| CONFIG_GPIO=n | ||
| CONFIG_BOOT_BANNER=n | ||
| CONFIG_NRFS_MRAM_SERVICE_ENABLED=n | ||
|
|
||
| CONFIG_ASSERT=y | ||
| CONFIG_NRFS=y | ||
|
|
||
| # Enable for debugging purposes only | ||
| CONFIG_PRINTK=n | ||
| CONFIG_LOG=n | ||
| CONFIG_CONSOLE=n | ||
| CONFIG_UART_CONSOLE=n | ||
| CONFIG_SERIAL=n |
12 changes: 12 additions & 0 deletions
12
tests/benchmarks/multicore/idle_hpu_temp_meas/remote/CMakeLists.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| # | ||
| # Copyright (c) 2022 Nordic Semiconductor ASA | ||
| # | ||
| # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
| # | ||
|
|
||
| cmake_minimum_required(VERSION 3.20.0) | ||
|
|
||
| find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) | ||
| project(remote) | ||
|
|
||
| target_sources(app PRIVATE ../src/main.c) |
21 changes: 21 additions & 0 deletions
21
tests/benchmarks/multicore/idle_hpu_temp_meas/remote/prj.conf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| CONFIG_PM=y | ||
| CONFIG_PM_S2RAM=y | ||
| CONFIG_PM_S2RAM_CUSTOM_MARKING=y | ||
| CONFIG_PM_DEVICE=y | ||
| CONFIG_PM_DEVICE_RUNTIME=y | ||
| CONFIG_POWEROFF=y | ||
|
|
||
| CONFIG_GPIO=n | ||
| CONFIG_BOOT_BANNER=n | ||
| CONFIG_NRFS_MRAM_SERVICE_ENABLED=n | ||
|
|
||
| CONFIG_ASSERT=y | ||
|
|
||
| CONFIG_NRFS=y | ||
|
|
||
| # Enable for debugging purposes only | ||
| CONFIG_PRINTK=n | ||
| CONFIG_LOG=n | ||
| CONFIG_CONSOLE=n | ||
| CONFIG_UART_CONSOLE=n | ||
| CONFIG_SERIAL=n |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| /* | ||
| * Copyright (c) 2024 Nordic Semiconductor ASA | ||
| * | ||
| * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
| */ | ||
|
|
||
| #include <zephyr/kernel.h> | ||
| #include <zephyr/sys/printk.h> | ||
| #include <zephyr/logging/log.h> | ||
| #include <nrfs_backend_ipc_service.h> | ||
| #include <nrfs_gdpwr.h> | ||
|
|
||
| LOG_MODULE_REGISTER(idle_hpu_temp_meas); | ||
|
|
||
| /* Required to power off the GD2 and GD3 domains | ||
| * Will be removed when GD handling | ||
| * is implemented in sdk-zephyr | ||
| */ | ||
| static void gdpwr_handler(nrfs_gdpwr_evt_t const *p_evt, void *context) | ||
| { | ||
| switch (p_evt->type) { | ||
| case NRFS_GDPWR_REQ_APPLIED: | ||
| LOG_INF("GDPWR handler - response received: 0x%x, CTX=%d", p_evt->type, | ||
| (uint32_t)context); | ||
| break; | ||
| case NRFS_GDPWR_REQ_REJECTED: | ||
| LOG_ERR("GDPWR handler - request rejected: 0x%x, CTX=%d", p_evt->type, | ||
| (uint32_t)context); | ||
| break; | ||
| default: | ||
| LOG_ERR("GDPWR handler - unexpected event: 0x%x, CTX=%d", p_evt->type, | ||
| (uint32_t)context); | ||
| break; | ||
| } | ||
| } | ||
|
|
||
| /* Required to power off the GD2 and GD3 domains | ||
| * Will be removed when GD handling | ||
| * is implemented in sdk-zephyr | ||
| */ | ||
| static void clear_global_power_domains_requests(void) | ||
| { | ||
| int service_status; | ||
| int tst_ctx = 1; | ||
|
|
||
| service_status = nrfs_gdpwr_init(gdpwr_handler); | ||
| LOG_INF("Response: %d", service_status); | ||
| LOG_INF("Sending GDPWR DISABLE request for: GDPWR_POWER_DOMAIN_ACTIVE_SLOW"); | ||
| service_status = nrfs_gdpwr_power_request(GDPWR_POWER_DOMAIN_ACTIVE_SLOW, | ||
| GDPWR_POWER_REQUEST_CLEAR, (void *)tst_ctx++); | ||
| LOG_INF("Response: %d", service_status); | ||
| LOG_INF("Sending GDPWR DISABLE request for: GDPWR_POWER_DOMAIN_ACTIVE_FAST"); | ||
| service_status = nrfs_gdpwr_power_request(GDPWR_POWER_DOMAIN_ACTIVE_FAST, | ||
| GDPWR_POWER_REQUEST_CLEAR, (void *)tst_ctx++); | ||
| LOG_INF("Response: %d", service_status); | ||
| LOG_INF("Sending GDPWR DISABLE request for: GDPWR_POWER_DOMAIN_MAIN_SLOW"); | ||
| service_status = nrfs_gdpwr_power_request(GDPWR_POWER_DOMAIN_MAIN_SLOW, | ||
| GDPWR_POWER_REQUEST_CLEAR, (void *)tst_ctx); | ||
| LOG_INF("Response: %d", service_status); | ||
| } | ||
|
|
||
| int main(void) | ||
| { | ||
| LOG_INF("SCFW HPU temperature measurement feature test, %s", CONFIG_BOARD_TARGET); | ||
| nrfs_backend_wait_for_connection(K_FOREVER); | ||
| clear_global_power_domains_requests(); | ||
| while (1) { | ||
| LOG_INF("Going to sleep forever"); | ||
| k_sleep(K_FOREVER); | ||
| } | ||
|
|
||
| return 0; | ||
| } | ||
26 changes: 26 additions & 0 deletions
26
tests/benchmarks/multicore/idle_hpu_temp_meas/sysbuild.cmake
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| # | ||
| # Copyright (c) 2023 Nordic Semiconductor ASA | ||
| # | ||
| # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
| # | ||
|
|
||
| if("${SB_CONFIG_REMOTE_BOARD}" STREQUAL "") | ||
| message(FATAL_ERROR "REMOTE_BOARD must be set to a valid board name") | ||
| endif() | ||
|
|
||
| # Add remote project | ||
| ExternalZephyrProject_Add( | ||
| APPLICATION remote | ||
| SOURCE_DIR ${APP_DIR}/remote | ||
| BOARD ${SB_CONFIG_REMOTE_BOARD} | ||
| BOARD_REVISION ${BOARD_REVISION} | ||
| ) | ||
| set_property(GLOBAL APPEND PROPERTY PM_DOMAINS CPUNET) | ||
| set_property(GLOBAL APPEND PROPERTY PM_CPUNET_IMAGES remote) | ||
| set_property(GLOBAL PROPERTY DOMAIN_APP_CPUNET remote) | ||
| set(CPUNET_PM_DOMAIN_DYNAMIC_PARTITION remote CACHE INTERNAL "") | ||
|
|
||
| # Add a dependency so that the remote image will be built and flashed first | ||
| add_dependencies(idle_hpu_temp_meas remote) | ||
| # Add dependency so that the remote image is flashed first. | ||
| sysbuild_add_dependencies(FLASH idle_hpu_temp_meas remote) |
1 change: 1 addition & 0 deletions
1
tests/benchmarks/multicore/idle_hpu_temp_meas/sysbuild/nrf54h20dk_nrf54h20_cpurad.conf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| SB_CONFIG_REMOTE_BOARD="nrf54h20dk/nrf54h20/cpurad" |
17 changes: 17 additions & 0 deletions
17
tests/benchmarks/multicore/idle_hpu_temp_meas/testcase.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| common: | ||
| sysbuild: true | ||
| tags: ci_build ci_tests_benchmarks_multicore hpu ppk_power_measure | ||
|
|
||
| tests: | ||
| benchmarks.multicore.idle_hpu_temp_meas: | ||
| harness: pytest | ||
| platform_allow: | ||
| - nrf54h20dk/nrf54h20/cpuapp | ||
| integration_platforms: | ||
| - nrf54h20dk/nrf54h20/cpuapp | ||
| extra_args: | ||
| - SB_CONF_FILE=sysbuild/nrf54h20dk_nrf54h20_cpurad.conf | ||
| harness_config: | ||
| fixture: ppk_power_measure | ||
| pytest_root: | ||
| - "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_power_consumption_hpu_feature" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Soon that GDPWR will not be needed: #18352
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From CI status on this PR is doesn't look 'soon' :)