Skip PE-PWR/PE-VIA without datasheet current (2.61.1).

Trace-width vs current runs only with I_load/Imax/I_abs. Missing I is a
skip, not INFO INSUFFICIENT, not USB 500 mA, not Iout_max-as-load.
This commit is contained in:
2026-09-21 12:11:52 +02:00
parent 6dc04b5cc7
commit c6abdae762
12 changed files with 115 additions and 64 deletions
+36 -1
View File
@@ -515,9 +515,44 @@ def test_power_trace_skips_without_i_load():
graph.components["U1"].specs.values["i_load_a"] = None # type: ignore[union-attr]
graph.components["U1"].specs = None
findings = check_pcb_power_traces(graph, cmap, layout)
assert findings == []
def test_power_trace_skips_iout_max_as_load():
from backend.periscopex.pcb_power_thermal import check_pcb_power_traces
graph, cmap, layout = _ldo_graph_layout(i_load=10)
graph.components["U1"].specs.values.clear() # type: ignore[union-attr]
graph.components["U1"].specs.values["iout_max_a"] = 10.0 # type: ignore[union-attr]
graph.components["U1"].specs.values["tj_max"] = 150.0 # type: ignore[union-attr]
findings = check_pcb_power_traces(graph, cmap, layout)
assert findings == []
def test_power_trace_uses_imax_when_i_load_absent():
from backend.periscopex.pcb_power_thermal import check_pcb_power_traces
graph, cmap, layout = _ldo_graph_layout(i_load=10)
vals = graph.components["U1"].specs.values # type: ignore[union-attr]
vals.pop("i_load_a", None)
vals["i_max"] = 10.0
findings = check_pcb_power_traces(graph, cmap, layout)
assert findings
assert findings[0].rule_id == "PE-PWR-001"
assert findings[0].evidence_status == "INSUFFICIENT"
assert findings[0].status == "ERROR"
def test_power_trace_uses_i_abs_when_i_load_absent():
from backend.periscopex.pcb_power_thermal import check_pcb_power_traces
graph, cmap, layout = _ldo_graph_layout(i_load=10)
vals = graph.components["U1"].specs.values # type: ignore[union-attr]
vals.pop("i_load_a", None)
vals["i_abs"] = 10.0
findings = check_pcb_power_traces(graph, cmap, layout)
assert findings
assert findings[0].rule_id == "PE-PWR-001"
assert findings[0].status == "ERROR"
def test_kelvin_sense_pin_on_shared_net():