hex_bga_escape module#

Escape differential pairs from a hex-grid BGA: a narrow pair through the ball field and the full pair outside it.

HexBgaEscape takes two differential pairs out of a 7 by 8 hex-grid BGA on a four-layer board to a two-lane chip 15 mm away. The BGA uses the HexBGA landpattern of the si_bga_optimization demo, at that demo’s 1.0 mm ball pitch and 0.5 mm ball. Every ball that is not a signal is on GND.

Vias. Each GND ball has a through via in its pad, GroundVia, which joins the ball to the ground planes on layers 1 and 3. Each signal ball has a blind via in its pad, SignalVia, from the top layer to layer 2, where the pairs route as stripline between the two planes. Both are placed in code at the ball centres, as the demo places them: they are via-in-pad on chosen balls, which no via rule expresses. The far chip’s pads take a SignalVia each the same way.

The ball field. On layer 2 the pair runs down the channel between two columns of ground vias. Hex columns sit 1.0 mm x sqrt(3)/2 = 0.866 mm apart and each via pad is 0.3 mm across, so the channel between pad edges is 0.866 - 0.3 = 0.566 mm. A pair needs its two traces, its pair gap and its clearance on each side. The full pair takes 2 x 0.15 + 0.15 + 2 x 0.15 = 0.75 mm, which does not fit; the neck takes 2 x 0.08 + 0.1 + 2 x 0.08 = 0.42 mm, which does. So through the field the pair takes the neck structure and outside it the full one. For another part, redo the sum with its pitch, its via pad and your structures.

Narrowing by tag. Two routing structures do it, and the rules that apply them are the ones layout_routing_structure_by_tag teaches, with that pattern’s tags:

  1. design_constraint(SignalTag(), priority=2).routing_structure(full, ref_net=GND) on each pair’s net gives every section the full structure.

  2. A PairPoint just outside the field splits the coupled route in two. The inner section, from the PairInsertion below the pair’s balls to that PairPoint, carries EscapeNeckTag, and design_constraint(EscapeNeckTag(), priority=4).routing_structure(neck, ref_net=GND) gives it the neck structure. The uncoupled legs from the two vias to the insertion carry the same tag, so they take the neck structure’s uncoupled region. The higher priority wins where both rules match.

layout_bga_escape passes a power trace between the balls of the same HexBGA with a narrower trace_width. A differential pair needs its trace width, pair gap and clearance to change together and the two traces to stay coupled, which a routing structure carries and a trace_width rule does not, so this pattern narrows with structures.

The change happens at the PairPoint. The point’s own copper, centred on it, changes from the neck’s trace width to the full pair’s, so the neck route ends and the full route starts within about 0.1 mm of it. The point sits TRANSITION_MARGIN below the field’s lowest ball edge, far enough that the full pair clears the last ground vias. Without the neck rule, the routes through the field are not made: the issues report “Unable to find path for requested route”.

A DifferentialRoutingStructure with an uncoupled_region and a PairInsertion at the field edge also narrows the pair, but its legs run uncoupled through the field and their gap drifts. A split at a PairPoint keeps the pair coupled at the neck structure’s gap, which is why this example uses it.

Fabrication limits. The neck, 0.08 mm traces 0.1 mm apart with 0.08 mm clearance, is below the 0.127 mm floors of the sample fabrication constraints, and a pair with all three at those floors, 5 x 0.127 = 0.635 mm, does not fit the 0.566 mm channel: the issues report “Unable to find path for requested route”. So the substrate states the limits of the HDI fabricator this board assumes, HdiFabConstraints (0.075 mm line and space, 0.15 mm drill), and every structure stays at or above them. A routing structure takes precedence over the fabrication minimums and routes at its own widths without raising an issue, so keeping it at or above the floors is the designer’s job; check realized copper with your fabricator’s design rule check.

Control points. The insertion point below each pair’s balls and the PairPoint at the field edge are fixed by the ball geometry. The bend that takes each full pair across to the chip’s lane, and the insertion where the pair splits for the chip’s pads, are choices a designer would make in the physical design view: they come from designer_placed_chip_side(), in code so that the example builds complete. JITX’s layout API refuses to move a PairInsertion or PairPoint placed in code, so in a real design leave these out of the code and place them in the view.

Structure labels. Each structure needs an impedance, and Substrate.differential_routing_structure looks structures up by it, as jitxlib’s protocol constraints do. The neck carries 0 ohm so that no lookup for a real impedance returns it: a lookup for the pair’s 100 ohm returns the full pair.

The widths here are illustrative, not solved for an impedance.

The test, tests/test_hex_bga_escape.py, checks the geometry offline: the full pair does not fit the channel and the neck does, the transition clears the field, and a ground via sits at every ground ball. With JITX_PATTERN_RUNTIME=1 and a runtime started at the project root, it builds the design and measures each section’s width and gap, where the transition falls, and that every route is made.

PAIR_BALLS = (((2, 4), (2, 3)), ((2, 6), (2, 5)))#

rows counted from 0, columns from 1. P is on the column offset half a pitch down, so P and N are neighbours 1.0 mm apart across the channel the pair escapes down.

Type:

Each pair’s (P, N) balls as HexBGA.get_pad (row, column)

ESCAPE_LAYER = 2#

The stripline layer the pairs route on, between the planes on 1 and 3.

PLANE_LAYERS = (1, 3)#

The ground plane layers.

INSERTION_DROP = 0.25#

From the lower ball of a pair to the PairInsertion where its legs join, in mm.

TRANSITION_MARGIN = 0.5#

From the field’s lowest ball edge to the PairPoint where the neck ends, in mm.

CHIP_INSERTION_RISE = 2.0#

From the far chip’s pads to the PairInsertion above each lane, in mm: a designer’s choice, used by designer_placed_chip_side().

VELOCITY = 191335235228#

illustrative.

Type:

Signal velocity for both structures, in mm/s

INSERTION_LOSS = 0.0178#

illustrative.

Type:

Insertion loss for both structures, in dB/mm

class FourLayerStackup[source]#

Bases: SampleStackup

The sample stackup with four copper layers.

class HdiFabConstraints[source]#

Bases: SampleFabConstraints

The limits of the HDI fabricator this board assumes: 0.075 mm (3 mil) line and space, 0.15 mm drills with a 0.075 mm annular ring. Not any one fabricator’s figures; take yours from its capability sheet.

min_copper_width: float = 0.075#

Minimum permissible copper width. This constraint will be enforced by the engine for generated copper shapes and will take precedence over other constraints and rules, such as trace width.

min_copper_copper_space: float = 0.075#

Minimum permissible copper-to-copper spacing. This constraint will be enforced by the engine for generated copper shapes and will take precedence over other constraints and rules, such as clearance.

min_copper_hole_space: float = 0.15#

Minimum permissible copper-to-hole spacing. This constraint will be enforced by the engine for generated copper shapes and will take precedence over other constraints and rules, such as clearance.

min_annular_ring: float = 0.075#

Minimum annular ring around a hole or via.

min_drill_diameter: float = 0.15#

Minimum diameter of a hole either in a pad or a via.

min_hole_to_hole: float = 0.15#

Minimum distance between two holes, such as through-hole pads or vias.

class HexEscapeSubstrate(*args, **kwargs)[source]#

Bases: Substrate

Four copper layers, the HDI fabrication limits, the two vias and the two pair structures.

stackup: Stackup = FourLayerStackup()#
constraints: FabricationConstraints = <jitxexamples.patterns.hex_bga_escape.HdiFabConstraints object>#
class GroundVia(*args, **kwargs)[source]#

Bases: Via

Through via in each ground ball’s pad.

start_layer: int = 0#

Starting layer for the via. Setting this to a layer index other than the top layer allows for creating buried or blind vias.

stop_layer: int = -1#

Ending layer for the via.

diameter: float | ViaDiameter = 0.3#

Pad diameter of the via, in mm. Can be overridden on a per-layer basis by diameters.

hole_diameter: float = 0.15#

Drilled or laser-cut hole diameter for the via, in mm.

filled: bool = True#

Whether the via is filled.

tented: set[Side] | Side | None | bool = 0#

Whether the via is tented on Top, Bottom, or both sides. Untented sides will have a solder mask opening.

type: ClassVar[ViaType] = 1#

MechanicalDrill or LaserDrill.

Type:

Type of via drilling method

via_in_pad: bool = True#

Whether the via is allowed to be placed inside a component’s pads.

class SignalVia(*args, **kwargs)[source]#

Bases: Via

Blind via in each signal pad, from the top to the escape layer.

start_layer: int = 0#

Starting layer for the via. Setting this to a layer index other than the top layer allows for creating buried or blind vias.

stop_layer: int = 2#

Ending layer for the via.

diameter: float | ViaDiameter = 0.3#

Pad diameter of the via, in mm. Can be overridden on a per-layer basis by diameters.

hole_diameter: float = 0.15#

Drilled or laser-cut hole diameter for the via, in mm.

filled: bool = True#

Whether the via is filled.

tented: set[Side] | Side | None | bool = 0#

Whether the via is tented on Top, Bottom, or both sides. Untented sides will have a solder mask opening.

type: ClassVar[ViaType] = 1#

MechanicalDrill or LaserDrill.

Type:

Type of via drilling method

via_in_pad: bool = True#

Whether the via is allowed to be placed inside a component’s pads.

FULL_PAIR = DifferentialRoutingStructure(name='Full pair', impedance=<Quantity(100, 'ohm')>, layers={2: Layer(trace_width=0.15, pair_spacing=0.15, clearance=0.15, velocity=191335235228, insertion_loss=0.0178).reference(1, 1.0).reference(3, 1.0)}, uncoupled_region=RoutingStructure(name='Full pair, uncoupled', impedance=<Quantity(50, 'ohm')>, layers={2: Layer(trace_width=0.15, clearance=0.15, velocity=191335235228, insertion_loss=0.0178).reference(1, 1.0).reference(3, 1.0)}))#

0.15 mm traces, 0.15 mm apart, 0.15 mm clearance.

Type:

The pair outside the field

NECK_PAIR = DifferentialRoutingStructure(name='Neck pair', impedance=<Quantity(0, 'ohm')>, layers={2: Layer(trace_width=0.08, pair_spacing=0.1, clearance=0.08, velocity=191335235228, insertion_loss=0.0178).reference(1, 1.0).reference(3, 1.0)}, uncoupled_region=RoutingStructure(name='Neck pair, uncoupled', impedance=<Quantity(50, 'ohm')>, layers={2: Layer(trace_width=0.08, clearance=0.08, velocity=191335235228, insertion_loss=0.0178).reference(1, 1.0).reference(3, 1.0)}))#

0.08 mm traces, 0.1 mm apart, 0.08 mm clearance. Its 0 ohm is a label that keeps impedance lookups on the full pair, not an impedance.

Type:

The pair in the field

class EscapeHexBGA[source]#

Bases: Component

A placeholder 56-ball hex-grid BGA with two differential pairs. Not an orderable part.

lanes[i] is on the balls PAIR_BALLS[i]; every other ball is GND.

manufacturer: str | None = 'Fictional'#

Manufacturer for this component.

mpn: str | None = 'EXAMPLE-HEXBGA56'#

Manufacturer part number for this component.

reference_designator_prefix: str | None = 'U'#

Reference designator prefix for this component. This will be used to generate a unique reference designator for each component of the same type.

Note

This field is a required data point for matching components between builds. If this value changes (including changing from unset to set), it will be treated as a new component, even if nothing else changes.

lanes = [DiffPair(), DiffPair()]#
GND = [Port(), Port(), Port(), Port(), Port(), Port(), Port(), Port(), Port(), Port(), Port(), Port(), Port(), Port(), Port(), Port(), Port(), Port(), Port(), Port(), Port(), Port(), Port(), Port(), Port(), Port(), Port(), Port(), Port(), Port(), Port(), Port(), Port(), Port(), Port(), Port(), Port(), Port(), Port(), Port(), Port(), Port(), Port(), Port(), Port(), Port(), Port(), Port(), Port(), Port(), Port(), Port()]#
landpattern = HexBGA(num_rows=7, num_cols=8, pitch=1.0, ball_diameter=0.5).pad_config(SMDPadConfig(copper=Ellipsis, soldermask=Ellipsis, paste=Ellipsis)).package_body(RectanglePackage(height=Toleranced(0.9, 0.1, 0.1), width=Toleranced(7, 0, 0), length=Toleranced(7.5, 0, 0)))#
symbol = BoxSymbol()#
pad_centre(pad, origin)[source]#

A landpattern pad’s centre in the circuit’s frame, for a part placed at origin with no rotation.

Return type:

tuple[float, float]

Parameters:
designer_placed_chip_side(transitions, lanes)[source]#

Each pair’s bend and chip-side insertion, as (bend, insertion).

lanes are the midpoints of each chip lane’s two pads. A designer places these points in the physical design view, where the board’s other routing shows what they have to clear. They are written here so the example builds complete: the insertion CHIP_INSERTION_RISE above the lane’s pads, and the bend halfway down from the transition to it, on the lane’s centreline.

Return type:

list[tuple[tuple[float, float], tuple[float, float]]]

Parameters:
class HexBgaEscape[source]#

Bases: Circuit

Two pairs from a hex-grid BGA to a two-lane chip, narrowed in the ball field.

nets: list[Net]#
signal_vias: list[Via]#
attachments: list[PortAttachment]#
insertions: list[PairInsertion]#
transitions: list[PairPoint]#
bends: list[PairPoint]#
chip_insertions: list[PairInsertion]#
legs: list[Route]#
necks: list[Route]#
fulls: list[Route]#
chip_legs: list[Route]#
class HexEscapeBoard[source]#

Bases: Board

A 16 by 30 mm board.

shape: Shape = ArcPolygon(elements=(Arc(center=(7.0, 14.0), radius=1, start=0.0, arc=90.0), Arc(center=(-7.0, 14.0), radius=1, start=90.0, arc=90.0), Arc(center=(-7.0, -14.0), radius=1, start=180.0, arc=90.0), Arc(center=(7.0, -14.0), radius=1, start=270.0, arc=90.0)))#

The board outline shape.

class hex_bga_escape_design(*args, **kwargs)[source]#

Bases: SampleDesign

Two pairs escaping a hex-grid BGA on a four-layer HDI board.

substrate: Substrate = HexEscapeSubstrate()#
board: Board = HexEscapeBoard()#
circuit: Circuit = HexBgaEscape()#