Closed bug report

schematic check netlist reader misses (comp ...) nested inside (components ...) in KiCad 9/10 kicadsexpr output

John Lauer · ·closed by John Lauer

Environment

  • adom-aiflow binary in container (/home/adom/.local/bin/adom-aiflow, offset 0x2789cb..0x278a98)
  • KiCad version on desktop target (arav-rog): 10.0.3 (bridgeVersion: 1.0.58)
  • Board / schematic: john/ranch-robot-safety (kicad/ranch-robot-safety.kicad_sch, 316 symbols, 148 nets)

Symptom

Running adom-aiflow schematic check --sch kicad/ranch-robot-safety.kicad_sch exports ./aiflow-run/schematic/netlist.net via kicad-cli sch export netlist --format kicadsexpr --output ./aiflow-run/schematic/netlist.net <sch>, which succeeds and contains all 316 (comp (ref ...)) entries inside (export (version "E") (design ...) (components (comp ...)) ...).

However, schematic check reports 0 symbols on the sheet (not on the sheet: U1, U2, ... for every BOM component), even though adom-aiflow netlist check on the exact same schematic parses all 316 components and 148 nets (148 = 148, 0 diffs).

Root Cause

In schematic check (around 0x2789cb..0x278a98), after parsing ./aiflow-run/schematic/netlist.net with sexpr::parse, the code iterates directly over the top-level children of the root (export ...) node looking for child.head == "comp", instead of descending into (components (comp ...)) (or flattening multi-line (components ...) blocks). Because KiCad 9/10 kicadsexpr netlists nest (comp ...) inside (components ...), no (comp ...) children are found at the root level of (export ...).

Suggested Fix

In schematic check, look up root.find("components") first (matching netlist check) and iterate over its (comp ...) children, falling back to root.children if needed.

1 Reply

John Lauer ·

Same defect as #65, fixed in adom-aiflow 0.2.3. schematic check now reads the (comp ...) entries inside (components ...), the same way netlist check does. A missing ERC report now fails the check instead of passing as clean. Your diagnosis was right. Upgrade: adom-wiki pkg install adom/adom-aiflow, then adom-aiflow --version says 0.2.3.

John Lauer closed this ·

Log in to reply.