@@ -561,6 +561,7 @@ harness: <string>
561
561
- robot
562
562
- ctest
563
563
- shell
564
+ - power
564
565
565
566
See :ref: `twister_harnesses ` for more information.
566
567
@@ -972,6 +973,44 @@ robot_testsuite: <robot file path> (default empty)
972
973
robot_option: <robot option> (default empty)
973
974
One or more options to be send to robotframework.
974
975
976
+ Power
977
+ =====
978
+ The ``power `` harness is used to measure and validate the current consumption.
979
+ It integrates with 'pytest' to perform automated data collection and analysis using a hardware power monitor.
980
+
981
+ The harness executes the following steps:
982
+
983
+ 1. Initializes a power monitoring device (e.g., ``stm_powershield ``) via the ``PowerMonitor `` abstract interface.
984
+ #. Starts current measurement for a defined ``measurement_duration ``.
985
+ #. Collects raw current waveform data.
986
+ #. Uses a peak detection algorithm to segment data into defined execution phases based on power transitions.
987
+ #. Computes RMS current values for each phase using a utility function.
988
+ #. Compares the computed values with user-defined expected RMS values.
989
+
990
+ .. code-block :: yaml
991
+
992
+ harness : power
993
+ harness_config :
994
+ fixture : pm_probe
995
+ power_measurements :
996
+ element_to_trim : 100
997
+ min_peak_distance : 40
998
+ min_peak_height : 0.008
999
+ peak_padding : 40
1000
+ measurement_duration : 6
1001
+ num_of_transitions : 4
1002
+ expected_rms_values : [56.0, 4.0, 1.2, 0.26, 140]
1003
+ tolerance_percentage : 20
1004
+
1005
+ - **elements_to_trim ** – Number of samples to discard at the start of measurement to eliminate noise.
1006
+ - **min_peak_distance ** – Minimum distance between detected current peaks (helps detect distinct transitions).
1007
+ - **min_peak_height ** – Minimum current threshold to qualify as a peak (in amps).
1008
+ - **peak_padding ** – Number of samples to extend around each detected peak.
1009
+ - **measurement_duration ** – Total time (in seconds) to record current data.
1010
+ - **num_of_transitions ** – Expected number of power state transitions in the DUT during test execution.
1011
+ - **expected_rms_values ** – Target RMS values for each identified execution phase (in milliamps).
1012
+ - **tolerance_percentage ** – Allowed deviation percentage from the expected RMS values.
1013
+
975
1014
Bsim
976
1015
====
977
1016
0 commit comments