do-tps5430-place-power-stage
Tier: hard · Mode: do · Expected outcome: edit · Covers: placement against vendor layout guidance
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 place a switching regulator’s power stage the way the regulator’s datasheet asks. The guidance is the TPS5430 datasheet’s layout section (TI SLVS632L rev L, §7.4.1, and Figure 7-12). It is qualitative throughout: as close as possible, minimize the loop area, keep the conductor short. Each assertion below turns one of its sentences into a measured bound, and says how the bound was chosen.
The request names the parts and asks for placement only. Routing is a separate task, do-tps5430-route-power-stage, so a failure here is a placement failure.
The starting state
start.patch is applied to the fixture before the baseline commit, so nothing it does counts as the run’s work. scripts/make-start-patch.ts writes it. It removes everything that would give the answer away:
-
The eleven fitted power-stage parts (U1, C1 to C6, D3, L1, R2, R3) move to two rows below the board, all at 0°. Unfitted C8 and C10 stay where they are.
-
Copper:
- all 58 tracks on VIN_BUCK, SW, BOOT, FB, +5V and EN;
- 11 GND tracks that ended on a staged pad, each chain followed to its end;
- 52 vias: the nets’ own, and the GND stitching vias within 1.5 mm of where a staged pad was or of a removed track;
- 28 teardrops.
-
Fills. All 22 remaining zone fills are removed. Their cutouts would mark the old pads.
-
The design record. Docs lines that pair a coordinate, an axis position or a copper area with a staged part, an unrouted net or a loop are replaced with a one-line notice:
File Lines withheld docs/CHANGELOG.md106 docs/DECISIONS.md43 docs/SPEC.md3 docs/SUBSYSTEMS.md6 Lines that locate only what stays, such as the outline, the mounting holes and the connectors, are kept. Validation checks that no staged part’s original position, and no end of a removed track, appears anywhere in the starting state.
The starting state’s DRC, with zones refilled, has 0 errors, 0 warnings, 0 parity issues and 45 unconnected items, all of them the unplaced stage. That is the recorded baseline in task.json.
About the pours. copperhead 0.14.0 refills the pours of a board a run has changed before its DRC, but not this board: the board stores its teardrops as zones, which a KiCad refill would regenerate, so copperhead declines and says so in the tool result. During the run its own DRC therefore sees the ground pours unfilled, as 0.13.0’s did, and reports their pads as unrouted. copperhead counts unrouted connections but never as violations, so this does not block it. The scorer refills on its copy before every DRC, so it grades the board a fab would build. A placement can pass the agent’s own check and still fail here, for example where the refilled pour cannot reach a ground pad. That is a real defect.
What is graded, and the arithmetic behind each bound
Every bound lies between a measured correct placement and a measured bad one. It is the geometric mean of the worst correct measurement and the best bad one, rounded to two significant figures. The two correct placements are:
- Reference: the fixture’s own rev E layout.
- Alternative: every staged part moved or turned. C2 rather than C1 closes the input loops, the divider stands vertical, C6 rather than C5 sits at L1, and the rest shift.
The bad placements are in test/layouts/. The calibration test replays every one of them.
| Assertion | §7.4.1 asks | Bound | Reference | Alternative | Bad | Unplaced start |
|---|---|---|---|---|---|---|
input-cap-at-vin |
ceramic bypass right at VIN | ≤ 2.7 mm | 0.58 | 0.58 | 12.61 (input caps beyond D3) | 3.47 |
bypass-loop |
small loop through bypass cap, VIN and GND | ≤ 11 mm² | 5.7 | 5.7 | 21.3 (input caps beyond D3) | 4.0 |
catch-diode-loop |
catch diode close, to keep its loop small | ≤ 42 mm² | 31.2 | 31.2 | 55.6 (input caps beyond D3), 91.8 (D3 beyond L1) | 91.9 |
switch-node-span |
inductor very close to PH, conductor area small | ≤ 14 mm | 9.15 | 8.92 | 20.16 (D3 beyond L1), 21.43 (boot cap far) | 41.89 |
boot-cap-close |
boot capacitor close, conductors short | ≤ 4.1 mm | 1.67 | 1.67 | 10.20 (boot cap far) | 36.72 |
output-cap-at-inductor |
keep the PH, Lout, Cout, GND loop small | ≤ 7.6 mm | 4.95 | 4.75 | 11.63 (above L1), 42.87 (far left) | 10.15 |
divider-at-vsense |
divider at VSENSE (Figure 7-12) | ≤ 12 mm | 3.37 | 4.50 | 31.64 (at the output connector) | 62.91 |
How each kind of measurement works:
- Spans (
pad_span_max): the shortest tree of copper gaps joining the named pads, read from the IPC-D-356 netlist kicad-cli exports. It is the least conductor any route of them needs. A switch node with three far-apart pads therefore measures its total spread, not one pair’s. - Loops (
pad_loop_area_max): the area enclosed by the pad centres in order, every lobe counted. - Why both. A loop alone does not prove closeness: in the unplaced start, C1 lies in line with U1’s pins, so the bypass loop encloses only 4.0 mm².
input-cap-at-vinbounds the distance alongside it. - Either capacitor. C1 and C2 are the same part, so either may close the input loops; C5 and C6 likewise at the output.
Also required:
stage-on-board: every pad of every staged part lies inside the outline. DRC raises nothing for a part left entirely off the board.rest-unmoved: nothing outside the stage moves, including the unfitted C7, C8, C10 and J3 and the test points.no-new-drc-errors: zones are refilled, and the baseline above applies. A courtyard overlap or a copper clash with what stays fails here.surgical-board-edit: the reference changes 68 of 11,498 lines, about six per part. The 2 % bound leaves room three times over 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 output loop’s area. §7.4.1 asks for the PH, inductor, output capacitor and ground loop to be small, and a pad-centre polygon cannot measure it on this board. The return runs through the ground pours, and every bad output-capacitor placement tried made the polygon smaller than the reference’s: 74.9 to 79.7 mm² against 110.9 mm². The output capacitor’s distance from the inductor is graded instead.
- Routing, which is the other task.
- C3, the 100 nF high-frequency decoupler. The datasheet’s bypass guidance is about the 4.7 µF-or-larger ceramic.
- Thermal. D3 is cooled from its anode copper and U1 through its exposed pad, and placement alone cannot show either.
- Where the test points end up relative to the stage. They stay put, and reaching them is routing.
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-place-power-stage