Skip to content

Commit 8be92f8

Browse files
gbarkadiuszkartben
authored andcommitted
Harness: Power harness documentation
Add documentation for power harness. Signed-off-by: Arkadiusz Cholewinski <arkadiuszx.cholewinski@intel.com>
1 parent 75e7d0e commit 8be92f8

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

doc/develop/test/twister.rst

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,7 @@ harness: <string>
561561
- robot
562562
- ctest
563563
- shell
564+
- power
564565

565566
See :ref:`twister_harnesses` for more information.
566567

@@ -972,6 +973,44 @@ robot_testsuite: <robot file path> (default empty)
972973
robot_option: <robot option> (default empty)
973974
One or more options to be send to robotframework.
974975

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+
9751014
Bsim
9761015
====
9771016

0 commit comments

Comments
 (0)