Change the stdev tolerance stdev from 10 to 33 when npcx timer is used. This is because the clock source of npcx event timer, which is used to generate the timeout interrupt, is running at 32.768 KHz. (i.e. 1 count = ~30.5 us.) The conversion from the absolute system timer to the event timer count might have -30.5 ~ 30.5 deviation. The tolerance setting is under the assumption that test sampes are evenly located at 1030.5 and 969.5 for the worst case. Fixes #59594 Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
74 lines
2.4 KiB
Plaintext
74 lines
2.4 KiB
Plaintext
# SPDX-License-Identifier: Apache-2.0
|
|
# Copyright (c) 2022 Intel Corporation
|
|
|
|
mainmenu "Timer Behavior Test"
|
|
|
|
config SYS_CLOCK_TICKS_PER_SEC
|
|
default 8192 if NRF_RTC_TIMER && TICKLESS_KERNEL
|
|
|
|
source "Kconfig.zephyr"
|
|
|
|
config TIMER_TEST_SAMPLES
|
|
int "The number of timer samples to gather for statistics"
|
|
default 1000 if (SRAM_SIZE < 24)
|
|
default 2000 if (SRAM_SIZE < 32)
|
|
default 3000 if (SRAM_SIZE < 48)
|
|
default 5000 if (SRAM_SIZE < 64)
|
|
default 7000 if (SRAM_SIZE < 96)
|
|
default 10000
|
|
|
|
config TIMER_TEST_PERIOD
|
|
int "The number of microseconds to for the timer period"
|
|
default 1000
|
|
|
|
config TIMER_TEST_MAX_STDDEV
|
|
int "Maximum standard deviation in microseconds allowed"
|
|
default 33 if NPCX_ITIM_TIMER
|
|
default 10
|
|
|
|
config TIMER_TEST_MAX_DRIFT
|
|
int "Maximum drift in microseconds allowed (should be about 1 period allowance)"
|
|
default 1000
|
|
|
|
config TIMER_TEST_PERIOD_MAX_DRIFT_PERCENT
|
|
int "Maximum drift percentage for the timer period"
|
|
# Use 13% on nRF platforms using the RTC timer because one tick there is
|
|
# ~122 us (see SYS_CLOCK_TICKS_PER_SEC configuration above) and one tick
|
|
# difference in the test period is nothing unusual (it can happen for
|
|
# example if a new tick elapses right after the kernel gets the number
|
|
# of elapsed ticks when scheduling a new timeout but before the timer
|
|
# driver sets up that timeout).
|
|
default 13 if NRF_RTC_TIMER && TICKLESS_KERNEL
|
|
default 10
|
|
help
|
|
A value of 10 means 10%.
|
|
|
|
config TIMER_EXTERNAL_TEST
|
|
bool "Perform test using an external tool"
|
|
help
|
|
Toggles a GPIO pin, on every period, that can be used by an external
|
|
tool (such as a logic analyzer) to gather timing data. A pytest harness
|
|
is used to get the data collected by the tool and evaluate it.
|
|
|
|
if TIMER_EXTERNAL_TEST
|
|
|
|
config TIMER_EXTERNAL_TEST_MAX_DRIFT_PPM
|
|
int "Maximum drift in PPM for tests using external tool"
|
|
default 4500
|
|
help
|
|
Parts Per Million of allowed drift when using an external tool
|
|
connected to a GPIO pin is used to measure time behaviour.
|
|
|
|
config TIMER_EXTERNAL_TEST_PERIOD_MAX_DRIFT_PPM
|
|
int "Maximum timer period drift in PPM for tests using external tool"
|
|
default 100000
|
|
help
|
|
Parts Per Million of allowed period drift when using an external tool
|
|
connected to a GPIO pin is used to measure time behaviour.
|
|
|
|
config TIMER_EXTERNAL_TEST_SYNC_DELAY
|
|
int "Delay, in seconds, between tests, so that external tool can be ready"
|
|
default 3
|
|
|
|
endif # TIMER_EXTERNAL_TEST
|