Treat KiCad /net vs schematic net as one hierarchy finding.

Pad-net compare strips leading slash and nested sheet path so /ESP32_EN
matches ESP32_EN. If every mismatch is only that prefix, emit PE-LAY-003
once instead of per-pad reconnect errors.
This commit is contained in:
2026-09-20 08:10:34 +02:00
parent 89a484830e
commit f3f96ea4d1
4 changed files with 208 additions and 26 deletions
+3 -2
View File
@@ -23,6 +23,7 @@ from backend.periscopex.models import (
LayoutGraph,
LayoutPad,
)
from backend.periscopex.pcb_net_match import kicad_nets_match
from backend.periscopex.validate import _match_constraints
@@ -146,7 +147,7 @@ def _decoupling_finding(ref, comp, cons, rule, graph: DesignGraph, layout: Layou
if not fp:
continue
for pad in fp.pads:
if pad.net == net or pad.net == ic_pad.net:
if kicad_nets_match(pad.net, net) or kicad_nets_match(pad.net, ic_pad.net):
cap_pads.append(pad)
if not cap_pads:
return []
@@ -215,7 +216,7 @@ def _same_layer_finding(ref, comp, cons, rule, graph: DesignGraph, layout: Layou
return []
if len(ic_fp.courtyard) >= 3:
for v in layout.vias:
if v.net and v.net != net:
if v.net and not kicad_nets_match(v.net, net):
continue
if _in_poly(v.x, v.y, ic_fp.courtyard):
return []