Skip to content

Commit 4d03fd7

Browse files
committed
Harness: Power harness documentation
Add documentation for power harness. Signed-off-by: Arkadiusz Cholewinski <arkadiuszx.cholewinski@intel.com>
1 parent 4e83888 commit 4d03fd7

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

doc/develop/test/twister.rst

+37
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,42 @@ 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+
1. Initializes a power monitoring device (e.g., ``stm_powershield``) via the ``PowerMonitor`` abstract interface.
983+
2. Starts current measurement for a defined ``measurement_duartion``.
984+
3. Collects raw current waveform data.
985+
4. Uses a peak detection algorithm to segment data into defined execution phases based on power transitions.
986+
5. Computes RMS current values for each phase using a utility function.
987+
6. Compares the computed values with user-defined expected RMS values.
988+
989+
.. code-block:: yaml
990+
harness: power
991+
harness_config:
992+
fixture: pm_probe
993+
power_measurements:
994+
element_to_trim: 100
995+
min_peak_distance: 40
996+
min_peak_height: 0.008
997+
peak_padding: 40
998+
measurement_duration: 6
999+
num_of_transitions: 4
1000+
expected_rms_values: [56.0, 4.0, 1.2, 0.26, 140]
1001+
tolerance_percentage: 20
1002+
1003+
- **elements_to_trim** – Number of samples to discard at the start of measurement to eliminate noise.
1004+
- **min_peak_distance** – Minimum distance between detected current peaks (helps detect distinct transitions).
1005+
- **min_peak_height** – Minimum current threshold to qualify as a peak (in amps).
1006+
- **peak_padding** – Number of samples to extend around each detected peak.
1007+
- **measurement_duration** – Total time (in seconds) to record current data.
1008+
- **num_of_transitions** – Expected number of power state transitions in the DUT during test execution.
1009+
- **expected_rms_values** – Target RMS values for each identified execution phase (in milliamps).
1010+
- **tolerance_percentage** – Allowed deviation percentage from the expected RMS values.
1011+
9751012
Bsim
9761013
====
9771014

0 commit comments

Comments
 (0)