From 4065e8aaa863663b2c4338f9642ad256c4ac6766 Mon Sep 17 00:00:00 2001 From: Bartosz Miller Date: Thu, 16 Jan 2025 14:40:03 +0100 Subject: [PATCH] tests: benchmarks: Collect coverage data from multicore benchmarks Add coverage calculation test case for each multicore idle* test Signed-off-by: Bartosz Miller --- .../multicore/idle_adc/Kconfig.sysbuild | 3 +- .../multicore/idle_adc/coverage.conf | 20 ++++++++ .../benchmarks/multicore/idle_adc/src/main.c | 12 ++++- .../sysbuild/nrf54h20dk_nrf54h20_cpurad.conf | 1 - .../multicore/idle_adc/testcase.yaml | 21 ++++++++- .../multicore/idle_comp/Kconfig.sysbuild | 3 +- .../multicore/idle_comp/coverage.conf | 20 ++++++++ .../benchmarks/multicore/idle_comp/src/main.c | 13 +++++- .../sysbuild/nrf54h20dk_nrf54h20_cpurad.conf | 1 - .../multicore/idle_comp/testcase.yaml | 23 +++++++++- .../multicore/idle_exmif/coverage.conf | 19 ++++++++ .../multicore/idle_exmif/src/main.c | 14 +++++- .../multicore/idle_exmif/testcase.yaml | 20 +++++++- .../multicore/idle_gpio/coverage.conf | 19 ++++++++ .../multicore/idle_ipc/coverage.conf | 21 +++++++++ .../benchmarks/multicore/idle_ipc/src/main.c | 13 +++++- .../multicore/idle_ipc/testcase.yaml | 19 ++++++++ .../multicore/idle_pwm_led/coverage.conf | 20 ++++++++ .../multicore/idle_pwm_led/src/main.c | 12 ++++- .../multicore/idle_pwm_led/testcase.yaml | 19 ++++++++ .../multicore/idle_pwm_loopback/coverage.conf | 20 ++++++++ .../multicore/idle_pwm_loopback/src/main.c | 14 +++++- .../multicore/idle_pwm_loopback/testcase.yaml | 24 ++++++++++ .../multicore/idle_spim/coverage.conf | 20 ++++++++ tests/benchmarks/multicore/idle_spim/prj.conf | 10 ++-- .../benchmarks/multicore/idle_spim/src/main.c | 12 ++++- .../multicore/idle_spim/testcase.yaml | 19 ++++++++ .../idle_spim_loopback/coverage.conf | 22 +++++++++ .../multicore/idle_spim_loopback/src/main.c | 12 ++++- .../idle_spim_loopback/testcase.yaml | 46 +++++++++++++++++++ .../multicore/idle_twim/Kconfig.sysbuild | 5 +- .../multicore/idle_twim/coverage.conf | 20 ++++++++ .../benchmarks/multicore/idle_twim/src/main.c | 12 ++++- .../sysbuild/nrf54h20dk_nrf54h20_cpurad.conf | 1 - .../multicore/idle_twim/testcase.yaml | 20 +++++++- .../multicore/idle_uarte/coverage.conf | 22 +++++++++ .../multicore/idle_uarte/src/main.c | 12 ++++- .../multicore/idle_uarte/testcase.yaml | 25 ++++++++++ 38 files changed, 579 insertions(+), 30 deletions(-) create mode 100644 tests/benchmarks/multicore/idle_adc/coverage.conf delete mode 100644 tests/benchmarks/multicore/idle_adc/sysbuild/nrf54h20dk_nrf54h20_cpurad.conf create mode 100644 tests/benchmarks/multicore/idle_comp/coverage.conf delete mode 100644 tests/benchmarks/multicore/idle_comp/sysbuild/nrf54h20dk_nrf54h20_cpurad.conf create mode 100644 tests/benchmarks/multicore/idle_exmif/coverage.conf create mode 100644 tests/benchmarks/multicore/idle_gpio/coverage.conf create mode 100644 tests/benchmarks/multicore/idle_ipc/coverage.conf create mode 100644 tests/benchmarks/multicore/idle_pwm_led/coverage.conf create mode 100644 tests/benchmarks/multicore/idle_pwm_loopback/coverage.conf create mode 100644 tests/benchmarks/multicore/idle_spim/coverage.conf create mode 100644 tests/benchmarks/multicore/idle_spim_loopback/coverage.conf create mode 100644 tests/benchmarks/multicore/idle_twim/coverage.conf delete mode 100644 tests/benchmarks/multicore/idle_twim/sysbuild/nrf54h20dk_nrf54h20_cpurad.conf create mode 100644 tests/benchmarks/multicore/idle_uarte/coverage.conf diff --git a/tests/benchmarks/multicore/idle_adc/Kconfig.sysbuild b/tests/benchmarks/multicore/idle_adc/Kconfig.sysbuild index 0898eb292938..a5a29117d87a 100644 --- a/tests/benchmarks/multicore/idle_adc/Kconfig.sysbuild +++ b/tests/benchmarks/multicore/idle_adc/Kconfig.sysbuild @@ -7,4 +7,5 @@ source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" config REMOTE_BOARD - string "The board used for remote target" + string + default "$(BOARD)/nrf54h20/cpurad" if SOC_NRF54H20_CPUAPP diff --git a/tests/benchmarks/multicore/idle_adc/coverage.conf b/tests/benchmarks/multicore/idle_adc/coverage.conf new file mode 100644 index 000000000000..6858cb25fc30 --- /dev/null +++ b/tests/benchmarks/multicore/idle_adc/coverage.conf @@ -0,0 +1,20 @@ +CONFIG_ADC=y +CONFIG_GPIO=y + +CONFIG_PM=y +CONFIG_PM_S2RAM=n +CONFIG_PM_S2RAM_CUSTOM_MARKING=n +CONFIG_PM_DEVICE=y +CONFIG_PM_DEVICE_RUNTIME=y +CONFIG_POWEROFF=y + +CONFIG_BOOT_BANNER=n +CONFIG_ASSERT=n +CONFIG_CLOCK_CONTROL=n + +CONFIG_PRINTK=y +CONFIG_LOG=n +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y + +CONFIG_LOG_BUFFER_SIZE=16384 diff --git a/tests/benchmarks/multicore/idle_adc/src/main.c b/tests/benchmarks/multicore/idle_adc/src/main.c index 51a54a333562..00e48cd58e0d 100644 --- a/tests/benchmarks/multicore/idle_adc/src/main.c +++ b/tests/benchmarks/multicore/idle_adc/src/main.c @@ -30,6 +30,7 @@ int main(void) int err; uint16_t channel_reading[5]; int16_t sample_value; + int test_repetitions = 3; /* Options for the sequence sampling. */ const struct adc_sequence_options options = { @@ -51,7 +52,13 @@ int main(void) err = adc_setup(); __ASSERT_NO_MSG(err == 0); - while (1) { +#if defined(CONFIG_COVERAGE) + printk("Coverage analysis enabled\n"); + while (test_repetitions--) +#else + while (test_repetitions) +#endif + { gpio_pin_set_dt(&gpio, 1); err = adc_read(adc, &sequence); sample_value = channel_reading[0]; @@ -63,5 +70,8 @@ int main(void) __ASSERT_NO_MSG(sample_value == ADC_LOW_LEVEL); k_sleep(K_SECONDS(1)); } +#if defined(CONFIG_COVERAGE) + printk("Coverage analysis start\n"); +#endif return 0; } diff --git a/tests/benchmarks/multicore/idle_adc/sysbuild/nrf54h20dk_nrf54h20_cpurad.conf b/tests/benchmarks/multicore/idle_adc/sysbuild/nrf54h20dk_nrf54h20_cpurad.conf deleted file mode 100644 index dd863e78d993..000000000000 --- a/tests/benchmarks/multicore/idle_adc/sysbuild/nrf54h20dk_nrf54h20_cpurad.conf +++ /dev/null @@ -1 +0,0 @@ -SB_CONFIG_REMOTE_BOARD="nrf54h20dk/nrf54h20/cpurad" diff --git a/tests/benchmarks/multicore/idle_adc/testcase.yaml b/tests/benchmarks/multicore/idle_adc/testcase.yaml index ba9da8d20598..167cb7a429f9 100644 --- a/tests/benchmarks/multicore/idle_adc/testcase.yaml +++ b/tests/benchmarks/multicore/idle_adc/testcase.yaml @@ -6,8 +6,10 @@ common: - ci_tests_benchmarks_multicore - adc - ppk_power_measure + tests: benchmarks.multicore.idle_adc.nrf54h20dk_cpuapp_cpurad.s2ram: + filter: not CONFIG_COVERAGE harness: pytest platform_allow: - nrf54h20dk/nrf54h20/cpuapp @@ -15,8 +17,25 @@ tests: - nrf54h20dk/nrf54h20/cpuapp extra_args: - FILE_SUFFIX=s2ram - - SB_CONF_FILE=sysbuild/nrf54h20dk_nrf54h20_cpurad.conf harness_config: fixture: gpio_loopback pytest_root: - "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_power_consumption_adc" + + benchmarks.multicore.idle_adc.nrf54h20dk_cpuapp_cpurad.coverage: + filter: CONFIG_COVERAGE + platform_allow: + - nrf54h20dk/nrf54h20/cpuapp + integration_platforms: + - nrf54h20dk/nrf54h20/cpuapp + extra_args: + - CONF_FILE=coverage.conf + - SHIELD=coverage_support + harness: console + harness_config: + fixture: gpio_loopback + type: multi_line + ordered: true + regex: + - ".*Coverage analysis enabled.*" + - ".*Coverage analysis start.*" diff --git a/tests/benchmarks/multicore/idle_comp/Kconfig.sysbuild b/tests/benchmarks/multicore/idle_comp/Kconfig.sysbuild index 0898eb292938..a5a29117d87a 100644 --- a/tests/benchmarks/multicore/idle_comp/Kconfig.sysbuild +++ b/tests/benchmarks/multicore/idle_comp/Kconfig.sysbuild @@ -7,4 +7,5 @@ source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" config REMOTE_BOARD - string "The board used for remote target" + string + default "$(BOARD)/nrf54h20/cpurad" if SOC_NRF54H20_CPUAPP diff --git a/tests/benchmarks/multicore/idle_comp/coverage.conf b/tests/benchmarks/multicore/idle_comp/coverage.conf new file mode 100644 index 000000000000..ab22cc9cbea7 --- /dev/null +++ b/tests/benchmarks/multicore/idle_comp/coverage.conf @@ -0,0 +1,20 @@ +CONFIG_COMPARATOR=y +CONFIG_GPIO=y + +CONFIG_PM=y +CONFIG_PM_S2RAM=n +CONFIG_PM_S2RAM_CUSTOM_MARKING=n +CONFIG_PM_DEVICE=y +CONFIG_PM_DEVICE_RUNTIME=y +CONFIG_POWEROFF=y + +CONFIG_BOOT_BANNER=n +CONFIG_ASSERT=n +CONFIG_CLOCK_CONTROL=n + +CONFIG_PRINTK=y +CONFIG_LOG=n +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y + +CONFIG_LOG_BUFFER_SIZE=16384 diff --git a/tests/benchmarks/multicore/idle_comp/src/main.c b/tests/benchmarks/multicore/idle_comp/src/main.c index ed362444158a..c496d8b26041 100644 --- a/tests/benchmarks/multicore/idle_comp/src/main.c +++ b/tests/benchmarks/multicore/idle_comp/src/main.c @@ -22,6 +22,7 @@ int main(void) { int rc; + int test_repetitions = 3; gpio_pin_configure_dt(&test_pin, GPIO_OUTPUT_INACTIVE); @@ -34,7 +35,13 @@ int main(void) rc = comparator_set_trigger(test_dev, COMPARATOR_TRIGGER_BOTH_EDGES); __ASSERT_NO_MSG(rc == 0); - while (1) { +#if defined(CONFIG_COVERAGE) + printk("Coverage analysis enabled\n"); + while (test_repetitions--) +#else + while (test_repetitions) +#endif + { counter = 0; k_msleep(200); gpio_pin_set_dt(&test_pin, 1); @@ -49,5 +56,9 @@ int main(void) pm_device_runtime_get(test_dev); k_msleep(1); } + +#if defined(CONFIG_COVERAGE) + printk("Coverage analysis start\n"); +#endif return 0; } diff --git a/tests/benchmarks/multicore/idle_comp/sysbuild/nrf54h20dk_nrf54h20_cpurad.conf b/tests/benchmarks/multicore/idle_comp/sysbuild/nrf54h20dk_nrf54h20_cpurad.conf deleted file mode 100644 index dd863e78d993..000000000000 --- a/tests/benchmarks/multicore/idle_comp/sysbuild/nrf54h20dk_nrf54h20_cpurad.conf +++ /dev/null @@ -1 +0,0 @@ -SB_CONFIG_REMOTE_BOARD="nrf54h20dk/nrf54h20/cpurad" diff --git a/tests/benchmarks/multicore/idle_comp/testcase.yaml b/tests/benchmarks/multicore/idle_comp/testcase.yaml index 4a73550d0b8b..d9ea18a2d5d6 100644 --- a/tests/benchmarks/multicore/idle_comp/testcase.yaml +++ b/tests/benchmarks/multicore/idle_comp/testcase.yaml @@ -6,6 +6,7 @@ common: - ppk_power_measure tests: benchmarks.multicore.idle_comp.nrf54h20dk_cpuapp_cpurad.s2ram: + filter: not CONFIG_COVERAGE harness: pytest platform_allow: - nrf54h20dk/nrf54h20/cpuapp @@ -13,7 +14,6 @@ tests: - nrf54h20dk/nrf54h20/cpuapp extra_args: - FILE_SUFFIX=s2ram - - SB_CONF_FILE=sysbuild/nrf54h20dk_nrf54h20_cpurad.conf - EXTRA_DTC_OVERLAY_FILE="boards/comp.overlay" harness_config: fixture: gpio_loopback @@ -21,6 +21,7 @@ tests: - "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_power_consumption_comp" benchmarks.multicore.idle_lpcomp.nrf54h20dk_cpuapp_cpurad.s2ram: + filter: not CONFIG_COVERAGE harness: pytest platform_allow: - nrf54h20dk/nrf54h20/cpuapp @@ -28,9 +29,27 @@ tests: - nrf54h20dk/nrf54h20/cpuapp extra_args: - FILE_SUFFIX=s2ram - - SB_CONF_FILE=sysbuild/nrf54h20dk_nrf54h20_cpurad.conf - EXTRA_DTC_OVERLAY_FILE="boards/lpcomp.overlay" harness_config: fixture: gpio_loopback pytest_root: - "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_power_consumption_lpcomp" + + benchmarks.multicore.idle_lpcomp.nrf54h20dk_cpuapp_cpurad.coverage: + filter: CONFIG_COVERAGE + platform_allow: + - nrf54h20dk/nrf54h20/cpuapp + integration_platforms: + - nrf54h20dk/nrf54h20/cpuapp + extra_args: + - EXTRA_DTC_OVERLAY_FILE="boards/lpcomp.overlay" + - CONF_FILE=coverage.conf + - SHIELD=coverage_support + harness: console + harness_config: + fixture: gpio_loopback + type: multi_line + ordered: true + regex: + - ".*Coverage analysis enabled.*" + - ".*Coverage analysis start.*" diff --git a/tests/benchmarks/multicore/idle_exmif/coverage.conf b/tests/benchmarks/multicore/idle_exmif/coverage.conf new file mode 100644 index 000000000000..ebc7b1b52258 --- /dev/null +++ b/tests/benchmarks/multicore/idle_exmif/coverage.conf @@ -0,0 +1,19 @@ +CONFIG_MSPI=y + +CONFIG_PM=y +CONFIG_PM_S2RAM=n +CONFIG_PM_S2RAM_CUSTOM_MARKING=n +CONFIG_PM_DEVICE=y +CONFIG_PM_DEVICE_RUNTIME=y +CONFIG_POWEROFF=y + +CONFIG_BOOT_BANNER=n +CONFIG_ASSERT=n +CONFIG_CLOCK_CONTROL=n + +CONFIG_PRINTK=y +CONFIG_LOG=n +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y + +CONFIG_LOG_BUFFER_SIZE=16384 diff --git a/tests/benchmarks/multicore/idle_exmif/src/main.c b/tests/benchmarks/multicore/idle_exmif/src/main.c index 8a08392b73d4..6c14e41b8eb7 100644 --- a/tests/benchmarks/multicore/idle_exmif/src/main.c +++ b/tests/benchmarks/multicore/idle_exmif/src/main.c @@ -160,6 +160,7 @@ static void configure_exmif_for_test(const struct device *controller, struct msp int main(void) { int ret; + int test_repetitions = 3; printk("Multicore idle exmif test on %s\n", CONFIG_BOARD_TARGET); k_msleep(10); @@ -172,9 +173,15 @@ int main(void) __ASSERT_NO_MSG(ret == 0); configure_exmif_for_test(controller, &dev_id); - k_msleep(500); - while (1) { + +#if defined(CONFIG_COVERAGE) + printk("Coverage analysis enabled\n"); + while (test_repetitions--) +#else + while (test_repetitions) +#endif + { printk("Wake up\n"); for (int counter = 0; counter < NUMBER_OF_TEST_READS; counter++) { read_jedec_id(controller, &dev_id); @@ -186,5 +193,8 @@ int main(void) gpio_pin_set_dt(&led, 1); } +#if defined(CONFIG_COVERAGE) + printk("Coverage analysis start\n"); +#endif return 0; } diff --git a/tests/benchmarks/multicore/idle_exmif/testcase.yaml b/tests/benchmarks/multicore/idle_exmif/testcase.yaml index 9bcb5e7ca3e7..ea8dc23a24cc 100644 --- a/tests/benchmarks/multicore/idle_exmif/testcase.yaml +++ b/tests/benchmarks/multicore/idle_exmif/testcase.yaml @@ -1,7 +1,6 @@ common: sysbuild: true depends_on: gpio - harness: pytest tags: - ci_build - ci_tests_benchmarks_multicore @@ -10,11 +9,30 @@ common: tests: benchmarks.multicore.idle_exmif.nrf54h20dk_cpuapp_cpurad: + filter: not CONFIG_COVERAGE platform_allow: - nrf54h20dk/nrf54h20/cpuapp integration_platforms: - nrf54h20dk/nrf54h20/cpuapp + harness: pytest harness_config: fixture: ppk_power_measure pytest_root: - "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_exmif_and_s2ram" + + benchmarks.multicore.idle_exmif.nrf54h20dk_cpuapp_cpurad.coverage: + filter: CONFIG_COVERAGE + platform_allow: + - nrf54h20dk/nrf54h20/cpuapp + integration_platforms: + - nrf54h20dk/nrf54h20/cpuapp + extra_args: + - CONF_FILE=coverage.conf + - SHIELD=coverage_support + harness: console + harness_config: + type: multi_line + ordered: true + regex: + - ".*Coverage analysis enabled.*" + - ".*Coverage analysis start.*" diff --git a/tests/benchmarks/multicore/idle_gpio/coverage.conf b/tests/benchmarks/multicore/idle_gpio/coverage.conf new file mode 100644 index 000000000000..96c13f0a084c --- /dev/null +++ b/tests/benchmarks/multicore/idle_gpio/coverage.conf @@ -0,0 +1,19 @@ +CONFIG_GPIO=y + +CONFIG_PM=y +CONFIG_PM_S2RAM=n +CONFIG_PM_S2RAM_CUSTOM_MARKING=n +CONFIG_PM_DEVICE=y +CONFIG_PM_DEVICE_RUNTIME=y +CONFIG_POWEROFF=y + +CONFIG_BOOT_BANNER=n +CONFIG_ASSERT=n +CONFIG_CLOCK_CONTROL=n + +CONFIG_PRINTK=y +CONFIG_LOG=n +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y + +CONFIG_LOG_BUFFER_SIZE=16384 diff --git a/tests/benchmarks/multicore/idle_ipc/coverage.conf b/tests/benchmarks/multicore/idle_ipc/coverage.conf new file mode 100644 index 000000000000..df749bf2f829 --- /dev/null +++ b/tests/benchmarks/multicore/idle_ipc/coverage.conf @@ -0,0 +1,21 @@ +CONFIG_HEAP_MEM_POOL_SIZE=4096 +CONFIG_MBOX=y +CONFIG_IPC_SERVICE=y + +CONFIG_PM=y +CONFIG_PM_S2RAM=n +CONFIG_PM_S2RAM_CUSTOM_MARKING=n +CONFIG_PM_DEVICE=y +CONFIG_PM_DEVICE_RUNTIME=y +CONFIG_POWEROFF=y + +CONFIG_BOOT_BANNER=n +CONFIG_ASSERT=n +CONFIG_CLOCK_CONTROL=n + +CONFIG_PRINTK=y +CONFIG_LOG=n +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y + +CONFIG_LOG_BUFFER_SIZE=16384 diff --git a/tests/benchmarks/multicore/idle_ipc/src/main.c b/tests/benchmarks/multicore/idle_ipc/src/main.c index 4d8166df4aa0..d7cc45307852 100644 --- a/tests/benchmarks/multicore/idle_ipc/src/main.c +++ b/tests/benchmarks/multicore/idle_ipc/src/main.c @@ -72,6 +72,7 @@ int main(void) int ret; unsigned long last_cnt = 0; unsigned long delta = 0; + int test_repetitions = 3; p_payload = (struct payload *)k_malloc(CONFIG_APP_IPC_SERVICE_MESSAGE_LEN); if (!p_payload) { @@ -112,8 +113,13 @@ int main(void) } k_msleep(CONFIG_TEST_START_DELAY_MS); - while (true) { - +#if defined(CONFIG_COVERAGE) + printk("Coverage analysis enabled\n"); + while (test_repetitions--) +#else + while (test_repetitions) +#endif + { printk("Hello\n"); printk("Send data over IPC\n"); @@ -140,5 +146,8 @@ int main(void) k_msleep(CONFIG_SLEEP_TIME_MS); } +#if defined(CONFIG_COVERAGE) + printk("Coverage analysis start\n"); +#endif return 0; } diff --git a/tests/benchmarks/multicore/idle_ipc/testcase.yaml b/tests/benchmarks/multicore/idle_ipc/testcase.yaml index 8c4dd48dd991..b9943cbde9ce 100644 --- a/tests/benchmarks/multicore/idle_ipc/testcase.yaml +++ b/tests/benchmarks/multicore/idle_ipc/testcase.yaml @@ -7,6 +7,7 @@ common: - ppk_power_measure tests: benchmarks.multicore.idle_ipc.nrf54h20dk_cpuapp_cpurad.s2ram: + filter: not CONFIG_COVERAGE harness: pytest platform_allow: - nrf54h20dk/nrf54h20/cpuapp @@ -18,6 +19,7 @@ tests: - "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_power_consumption_ipc" benchmarks.multicore.idle_ipc.shifted.nrf54h20dk_cpuapp_cpurad.s2ram: + filter: not CONFIG_COVERAGE harness: pytest platform_allow: - nrf54h20dk/nrf54h20/cpuapp @@ -29,3 +31,20 @@ tests: fixture: ppk_power_measure pytest_root: - "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_power_consumption_ipc" + + benchmarks.multicore.idle_ipc.shifted.nrf54h20dk_cpuapp_cpurad.coverage: + filter: CONFIG_COVERAGE + platform_allow: + - nrf54h20dk/nrf54h20/cpuapp + integration_platforms: + - nrf54h20dk/nrf54h20/cpuapp + extra_args: + - CONF_FILE=coverage.conf + - SHIELD=coverage_support + harness: console + harness_config: + type: multi_line + ordered: true + regex: + - ".*Coverage analysis enabled.*" + - ".*Coverage analysis start.*" diff --git a/tests/benchmarks/multicore/idle_pwm_led/coverage.conf b/tests/benchmarks/multicore/idle_pwm_led/coverage.conf new file mode 100644 index 000000000000..67d5547792e8 --- /dev/null +++ b/tests/benchmarks/multicore/idle_pwm_led/coverage.conf @@ -0,0 +1,20 @@ +CONFIG_PWM=y +CONFIG_GPIO=y + +CONFIG_PM=y +CONFIG_PM_S2RAM=n +CONFIG_PM_S2RAM_CUSTOM_MARKING=n +CONFIG_PM_DEVICE=y +CONFIG_PM_DEVICE_RUNTIME=y +CONFIG_POWEROFF=y + +CONFIG_BOOT_BANNER=n +CONFIG_ASSERT=n +CONFIG_CLOCK_CONTROL=n + +CONFIG_PRINTK=y +CONFIG_LOG=n +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y + +CONFIG_LOG_BUFFER_SIZE=16384 diff --git a/tests/benchmarks/multicore/idle_pwm_led/src/main.c b/tests/benchmarks/multicore/idle_pwm_led/src/main.c index 9066c1b20cdd..b8cf6aa7b731 100644 --- a/tests/benchmarks/multicore/idle_pwm_led/src/main.c +++ b/tests/benchmarks/multicore/idle_pwm_led/src/main.c @@ -29,6 +29,7 @@ int main(void) uint32_t pulse_max; int32_t pulse_step; uint32_t current_pulse_width; + int test_repetitions = 3; if (!gpio_is_ready_dt(&led)) { LOG_ERR("GPIO Device not ready"); @@ -75,7 +76,13 @@ int main(void) pm_device_runtime_enable(pwm_led.dev); #endif - while (1) { +#if defined(CONFIG_COVERAGE) + printk("Coverage analysis enabled\n"); + while (test_repetitions--) +#else + while (test_repetitions) +#endif + { LOG_INF("Multicore idle_pwm_led test iteration %u", cnt++); #if defined(CONFIG_PM_DEVICE_RUNTIME) @@ -120,5 +127,8 @@ int main(void) gpio_pin_set_dt(&led, 1); } +#if defined(CONFIG_COVERAGE) + printk("Coverage analysis start\n"); +#endif return 0; } diff --git a/tests/benchmarks/multicore/idle_pwm_led/testcase.yaml b/tests/benchmarks/multicore/idle_pwm_led/testcase.yaml index 0b2b6d8bbf22..3167ad5a7985 100644 --- a/tests/benchmarks/multicore/idle_pwm_led/testcase.yaml +++ b/tests/benchmarks/multicore/idle_pwm_led/testcase.yaml @@ -10,6 +10,7 @@ common: tests: benchmarks.multicore.idle_pwm_led.nrf54h20dk_cpuapp_cpurad.no_sleep: + filter: not CONFIG_COVERAGE harness: console harness_config: type: multi_line @@ -20,6 +21,7 @@ tests: - "Multicore idle_pwm_led test iteration 1" benchmarks.multicore.idle_pwm_led.nrf54h20dk_cpuapp_cpurad.idle: + filter: not CONFIG_COVERAGE tags: ppk_power_measure extra_args: - idle_pwm_led_CONF_FILE=prj_s2ram.conf @@ -33,6 +35,7 @@ tests: - "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_pwm_and_idle" benchmarks.multicore.idle_pwm_led.nrf54h20dk_cpuapp_cpurad.s2ram: + filter: not CONFIG_COVERAGE tags: ppk_power_measure extra_args: - idle_pwm_led_CONF_FILE=prj_s2ram.conf @@ -43,7 +46,22 @@ tests: pytest_root: - "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_pwm_and_s2ram" + benchmarks.multicore.idle_pwm_led.nrf54h20dk_cpuapp_cpurad.coverage: + filter: CONFIG_COVERAGE + extra_args: + - idle_pwm_led_CONF_FILE=coverage.conf + - SHIELD=coverage_support + harness: console + harness_config: + type: multi_line + ordered: true + regex: + - ".*Coverage analysis enabled.*" + - ".*Coverage analysis start.*" + timeout: 90 + benchmarks.multicore.idle_pwm_led.nrf54h20dk_cpuapp_cpurad.idle_fast: + filter: not CONFIG_COVERAGE tags: ppk_power_measure extra_args: - idle_pwm_led_CONF_FILE=prj_s2ram.conf @@ -58,6 +76,7 @@ tests: - "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_pwm_and_idle" benchmarks.multicore.idle_pwm_led.nrf54h20dk_cpuapp_cpurad.s2ram_fast: + filter: not CONFIG_COVERAGE tags: ppk_power_measure extra_args: - idle_pwm_led_CONF_FILE=prj_s2ram.conf diff --git a/tests/benchmarks/multicore/idle_pwm_loopback/coverage.conf b/tests/benchmarks/multicore/idle_pwm_loopback/coverage.conf new file mode 100644 index 000000000000..67d5547792e8 --- /dev/null +++ b/tests/benchmarks/multicore/idle_pwm_loopback/coverage.conf @@ -0,0 +1,20 @@ +CONFIG_PWM=y +CONFIG_GPIO=y + +CONFIG_PM=y +CONFIG_PM_S2RAM=n +CONFIG_PM_S2RAM_CUSTOM_MARKING=n +CONFIG_PM_DEVICE=y +CONFIG_PM_DEVICE_RUNTIME=y +CONFIG_POWEROFF=y + +CONFIG_BOOT_BANNER=n +CONFIG_ASSERT=n +CONFIG_CLOCK_CONTROL=n + +CONFIG_PRINTK=y +CONFIG_LOG=n +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y + +CONFIG_LOG_BUFFER_SIZE=16384 diff --git a/tests/benchmarks/multicore/idle_pwm_loopback/src/main.c b/tests/benchmarks/multicore/idle_pwm_loopback/src/main.c index 9026639517c1..88c363616af2 100644 --- a/tests/benchmarks/multicore/idle_pwm_loopback/src/main.c +++ b/tests/benchmarks/multicore/idle_pwm_loopback/src/main.c @@ -98,6 +98,7 @@ int main(void) uint32_t edges; uint32_t tolerance; int ret; + int test_repetitions = 3; ret = gpio_is_ready_dt(&led); __ASSERT(ret, "Error: GPIO Device not ready"); @@ -161,8 +162,14 @@ int main(void) k_timer_init(&my_timer, my_timer_handler, NULL); - /* Run test forever */ - while (1) { +#if defined(CONFIG_COVERAGE) + printk("Coverage analysis enabled\n"); + while (test_repetitions--) +#else + /* Run test forever. */ + while (test_repetitions) +#endif + { timer_expired = false; /* clear edge counters */ @@ -241,5 +248,8 @@ int main(void) gpio_pin_set_dt(&led, 1); } +#if defined(CONFIG_COVERAGE) + printk("Coverage analysis start\n"); +#endif return 0; } diff --git a/tests/benchmarks/multicore/idle_pwm_loopback/testcase.yaml b/tests/benchmarks/multicore/idle_pwm_loopback/testcase.yaml index 10fb5796c02c..ac8cb2c895e9 100644 --- a/tests/benchmarks/multicore/idle_pwm_loopback/testcase.yaml +++ b/tests/benchmarks/multicore/idle_pwm_loopback/testcase.yaml @@ -10,6 +10,7 @@ common: tests: benchmarks.multicore.idle_pwm_loopback.nrf54h20dk_cpuapp_cpurad.no_sleep: + filter: not CONFIG_COVERAGE harness: console harness_config: fixture: spi_loopback @@ -21,6 +22,7 @@ tests: - "Iteration 1" benchmarks.multicore.idle_pwm_loopback.nrf54h20dk_cpuapp_cpurad.idle: + filter: not CONFIG_COVERAGE tags: ppk_power_measure extra_args: - idle_pwm_loopback_CONF_FILE=prj_s2ram.conf @@ -34,6 +36,7 @@ tests: - "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_pwm_and_idle" benchmarks.multicore.idle_pwm_loopback.nrf54h20dk_cpuapp_cpurad.s2ram: + filter: not CONFIG_COVERAGE tags: ppk_power_measure extra_args: - idle_pwm_loopback_CONF_FILE=prj_s2ram.conf @@ -44,7 +47,22 @@ tests: pytest_root: - "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_pwm_and_s2ram" + benchmarks.multicore.idle_pwm_loopback.nrf54h20dk_cpuapp_cpurad.coverage: + filter: CONFIG_COVERAGE + extra_args: + - idle_pwm_loopback_CONF_FILE=coverage.conf + - SHIELD=coverage_support + harness: console + harness_config: + fixture: spi_loopback + type: multi_line + ordered: true + regex: + - ".*Coverage analysis enabled.*" + - ".*Coverage analysis start.*" + benchmarks.multicore.idle_pwm_loopback.nrf54h20dk_cpuapp_cpurad.no_sleep_fast: + filter: not CONFIG_COVERAGE extra_args: - idle_pwm_loopback_DTC_OVERLAY_FILE="boards/nrf54h20dk_nrf54h20_cpuapp_fast_p7_1.overlay" harness: console @@ -57,6 +75,7 @@ tests: - "Iteration 1" benchmarks.multicore.idle_pwm_loopback.nrf54h20dk_cpuapp_cpurad.idle_fast: + filter: not CONFIG_COVERAGE tags: ppk_power_measure extra_args: - idle_pwm_loopback_CONF_FILE=prj_s2ram.conf @@ -71,6 +90,7 @@ tests: - "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_pwm_and_idle" benchmarks.multicore.idle_pwm_loopback.nrf54h20dk_cpuapp_cpurad.s2ram_fast.no_clock_control: + filter: not CONFIG_COVERAGE tags: ppk_power_measure extra_args: - idle_pwm_loopback_CONF_FILE=prj_s2ram.conf @@ -83,6 +103,7 @@ tests: - "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_pwm_and_s2ram" benchmarks.multicore.idle_pwm_loopback.nrf54h20dk_cpuapp_cpurad.s2ram_fast.gd_freq_320MHz: + filter: not CONFIG_COVERAGE tags: ppk_power_measure extra_args: - idle_pwm_loopback_CONF_FILE=prj_s2ram.conf @@ -97,6 +118,7 @@ tests: - "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_pwm_and_s2ram_with_clock_control" benchmarks.multicore.idle_pwm_loopback.nrf54h20dk_cpuapp_cpurad.s2ram_fast.gd_freq_256MHz: + filter: not CONFIG_COVERAGE tags: ppk_power_measure extra_args: - idle_pwm_loopback_CONF_FILE=prj_s2ram.conf @@ -111,6 +133,7 @@ tests: - "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_pwm_and_s2ram_with_clock_control" benchmarks.multicore.idle_pwm_loopback.nrf54h20dk_cpuapp_cpurad.s2ram_fast.gd_freq_128MHz: + filter: not CONFIG_COVERAGE tags: ppk_power_measure extra_args: - idle_pwm_loopback_CONF_FILE=prj_s2ram.conf @@ -125,6 +148,7 @@ tests: - "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_pwm_and_s2ram_with_clock_control" benchmarks.multicore.idle_pwm_loopback.nrf54h20dk_cpuapp_cpurad.s2ram_fast.gd_freq_64MHz: + filter: not CONFIG_COVERAGE tags: ppk_power_measure extra_args: - idle_pwm_loopback_CONF_FILE=prj_s2ram.conf diff --git a/tests/benchmarks/multicore/idle_spim/coverage.conf b/tests/benchmarks/multicore/idle_spim/coverage.conf new file mode 100644 index 000000000000..6f07906e4b20 --- /dev/null +++ b/tests/benchmarks/multicore/idle_spim/coverage.conf @@ -0,0 +1,20 @@ +CONFIG_SPI=y +CONFIG_GPIO=y + +CONFIG_PM=y +CONFIG_PM_S2RAM=n +CONFIG_PM_S2RAM_CUSTOM_MARKING=n +CONFIG_PM_DEVICE=y +CONFIG_PM_DEVICE_RUNTIME=y +CONFIG_POWEROFF=y + +CONFIG_BOOT_BANNER=n +CONFIG_ASSERT=n +CONFIG_CLOCK_CONTROL=n + +CONFIG_PRINTK=y +CONFIG_LOG=n +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y + +CONFIG_LOG_BUFFER_SIZE=16384 diff --git a/tests/benchmarks/multicore/idle_spim/prj.conf b/tests/benchmarks/multicore/idle_spim/prj.conf index a87c9c9481f6..c04945c95c94 100644 --- a/tests/benchmarks/multicore/idle_spim/prj.conf +++ b/tests/benchmarks/multicore/idle_spim/prj.conf @@ -12,8 +12,8 @@ CONFIG_BOOT_BANNER=n CONFIG_ASSERT=y # Enable for debugging purposes only -CONFIG_PRINTK=n -CONFIG_LOG=n -CONFIG_CONSOLE=n -CONFIG_UART_CONSOLE=n -CONFIG_SERIAL=n +CONFIG_PRINTK=y +CONFIG_LOG=y +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y +CONFIG_SERIAL=y diff --git a/tests/benchmarks/multicore/idle_spim/src/main.c b/tests/benchmarks/multicore/idle_spim/src/main.c index cbd1b910e4a0..d0ccac81f8b3 100644 --- a/tests/benchmarks/multicore/idle_spim/src/main.c +++ b/tests/benchmarks/multicore/idle_spim/src/main.c @@ -44,6 +44,7 @@ int main(void) { bool status; uint8_t response; + int test_repetitions = 3; status = gpio_is_ready_dt(&led); __ASSERT(status, "Error: GPIO Device not ready"); @@ -54,7 +55,13 @@ int main(void) status = spi_is_ready_dt(&spim_spec); __ASSERT(status, "Error: SPI device is not ready"); - while (1) { +#if defined(CONFIG_COVERAGE) + printk("Coverage analysis enabled\n"); + while (test_repetitions--) +#else + while (test_repetitions) +#endif + { for (int read_index = 0; read_index < SPI_READ_COUNT; read_index++) { spi_read_register(CHIP_ID_REGISTER_ADDRESS, &response); printk("Chip ID: 0x%x\n", response); @@ -64,5 +71,8 @@ int main(void) gpio_pin_set_dt(&led, 1); } +#if defined(CONFIG_COVERAGE) + printk("Coverage analysis start\n"); +#endif return 0; } diff --git a/tests/benchmarks/multicore/idle_spim/testcase.yaml b/tests/benchmarks/multicore/idle_spim/testcase.yaml index 360e6aaeb4a4..70efc7d2e4a5 100644 --- a/tests/benchmarks/multicore/idle_spim/testcase.yaml +++ b/tests/benchmarks/multicore/idle_spim/testcase.yaml @@ -8,6 +8,7 @@ common: - ppk_power_measure tests: benchmarks.multicore.idle_spim.nrf54h20dk_cpuapp_cpurad.s2ram: + filter: not CONFIG_COVERAGE harness: pytest platform_allow: - nrf54h20dk/nrf54h20/cpuapp @@ -19,3 +20,21 @@ tests: fixture: pca63566 pytest_root: - "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_power_consumption_spim" + + benchmarks.multicore.idle_spim.nrf54h20dk_cpuapp_cpurad.coverge: + filter: CONFIG_COVERAGE + platform_allow: + - nrf54h20dk/nrf54h20/cpuapp + integration_platforms: + - nrf54h20dk/nrf54h20/cpuapp + extra_args: + - SHIELD=pca63566;coverage_support + - CONF_FILE=coverage.conf + harness: console + harness_config: + fixture: pca63566 + type: multi_line + ordered: true + regex: + - ".*Coverage analysis enabled.*" + - ".*Coverage analysis start.*" diff --git a/tests/benchmarks/multicore/idle_spim_loopback/coverage.conf b/tests/benchmarks/multicore/idle_spim_loopback/coverage.conf new file mode 100644 index 000000000000..7bfe8b33032e --- /dev/null +++ b/tests/benchmarks/multicore/idle_spim_loopback/coverage.conf @@ -0,0 +1,22 @@ +CONFIG_SPI=y +CONFIG_GPIO=y + +CONFIG_NRF_REGTOOL_VERBOSITY=1 + +CONFIG_PM=y +CONFIG_PM_S2RAM=n +CONFIG_PM_S2RAM_CUSTOM_MARKING=n +CONFIG_PM_DEVICE=y +CONFIG_PM_DEVICE_RUNTIME=y +CONFIG_POWEROFF=y + +CONFIG_BOOT_BANNER=n +CONFIG_ASSERT=n +CONFIG_CLOCK_CONTROL=n + +CONFIG_PRINTK=y +CONFIG_LOG=n +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y + +CONFIG_LOG_BUFFER_SIZE=16384 diff --git a/tests/benchmarks/multicore/idle_spim_loopback/src/main.c b/tests/benchmarks/multicore/idle_spim_loopback/src/main.c index 935ef06880b4..fbefe5df6779 100644 --- a/tests/benchmarks/multicore/idle_spim_loopback/src/main.c +++ b/tests/benchmarks/multicore/idle_spim_loopback/src/main.c @@ -113,6 +113,7 @@ int main(void) int counter = 0; uint8_t acc = 0; bool test_pass; + int test_repetitions = 3; /* SPI buffer sets */ struct spi_buf tx_spi_buf = { @@ -187,8 +188,14 @@ int main(void) k_timer_init(&my_timer, my_timer_handler, NULL); +#if defined(CONFIG_COVERAGE) + printk("Coverage analysis enabled\n"); + while (test_repetitions--) +#else /* Run test forever. */ - while (1) { + while (test_repetitions) +#endif + { test_pass = true; timer_expired = false; @@ -338,5 +345,8 @@ int main(void) gpio_pin_set_dt(&led, 1); } +#if defined(CONFIG_COVERAGE) + printk("Coverage analysis start\n"); +#endif return 0; } diff --git a/tests/benchmarks/multicore/idle_spim_loopback/testcase.yaml b/tests/benchmarks/multicore/idle_spim_loopback/testcase.yaml index 20c1952b4af9..732e39c5cf88 100644 --- a/tests/benchmarks/multicore/idle_spim_loopback/testcase.yaml +++ b/tests/benchmarks/multicore/idle_spim_loopback/testcase.yaml @@ -16,6 +16,7 @@ tests: # benchmarks.multicore.idle_spim_loopback.4_bytes.no_sleep: + filter: not CONFIG_COVERAGE harness: console harness_config: fixture: spi_loopback @@ -28,6 +29,7 @@ tests: - ".*Run 1 - PASS" benchmarks.multicore.idle_spim_loopback.4_bytes.idle: + filter: not CONFIG_COVERAGE tags: ppk_power_measure extra_args: - idle_spim_loopback_CONF_FILE=prj_s2ram.conf @@ -39,6 +41,7 @@ tests: - "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_spim_and_idle" benchmarks.multicore.idle_spim_loopback.4_bytes.s2ram: + filter: not CONFIG_COVERAGE tags: ppk_power_measure extra_args: idle_spim_loopback_CONF_FILE=prj_s2ram.conf harness: pytest @@ -47,7 +50,22 @@ tests: pytest_root: - "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_spim_and_s2ram" + benchmarks.multicore.idle_spim_loopback.coverage: + filter: CONFIG_COVERAGE + extra_args: + - SHIELD=coverage_support + - CONF_FILE=coverage.conf + harness: console + harness_config: + fixture: spi_loopback + type: multi_line + ordered: true + regex: + - ".*Coverage analysis enabled.*" + - ".*Coverage analysis start.*" + benchmarks.multicore.idle_spim_loopback.4_bytes.no_sleep_fast: + filter: not CONFIG_COVERAGE extra_args: - idle_spim_loopback_DTC_OVERLAY_FILE="boards/nrf54h20dk_nrf54h20_cpuapp_fast.overlay" harness: console @@ -62,6 +80,7 @@ tests: - ".*Run 1 - PASS" benchmarks.multicore.idle_spim_loopback.4_bytes.idle_fast: + filter: not CONFIG_COVERAGE tags: ppk_power_measure extra_args: - idle_spim_loopback_CONF_FILE=prj_s2ram.conf @@ -74,6 +93,7 @@ tests: - "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_spim_and_idle" benchmarks.multicore.idle_spim_loopback.4_bytes.s2ram_fast: + filter: not CONFIG_COVERAGE tags: ppk_power_measure extra_args: - idle_spim_loopback_CONF_FILE=prj_s2ram.conf @@ -85,6 +105,7 @@ tests: - "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_spim_and_s2ram" benchmarks.multicore.idle_spim_loopback.4_bytes.gd_freq_256MHz.s2ram_fast: + filter: not CONFIG_COVERAGE tags: ppk_power_measure extra_args: - idle_spim_loopback_CONF_FILE=prj_s2ram.conf @@ -98,6 +119,7 @@ tests: - "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_spim_and_s2ram" benchmarks.multicore.idle_spim_loopback.4_bytes.gd_freq_128MHz.s2ram_fast: + filter: not CONFIG_COVERAGE tags: ppk_power_measure extra_args: - idle_spim_loopback_CONF_FILE=prj_s2ram.conf @@ -111,6 +133,7 @@ tests: - "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_spim_and_s2ram" benchmarks.multicore.idle_spim_loopback.4_bytes.gd_freq_64MHz.s2ram_fast: + filter: not CONFIG_COVERAGE tags: ppk_power_measure extra_args: - idle_spim_loopback_CONF_FILE=prj_s2ram.conf @@ -128,6 +151,7 @@ tests: # benchmarks.multicore.idle_spim_loopback.16_bytes.no_sleep: + filter: not CONFIG_COVERAGE extra_args: idle_spim_loopback_CONFIG_DATA_FIELD=16 harness: console harness_config: @@ -141,6 +165,7 @@ tests: - ".*Run 1 - PASS" benchmarks.multicore.idle_spim_loopback.16_bytes.idle: + filter: not CONFIG_COVERAGE tags: ppk_power_measure extra_args: - idle_spim_loopback_CONF_FILE=prj_s2ram.conf @@ -153,6 +178,7 @@ tests: - "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_spim_and_idle" benchmarks.multicore.idle_spim_loopback.16_bytes.s2ram: + filter: not CONFIG_COVERAGE tags: ppk_power_measure extra_args: - idle_spim_loopback_CONF_FILE=prj_s2ram.conf @@ -164,6 +190,7 @@ tests: - "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_spim_and_s2ram" benchmarks.multicore.idle_spim_loopback.16_bytes.no_sleep_fast: + filter: not CONFIG_COVERAGE extra_args: - idle_spim_loopback_DTC_OVERLAY_FILE="boards/nrf54h20dk_nrf54h20_cpuapp_fast.overlay" - idle_spim_loopback_CONFIG_DATA_FIELD=16 @@ -179,6 +206,7 @@ tests: - ".*Run 1 - PASS" benchmarks.multicore.idle_spim_loopback.16_bytes.idle_fast: + filter: not CONFIG_COVERAGE tags: ppk_power_measure extra_args: - idle_spim_loopback_CONF_FILE=prj_s2ram.conf @@ -192,6 +220,7 @@ tests: - "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_spim_and_idle" benchmarks.multicore.idle_spim_loopback.16_bytes.s2ram_fast: + filter: not CONFIG_COVERAGE tags: ppk_power_measure extra_args: - idle_spim_loopback_CONF_FILE=prj_s2ram.conf @@ -204,6 +233,7 @@ tests: - "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_spim_and_s2ram" benchmarks.multicore.idle_spim_loopback.16_bytes.gd_freq_256MHz.s2ram_fast: + filter: not CONFIG_COVERAGE tags: ppk_power_measure extra_args: - idle_spim_loopback_CONF_FILE=prj_s2ram.conf @@ -218,6 +248,7 @@ tests: - "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_spim_and_s2ram" benchmarks.multicore.idle_spim_loopback.16_bytes.gd_freq_128MHz.s2ram_fast: + filter: not CONFIG_COVERAGE tags: ppk_power_measure extra_args: - idle_spim_loopback_CONF_FILE=prj_s2ram.conf @@ -232,6 +263,7 @@ tests: - "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_spim_and_s2ram" benchmarks.multicore.idle_spim_loopback.16_bytes.gd_freq_64MHz.s2ram_fast: + filter: not CONFIG_COVERAGE tags: ppk_power_measure extra_args: - idle_spim_loopback_CONF_FILE=prj_s2ram.conf @@ -250,6 +282,7 @@ tests: # benchmarks.multicore.idle_spim_loopback.4_bytes_cs_lock.s2ram_fast: + filter: not CONFIG_COVERAGE tags: ppk_power_measure extra_args: - idle_spim_loopback_CONFIG_TEST_SPI_HOLD_ON_CS=y @@ -266,6 +299,7 @@ tests: # benchmarks.multicore.idle_spim_loopback.4_bytes_spi_lock.s2ram_fast: + filter: not CONFIG_COVERAGE tags: ppk_power_measure extra_args: - idle_spim_loopback_CONFIG_TEST_SPI_LOCK_ON=y @@ -282,6 +316,7 @@ tests: # benchmarks.multicore.idle_spim_loopback.4_bytes_cs_and_spi_lock.no_sleep: + filter: not CONFIG_COVERAGE extra_args: - idle_spim_loopback_CONFIG_TEST_SPI_HOLD_ON_CS=y - idle_spim_loopback_CONFIG_TEST_SPI_LOCK_ON=y @@ -299,6 +334,7 @@ tests: - ".*Run 1 - PASS" benchmarks.multicore.idle_spim_loopback.4_bytes_cs_and_spi_lock.idle: + filter: not CONFIG_COVERAGE tags: ppk_power_measure extra_args: - idle_spim_loopback_CONFIG_TEST_SPI_HOLD_ON_CS=y @@ -312,6 +348,7 @@ tests: - "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_spim_and_idle" benchmarks.multicore.idle_spim_loopback.4_bytes_cs_and_spi_lock.s2ram: + filter: not CONFIG_COVERAGE tags: ppk_power_measure extra_args: - idle_spim_loopback_CONFIG_TEST_SPI_HOLD_ON_CS=y @@ -324,6 +361,7 @@ tests: - "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_spim_and_s2ram" benchmarks.multicore.idle_spim_loopback.4_bytes_cs_and_spi_lock.no_sleep_fast: + filter: not CONFIG_COVERAGE extra_args: - idle_spim_loopback_CONFIG_TEST_SPI_HOLD_ON_CS=y - idle_spim_loopback_CONFIG_TEST_SPI_LOCK_ON=y @@ -342,6 +380,7 @@ tests: - ".*Run 1 - PASS" benchmarks.multicore.idle_spim_loopback.4_bytes_cs_and_spi_lock.idle_fast: + filter: not CONFIG_COVERAGE tags: ppk_power_measure extra_args: - idle_spim_loopback_CONFIG_TEST_SPI_HOLD_ON_CS=y @@ -356,6 +395,7 @@ tests: - "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_spim_and_idle" benchmarks.multicore.idle_spim_loopback.4_bytes_cs_and_spi_lock.s2ram_fast: + filter: not CONFIG_COVERAGE tags: ppk_power_measure extra_args: - idle_spim_loopback_CONFIG_TEST_SPI_HOLD_ON_CS=y @@ -374,6 +414,7 @@ tests: # benchmarks.multicore.idle_spim_loopback.4_bytes_cs_and_spi_lock_no_release.no_sleep: + filter: not CONFIG_COVERAGE extra_args: - idle_spim_loopback_CONFIG_TEST_SPI_HOLD_ON_CS=y - idle_spim_loopback_CONFIG_TEST_SPI_LOCK_ON=y @@ -393,6 +434,7 @@ tests: - ".*Run 1 - PASS" benchmarks.multicore.idle_spim_loopback.4_bytes_cs_and_spi_lock_no_release.idle: + filter: not CONFIG_COVERAGE tags: ppk_power_measure extra_args: - idle_spim_loopback_CONFIG_TEST_SPI_HOLD_ON_CS=y @@ -407,6 +449,7 @@ tests: - "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_spim_and_idle" benchmarks.multicore.idle_spim_loopback.4_bytes_cs_and_spi_lock_no_release.s2ram: + filter: not CONFIG_COVERAGE tags: ppk_power_measure extra_args: - idle_spim_loopback_CONFIG_TEST_SPI_HOLD_ON_CS=y @@ -420,6 +463,7 @@ tests: - "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_spim_and_s2ram" benchmarks.multicore.idle_spim_loopback.4_bytes_cs_and_spi_lock_no_release.no_sleep_fast: + filter: not CONFIG_COVERAGE extra_args: - idle_spim_loopback_CONFIG_TEST_SPI_HOLD_ON_CS=y - idle_spim_loopback_CONFIG_TEST_SPI_LOCK_ON=y @@ -440,6 +484,7 @@ tests: - ".*Run 1 - PASS" benchmarks.multicore.idle_spim_loopback.4_bytes_cs_and_spi_lock_no_release.idle_fast: + filter: not CONFIG_COVERAGE tags: ppk_power_measure extra_args: - idle_spim_loopback_CONFIG_TEST_SPI_HOLD_ON_CS=y @@ -455,6 +500,7 @@ tests: - "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_spim_and_idle" benchmarks.multicore.idle_spim_loopback.4_bytes_cs_and_spi_lock_no_release.s2ram_fast: + filter: not CONFIG_COVERAGE tags: ppk_power_measure extra_args: - idle_spim_loopback_CONFIG_TEST_SPI_HOLD_ON_CS=y diff --git a/tests/benchmarks/multicore/idle_twim/Kconfig.sysbuild b/tests/benchmarks/multicore/idle_twim/Kconfig.sysbuild index da26dbe3dc09..c72396b7c358 100644 --- a/tests/benchmarks/multicore/idle_twim/Kconfig.sysbuild +++ b/tests/benchmarks/multicore/idle_twim/Kconfig.sysbuild @@ -1,5 +1,5 @@ # -# Copyright (c) 2023 Nordic Semiconductor ASA +# Copyright (c) 2025 Nordic Semiconductor ASA # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # @@ -7,4 +7,5 @@ source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" config REMOTE_BOARD - string "The board used for remote target" + string + default "$(BOARD)/nrf54h20/cpurad" if SOC_NRF54H20_CPUAPP diff --git a/tests/benchmarks/multicore/idle_twim/coverage.conf b/tests/benchmarks/multicore/idle_twim/coverage.conf new file mode 100644 index 000000000000..dcbe2eac9ed8 --- /dev/null +++ b/tests/benchmarks/multicore/idle_twim/coverage.conf @@ -0,0 +1,20 @@ +CONFIG_I2C=y +CONFIG_GPIO=n + +CONFIG_PM=y +CONFIG_PM_S2RAM=n +CONFIG_PM_S2RAM_CUSTOM_MARKING=n +CONFIG_PM_DEVICE=y +CONFIG_PM_DEVICE_RUNTIME=y +CONFIG_POWEROFF=y + +CONFIG_BOOT_BANNER=n +CONFIG_ASSERT=n +CONFIG_CLOCK_CONTROL=n + +CONFIG_PRINTK=y +CONFIG_LOG=n +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y + +CONFIG_LOG_BUFFER_SIZE=16384 diff --git a/tests/benchmarks/multicore/idle_twim/src/main.c b/tests/benchmarks/multicore/idle_twim/src/main.c index e513d29599ae..6b7fc07d336b 100644 --- a/tests/benchmarks/multicore/idle_twim/src/main.c +++ b/tests/benchmarks/multicore/idle_twim/src/main.c @@ -39,6 +39,7 @@ static uint8_t read_sensor_register(uint8_t register_address) int main(void) { uint8_t response; + int test_repetitions = 3; uint32_t i2c_config = I2C_SPEED_SET(I2C_SPEED_STANDARD) | I2C_MODE_CONTROLLER; printk("Device address 0x%x\n", DEVICE_ADDRESS); @@ -50,7 +51,13 @@ int main(void) return -1; } - while (1) { +#if defined(CONFIG_COVERAGE) + printk("Coverage analysis enabled\n"); + while (test_repetitions--) +#else + while (test_repetitions) +#endif + { response = read_sensor_register(CHIP_ID_REGISTER_ADDRESS); printk("Chip_Id: %d\n", response); @@ -59,5 +66,8 @@ int main(void) k_msleep(2000); } +#if defined(CONFIG_COVERAGE) + printk("Coverage analysis start\n"); +#endif return 0; } diff --git a/tests/benchmarks/multicore/idle_twim/sysbuild/nrf54h20dk_nrf54h20_cpurad.conf b/tests/benchmarks/multicore/idle_twim/sysbuild/nrf54h20dk_nrf54h20_cpurad.conf deleted file mode 100644 index dd863e78d993..000000000000 --- a/tests/benchmarks/multicore/idle_twim/sysbuild/nrf54h20dk_nrf54h20_cpurad.conf +++ /dev/null @@ -1 +0,0 @@ -SB_CONFIG_REMOTE_BOARD="nrf54h20dk/nrf54h20/cpurad" diff --git a/tests/benchmarks/multicore/idle_twim/testcase.yaml b/tests/benchmarks/multicore/idle_twim/testcase.yaml index 177ba4f54212..729b7598c422 100644 --- a/tests/benchmarks/multicore/idle_twim/testcase.yaml +++ b/tests/benchmarks/multicore/idle_twim/testcase.yaml @@ -8,6 +8,7 @@ common: - ppk_power_measure tests: benchmarks.multicore.idle_twim.nrf54h20dk_cpuapp_cpurad.s2ram: + filter: not CONFIG_COVERAGE harness: pytest platform_allow: - nrf54h20dk/nrf54h20/cpuapp @@ -15,8 +16,25 @@ tests: - nrf54h20dk/nrf54h20/cpuapp extra_args: - SHIELD=pca63566 - - SB_CONF_FILE=sysbuild/nrf54h20dk_nrf54h20_cpurad.conf harness_config: fixture: pca63566 pytest_root: - "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_power_consumption_twim" + + benchmarks.multicore.idle_twim.nrf54h20dk_cpuapp_cpurad.coverge: + filter: CONFIG_COVERAGE + platform_allow: + - nrf54h20dk/nrf54h20/cpuapp + integration_platforms: + - nrf54h20dk/nrf54h20/cpuapp + extra_args: + - SHIELD=pca63566;coverage_support + - CONF_FILE=coverage.conf + harness: console + harness_config: + fixture: pca63566 + type: multi_line + ordered: true + regex: + - ".*Coverage analysis enabled.*" + - ".*Coverage analysis start.*" diff --git a/tests/benchmarks/multicore/idle_uarte/coverage.conf b/tests/benchmarks/multicore/idle_uarte/coverage.conf new file mode 100644 index 000000000000..b95d0bdb7a18 --- /dev/null +++ b/tests/benchmarks/multicore/idle_uarte/coverage.conf @@ -0,0 +1,22 @@ +CONFIG_SERIAL=y +CONFIG_MAIN_STACK_SIZE=2048 +CONFIG_UART_ASYNC_API=y +CONFIG_UART_USE_RUNTIME_CONFIGURE=y + +CONFIG_PM=y +CONFIG_PM_S2RAM=n +CONFIG_PM_S2RAM_CUSTOM_MARKING=n +CONFIG_PM_DEVICE=y +CONFIG_PM_DEVICE_RUNTIME=y +CONFIG_POWEROFF=y + +CONFIG_BOOT_BANNER=n +CONFIG_ASSERT=n +CONFIG_CLOCK_CONTROL=n + +CONFIG_PRINTK=y +CONFIG_LOG=n +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y + +CONFIG_LOG_BUFFER_SIZE=16384 diff --git a/tests/benchmarks/multicore/idle_uarte/src/main.c b/tests/benchmarks/multicore/idle_uarte/src/main.c index 7cb05a730b9e..780e2552d33e 100644 --- a/tests/benchmarks/multicore/idle_uarte/src/main.c +++ b/tests/benchmarks/multicore/idle_uarte/src/main.c @@ -142,6 +142,7 @@ void disable_uart_rx(void) int main(void) { int err; + int test_repetitions = 3; struct uart_config test_uart_config = {.baudrate = 115200, .parity = UART_CFG_PARITY_ODD, .stop_bits = UART_CFG_STOP_BITS_1, @@ -191,7 +192,13 @@ int main(void) pm_device_runtime_enable(console_dev); } - while (1) { +#if defined(CONFIG_COVERAGE) + printk("Coverage analysis enabled\n"); + while (test_repetitions--) +#else + while (test_repetitions) +#endif + { printk("Hello\n"); enable_uart_rx(); printk("UART test transmission\n"); @@ -207,5 +214,8 @@ int main(void) gpio_pin_set_dt(&led, 1); } +#if defined(CONFIG_COVERAGE) + printk("Coverage analysis start\n"); +#endif return 0; } diff --git a/tests/benchmarks/multicore/idle_uarte/testcase.yaml b/tests/benchmarks/multicore/idle_uarte/testcase.yaml index 5431d90072e5..e729b6fac3cb 100644 --- a/tests/benchmarks/multicore/idle_uarte/testcase.yaml +++ b/tests/benchmarks/multicore/idle_uarte/testcase.yaml @@ -8,6 +8,7 @@ common: - ppk_power_measure tests: benchmarks.multicore.idle_uarte.nrf54h20dk_cpuapp_cpurad.s2ram: + filter: not CONFIG_COVERAGE harness: pytest platform_allow: - nrf54h20dk/nrf54h20/cpuapp @@ -20,7 +21,27 @@ tests: pytest_root: - "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_power_consumption_uarte" + benchmarks.multicore.idle_uarte.nrf54h20dk_cpuapp_cpurad.coverage: + filter: CONFIG_COVERAGE + platform_allow: + - nrf54h20dk/nrf54h20/cpuapp + integration_platforms: + - nrf54h20dk/nrf54h20/cpuapp + extra_args: + - DTC_OVERLAY_FILE="boards/nrf54h20dk_nrf54h20_cpuapp_normal.overlay" + - CONF_FILE=coverage.conf + - SHIELD=coverage_support + harness: console + harness_config: + fixture: gpio_loopback + type: multi_line + ordered: true + regex: + - ".*Coverage analysis enabled.*" + - ".*Coverage analysis start.*" + benchmarks.multicore.idle_uarte.fast.nrf54h20dk_cpuapp_cpurad.s2ram: + filter: not CONFIG_COVERAGE harness: pytest platform_allow: - nrf54h20dk/nrf54h20/cpuapp @@ -34,6 +55,7 @@ tests: - "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_power_consumption_uarte" benchmarks.multicore.idle_uarte.fast.gd_freq_256MHz.nrf54h20dk_cpuapp_cpurad.s2ram: + filter: not CONFIG_COVERAGE harness: pytest platform_allow: - nrf54h20dk/nrf54h20/cpuapp @@ -49,6 +71,7 @@ tests: - "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_power_consumption_uarte" benchmarks.multicore.idle_uarte.fast.gd_freq_128MHz.nrf54h20dk_cpuapp_cpurad.s2ram: + filter: not CONFIG_COVERAGE harness: pytest platform_allow: - nrf54h20dk/nrf54h20/cpuapp @@ -64,6 +87,7 @@ tests: - "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_power_consumption_uarte" benchmarks.multicore.idle_uarte.fast.gd_freq_64MHz.nrf54h20dk_cpuapp_cpurad.s2ram: + filter: not CONFIG_COVERAGE harness: pytest platform_allow: - nrf54h20dk/nrf54h20/cpuapp @@ -79,6 +103,7 @@ tests: - "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_power_consumption_uarte" benchmarks.multicore.idle_uarte.automatic_pm.nrf54h20dk_cpuapp_cpurad.s2ram: + filter: not CONFIG_COVERAGE harness: pytest platform_allow: - nrf54h20dk/nrf54h20/cpuapp