embeddedci-openhtf 2.3.0__tar.gz → 2.4.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {embeddedci_openhtf-2.3.0 → embeddedci_openhtf-2.4.0}/CHANGELOG.md +12 -0
- {embeddedci_openhtf-2.3.0 → embeddedci_openhtf-2.4.0}/PKG-INFO +4 -4
- {embeddedci_openhtf-2.3.0 → embeddedci_openhtf-2.4.0}/README.md +2 -2
- {embeddedci_openhtf-2.3.0 → embeddedci_openhtf-2.4.0}/examples/analog_loopback.py +2 -2
- {embeddedci_openhtf-2.3.0 → embeddedci_openhtf-2.4.0}/pyproject.toml +2 -2
- {embeddedci_openhtf-2.3.0 → embeddedci_openhtf-2.4.0}/src/embeddedci_openhtf/analog.py +8 -7
- {embeddedci_openhtf-2.3.0 → embeddedci_openhtf-2.4.0}/src/embeddedci_openhtf/plug.py +2 -2
- {embeddedci_openhtf-2.3.0 → embeddedci_openhtf-2.4.0}/tests/test_analog.py +6 -5
- {embeddedci_openhtf-2.3.0 → embeddedci_openhtf-2.4.0}/tests/test_e2e_openhtf.py +11 -0
- {embeddedci_openhtf-2.3.0 → embeddedci_openhtf-2.4.0}/tests/test_power.py +8 -8
- {embeddedci_openhtf-2.3.0 → embeddedci_openhtf-2.4.0}/.gitignore +0 -0
- {embeddedci_openhtf-2.3.0 → embeddedci_openhtf-2.4.0}/LICENSE +0 -0
- {embeddedci_openhtf-2.3.0 → embeddedci_openhtf-2.4.0}/examples/flash_and_boot.py +0 -0
- {embeddedci_openhtf-2.3.0 → embeddedci_openhtf-2.4.0}/examples/serial_smoke.py +0 -0
- {embeddedci_openhtf-2.3.0 → embeddedci_openhtf-2.4.0}/examples/station.py +0 -0
- {embeddedci_openhtf-2.3.0 → embeddedci_openhtf-2.4.0}/src/embeddedci_openhtf/__init__.py +0 -0
- {embeddedci_openhtf-2.3.0 → embeddedci_openhtf-2.4.0}/src/embeddedci_openhtf/measurements.py +0 -0
- {embeddedci_openhtf-2.3.0 → embeddedci_openhtf-2.4.0}/src/embeddedci_openhtf/phases.py +0 -0
- {embeddedci_openhtf-2.3.0 → embeddedci_openhtf-2.4.0}/src/embeddedci_openhtf/pins.py +0 -0
- {embeddedci_openhtf-2.3.0 → embeddedci_openhtf-2.4.0}/src/embeddedci_openhtf/power.py +0 -0
- {embeddedci_openhtf-2.3.0 → embeddedci_openhtf-2.4.0}/tests/_fake.py +0 -0
- {embeddedci_openhtf-2.3.0 → embeddedci_openhtf-2.4.0}/tests/conftest.py +0 -0
- {embeddedci_openhtf-2.3.0 → embeddedci_openhtf-2.4.0}/tests/test_docs_coverage.py +0 -0
- {embeddedci_openhtf-2.3.0 → embeddedci_openhtf-2.4.0}/tests/test_measurements.py +0 -0
- {embeddedci_openhtf-2.3.0 → embeddedci_openhtf-2.4.0}/tests/test_persistent.py +0 -0
- {embeddedci_openhtf-2.3.0 → embeddedci_openhtf-2.4.0}/tests/test_phases.py +0 -0
- {embeddedci_openhtf-2.3.0 → embeddedci_openhtf-2.4.0}/tests/test_pins.py +0 -0
- {embeddedci_openhtf-2.3.0 → embeddedci_openhtf-2.4.0}/tests/test_plug.py +0 -0
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog — `embeddedci-openhtf`
|
|
2
2
|
|
|
3
|
+
## 2.4.0
|
|
4
|
+
|
|
5
|
+
- Needs embeddedci 3.0: wiring profiles live on the pod and nothing is wired by default. A plug
|
|
6
|
+
without a wiring profile needs `efuse=` for power calls; pass `wiring=` or save the bench's
|
|
7
|
+
profile on the pod.
|
|
8
|
+
|
|
9
|
+
## 2.3.1
|
|
10
|
+
|
|
11
|
+
- `signal_generate`, `signal_generate_phase` and `loopback_measure_phase` default to
|
|
12
|
+
`dac_path="3v3"` instead of `"5v"`; `dac_replay_phase` now defaults to the path stored with the
|
|
13
|
+
waveform, else `"3v3"`. Pass `dac_path="5v"` to keep the old output.
|
|
14
|
+
|
|
3
15
|
## 2.3.0
|
|
4
16
|
|
|
5
17
|
- Needs `embeddedci` 2.12.0 or later (was 2.4), the SDK whose `usb` connection reaches the USB
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: embeddedci-openhtf
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.4.0
|
|
4
4
|
Summary: OpenHTF plug for driving an EmbeddedCI BenchPod directly over TCP or serial (no cloud)
|
|
5
5
|
Project-URL: Homepage, https://embeddedci.com
|
|
6
6
|
Project-URL: Repository, https://github.com/embeddedci-com/embeddedci-python
|
|
@@ -18,7 +18,7 @@ Classifier: Programming Language :: Python :: 3.12
|
|
|
18
18
|
Classifier: Programming Language :: Python :: 3.13
|
|
19
19
|
Classifier: Topic :: Software Development :: Testing
|
|
20
20
|
Requires-Python: >=3.10
|
|
21
|
-
Requires-Dist: embeddedci<3
|
|
21
|
+
Requires-Dist: embeddedci<4,>=3.0.0
|
|
22
22
|
Requires-Dist: openhtf>=1.6
|
|
23
23
|
Provides-Extra: dev
|
|
24
24
|
Requires-Dist: pytest>=7.0; extra == 'dev'
|
|
@@ -111,7 +111,7 @@ def pulse_and_wait(test, bench):
|
|
|
111
111
|
### LA voltage
|
|
112
112
|
|
|
113
113
|
The pod refuses every LA-bank operation — **flashing, the UART proxy, LA capture,
|
|
114
|
-
pull resistors,
|
|
114
|
+
pull resistors, sensor emulation** — until the LA I/O-bank voltage is selected.
|
|
115
115
|
Set it to your DUT's I/O voltage (`1.8` or `3.3` volts); the plug applies it right
|
|
116
116
|
after connecting. Resolution order: `benchpod_plug(..., la_voltage=)`, then the
|
|
117
117
|
`benchpod_la_voltage` conf key, then the `BENCHPOD_LA_VOLTAGE` env var. Leave all three
|
|
@@ -217,7 +217,7 @@ from embeddedci_openhtf import (
|
|
|
217
217
|
bench = benchpod_plug("192.168.1.50:8080")
|
|
218
218
|
|
|
219
219
|
test = htf.Test(
|
|
220
|
-
# drive a 1 V-peak sine
|
|
220
|
+
# drive a 1 V-peak sine centered on 2.5 V (5V DAC path), capture the front ADC SMA
|
|
221
221
|
# while it runs, stop the DAC, and assert the round trip in volts
|
|
222
222
|
loopback_measure_phase(bench, waveform="sine", freq_hz=100, amplitude=1.0,
|
|
223
223
|
samples=4096, sample_rate_hz=50_000,
|
|
@@ -85,7 +85,7 @@ def pulse_and_wait(test, bench):
|
|
|
85
85
|
### LA voltage
|
|
86
86
|
|
|
87
87
|
The pod refuses every LA-bank operation — **flashing, the UART proxy, LA capture,
|
|
88
|
-
pull resistors,
|
|
88
|
+
pull resistors, sensor emulation** — until the LA I/O-bank voltage is selected.
|
|
89
89
|
Set it to your DUT's I/O voltage (`1.8` or `3.3` volts); the plug applies it right
|
|
90
90
|
after connecting. Resolution order: `benchpod_plug(..., la_voltage=)`, then the
|
|
91
91
|
`benchpod_la_voltage` conf key, then the `BENCHPOD_LA_VOLTAGE` env var. Leave all three
|
|
@@ -191,7 +191,7 @@ from embeddedci_openhtf import (
|
|
|
191
191
|
bench = benchpod_plug("192.168.1.50:8080")
|
|
192
192
|
|
|
193
193
|
test = htf.Test(
|
|
194
|
-
# drive a 1 V-peak sine
|
|
194
|
+
# drive a 1 V-peak sine centered on 2.5 V (5V DAC path), capture the front ADC SMA
|
|
195
195
|
# while it runs, stop the DAC, and assert the round trip in volts
|
|
196
196
|
loopback_measure_phase(bench, waveform="sine", freq_hz=100, amplitude=1.0,
|
|
197
197
|
samples=4096, sample_rate_hz=50_000,
|
|
@@ -43,7 +43,7 @@ def build_test(pod: str) -> htf.Test:
|
|
|
43
43
|
return htf.Test(
|
|
44
44
|
htf.PhaseGroup(
|
|
45
45
|
main=[
|
|
46
|
-
# 1) loopback: a 100 Hz, 1 V-peak sine
|
|
46
|
+
# 1) loopback: a 100 Hz, 1 V-peak sine centered on 2.5 V (5V path),
|
|
47
47
|
# captured while it runs; expect ~2 V peak-to-peak around 2.5 V.
|
|
48
48
|
loopback_measure_phase(
|
|
49
49
|
bench, waveform="sine", freq_hz=100, amplitude=1.0, offset=2.5,
|
|
@@ -52,7 +52,7 @@ def build_test(pod: str) -> htf.Test:
|
|
|
52
52
|
),
|
|
53
53
|
# 2) free-run a square wave for 2 s, then snapshot the ADC on its own.
|
|
54
54
|
signal_generate_phase(bench, waveform="square", freq_hz=100, amplitude=1.0,
|
|
55
|
-
duration=2.0),
|
|
55
|
+
dac_path="5v", duration=2.0),
|
|
56
56
|
adc_capture_phase(bench, samples=4096, sample_rate_hz=ADC_RATE_HZ,
|
|
57
57
|
source="ext", pp_range=(1.8, 2.2)),
|
|
58
58
|
],
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "embeddedci-openhtf"
|
|
7
|
-
version = "2.
|
|
7
|
+
version = "2.4.0"
|
|
8
8
|
description = "OpenHTF plug for driving an EmbeddedCI BenchPod directly over TCP or serial (no cloud)"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.10"
|
|
@@ -23,7 +23,7 @@ classifiers = [
|
|
|
23
23
|
"Topic :: Software Development :: Testing",
|
|
24
24
|
]
|
|
25
25
|
dependencies = [
|
|
26
|
-
"embeddedci>=
|
|
26
|
+
"embeddedci>=3.0.0,<4",
|
|
27
27
|
"openhtf>=1.6",
|
|
28
28
|
]
|
|
29
29
|
|
|
@@ -92,12 +92,12 @@ _ADC_SOURCE_PATH: Dict[str, str] = {"ext": "adc_ext", "cal1": "cal1", "cal2": "c
|
|
|
92
92
|
# -- low-level helpers (operate on a BenchPod or BenchPodPlug) ---------------
|
|
93
93
|
|
|
94
94
|
def signal_generate(bench: Any, *, waveform: Waveshape, freq_hz: float, amplitude: float,
|
|
95
|
-
offset: Optional[float] = None, dac_path: DacPath = "
|
|
95
|
+
offset: Optional[float] = None, dac_path: DacPath = "3v3",
|
|
96
96
|
duration: Optional[float] = None,
|
|
97
97
|
sample_rate_hz: Optional[float] = None) -> DacHandle:
|
|
98
98
|
"""Start a parametric DAC waveform (``sine``/``square``/``sawtooth``) on ``dac_path``.
|
|
99
99
|
|
|
100
|
-
``amplitude`` is the peak and ``offset`` the
|
|
100
|
+
``amplitude`` is the peak and ``offset`` the center, both in **volts** (``offset`` defaults to
|
|
101
101
|
the middle of the path's range). ``duration`` (seconds) stops it by itself; omitted, it runs
|
|
102
102
|
until :func:`signal_stop` or the returned handle's ``stop()``. See
|
|
103
103
|
:meth:`BenchPod.generate <embeddedci.benchpod.BenchPod.generate>`.
|
|
@@ -223,7 +223,7 @@ def _record_volts(test: Any, cap: Capture, *, prefix: str, attachment: Optional[
|
|
|
223
223
|
# -- phase factories ---------------------------------------------------------
|
|
224
224
|
|
|
225
225
|
def signal_generate_phase(plug: type, *, waveform: Waveshape, freq_hz: float, amplitude: float,
|
|
226
|
-
offset: Optional[float] = None, dac_path: DacPath = "
|
|
226
|
+
offset: Optional[float] = None, dac_path: DacPath = "3v3",
|
|
227
227
|
duration: Optional[float] = None,
|
|
228
228
|
sample_rate_hz: Optional[float] = None,
|
|
229
229
|
name: str = "signal_generate") -> object:
|
|
@@ -362,7 +362,7 @@ def adc_capture_phase(plug: type, *, samples: int = 4096, sample_rate_hz: Option
|
|
|
362
362
|
|
|
363
363
|
def loopback_measure_phase(plug: type, *, waveform: Waveshape = "sine", freq_hz: float,
|
|
364
364
|
amplitude: float, offset: Optional[float] = None,
|
|
365
|
-
dac_path: DacPath = "
|
|
365
|
+
dac_path: DacPath = "3v3", samples: int = 4096,
|
|
366
366
|
sample_rate_hz: Optional[float] = None,
|
|
367
367
|
source: Optional[AdcSource] = "ext", settle: float = 0.1,
|
|
368
368
|
prefix: str = "adc", mean_range: _Range = None,
|
|
@@ -380,7 +380,7 @@ def loopback_measure_phase(plug: type, *, waveform: Waveshape = "sine", freq_hz:
|
|
|
380
380
|
``_rms_v`` / ``_min_v`` / ``_max_v``.
|
|
381
381
|
|
|
382
382
|
Wire the DAC output SMA to the front ADC SMA (directly, or through the DUT whose response you
|
|
383
|
-
are checking) and keep ``source="ext"``. E.g. a 1 V-peak sine
|
|
383
|
+
are checking) and keep ``source="ext"``. E.g. a 1 V-peak sine centered on 2.5 V straight back
|
|
384
384
|
in: ``pp_range=(1.8, 2.2), mean_range=(2.4, 2.6)``.
|
|
385
385
|
"""
|
|
386
386
|
_check_source(source)
|
|
@@ -454,12 +454,13 @@ def control_loop_phase(plug: type, *, voc_code: Optional[int] = None, sharpness:
|
|
|
454
454
|
return _loop
|
|
455
455
|
|
|
456
456
|
|
|
457
|
-
def dac_replay_phase(plug: type, *, waveform_id: str, dac_path: DacPath =
|
|
457
|
+
def dac_replay_phase(plug: type, *, waveform_id: str, dac_path: Optional[DacPath] = None,
|
|
458
458
|
mapping: ReplayMapping = "faithful", target_samples: int = 4096,
|
|
459
459
|
stop_after: bool = False, switch_image: bool = True,
|
|
460
460
|
name: str = "dac_replay") -> object:
|
|
461
461
|
"""A phase that loads a cloud-stored waveform and replays it (looping) on the DAC.
|
|
462
462
|
|
|
463
|
+
``dac_path`` left out is the path stored with the waveform, else ``3v3``.
|
|
463
464
|
Needs server access (``BENCHPOD_API_KEY``). By default the replay keeps looping after the
|
|
464
465
|
phase (so a later capture phase can observe it); set ``stop_after=True`` to stop it at the end
|
|
465
466
|
of this phase. A replay that needs the deep-replay gateware image switches the pod to it first
|
|
@@ -474,7 +475,7 @@ def dac_replay_phase(plug: type, *, waveform_id: str, dac_path: DacPath = "5v",
|
|
|
474
475
|
if handle.switched_image is not None:
|
|
475
476
|
test.logger.warning("switched the FPGA to the deep-replay gateware image")
|
|
476
477
|
test.logger.info("replaying waveform %s on %s (%d samples)",
|
|
477
|
-
waveform_id, dac_path, handle.samples)
|
|
478
|
+
waveform_id, handle.dac_path, handle.samples)
|
|
478
479
|
if stop_after:
|
|
479
480
|
handle.stop()
|
|
480
481
|
|
|
@@ -43,7 +43,7 @@ wherever a channel does::
|
|
|
43
43
|
gpio(bench, "TRIGGER").pulse(0.001) # the channel the profile names TRIGGER
|
|
44
44
|
|
|
45
45
|
**LA voltage.** The pod refuses every LA-bank operation — flashing, the UART
|
|
46
|
-
proxy, LA capture, pull resistors,
|
|
46
|
+
proxy, LA capture, pull resistors, sensor emulation — until the LA I/O-bank
|
|
47
47
|
voltage (1.8 or 3.3 V) is selected. Pass ``la_voltage=`` to :func:`benchpod_plug`,
|
|
48
48
|
set the ``benchpod_la_voltage`` conf key, or export ``BENCHPOD_LA_VOLTAGE``; it is
|
|
49
49
|
applied right after connecting.
|
|
@@ -100,7 +100,7 @@ htf.conf.declare(
|
|
|
100
100
|
"benchpod_la_voltage",
|
|
101
101
|
description=(
|
|
102
102
|
"LA I/O-bank voltage in volts (1.8 or 3.3), selected right after connecting. The pod "
|
|
103
|
-
"refuses flashing, UART, LA capture, pull resistors and
|
|
103
|
+
"refuses flashing, UART, LA capture, pull resistors and sensor emulation until one "
|
|
104
104
|
f"is set. Falls back to the {LA_VOLTAGE_ENV_VAR} env var."
|
|
105
105
|
),
|
|
106
106
|
default_value=None,
|
|
@@ -65,11 +65,11 @@ def test_signal_generate_phase_converts_volts_through_generate():
|
|
|
65
65
|
freq_hz=1000, amplitude=1.0, duration=0.5))
|
|
66
66
|
assert rec.outcome == tr.Outcome.PASS
|
|
67
67
|
i = _cmds(tx).index("generate")
|
|
68
|
-
# generate routes the DAC path first, then sends 8-bit generator
|
|
69
|
-
# 1.0 V / (
|
|
70
|
-
assert tx.commands[i - 1] == {"cmd": "dac_out", "path": "
|
|
68
|
+
# generate routes the DAC path first (3v3 when none is given), then sends 8-bit generator
|
|
69
|
+
# codes: 1.0 V / (3.3 V / 255) = 77, offset defaults to mid-range 1.65 V -> 127.
|
|
70
|
+
assert tx.commands[i - 1] == {"cmd": "dac_out", "path": "3v3"}
|
|
71
71
|
assert tx.commands[i] == {"cmd": "generate", "waveform": "sine", "freq": 1000.0,
|
|
72
|
-
"amplitude":
|
|
72
|
+
"amplitude": 77, "offset": 127, "duration_ms": 500}
|
|
73
73
|
|
|
74
74
|
|
|
75
75
|
def test_signal_generate_helper_path_offset_and_rate():
|
|
@@ -169,8 +169,9 @@ def test_loopback_measure_phase_generates_captures_then_stops():
|
|
|
169
169
|
assert rec.outcome == tr.Outcome.PASS
|
|
170
170
|
# DAC first (its path re-applies and would open a loopback relay), then route the ADC.
|
|
171
171
|
assert _cmds(tx) == ["dac_out", "generate", "analog_path", "capture", "dac_stop"]
|
|
172
|
+
assert tx.commands[0] == {"cmd": "dac_out", "path": "3v3"}
|
|
172
173
|
assert tx.commands[1] == {"cmd": "generate", "waveform": "sine", "freq": 100.0,
|
|
173
|
-
"amplitude":
|
|
174
|
+
"amplitude": 77, "offset": 127}
|
|
174
175
|
assert tx.commands[2] == {"cmd": "analog_path", "path": "adc_ext"}
|
|
175
176
|
assert tx.commands[3] == {"cmd": "capture", "samples": 8, "sample_rate_mhz": 0.05}
|
|
176
177
|
p = _phase(rec, "loopback_measure")
|
|
@@ -45,7 +45,16 @@ def _run(*phases):
|
|
|
45
45
|
return record, failed
|
|
46
46
|
|
|
47
47
|
|
|
48
|
+
def _require_analog(connection: str) -> None:
|
|
49
|
+
from embeddedci.benchpod import BenchPod
|
|
50
|
+
|
|
51
|
+
with BenchPod(connection, lease=False) as probe:
|
|
52
|
+
if not probe.can_analog:
|
|
53
|
+
pytest.skip("digital-only board: no analog front end (DAC, ADC, 4-20 mA)")
|
|
54
|
+
|
|
55
|
+
|
|
48
56
|
def test_analog_phases_against_the_pod(benchpod_connection):
|
|
57
|
+
_require_analog(benchpod_connection)
|
|
49
58
|
bench = benchpod_plug(benchpod_connection, la_voltage=LA_VOLTAGE)
|
|
50
59
|
record, failed = _run(
|
|
51
60
|
dac_output_phase(bench, path="5v", volts=2.5),
|
|
@@ -62,6 +71,8 @@ def test_current_loop_phases_against_the_pod(benchpod_connection):
|
|
|
62
71
|
from embeddedci.benchpod import BenchPod
|
|
63
72
|
|
|
64
73
|
with BenchPod(benchpod_connection, lease=False) as probe:
|
|
74
|
+
if not probe.can_analog:
|
|
75
|
+
pytest.skip("digital-only board: no analog front end (DAC, ADC, 4-20 mA)")
|
|
65
76
|
if not probe.capabilities.current_out:
|
|
66
77
|
pytest.skip("this pod's firmware has no current_out command")
|
|
67
78
|
if os.environ.get("BENCHPOD_E2E_J8_WIRED") == "1":
|
|
@@ -37,7 +37,7 @@ def _request(tx, cmd="power_profile"):
|
|
|
37
37
|
|
|
38
38
|
def test_measure_power_returns_si_units():
|
|
39
39
|
tx = FakeTransport()
|
|
40
|
-
plug = benchpod_plug(transport=tx)()
|
|
40
|
+
plug = benchpod_plug(transport=tx, wiring={"version": 2, "efuse": 1})()
|
|
41
41
|
profile = measure_power(plug, 1.0)
|
|
42
42
|
assert isinstance(profile, PowerProfile)
|
|
43
43
|
assert _request(tx) == {"cmd": "power_profile", "efuse": 1, "rate_hz": 500,
|
|
@@ -51,7 +51,7 @@ def test_measure_power_returns_si_units():
|
|
|
51
51
|
|
|
52
52
|
def test_measure_power_passes_its_keywords_through():
|
|
53
53
|
tx = FakeTransport()
|
|
54
|
-
plug = benchpod_plug(transport=tx)()
|
|
54
|
+
plug = benchpod_plug(transport=tx, wiring={"version": 2, "efuse": 1})()
|
|
55
55
|
profile = measure_power(plug, 0.5, efuse=2, rate_hz=500, keep_samples=2)
|
|
56
56
|
req = _request(tx)
|
|
57
57
|
assert req["efuse"] == 2 and req["rate_hz"] == 500.0 and req["keep_samples"] == 2
|
|
@@ -70,7 +70,7 @@ def test_measure_power_uses_the_wiring_profile_rail():
|
|
|
70
70
|
|
|
71
71
|
def test_measure_power_phase_records_current_voltage_and_energy():
|
|
72
72
|
tx = FakeTransport()
|
|
73
|
-
rec = _run(measure_power_phase(benchpod_plug(transport=tx), duration=1.0))
|
|
73
|
+
rec = _run(measure_power_phase(benchpod_plug(transport=tx, wiring={"version": 2, "efuse": 1}), duration=1.0))
|
|
74
74
|
assert rec.outcome == tr.Outcome.PASS
|
|
75
75
|
phase = _phase(rec, "measure_power")
|
|
76
76
|
assert _value(phase, "power_avg_current_a") == pytest.approx(0.052)
|
|
@@ -85,20 +85,20 @@ def test_measure_power_phase_records_current_voltage_and_energy():
|
|
|
85
85
|
|
|
86
86
|
def test_measure_power_phase_limits_pass_and_fail():
|
|
87
87
|
tx = FakeTransport()
|
|
88
|
-
rec = _run(measure_power_phase(benchpod_plug(transport=tx), duration=1.0,
|
|
88
|
+
rec = _run(measure_power_phase(benchpod_plug(transport=tx, wiring={"version": 2, "efuse": 1}), duration=1.0,
|
|
89
89
|
avg_current_range=(0, 0.1), peak_current_range=(0, 0.2),
|
|
90
90
|
energy_range=(0, 1.0)))
|
|
91
91
|
assert rec.outcome == tr.Outcome.PASS
|
|
92
92
|
|
|
93
93
|
tx = FakeTransport()
|
|
94
|
-
rec = _run(measure_power_phase(benchpod_plug(transport=tx), duration=1.0,
|
|
94
|
+
rec = _run(measure_power_phase(benchpod_plug(transport=tx, wiring={"version": 2, "efuse": 1}), duration=1.0,
|
|
95
95
|
avg_current_range=(0, 0.01))) # a 10 mA budget it blows
|
|
96
96
|
assert rec.outcome == tr.Outcome.FAIL
|
|
97
97
|
|
|
98
98
|
|
|
99
99
|
def test_measure_power_phase_attaches_the_kept_samples():
|
|
100
100
|
tx = FakeTransport()
|
|
101
|
-
rec = _run(measure_power_phase(benchpod_plug(transport=tx), duration=1.0, keep_samples=2,
|
|
101
|
+
rec = _run(measure_power_phase(benchpod_plug(transport=tx, wiring={"version": 2, "efuse": 1}), duration=1.0, keep_samples=2,
|
|
102
102
|
efuse=2, rate_hz=500, prefix="sleep"))
|
|
103
103
|
phase = _phase(rec, "measure_power")
|
|
104
104
|
assert _value(phase, "sleep_avg_current_a") == pytest.approx(0.052)
|
|
@@ -109,7 +109,7 @@ def test_measure_power_phase_attaches_the_kept_samples():
|
|
|
109
109
|
|
|
110
110
|
def test_measure_power_phase_can_skip_the_attachment():
|
|
111
111
|
tx = FakeTransport()
|
|
112
|
-
rec = _run(measure_power_phase(benchpod_plug(transport=tx), duration=1.0, keep_samples=2,
|
|
112
|
+
rec = _run(measure_power_phase(benchpod_plug(transport=tx, wiring={"version": 2, "efuse": 1}), duration=1.0, keep_samples=2,
|
|
113
113
|
attachment=None))
|
|
114
114
|
assert "power.json" not in _phase(rec, "measure_power").attachments
|
|
115
115
|
|
|
@@ -117,7 +117,7 @@ def test_measure_power_phase_can_skip_the_attachment():
|
|
|
117
117
|
def test_measure_power_phase_reports_a_fault_and_a_truncated_profile():
|
|
118
118
|
tx = FakeTransport()
|
|
119
119
|
tx.power_stats = dict(tx.power_stats, fault=True, truncated=True)
|
|
120
|
-
rec = _run(measure_power_phase(benchpod_plug(transport=tx), duration=1.0))
|
|
120
|
+
rec = _run(measure_power_phase(benchpod_plug(transport=tx, wiring={"version": 2, "efuse": 1}), duration=1.0))
|
|
121
121
|
assert rec.outcome == tr.Outcome.PASS # no limits were given; the log carries the warning
|
|
122
122
|
assert _value(_phase(rec, "measure_power"), "power_peak_current_a") == pytest.approx(0.18)
|
|
123
123
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{embeddedci_openhtf-2.3.0 → embeddedci_openhtf-2.4.0}/src/embeddedci_openhtf/measurements.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|