part2_power module#
JS4 Part 2: power, in code: the decoupling placed, the plane pours drawn and the rules for the two 2 oz power layers.
JS4PowerCircuit takes Part 1’s fanned-out board
(part1_fanout_escape) and adds, on BOTTOM, every decoupling
capacitor and the ZQ, IO_VR and RREF resistors, each in the circuit of the
part it serves so it moves with that part; one plane pour per planed rail
per layer; and the power rules. The design models no power source: each
rail ends at its pours and its capacitors.
Placement order, each step clear of what the earlier ones placed: the resistors; the small capacitors, rails with the fewest balls first, so a small rail gets its sites before a large one takes the room around them; the bulk capacitors, and any small one that found no free site, in the ring; then the pours.
Resistors (PowerFpga, PowerMemory). Each straddles
two of its part’s ball vias where its two nets sit one pitch apart, so its
pads lie on the vias and it needs no route:
each
r_zqover its ZQ ball and the VDD2 ball beside it in row A (the memory’s ZQ0 at A5 beside A4, ZQ1 at A8 beside A9; ZQ’s resistor goes to the 1.1 V net, which VDD2 is on);each
r_rrefover its group’s AVTTRCAL ball and the RREF ball beside it in the same row (GTY at AB6 and AB7, GTM_L at W28 and W27, GTM_RN at T10 and T11).
IO_VR_700 (AJ12) has no ball of the 1.1 V net beside it: its nearest
VCCO_700 ball is three rows away. r_io_vr puts its IO_VR pad on the
ball’s via and its other pad on a through via of its own at the centre of
the square of four balls beside it, toward bank 700’s VCCO balls; that via
joins the 1.1 V plane on L9, whose outline reaches it.
Small capacitors, below 10 uF (place_straddles()). Each sits on
BOTTOM across a one-pitch pair of ball vias, its rail pad over a ball via of
its rail and its return pad over a ground ball via beside it, with no route:
the pads lie on the vias. It takes the pair nearest the ball its
ShortTrace names (vp1002_lpddr4.decoupling) whose courtyard
overlaps no part placed before it, trying that ball’s neighbours in the
order +x, -x, +y, -y. What fits, as a one-pitch straddle on the
THVia_6p0 fanout vias (pad 0.252 mm), each pad reaching its via and
keeping 2.8 mil (0.071 mm, the substrate’s copper space floor) from every
other via pad, with the example catalogue’s lands:
Land |
FPGA, 0.92 mm |
Memory, 0.8 mm (x) |
Memory, 0.65 mm (y) |
|---|---|---|---|
0201 |
fits, 0.629 mm |
fits, 0.359 mm |
fits, 0.334 mm |
0402 |
fits, 0.494 mm |
fits, 0.224 mm |
fits, 0.099 mm |
0603 |
fails, 0.029 |
fails, pad on via |
fails |
0805 |
fails, on via |
fails |
fails |
Each figure is the gap from the cap’s pads to the nearest other via pad.
Every capacitor below 10 uF in the design is an 0201 or an 0402, so each one
fits a pair by size. Across the pair, an 0201’s courtyard (0.83 mm) fits
between FPGA rows (0.92 mm); an 0402’s (1.10 mm) does not, nor does either
at the memory, so the courtyard check keeps those a row apart. What runs
out is room: all 12 of the memory’s small capacitors straddle, and 34 of
the FPGA’s 37. The other three (UNPAIRED), one each of XPIO
banks 700, 701 and 702, belong to rails of three balls whose few
rail/return pairs are already taken. They go to the ring as a bulk
capacitor does, on the 1.1 V plane, tied to their ball by a plain net, not
a ShortTrace, since a ring capacitor has no trace back to a ball. Eight
more small capacitors of the base design’s sets find no pair either, on
rails with no plane here; Part 1 never creates them (below).
Bulk capacitors, 10 uF and up, and the small capacitors with no free site
(place_ring()). No bulk capacitor fits between the vias, and a
production FPGA evaluation board puts every part of 10 uF and up outside
the ball field, each on its own via to the plane. Each goes in a ring just
outside its part’s field, axis across the field’s edge with its rail pad
toward the field and its courtyard starting half a pitch outside
the outermost ball centres, on the edge nearest its rail’s balls (ties in
the order right, left, top, bottom), slid along that edge from the point
nearest those balls until its courtyard is clear. Each pad has a
THVia_6p0 through via at its centre, so the rail pad reaches its plane
and the return pad the ground pours with no route; the evaluation board’s
ring traces reach at most 47.9 mil (1.22 mm), and a via in the pad is
within that. The memory’s edge facing the FPGA takes no ring capacitor,
and the FPGA’s edge facing the memory takes only the XPIO banks’ (the 1.1
V net): the channel between the parts is where the LPDDR4 routes run.
Those also keep out of the corridor where Part 4 routes channel B’s two
byte lanes (BYTE_LANE_CORRIDOR), so bank 702’s two slide along
the edge to x -11.04 and -12.88 mm. In a capture of the built design, the
nearest of those vias, at (-2.76, -5.51), keeps 153.22 mil (3.89 mm) from
its pad edge to the copper of Part 1’s L3 escape routes. A ring
capacitor carries no ShortTrace, so no route runs back to a ball.
In the ring: the FPGA’s seven bulk capacitors on planed rails (VCCINT,
VCC_SOC, VCC_IO, VCCAUX and one per XPIO bank) and the three small ones of
the XPIO banks; the memory’s three (VDDQ, VDD2 and VDD1).
Left out, by Part 1. A ring capacitor on a rail with no plane here would
sit on its two vias with nothing joining its rail via to its rail’s balls,
so it would decouple nothing. Part 1’s FPGA circuit never creates one
(part1_fanout_escape.FanoutFpga.decoupling_layouts()): 27 of the
base design’s 71 FPGA capacitors, 19 bulk capacitors, one each on VCC_RAM,
VCCAUX_PMC, VCC_PMC, VCC_PSLP, VCC_PSFP, VCCO_500, VCCO_502, VCCO_503,
GTY_AVCC_RS, GTY_AVCCAUX_RS, GTY_AVTT_RS, GTM_AVCC_L, GTM_AVCC_RN,
GTM_AVCCAUX_L, GTM_AVCCAUX_RN, GTM_AVTT_L, GTM_AVTT_RN, VCCINT_GT_L and
VCCINT_GT_R, and the eight small ones above. Part 2 places every capacitor
it inherits. Its FPGA circuit adds one thing to Part 1’s
RailLayout per rail, read before
any capacitor is created (PowerFpga.decoupling_layouts()): the
XPIO banks’ unpaired capacitors tied by a plain net. A small capacitor in
a field stays whatever its rail: it sits on its rail’s ball via. The
design holds 59 capacitors: 46 in the fields (34 FPGA, 12 memory) and 13
in the ring (10 FPGA, 3 memory).
Rail to layer (PLANES), after the split of the same evaluation
board’s planes, a design choice:
L9_PWR1_2OZ: VCCINT under the FPGA, as on the evaluation board; and the 1.1 V net (the VCCO of XPIO banks 700 to 702 and the memory’s VDD2 and VDDQ), one piece from bank 700 to 702’s VCCO balls to the whole memory field, as the evaluation board’s VCC1V1_LP4 sits alone on L9 under its memory. It is the rail’s only copper joining its balls, since the design has no source.
L10_PWR2_2OZ: VCC_SOC (with VCC_IO, one net) and VCCAUX under the FPGA, as on the evaluation board.
L12_SIG4: the memory’s VDD1, 1.8 V, alone under the memory, as the evaluation board puts its memory 1.8 V rail on a signal layer. Nothing of Parts 1 and 3 uses L12: Part 1’s escapes are on L3 and its pours on the ground layers, and the runbooks give channel A L5 and the command, address and clock L7.
The other FPGA rails (VCC_RAM, the PMC, PSLP, PSFP and VCCO_50x rails, the
GTY and GTM rails and VCCINT_GT) get no plane here, so Part 1 creates no
ring capacitor on them. FPGA_PLANES names the same FPGA rails
as Part 1’s POURED_RAILS.
Pours (rail_outline(), split_layers()). One polygon per
rail per layer, from the part’s ball grid: a cell one pitch square on each
of the rail’s balls; the cells’ bounding box per contiguous cluster (balls
at most two pitches apart, so VCCINT’s checkerboard is one cluster and the
other-net vias inside it are voids in the pour); clusters joined by the
hull of each pair, the next cluster to the nearest one already joined; and
each ring capacitor’s or resistor’s rail via joined to the rail ball
nearest it by a link (channel_link()), LINK_WIDTH wide
once the layer is split. The link runs midway between ball rows and
columns, never along one: a strip one cell wide along a row has the voids
of that row’s other-net vias in it, and the webs left beside them fall
under the width floor (rules, below), so the via ends up on an island.
Under the memory a ring via is joined by the hull of its cell and its
nearest ball’s. On a layer, a rail earlier in PLANES keeps any
overlap, and every outline then shrinks by half of PLANE_GAP,
so two rails on a layer stay that far apart.
Under the memory each rail has its layer to itself, so its outline is the
memory’s whole field, with no subtraction.
The pours sit in JS4PowerCircuit, computed from where the parts’
circuits sit, so they do not follow a part that moves; the capacitors,
resistors and their vias do.
Rules. The substrate’s L9_PWR1_2OZ and L10_PWR2_2OZ are 2 oz copper,
2.4 mil finished (the stackup table,
STACKUP_ROWS). The
substrate’s drawing gives no width or gap on either: its impedance table
covers only the signal layers. The values come from a fabricator’s
published capability, PCBWay’s “PCB Capabilities” page, Advanced PCB item
14, “Inner layer min width/spacing (before compensation)”, 70 um row
(https://www.pcbway.com/capabilities.html, read 2026-11-10; the page
carries no revision): 6/8 mil in the normal process, 6/7 mil at medium
difficulty. The 70 um row is 2 oz nominal; the drawing’s layers finish at
61 um, so the row is the conservative one.
Width floor,
HEAVY_MIN_WIDTH: 6.0 mil on each plane layer.Clearance floor,
HEAVY_MIN_CLEARANCE: 7.0 mil on each plane layer, the medium column, a design choice: the board already builds its 0.5 oz layers at the fabricator’s finest column (2.6 mil lines, 2.8 mil gaps), so the medium column on 2 oz does not raise its build class. A plane keeps6.0 + 2 x 7.0mil clear across two other-net vias, each a 6.0 mil hole on L9 and L10 (drawing note 9 removes their unused pads): 20.0 mil. A capture of the built design agrees: each void around another net’s via on L9 and L10 is 0.51 mm (20.1 mil) across. That leaves a web of 16.22 mil between FPGA balls (36.22 mil pitch) and 11.50 mil between memory columns (31.50 mil); between memory rows (25.59 mil) it leaves 5.59 mil, under the width floor, so the sliver rule removes it and the 1.1 V plane joins its memory balls along the columns. A strip one FPGA pitch wide centred on a ball row leaves 8.11 mil of copper each side of a void in that row, and 3.11 mil once the layer split takes half ofPLANE_GAPoff each edge, under the floor: hence the links between rows (pours, above).
Both floors go on each plane layer through
heavy_layer_rules()
at priority 1, with the trace to pour rule’s form on the layer at the
clearance floor. Every other layer keeps the substrate’s fabrication floor.
Power width. Each planed rail’s net carries PowerTag, with
POWER_WIDTH, 6.0 mil, for any trace on it, at priority 2. The
design gives no rail current, so the value is a design choice: the plane
layers’ width floor, so it needs no copy there, and narrow enough to pass
between two of the memory’s fanout vias in adjacent rows (10.07 mil
between their pads at the 2.8 mil floor). No trace in this part takes it:
every capacitor and resistor sits on its vias.
Pours join every via and pad of their own net solid: the design has no
relief rule. The vias are filled and plated over (drawing note 18) and no
inner layer is soldered, so a relief would buy no solderability and put
its spokes in series with every via’s current. A pour drops any part
narrower than its layer’s width floor, POUR_FEATURE (2.6 mil) on
every layer and HEAVY_MIN_WIDTH on L9 and L10.
The design applies no SI constraints. It needs the parts chain
base describes.
- L9 = 8#
L9_PWR1_2OZ, by the substrate’s conductor-index map.
- L10 = 9#
L10_PWR2_2OZ, by the substrate’s conductor-index map.
- L12 = 11#
L12_SIG4, by the substrate’s conductor-index map.
- PLANE_LAYERS_2OZ = (8, 9)#
The two 2 oz plane layers the heavy copper rules apply to.
- HEAVY_MIN_WIDTH = 0.15239999999999998#
PCBWay Advanced PCB item 14, 70 um row, normal and medium columns (module docstring).
- Type:
Trace width floor on a 2 oz plane layer, mm
- HEAVY_MIN_CLEARANCE = 0.17779999999999999#
PCBWay Advanced PCB item 14, 70 um row, the medium column, a design choice (module docstring).
- Type:
Copper clearance floor on a 2 oz plane layer, mm
- POWER_WIDTH = 0.15239999999999998#
no rail current is given (module docstring).
- Type:
Width of a trace on a planed rail, mm. A design choice
- POUR_FEATURE = 0.06604#
the substrate’s fabrication floor, 2.6 mil.
- Type:
Narrowest pour feature kept on any layer, mm
- PLANE_GAP = 0.254#
Gap between two rails’ pours on one layer, mm. A design choice above the 7.0 mil floor: the smallest gap between rails on the production FPGA evaluation board’s L9 and L10 under its FPGA is 10.0 mil.
- LINK_WIDTH = 0.46#
Width of a ring via’s link to its rail’s balls, once the layer is split, mm: half the FPGA’s ball pitch, so it holds the whole channel between two rows of via voids (module docstring, pours).
- FPGA_PITCH = (0.92, 0.92)#
AMD’s NFVI1369 package drawing, e = 0.92.
- Type:
The VP1002’s ball pitch, x and y, mm
- MEMORY_PITCH = (0.8, 0.65)#
0.8 between columns (x) and 0.65 between rows (y), Micron’s 200-ball package drawing.
- Type:
The memory’s ball pitch, mm
- CLUSTER_LINK = 2#
Two balls of a rail are in one cluster when at most this many pitches apart in row and in column, so a rail whose balls alternate with ground (VCCINT’s checkerboard) is one cluster.
- RING_EDGES = ('right', 'left', 'top', 'bottom')#
The edges of a ball field, in the order that breaks a tie for the nearest edge.
- BYTE_LANE_CORRIDOR = (-0.36, -10.227, 10.91, -5.02)#
Where channel B’s byte lanes run between the two ball fields, as
(x0, y0, x1, y1), mm, in the board’s frame: across the gap from the memory field’s FPGA-facing edge (y -10.227) to the FPGA field’s memory-facing edge (y -5.020), over the span that the reference layout Part 4 routes along (part4_reference_routes) and Part 1’s strobe escapes occupy there. It runs from byte lane 1’s DQ3, where it crosses the FPGA field’s edge (x -0.360), to byte lane 0’s DQ3 at its memory field exit (x 10.910); Part 1’s two FPGA escape pair points lie inside it (x 1.382 and 7.931).
- CORRIDOR_MARGIN = 0.19685000000000002#
How far, mm, a ring capacitor’s courtyard keeps outside
BYTE_LANE_CORRIDOR: half the width of a byte lane’s open-field line, the substrate’s 46 ohm structure on L3_SIG1 (3.1 mil), plus that structure’s clearance (6.2 mil, twice the width), so a line along the corridor’s edge keeps its clearance from everything under the courtyard.
- class Plane(*values)[source]#
Bases:
EnumEach planed rail, in the order its layer is split: on a layer, an earlier rail keeps any overlap.
- VCCINT = 'VCCINT'#
- LP4_1V1 = 'LP4_1V1'#
- VCCAUX = 'VCCAUX'#
- VCC_SOC = 'VCC_SOC'#
- LP4_VDD1 = 'LP4_VDD1'#
- PLANES: dict[Plane, int] = {Plane.LP4_1V1: 8, Plane.LP4_VDD1: 11, Plane.VCCAUX: 9, Plane.VCCINT: 8, Plane.VCC_SOC: 9}#
The layer of each planed rail’s pour (module docstring, rail to layer).
- FPGA_PLANES: dict[str, Plane] = {'VCCAUX': Plane.VCCAUX, 'VCCINT': Plane.VCCINT, 'VCCO_700': Plane.LP4_1V1, 'VCCO_701': Plane.LP4_1V1, 'VCCO_702': Plane.LP4_1V1, 'VCC_IO': Plane.VCC_SOC, 'VCC_SOC': Plane.VCC_SOC}#
The plane of each FPGA rail that has one, by the rail names of
fpga_sets(); VCC_IO is on VCC_SOC’s net.
- UNPAIRED: dict[str, frozenset[int]] = {'VCCO_700': frozenset({1}), 'VCCO_701': frozenset({1}), 'VCCO_702': frozenset({1})}#
The FPGA’s capacitors below 10 uF on a planed rail that find no free pair of ball vias, by rail name and place in the rail’s set (
fpga_sets()): the second 4.7 uF of each XPIO bank. Those with no pair on rails with no plane are Part 1’sNO_FIELD_PAIR, never created. Whether a capacitor finds a pair is known only once the field is placed, but the decoupling sets read the layout before any capacitor is created (PowerFpga.decoupling_layouts()). The placement (place_straddles()) is deterministic, so the result is worked out once and written here as data. If it goes stale,PowerParts.place_decoupling()fails when a capacitor not listed here finds no pair. A listed one that would now find a pair is never tried here, since it is in the ring; the repository’s Part 2 tests place every set whole and check that the capacitors with no pair are exactly these and Part 1’s.
- class RailCaps(balls, returns, small, bulk, plane, edges)[source]#
Bases:
objectOne decoupling set to place: its rail’s balls, the balls its return pads may sit on, each capacitor with the ball its net names (by ShortTrace, to sit at the ball, or by plain net, to go in the ring), the plane its rail joins and the field edges its ring may use.
- Parameters:
- class Field(part, pitch)[source]#
Bases:
objectA placed BGA part’s balls in the frame of the circuit that holds it: their pad centres, grid positions and pitch, and the courtyards of the parts placed on BOTTOM so far.
- neighbours(ball)[source]#
The balls one pitch from
ballalong a row or column, in the order +x, -x, +y, -y in this frame.
- courtyard(part)[source]#
A placed part’s courtyard in the frame of the circuit that holds it.
- Return type:
BaseGeometry- Parameters:
part (Component)
- pad_points(part)[source]#
The centre of each of a placed part’s pads in the frame of the circuit that holds it.
- straddle(part, p1_at, p2_at)[source]#
Place a two-pad part on BOTTOM centred between two points, its axis along the line joining them and its
p1pad towardp1_at.p1is on the land’s first pad: the part declares no pad mapping, so JITX pairs its ports with its pads in declaration order.
- place_straddles(field, rail)[source]#
Place each small capacitor of
railacross a free rail/return pair, the pair nearest the ball its net names; return each placed capacitor with its two balls, and those that found no free pair.
- fits(field, part, a, b)[source]#
Whether
part, straddling ballsaandb, is clear of every courtyard kept so far.
- place_ring(field, part, balls, edges)[source]#
Place a capacitor in the ring outside the field, its axis across the edge of
edgesnearestballsand itsp1pad toward the field, its courtyard starting half a pitch outside the outermost ball centres, slid along the edge one pitch at a time from the point nearest those balls until its courtyard is clear. Return itsp1andp2pad centres.
- tied(nets, caps)[source]#
Each of
capswhosep1is in one ofnets(a decoupling set’sshort_tracesorbulk_nets), with the ball the net ties it to, in the order ofnets.
- class PowerParts[source]#
Bases:
objectWhat
PowerFpgaandPowerMemoryshare: the vias they add, and where each via that joins a plane sits, with that plane. Each part is held once, by the decoupling set or straps that made it, so nothing here lists the parts.- power_attachments: list[PortAttachment]#
- place_field(field, rails)[source]#
The small capacitors in the field, rails with the fewest balls first, so a small rail gets its sites before a large one takes the room around them. Return those that found no free pair.
- place_decoupling(field, rails, keepouts=())[source]#
The small capacitors in the field (
place_field()). Then the ring capacitors, clear ofkeepouts, the bulk ones first and then any small one the layout sends there (UNPAIRED), each pad on its own via and no trace back to a ball. Fails if a small capacitor finds no pair or a rail with no plane has a ring capacitor:UNPAIREDno longer agrees with the placement.
- class PowerFpga[source]#
Bases:
FanoutFpga,PowerPartsPart 1’s FPGA circuit with its resistors and capacitors placed on BOTTOM, and their vias.
- decoupling_layouts()[source]#
Part 1’s layouts, which leave out the capacitors a rail with no plane could not use (module docstring, “Left out”), with the small capacitors of
UNPAIREDsent to the ring. Fails ifFPGA_PLANESand Part 1’sPOURED_RAILSname different rails.- Return type:
- rail_caps()[source]#
Each decoupling set of the FPGA: the XPIO banks’, every other rail’s and VCCAUX_SMON’s. Only the XPIO banks’ ring may use the bottom edge, which faces the memory, and there only outside
BYTE_LANE_CORRIDOR, a design choice: the byte lanes and Part 1’s strobe escapes leave the field there, and a ring via in their way leaves them no room (a build of Part 4’s reference with a 1.1 V ring via at (0.92, -5.51) reported a route there as unrealizable for lack of space). A capacitor whose nearest position falls in the corridor slides along the edge to the nearest free one outside it (place_ring()).
- class PowerMemory[source]#
Bases:
FanoutMemory,PowerPartsPart 1’s memory circuit with its ZQ resistors and capacitors placed on BOTTOM, and their vias.
- to_board(shape, circuit)[source]#
shape, in the frame ofcircuit, in the frame of the circuit that holds it.- Return type:
BaseGeometry- Parameters:
shape (BaseGeometry)
circuit (Circuit)
- rail_outline(field, balls, attachments=())[source]#
One rail’s outline on its layer, in the field’s frame, before the layer is split: each cluster’s box of one-pitch cells, the clusters joined (
join_boxes()), and each attachment point (a capacitor’s or resistor’s rail via) joined to the rail ball nearest it bychannel_link().
- channel_line(field, axis, v, toward)[source]#
A coordinate along
axis(1 for y, across ball rows; 0 for x, across columns) for a link to run on:vitself when it is more than a quarter pitch from every ball row or column, elsevmoved half a pitch towardtoward, which is midway between two rows or columns whenvlies on one.
- channel_link(field, at, ball)[source]#
A strip joining
attoballthat runs between ball rows and columns, never along one, so the vias of other nets beside it leave it the full channel between their voids (module docstring, pours). From a point beyond the field’s left or right edge it runs along the channel besideat’s row, then along the channel besideball’s column; otherwise along the channel besideat’s column, then besideball’s row. Its width isLINK_WIDTHplusPLANE_GAP, the partsplit_layers()shrinks away.
- attach(field, shape, balls, attachments)[source]#
shapewith each attachment point joined to it by the hull of the point’s cell and the cell of the ball ofballsnearest it.
- join_boxes(boxes)[source]#
The boxes as one shape: each next box, the one nearest those already joined, joined by the hull of it and the joined box nearest it.
- Return type:
BaseGeometry- Parameters:
boxes (Sequence[BaseGeometry])
- split_layers(outlines, gap)[source]#
Each plane’s pour: its outline less those of the planes before it on its layer, in
Planeorder, then shrunk by half ofgap.
- class JS4PowerCircuit[source]#
Bases:
JS4FanoutCircuitJS4FanoutCircuitwith Part 2’s power: the resistors and capacitors placed with their vias (in the parts’ circuits), the plane pours and the power rules.- power_rules: list[DesignConstraint]#