layout_heavy_copper_layer module#
Wider traces and clearances on one heavy copper layer, by layer rule.
Heavier copper etches less precisely, so a fabricator asks for wider traces
and wider gaps on a 2 oz layer than on a 1 oz one. A design rule carries that
per layer: OnLayer(i) is a condition that matches copper on conductor
layer i. The heavy layer gets floors, and every rule that would
otherwise beat a floor on that layer gets a copy narrowed to the layer.
HeavyInnerSubstrate is a 4-layer stackup with a 70 um (2 oz) first inner
layer; the other three conductors are 35 um. heavy_layer_index()
finds it by walking substrate.stackup.conductors (0 is the top) by
thickness. Two nets are routed between pairs of PowerVia, each layer
under a GND pour: PWR, which carries PowerTag, once each on layers 0,
1 and 2; SIG, which carries no tag, on layers 0 and 1.
The rules sit on one priority ladder, the layout-constraints skill’s:
0, board defaults:
IsTrace0.2 mm wide,(IsCopper, IsCopper)0.15 mm apart;1, the trace-to-pour clearance
(IsTrace, IsPour)0.2 mm, below every rule on a net tag so a tag’s clearance to pours wins; and the heavy layer’s floors,IsTrace & OnLayer(1)0.5 mm wide and(IsCopper & OnLayer(1), AnyObject)0.35 mm, with the trace-to-pour rule’s own form on that layer,(IsTrace & OnLayer(1), IsPour), at the larger of its value and the floor;2, the power nets’ rules:
PowerTag0.4 mm wide and 0.3 mm to any object;3, the power rules’ copies on the heavy layer,
PowerTag() & OnLayer(1), at the floor, since both power values are below it.
A floor at 1 loses to every rule at 2 or above that matches the same copper,
with nothing reported; the copies at 3 are what hold the floor for the power
nets. heavy_layer_rules() writes the floors, the trace-to-pour
layer form and the copies from the rules it is given.
Measured on jitx 4.6, at mid-span, with the pour pullback the winning clearance plus 0.01 mm:
PWR on layers 0 and 2: 0.4 mm wide, pour 0.31 mm away;
PWR on layer 1: 0.5 mm wide, pour 0.36 mm away;
SIG on layer 0: 0.2 mm wide, pour 0.21 mm away;
SIG on layer 1: 0.5 mm wide, pour 0.36 mm away.
Each piece is needed, measured on jitx 4.6 with that piece left out and no design issue either time:
without the copies at 3, PWR on layer 1 came back 0.4 mm wide with the pour 0.31 mm away: the power rules at 2 beat both floors;
without the trace-to-pour layer form, the pour came back 0.21 mm from SIG on layer 1: at rung 1,
(IsTrace, IsPour)beat the clearance floor.
OnLayer.internal() matches every inner layer, here both 1 and 2, not
the heavy one alone; name the index when one inner layer differs (measured
on jitx 4.6: a width rule on PowerTag() & OnLayer.internal() widened
the routes on layers 1 and 2 and left layer 0’s).
Keep a requested width at or below the pads the route ends on. On jitx 4.6
a route asked to be wider than its 1.0 mm end pads came back 1.0 mm wide,
the convex hull of the two pads, with no design issue. PowerVia has a
1.0 mm pad so that the heavy floor fits.
- BOARD_WIDTH = 0.2#
Board default trace width, mm.
- BOARD_CLEARANCE = 0.15#
Board default copper-to-copper clearance, mm.
- TRACE_TO_POUR = 0.2#
Trace-to-pour clearance, mm.
- POWER_WIDTH = 0.4#
Power trace width, mm.
- POWER_CLEARANCE = 0.3#
Power copper to any other object, mm.
- HEAVY_MIN_WIDTH = 0.5#
The heavy layer’s trace width floor, mm.
- HEAVY_MIN_CLEARANCE = 0.35#
The heavy layer’s copper clearance floor, mm.
- POWER_ROUTE_Y = {0: 10.0, 1: 0.0, 2: -10.0}#
The y coordinate of the power route on each routed layer, mm.
- SIGNAL_ROUTE_Y = {0: 4.0, 1: -5.0}#
The y coordinate of the untagged route on each routed layer, mm.
- heavy_layer_index(substrate, thickness=None)[source]#
The conductor index of the heavy layer, 0 being the top.
Walks
substrate.stackup.conductorsand reads each conductor’sthickness. Withthicknessgiven, returns the one conductor that thick; without it, the one conductor thicker than the rest. RaisesValueErrorwhen a conductor has no thickness, when no conductor or more than one matches (pass the index directly for a stackup with two heavy layers), or when every conductor is equally thick: a layer the substrate does not model as heavy is a substrate task first.
- heavy_layer_rules(layer, min_width, min_clearance, trace_to_pour, class_rules=(), *, exclude=())[source]#
The rules that hold one heavy layer’s floors, on the skill’s ladder.
Returns, for conductor
layer:the floors at priority 1:
IsTrace & OnLayer(layer)atmin_widthand(IsCopper & OnLayer(layer), AnyObject)atmin_clearance;the trace-to-pour rule’s layer form at priority 1,
(IsTrace & OnLayer(layer), IsPour), at the larger oftrace_to_pourandmin_clearance, so that on the layer it beats both(IsTrace, IsPour)and the floor;for each rule in
class_ruleswhose value is below the floor, a copy at priority 3 narrowed with& OnLayer(layer), at the floor. A rule at priority 2 or 3 beats the floors at 1 on the layer’s copper, with nothing reported, so without the copy it would hold its own value there. A rule at or above the floor needs no copy.
excludenames route tags a width copy must not match, such as a sense tag on sense routes that is not a subclass of the class tag:PowerTag() & ~SenseTag() & OnLayer(layer). A tag is not excluded from its own rule’s copy. Clearance copies are not narrowed byexclude: on an excluded route a clearance copy that left it out would leave the class’s rule at 2, below the floor, beating the floor at 1. The cost: a sense clearance above the floor loses to the copy on the heavy layer. A sense route on a power net there meets(SenseTag(), AnyObject)at 3, say 0.5, and the copy(PowerTag() & OnLayer(layer), AnyObject)at 3, at the floor. At one priority the more specific condition wins, and the copy is more specific, so the sense route holds the floor (0.35 in this module), not 0.5. A user’s ownSenseTag() & OnLayer(layer)rule at 3 ties the copy on specificity, and what decides a tie is not established. That reasoning follows the layout-constraints skill’s priority ladder; a sense route on a heavy layer was not measured here.class_rulestakes only the shapes the layout-constraints skill teaches: one-conditiontrace_widthrules and two-conditionclearancerules, at priority 2 or 3, whose (first) condition is one tag. Anything else raisesValueError; write its layer form by hand. A class that wants a value on the layer above the floor writes its own& OnLayer(layer)rule at 3 and is left out ofclass_rules.- Return type:
- Parameters:
- class HeavyInnerStackup[source]#
Bases:
StackupFour conductors, top to bottom 35, 70, 35 and 35 um.
- top_surface = SoldermaskLayer(thickness=0.1)#
- l0 = Copper(thickness=0.035, name='Top')#
- d0 = Core(thickness=0.55)#
- l1 = Copper(thickness=0.07, name='In1 (2 oz)')#
- d1 = Prepreg(thickness=0.1)#
- l2 = Copper(thickness=0.035, name='In2')#
- d2 = Core(thickness=0.55)#
- l3 = Copper(thickness=0.035, name='Bottom')#
- bottom_surface = SoldermaskLayer(thickness=0.1)#
- class HeavyInnerSubstrate(*args, **kwargs)[source]#
Bases:
SubstrateThe 4-layer stackup with the sample fabrication constraints.
- constraints: FabricationConstraints = <jitx.sample.SampleFabConstraints object>#
- class PowerVia(*args, **kwargs)[source]#
Bases:
ViaA through via with a 1.0 mm pad and a 0.5 mm drill.
- 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.
- diameter: float | ViaDiameter = 1.0#
Pad diameter of the via, in mm. Can be overridden on a per-layer basis by
diameters.