Closed feature request

Routing: signal nets take twice the vias and twice the copper they need

noah · ·closed by John Lauer

Routing: signal nets take twice the vias and twice the copper they need

Seen on: adom-aiflow 0.2.40 to 0.2.44, the same AM32 ESC built twice (boards and method in #127):

  • AI Flow: adom/am32-esc-2s6s-molecule, board-19, full AI Flow run.
  • Hands-on: adom/am32-esc-v1, routed by hand.

What happened: "signal" below means every net except ground, battery, phase and the supply rails.

AI Flow Hands-on
Signal vias 48 on 16 of 33 signal nets 25 on 12 of 34
Signal copper 701 mm 319 mm
Median detour (routed length ÷ minimum spanning tree of the net's pads) 1.41 1.14

Worst nets on the AI Flow board:

Net AI Flow Hands-on
BEMF_A / B / C (back-EMF sense) 87.5 / 91.8 / 46.7 mm; 2 / 10 / 5 vias 17.0 / 23.0 / 32.4 mm; 2 / 2 / 2 vias
Gate drive, driver to gate (6 lines) 23 to 47 mm, average 33 mm; worst phase A high side 47 mm 15 to 29 mm, average 22 mm
MCU to driver PWM inputs (INHx / INLx) 10 to 25 mm, 2 vias on each high-side line about 2 mm each, 0 vias
SWCLK 24.6 mm, detour 2.3 7.6 mm

Where the signal vias came from:

  • 26 from the AI's hand-written power and gate-drive plan
  • 18 from AI Flow's grid router
  • 4 from the AI's own maze router (finish.py, which closed the connections the router left open)

Why it matters: each via adds inductance, a stub, a drill hit and a place to fail, and it blocks the other layer. Here most of them, and most of the extra length, are avoidable. Better placement would have removed many: the MCU next to the driver inputs, the back-EMF dividers between the phase contacts and the MCU's comparator pins. Re-ordering or re-layering the traces would have removed others. The router's via cost only trades a via against a few grid steps, one connection at a time; it never asks whether moving a part or an earlier trace would remove the via.

Suggested fix:

  1. Report vias and detour per signal net in route and gate: count, length, detour ratio, worst nets first. Then the AI (and the human, on the timeline) sees "BEMF_B: 10 vias, 92 mm, 2.3× its pad tree" before landing.
  2. A per-net via budget in the spec, defaulted from the signal-priority ranking (0 vias for the top-ranked nets, small budgets below). route honours it with rip-up of lower-priority nets, and gate reports nets over budget.
  3. When a net is over budget or over a detour ratio, the hint names placement as the fix: "INHA: 25 mm, 2 vias between U1.21 and U2.22, 14 mm apart; move U2 toward U1 or rotate it (place pack --wish)". Today the levers listed are more passes, back to placement for parts that failed to route, or take the stage, and none of them fires for a net that routed badly.
  4. route --variants ranks on total copper length and via count today. Weight both by the net's priority, so a variant that saves a via on BEMF beats one that saves a via on a test point.

fig_compare

1 Reply

John Lauer ·

Noah, fixed in adom-aiflow 0.2.49 as part of the route-quality report (see #127).

For every signal net, route, gate and finish give:

  • its via count;
  • its routed length;
  • its detour: routed length divided by the minimum spanning tree of its pads.

The worst nets come first. Power nets are left out: anything the spec lists under loads, planes, wideNets, switchNodes or pours, plus names like GND, VBAT, PH*, V*, 3V3 and 12V.

Placement suggestion. When a signal net has 2 or more vias, or a detour of 1.5x with at least 3 mm of extra copper, the report names the part to move, in your wording:

INHA: 25.0 mm, 2 vias between U1.21 and U2.22 that are 14.0 mm apart: move U2 toward U1 or rotate it (place pack --wish)

A net with more pads names its longest hop.

Not built: a per-net via budget that fails the gate (item 2), and ranking route variants by it (item 4). AI Flow no longer refuses anything (0.2.48). The numbers and suggestions are there for the AI and the human to act on. A via budget can come back as a preference that shapes suggestions, together with #129's signal ranking.

Closing this one; reopen if the report misses a case you see.

Upgrade: tell your AI "give me the latest adom-aiflow" (or adom-wiki pkg install adom/adom-aiflow); adom-aiflow --version says 0.2.49.

John Lauer closed this ·

Log in to reply.