do-tps5430-route-power-stage
Tier: hard · Mode: do · Expected outcome: edit · Covers: routing against vendor layout guidance and a recorded current requirement
Fixture: copperheadhq-tps5430-buck (copperhead’s TPS5430 12 V to 5 V buck, rev E), from a patched starting state
What this tests
Whether the model can route a switching regulator’s three sensitive nets as its datasheet asks, on a board where every part is already placed. The nets are:
- SW, the switching node (PH);
- BOOT, the bootstrap;
- FB, the feedback (VSENSE).
The guidance is the TPS5430 datasheet’s layout section (TI SLVS632L rev L, §7.4.1): keep the switch-node conductor small, keep the boot capacitor’s conductors short, and keep VSENSE away from PH. The board’s own record adds a requirement the datasheet does not state, the 3 A the power path must carry. Placement is a separate task, do-tps5430-place-power-stage. Here the placement is the reference’s and may not change.
copperhead 0.14.0 has no routing tool. A model routes by writing (segment …) forms into the board file through edit_file, working out pad coordinates from the footprints itself. Expect low pass rates. This task is the baseline a routing capability would be measured against; a low score is not a verdict on what routing tools can do.
The starting state
start.patch is applied before the baseline commit, and scripts/make-start-patch.ts writes it. It removes:
-
Tracks: all 16 on SW (8), BOOT (3) and FB (5), and their 13 teardrops.
-
Vias: the 7 GND stitching vias within 2 mm of a removed track. The record describes a ring of them along the switch-node copper, which traces the route.
-
Fills: all 37 zone fills. Their cutouts would trace the removed tracks.
-
The design record. Docs lines that pair a coordinate, an axis position or a copper area with one of the three nets, a part with a pad on one, or a loop, are replaced with a one-line notice:
File Lines withheld docs/CHANGELOG.md65 docs/DECISIONS.md33 docs/SPEC.md2 docs/SUBSYSTEMS.md5 Validation checks that no end of a removed track appears anywhere in the starting state.
With zones refilled, the starting state’s DRC has 0 errors, 0 warnings, 0 parity issues and 12 unconnected items, all on the three nets.
About the pours. As in the placement task, copperhead cannot refill zones, so its own DRC sees the pours unfilled. The scorer refills on its copy before every DRC and before measuring copper, so a switch-node pour the model draws counts as the copper a fab would pour, even unfilled.
What is graded, and the arithmetic behind each bound
Two routes are correct:
- Reference: the fixture’s rev E tracks.
- Alternative:
- SW at 1.2 mm out of PH, then 1.6 mm, with a diagonal into L1;
- the boot branch at 0.6 mm;
- BOOT at 0.5 mm with one 45° corner;
- FB into R2 from the east and into R3 from above.
The bad routes are in test/layouts/, and the calibration test replays each.
| Assertion | Asks | Bound | Reference | Alternative | Bad |
|---|---|---|---|---|---|
routed-and-clean |
every connection made, no DRC error | 0 errors, 0 unrouted | clean | clean | the starting state has 12 unrouted |
sw-path-to-inductor |
SW from PH to L1 carries 3 A | ≥ 0.45 mm | 1.0 | 1.2 | 0.3 (thin power path) |
sw-path-to-diode |
SW from PH to D3 carries 3 A | ≥ 0.45 mm | 1.0 | 1.2 | 0.3 (thin power path) |
boot-short |
boot capacitor’s conductors short | ≤ 6.5 mm | 3.99 | 3.69 | 10.62 (detour round the top of U1) |
fb-away-from-sw |
VSENSE not close to PH | ≥ 1.2 mm | over 5 | over 5 | 0.3 (FB branch past C4’s SW pad) |
sw-copper-small |
switch-node conductor area small | ≤ 30 mm² | 22.66 | 18.26 | 39.95 (SW pour beside D3) |
How each bound was chosen:
- The power path’s width comes from a requirement.
docs/SPEC.mdsizes the power path for 3 A at a 20 °C rise or less in 2 oz copper. By IPC-2221’s external-layer formula, I = 0.048 · ΔT^0.44 · A^0.725 with A in mil², 3 A at 20 °C needs 48.7 mil². At 2 oz (2.76 mil) that is 17.7 mil, or 0.45 mm.- A 0.5 mm path meets that and is recorded as correct; a 0.3 mm path fails.
- The width is the widest copper path’s narrowest track, from KiCad’s own board. The 0.5 mm branch to the boot capacitor and TP5 is not on that path and is not graded by it.
- Pads, vias and fills are never the bottleneck. U1’s 0.6 mm PH pad is the part’s copper, not the route’s.
- The rest are calibrated. Each is the geometric mean of the worst correct measurement and the best bad one, rounded to two significant figures.
- BOOT length and FB clearance are KiCad DRC rules in grading.kicad_dru. The scorer appends them after the project’s own rules, never shows them to the run, and attributes violations by rule name. A rule the run adds to the project’s file cannot relax them, and a test checks that.
- Switch-node copper is the SW tracks, vias and fills, minus the pad copper, measured on the refilled board on a 0.01 mm grid. A thinner route also shrinks it: the 0.3 mm route measures 8.55 mm². Area and width pull against each other, so a correct route is short and wide.
Also required:
parts-unmoved: every footprint where it started.surgical-board-edit: the reference adds 128 of 13,047 lines, 16 tracks at 8 lines each. The 4 % bound leaves room for about 65 tracks and fails a regenerated board.- The schematic untouched, the files bounded, one commit, a clean finish, no secret.
What is not graded, and why
- The GND stitching vias. The start patch removed seven, and a correct route need not put them back. Ground stays connected through the pours.
- Teardrops. KiCad regenerates them when it refills, so the scorer’s measurements include them whether or not the run drew any.
- The VIN side of the input loop. That is placement-dominated, and VIN_BUCK is not unrouted here.
- EMI beyond these proxies. No simulation is run.
Regenerating the starting state
Only when the fixture changes. The baseline in task.json is rewritten by the same command:
npx tsx scripts/make-start-patch.ts do-tps5430-route-power-stage