Skip to content

Commit 3b73572

Browse files
nordic-bamirlubos
authored andcommitted
tests: benchmarks: Extend testing for clock control
Test on CPURAD Enable coverage Signed-off-by: Bartosz Miller <[email protected]>
1 parent ab335b2 commit 3b73572

File tree

4 files changed

+96
-16
lines changed

4 files changed

+96
-16
lines changed

tests/benchmarks/multicore/idle_clock_control/Kconfig.sysbuild

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ source "${ZEPHYR_BASE}/share/sysbuild/Kconfig"
99
config REMOTE_BOARD
1010
string
1111
default "$(BOARD)/nrf54h20/cpurad" if SOC_NRF54H20_CPUAPP
12+
default "$(BOARD)/nrf54h20/cpuapp" if SOC_NRF54H20_CPURAD
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
CONFIG_PM=n
2+
CONFIG_PM_S2RAM=n
3+
CONFIG_PM_S2RAM_CUSTOM_MARKING=n
4+
CONFIG_PM_DEVICE=n
5+
CONFIG_PM_DEVICE_RUNTIME=n
6+
CONFIG_POWEROFF=n
7+
8+
CONFIG_GPIO=n
9+
10+
CONFIG_NRFS=y
11+
CONFIG_CLOCK_CONTROL=y
12+
CONFIG_ASSERT=n
13+
14+
CONFIG_PRINTK=y
15+
CONFIG_LOG=n
16+
CONFIG_CONSOLE=y
17+
CONFIG_UART_CONSOLE=y
18+
CONFIG_SERIAL=y
19+
20+
CONFIG_LOG_BUFFER_SIZE=16384

tests/benchmarks/multicore/idle_clock_control/src/main.c

Lines changed: 34 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ struct test_clk_ctx {
1919
size_t clk_specs_size;
2020
};
2121

22+
#if defined(CONFIG_BOARD_NRF54H20DK_NRF54H20_CPUAPP)
2223
const struct nrf_clock_spec test_clk_specs_hsfll[] = {
2324
{
2425
.frequency = MHZ(128),
@@ -37,6 +38,15 @@ const struct nrf_clock_spec test_clk_specs_hsfll[] = {
3738
},
3839
};
3940

41+
static const struct test_clk_ctx hsfll_test_clk_ctx[] = {
42+
{
43+
.clk_dev = DEVICE_DT_GET(DT_NODELABEL(cpuapp_hsfll)),
44+
.clk_specs = test_clk_specs_hsfll,
45+
.clk_specs_size = ARRAY_SIZE(test_clk_specs_hsfll),
46+
},
47+
};
48+
#endif /* CONFIG_BOARD_NRF54H20DK_NRF54H20_CPUAPP */
49+
4050
const struct nrf_clock_spec test_clk_specs_global_hsfll[] = {
4151
{
4252
.frequency = MHZ(320),
@@ -86,14 +96,6 @@ static const struct test_clk_ctx fll16m_test_clk_ctx[] = {
8696
},
8797
};
8898

89-
static const struct test_clk_ctx hsfll_test_clk_ctx[] = {
90-
{
91-
.clk_dev = DEVICE_DT_GET(DT_NODELABEL(cpuapp_hsfll)),
92-
.clk_specs = test_clk_specs_hsfll,
93-
.clk_specs_size = ARRAY_SIZE(test_clk_specs_hsfll),
94-
},
95-
};
96-
9799
const struct nrf_clock_spec test_clk_specs_lfclk[] = {
98100
{
99101
.frequency = 32768,
@@ -120,6 +122,7 @@ static const struct test_clk_ctx lfclk_test_clk_ctx[] = {
120122
},
121123
};
122124

125+
#if defined(CONFIG_BOARD_NRF54H20DK_NRF54H20_CPUAPP)
123126
const struct nrf_clock_spec test_clk_specs_hfxo[] = {
124127
{
125128
.frequency = MHZ(32),
@@ -135,6 +138,7 @@ static const struct test_clk_ctx hfxo_test_clk_ctx[] = {
135138
.clk_specs_size = ARRAY_SIZE(test_clk_specs_hfxo),
136139
},
137140
};
141+
#endif /* CONFIG_BOARD_NRF54H20DK_NRF54H20_CPUAPP */
138142

139143
static void test_request_release_clock_spec(const struct device *clk_dev,
140144
const struct nrf_clock_spec *clk_spec)
@@ -190,6 +194,7 @@ static void test_clock_control_request(const struct test_clk_ctx *clk_contexts,
190194
}
191195
}
192196

197+
#if defined(CONFIG_BOARD_NRF54H20DK_NRF54H20_CPUAPP)
193198
static void test_auxpll_control(const struct device *clk_dev)
194199
{
195200
int err;
@@ -207,20 +212,34 @@ static void test_auxpll_control(const struct device *clk_dev)
207212
__ASSERT_NO_MSG(clk_status == CLOCK_CONTROL_STATUS_OFF);
208213
k_msleep(1000);
209214
}
215+
#endif /* CONFIG_BOARD_NRF54H20DK_NRF54H20_CPUAPP */
216+
217+
void run_tests(void)
218+
{
219+
#if defined(CONFIG_BOARD_NRF54H20DK_NRF54H20_CPUAPP)
220+
test_auxpll_control(DEVICE_DT_GET(DT_NODELABEL(canpll)));
221+
test_clock_control_request(hfxo_test_clk_ctx, ARRAY_SIZE(hfxo_test_clk_ctx));
222+
test_clock_control_request(hsfll_test_clk_ctx, ARRAY_SIZE(hsfll_test_clk_ctx));
223+
#endif /* CONFIG_BOARD_NRF54H20DK_NRF54H20_CPUAPP */
224+
test_clock_control_request(global_hsfll_test_clk_ctx,
225+
ARRAY_SIZE(global_hsfll_test_clk_ctx));
226+
test_clock_control_request(fll16m_test_clk_ctx, ARRAY_SIZE(fll16m_test_clk_ctx));
227+
test_clock_control_request(lfclk_test_clk_ctx, ARRAY_SIZE(lfclk_test_clk_ctx));
228+
}
210229

211230
int main(void)
212231
{
213232
LOG_INF("Idle clock_control, %s", CONFIG_BOARD_TARGET);
214233
k_msleep(100);
234+
#if defined(CONFIG_COVERAGE)
235+
printk("Start testing\n");
236+
run_tests();
237+
printk("Testing done\n");
238+
#else
215239
while (1) {
216-
test_auxpll_control(DEVICE_DT_GET(DT_NODELABEL(canpll)));
217-
test_clock_control_request(hfxo_test_clk_ctx, ARRAY_SIZE(hfxo_test_clk_ctx));
218-
test_clock_control_request(hsfll_test_clk_ctx, ARRAY_SIZE(hsfll_test_clk_ctx));
219-
test_clock_control_request(global_hsfll_test_clk_ctx,
220-
ARRAY_SIZE(hsfll_test_clk_ctx));
221-
test_clock_control_request(fll16m_test_clk_ctx, ARRAY_SIZE(fll16m_test_clk_ctx));
222-
test_clock_control_request(lfclk_test_clk_ctx, ARRAY_SIZE(lfclk_test_clk_ctx));
240+
run_tests();
223241
}
242+
#endif /* CONFIG_COVERAGE */
224243

225244
return 0;
226245
}

tests/benchmarks/multicore/idle_clock_control/testcase.yaml

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ common:
44
- ci_build
55
- ci_tests_benchmarks_multicore
66
- ppk_power_measure
7+
78
tests:
8-
benchmarks.multicore.idle_clock_control:
9+
benchmarks.multicore.idle_clock_control.app:
10+
filter: not CONFIG_COVERAGE
911
harness: pytest
1012
platform_allow:
1113
- nrf54h20dk/nrf54h20/cpuapp
@@ -16,3 +18,41 @@ tests:
1618
pytest_root:
1719
- "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_power_consumption_clock_control"
1820
timeout: 90
21+
22+
# note: in this scenario cpuapp is the 'remote'
23+
benchmarks.multicore.idle_clock_control.rad:
24+
filter: not CONFIG_COVERAGE
25+
harness: pytest
26+
platform_allow:
27+
- nrf54h20dk/nrf54h20/cpurad
28+
integration_platforms:
29+
- nrf54h20dk/nrf54h20/cpurad
30+
extra_args:
31+
- CONFIG_PM_S2RAM=n
32+
- CONFIG_PM_S2RAM_CUSTOM_MARKING=n
33+
- remote_CONFIG_PM_S2RAM=y
34+
- remote_CONFIG_PM_S2RAM_CUSTOM_MARKING=y
35+
- remote_CONFIG_PM_DEVICE=y
36+
- remote_CONFIG_PM_DEVICE_RUNTIME=y
37+
- remote_CONFIG_GPIO=n
38+
- remote_CONFIG_BOOT_BANNER=n
39+
- remote_CONFIG_CLOCK_CONTROL=n
40+
harness_config:
41+
fixture: ppk_power_measure
42+
pytest_root:
43+
- "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_power_consumption_clock_control"
44+
timeout: 90
45+
46+
benchmarks.multicore.idle_clock_control.coverage:
47+
filter: CONFIG_COVERAGE
48+
harness: console
49+
harness_config:
50+
type: multi_line
51+
regex:
52+
- ".*Start testing.*"
53+
- ".*Testing done.*"
54+
extra_args:
55+
- CONF_FILE=coverage.conf
56+
- SHIELD=coverage_support
57+
platform_allow:
58+
- nrf54h20dk/nrf54h20/cpuapp

0 commit comments

Comments
 (0)