fenced_pour_outline module#
Fence vias along an arbitrary closed outline.
Use this pattern when a row of ground vias has to follow a shape that is not
a route: the antipad opening around a signal-via pair, the perimeter of an RF
cavity, the boundary of a BGA breakout. A fence_via rule fences the pours
it matches. On jitx 4.6 it fences no route, whether its tag is on the route
or on its net, and reports no issue; a route’s fence comes from its routing
structure (RoutingStructure.Layer.fence). With the tag on a net, the rule
fences that net’s pours, placing the same vias as the tag on the pour. A
tagged pour gives the rule the outline to follow. The module has two
examples: FencedOutline, a ring outside an opening that stays clear, and
CavityRing, a closed ring inside a ground cavity pour. Three pieces
compose:
A rule.
FenceOutlineTagnames the outlines to fence, anddesign_constraint(FenceOutlineTag()).fence_via(via, pattern)asks for fence vias of classviaalong every object that carries the tag. Here the rule is a substrate attribute: JITX finds design constraints by walking the design, so a rule takes effect only once the design can reach it.A tagged pour.
fence_pouris drawn in the shape to fence, and the tag is what makes the rule select it. The generated vias take the pour’s net, so the pour has to be on the board’s ground net:FencedOutlineexposes aGNDport, and the circuit that uses it connects that port to its own ground. The pour sits on the fence via’s stop layer, the convention the BGA escape demo follows:uGnd_L1_L3spans layers 0 to 2, and the pour is on layer 2.A KeepOut, optional in general and used here.
fence_keepoutcovers the same outline on the same layer;pour=Truekeeps pours from covering the area andvia=Truekeeps auto-placed vias out of it. Use it when the opening has to stay clear, as for an antipad or a cavity. Leave it out when the area should stay copper, for example a ground region that is also a return path. The fence vias are placed with or without it.
ViaFencePattern.offset is the spacing between rows of vias and, while
initial_offset is unset, also the distance from the outline to the
centres of the first row, measured outwards. With the one row used here, the
0.2 mm offset puts the 0.25 mm via pads 0.075 mm clear of the outline, outside
the KeepOut. The 0.4 mm pitch is the closest the generic substrate allows
for this via: its 0.1 mm drills then sit 0.3 mm apart, the substrate’s
min_hole_to_hole, and JITX does not check it. The 0.25 mm pads need no
copper spacing: the fence vias are all on GND, and clearance is not enforced
between copper of the same net. On this 1.6 mm outline the
fence has 13 vias, and the via at the outline’s end sits 1.0 mm from the
centre (0.8 mm half-length plus the 0.2 mm offset). Measured on jitx 4.6:
13 vias 0.407 mm apart, the end via 1.0004 mm from the centre, no design
issues. The pour itself comes back empty there, since the KeepOut covers it
and nothing else of its net is inside it, and the fence is still placed
along its drawn outline.
CavityRing turns the fence inwards. A negative offset and
initial_offset put the row inside the outline, so the vias land in the
cavity pour’s own copper and join it to the GND plane on layer 2. Measured on
jitx 4.6 with CAVITY_PATTERN: 24 vias, centres 0.5 mm inside the 8 mm by
6 mm outline at 1.0 mm spacing, one at each corner, so the ring is closed; no
design issues. The ring’s vias do not anchor the pour: with anchor
moved outside the cavity, the cavity pour came back empty. anchor is a
code-placed GND via that keeps the cavity pour and the plane from being
dropped as islands. The fab sets the closest the ring can be:
CAVITY_PATTERN.pitch is at least one via pad, since JITX thins a pitch
below the pad without a design issue, and keeps min_hole_to_hole between
drills, which JITX does not check either.
input_shape_only keeps its default (true), so the rule fences the pour’s
pre-isolation outline, the shape as drawn, rather than its post-isolation
shape.
The pour sets no isolate: Pour.isolate is deprecated since jitx 4.4.
Pour clearance belongs in a design rule.
fence_count_range() gives the via count to expect along an outline
before a build is checked: it returns 12 to 14 for FencedOutline (13
measured) and 23 to 24 for CavityRing, whose offset outline is exactly
24 pitches long (24 measured).
- FENCE_LAYER = 2#
Conductor layer of the fenced pour (L3-Ground2), where
uGnd_L1_L3stops.
- FENCE_PATTERN = ViaFencePattern(pitch=0.4, offset=0.2, num_rows=1, min_pitch=None, max_pitch=None, initial_offset=None, input_shape_only=None)#
One row of vias at 0.4 mm pitch, centred 0.2 mm outside the outline.
- fence_count_range(outline, initial_offset, pitch, via, fab)[source]#
The fence via counts to accept per row along a pour outline, lowest first.
outlineis the pour’s drawn outline in any frame, andinitial_offsetthe row’s offset, positive outward and negative inward. For row k of a pattern, pass the pattern’sinitial_offset + (k - 1) * offset(the pattern’sinitial_offsetdefaults to itsoffset). Every measured outline fence had one row; multi-row outline fences were not measured. L is the length of the outline offset byinitial_offset, its corners kept square:an outward offset of a square whose L is a whole number of pitches gives
L / pitchvias: the offset keeps each corner square, with one via on its diagonal. Measured on jitx 4.6 on one case, 36 vias outside an 8 by 8 pour at offset 0.5, pitch 1.0 (L 36);anything else gives
floor(L / pitch) - 1toceil(L / pitch), never below 0: the runtime changes the spacing to close the ring (measured on jitx 4.6: 26 vias 0.6 inside an 8 by 8 pour at pitch 1.0, 19 around a 2.5 radius circle at offset 0.5, 13 around this module’s capsule and 24 inside its cavity). Outward offsets of rectangles that are not square, and of a square whose L is not a whole number of pitches, were not measured and take this range.
Raises
ValueErrorfor a pitch belowmin_stitch_pitch()forviaandfab, the larger of two bounds. Below one via pad the runtime thins the fence, so no count from L applies (measured on jitx 4.6 on a pour outline: 40 vias, every other site, at pitch 0.3 with a 0.45 pad). Below the drill plusmin_hole_to_holethe runtime fills every site but the fab cannot drill them (measured on jitx 4.6 on a stitch grid: 289 vias at pitch 0.5, drill edges 0.2 apart against a 0.254 minimum, with no issue).The range assumes the pattern sets neither
min_pitchnormax_pitch, which change how many vias the runtime places (measured on jitx 4.6: pitch 0.3 withmin_pitch0.6 gave 38, not 40).Count the generated vias that sit on the offset outline at the pitch; a distance band alone does not separate a fence from a stitch grid.
- class FencedOutlineSubstrate(*args, **kwargs)[source]#
Bases:
Generic_SubstrateThe generic 20-layer substrate with the outline fence rule attached.
- outline_fence = UnaryDesignConstraint(FenceOutlineTag, name=None, priority=0).fence_via(FenceVia(definition=<class 'jitxexamples.substrates.generic_20layer.Generic_Substrate.uGnd_L1_L3'>, pattern=ViaFencePattern(pitch=0.4, offset=0.2, num_rows=1, min_pitch=None, max_pitch=None, initial_offset=None, input_shape_only=None)))#
- class FencedOutline[source]#
Bases:
CircuitOne fenced outline: a 1.6 mm by 0.8 mm capsule on layer 2.
Connect
GNDto the board’s ground net; the fence pour and its vias are on that net.- GND = Port()#
- class fenced_pour_outline_design(*args, **kwargs)[source]#
Bases:
DesignThe fenced outline on its own board, with the substrate that carries the fence rule bound on the design.
- CAVITY_LAYER = 0#
Conductor layer of the cavity pour (L1-Ground1).
- CAVITY_VIA#
The ring via: the generic substrate’s through via, pad 0.5 mm, drill 0.25 mm.
- CAVITY_PATTERN = ViaFencePattern(pitch=1.0, offset=-0.5, num_rows=1, min_pitch=None, max_pitch=None, initial_offset=-0.5, input_shape_only=None)#
One row of vias at 1.0 mm pitch, centred 0.5 mm inside the cavity outline.
- class CavityRingTag[source]#
Bases:
TagPours with this tag get a ring of vias inside their outline.
- class CavityRing[source]#
Bases:
CircuitAn 8 mm by 6 mm GND cavity pour on layer 0 with a closed via ring inside its outline, joined to a GND plane on layer 2.
Connect
GNDto the board’s ground net. The ring rule is an attribute of the circuit, so it reaches any design that uses the circuit.- GND = Port()#