RUE Logo

Tutorial 5.3: Routing Rules & Constraints

Defining and verifying design rules for trace widths, clearances, differential pairs, and length matching

Introduction to Routing Rules

Routing rules and constraints are the DNA of a well-designed PCB. They translate electrical requirements (impedance, timing, voltage isolation) into physical parameters (trace width, spacing, length) that the designer and DRC engine enforce during layout. A design without properly configured constraints is relying solely on the designer's memory and discipline - both of which fail under schedule pressure.

Rule Hierarchy

  1. Default rules: Baseline minimum values for the entire design (manufacturing minimum)
  2. Net class rules: Override defaults for specific groups of nets (e.g., "Power" class, "High-Speed" class)
  3. Net-specific rules: Override net class for individual critical nets
  4. Region-specific rules: Override all above within a defined board region (e.g., BGA breakout zone)

Checkpoint: Minimum Trace Width Per Net Class

Review Criteria

Every net class has an appropriate minimum trace width defined based on current capacity, impedance requirements, and manufacturer capabilities. No trace is narrower than the fabricator's minimum capability.

Net Class Width Definitions

Net ClassMin WidthPreferred WidthBasis
Default Signal4 mil (0.1mm)5 mil (0.127mm)Manufacturing minimum
Power (1A)10 mil (0.25mm)15 mil (0.38mm)IPC-2152 current capacity
Power (2A)20 mil (0.5mm)30 mil (0.76mm)IPC-2152 current capacity
Power (5A)50 mil (1.27mm)80 mil (2.0mm)IPC-2152 current capacity
50 ohm ControlledCalculated6.5 mil typField solver (stackup dependent)
100 ohm Diff PairCalculated4/5 mil W/S typField solver (stackup dependent)
USB 2.0 (90 ohm)Calculated5/7 mil W/S typUSB-IF specification

Manufacturer Minimum Capabilities

ParameterJLCPCB StandardJLCPCB AdvancedPCBWay StandardAdvanced Circuits
Min trace width5 mil (0.127mm)3.5 mil (0.09mm)4 mil (0.1mm)4 mil (0.1mm)
Min trace space5 mil (0.127mm)3.5 mil (0.09mm)4 mil (0.1mm)4 mil (0.1mm)
Width tolerance+/- 1 mil+/- 0.5 mil+/- 0.8 mil+/- 0.5 mil

Step-by-Step Width Rule Setup

  1. Define net classes based on function (Power_3V3, Power_1V8, USB_HS, DDR_Data, General_Signal)
  2. Assign all nets to appropriate classes (no orphan nets in "Default" unless truly default)
  3. Calculate required widths for power nets using IPC-2152 or Saturn PCB Toolkit
  4. Calculate impedance-controlled widths from field solver for signal nets
  5. Set minimum width rule for each class
  6. Set preferred width (used by auto-router and interactive width selection)
  7. Run DRC to verify no violations exist
Altium Designer - Net Class Setup

Navigate to Design > Net Classes. Create classes by selecting nets from the net list or using pattern matching (e.g., VCC* for all VCC nets). Set width rules in Design > Rules > Routing > Width. Create a rule for each net class: min/preferred/max width. Priority: higher number = higher priority.

KiCad - Net Classes

Open Board Setup > Net Classes. Define classes and assign nets using regex patterns. Set track width, clearance, and via size per class. In the schematic, you can assign net classes using "Net Class Directive" symbols attached to wires or buses.

Cadence Allegro - Constraint Manager

Open Setup > Constraints > Constraint Manager. Navigate to Physical tab. Define "Net Class" constraints with min/max/preferred widths. Use "Bus" objects to group related nets. The constraint hierarchy allows region-specific overrides for areas like BGA breakout zones.

Checkpoint: Clearance Rules Set Per Voltage

Review Criteria

Clearance between conductors is set based on the maximum voltage difference between adjacent nets. High-voltage nets have increased clearance per IPC-2221 requirements. Creepage and clearance distances meet safety standards.

IPC-2221B Clearance Requirements (Sea Level, Uncoated)

Voltage (DC or AC peak)Internal ClearanceExternal Clearance (Uncoated)External (Conformal Coated)
0-15V0.05mm (2 mil)0.1mm (4 mil)0.05mm (2 mil)
16-30V0.05mm (2 mil)0.1mm (4 mil)0.05mm (2 mil)
31-50V0.1mm (4 mil)0.6mm (24 mil)0.13mm (5 mil)
51-100V0.1mm (4 mil)0.6mm (24 mil)0.13mm (5 mil)
101-150V0.2mm (8 mil)1.25mm (50 mil)0.4mm (16 mil)
151-170V0.2mm (8 mil)1.25mm (50 mil)0.4mm (16 mil)
171-250V0.2mm (8 mil)1.25mm (50 mil)0.4mm (16 mil)
251-300V0.2mm (8 mil)1.5mm (60 mil)0.8mm (32 mil)
301-500V0.25mm (10 mil)2.5mm (100 mil)0.8mm (32 mil)

Safety Standard Creepage/Clearance (IEC 62368-1)

For mains-connected equipment, additional safety clearances apply:

Insulation TypeWorking Voltage 240VACClearanceCreepage (Pollution Degree 2)
Basic240 Vrms2.5mm4.0mm
Supplementary240 Vrms2.5mm4.0mm
Reinforced240 Vrms5.0mm8.0mm

How to Configure Voltage-Based Clearance

  1. Identify all voltage domains in the design and their maximum voltages
  2. Calculate clearance requirements between each voltage domain pair
  3. Configure clearance rules that apply to specific net-to-net combinations
  4. Pay special attention to:
    • Mains AC to low-voltage DC (reinforced insulation required)
    • High-voltage power supply output to logic signals
    • Battery terminals to chassis/ground
    • ESD protection devices (high transient voltages)
  5. Verify clearance is maintained on ALL layers (including internal layers at vias)
Good: Multi-Level Clearance Rules

Design has 5 clearance classes: Low-Voltage (5 mil), Mid-Voltage-48V (25 mil), High-Voltage-400V (100 mil), Mains-Basic (100 mil), Mains-Reinforced (200 mil). Each net is assigned to the correct class. Net-to-net clearance rules enforce the larger of the two classes involved.

Bad: Single Default Clearance

Entire design uses default 6 mil clearance. 48V power traces pass within 6 mil of 3.3V logic. Mains input traces have the same clearance as low-voltage signal traces. No safety clearance rules defined. Board will fail safety certification.

Checkpoint: Differential Pair Routing with Tight Coupling

Review Criteria

Differential pairs maintain consistent spacing throughout their length. Pairs are tightly coupled (spacing 1-2x trace width). Length matching between P and N is within specification. Pairs route symmetrically through vias and around obstacles.

Differential Pair Parameters by Interface

InterfaceTarget Z_diffTypical W/S (microstrip)Max Intra-Pair SkewMax Length
USB 2.0 HS90 ohm5mil / 7mil2.5 mil (0.15mm)150mm
USB 3.2 Gen185 ohm4.5mil / 6mil2 mil (0.05mm)100mm (PCB only)
PCIe Gen385 ohm4.5mil / 6mil5 mil200mm (PCB total)
PCIe Gen485 ohm4mil / 5mil2 mil150mm (PCB total)
HDMI 2.0100 ohm4mil / 6.5mil2 mil100mm
SATA III85 ohm4.5mil / 6mil5 mil200mm
DDR4 DQS100 ohm4mil / 5mil1 milPer byte-lane matching
LVDS100 ohm4mil / 6.5mil5 mil500mm
Ethernet (SGMII)100 ohm4mil / 6.5mil5 mil200mm

Differential Pair Routing Best Practices

  1. Maintain constant spacing: The space between P and N traces must not vary by more than 10% along the route
  2. Symmetric bends: When the pair turns, both traces must bend identically. Use coupled-mode routing, not individual trace routing
  3. No reference plane gaps: Never route a diff pair over a plane split or gap. The return path disruption destroys impedance and balance
  4. Via transitions in pairs: Both P and N vias must be placed symmetrically, with identical GND return vias adjacent
  5. Length matching: Match within each pair first (intra-pair), then match between pairs in the same interface (inter-pair)
  6. Breakout from IC: Begin tight coupling as soon as both traces clear the IC pad field

Common Pitfall: Asymmetric BGA Escape

When differential pairs exit a BGA, the P and N pads are often on different rows, creating unavoidable length mismatch in the breakout zone. This is acceptable IF: (1) You minimize the uncoupled length, (2) You compensate with serpentine on the shorter trace immediately after the breakout, and (3) The total skew budget accounts for this. Never leave uncoupled breakout length uncomprensated - even 2mm can exceed USB 3.x skew budget.

Checkpoint: Length Matching Groups Defined

Review Criteria

All nets requiring length matching have been identified, grouped correctly, and assigned appropriate matching tolerances. Length tuning serpentines are properly constructed with adequate amplitude and spacing.

Length Matching Requirements by Interface

InterfaceMatching GroupToleranceReference Net
DDR4 DataPer byte lane (DQ0-7 + DQS)+/- 2.5mm within groupDQS of each byte lane
DDR4 Address/CMDAll ADDR/CMD together+/- 5mm within groupClock (CK/CK#)
DDR4 ClockCK to CK# (intra-pair)+/- 0.5mmN/A (self-referenced)
RGMII TXTXD[0:3] + TX_CTL+/- 2.5mmTX_CLK
RGMII RXRXD[0:3] + RX_CTL+/- 2.5mmRX_CLK
PCIe LaneTX+/TX- (intra-pair)+/- 0.13mm (5 mil)N/A (self-referenced)
HDMID0+/-, D1+/-, D2+/-, CLK+/-+/- 2mm inter-pairCLK pair
SPI (high-speed)CLK, MOSI, MISO, CS+/- 5mmCLK

Serpentine Tuning Rules

Serpentine Quality Guidelines:
================================
Amplitude (A):  1x to 3x trace width (typically 3W max)
Spacing (S):    >= 3x trace width (to avoid self-coupling)
Gap (G):        >= 4x trace width (between adjacent serpentines)

Example for 5-mil trace:
  Amplitude: 5-15 mil
  Spacing:   >= 15 mil
  Gap:       >= 20 mil

GOOD serpentine:       BAD serpentine:
  _     _     _         __    __    __
 | |   | |   | |       |  |  |  |  |  |
 | |   | |   | |       |  |  |  |  |  |
 |_|   |_|   |_|       |__|  |__|  |__|

 S=3W, A=2W            S=1W, A=5W
 Low self-coupling     High self-coupling
 Minimal impedance     Significant Z change
 impact                and crosstalk
            
Altium Designer - Length Matching

Use Design > Rules > High Speed > Matched Net Lengths. Define "Match Group" rules with tolerance. During interactive routing, use Interactive Length Tuning tool (shortcut: select trace, then press "T" for tuning). Altium shows real-time length difference overlay. Use "Accordion" style for tight spaces or "Trombone" for wider areas.

KiCad - Length Tuning

Select a routed trace, then use Route > Tune Track Length (shortcut key depends on version). KiCad shows the target length and current length in real-time. Set target length in Board Setup > Design Rules > Net Classes or via custom rules. The interactive tuning creates meander patterns with adjustable amplitude and spacing.

Cadence Allegro - Constraint-Driven Length Matching

Define match groups in Constraint Manager > Electrical > Relative Propagation Delay. Set tolerance per group. During routing, enable Timing Vision to see real-time length status with color coding (green=matched, red=violation). Use Route > Delay Tune to add serpentines interactively.

Checkpoint: No Acute Angles (45-degree or Arc Preferred)

Review Criteria

All trace routing uses 45-degree angles or arcs. No 90-degree corners on signal traces (acceptable on power fills). No acute angles (<90 degrees) that create acid traps during etching. BGA fan-out uses 45-degree breakout patterns.

Trace Angle Guidelines

Angle TypeAcceptable?ImpactWhen Allowed
45-degreeBest practiceMinimal impedance discontinuityAlways - standard routing mode
Arc/CurveBest for high-speedSmoothest impedance transitionHigh-speed differential pairs, RF traces
90-degreeAcceptable (non-critical)Small impedance bump at cornerPower traces, low-speed signals, power polygons
Acute (<45 deg)NeverAcid trap in manufacturing, impedance spikeNever - always a DRC violation

The 90-Degree Corner Myth

While frequently cited as a major signal integrity issue, 90-degree corners have negligible electrical impact below 10 GHz. The actual impedance change at a 90-degree corner is approximately 15% over a distance of the trace width - typically less than 0.1 ps of timing impact. However, 90-degree corners are avoided because:

Common Pitfall: Acid Traps at Junctions

Acid traps occur where traces meet at acute angles (less than 90 degrees), creating small triangular pockets where etchant can pool and over-etch copper. This is most common at T-junctions where a branch trace meets the main trace at a shallow angle. Always ensure T-junctions meet at 90 degrees or greater, and use teardrop fillets at pad entries to prevent acid traps at trace-to-pad transitions.

Checkpoint: Trace Entry to Pads Centered

Review Criteria

Traces enter pads at the center axis or with adequate copper on both sides. Off-center pad entries create asymmetric solder joints during reflow. Teardrops added at critical pad entries for manufacturing reliability.

Pad Entry Requirements

Teardrop Benefits

  1. Eliminates potential acid trap at trace-pad junction
  2. Provides manufacturing margin for drill-to-copper registration
  3. Reduces stress concentration that can cause trace fracture during thermal cycling
  4. IPC Class 3 designs often require teardrops at all connections
Adding Teardrops by Tool

Altium: Tools > Teardrops - apply to all vias and/or SMD pads with configurable teardrop size.
KiCad: Edit > Apply Teardrops (KiCad 7+) - global teardrop application with radius control.
Allegro: Route > Gloss > Parameters > Fillet - configure automatic fillets during routing or as post-process.

Checkpoint: Neck-Down Rules at BGA Escape

Review Criteria

BGA breakout routing uses defined neck-down rules where traces transition from the pad field to full-width routing. The neck-down region has specific reduced width and spacing rules that maintain manufacturability while enabling escape from tight-pitch BGAs.

BGA Fan-Out Strategies

BGA PitchPad DiameterEscape Trace WidthEscape SpaceChannels Between Pads
1.27mm (50mil)0.6mm6mil6mil2 traces
1.0mm (40mil)0.5mm4mil4mil1-2 traces
0.8mm (31mil)0.4mm3.5mil3.5mil1 trace
0.65mm (25mil)0.3mm3mil3mil1 trace (advanced)
0.5mm (20mil)0.25mm2.5mil2.5mil0 (via-in-pad, HDI)

BGA Escape Routing Techniques

1.0mm Pitch BGA - Dog-Bone Fan-Out:

    O   O   O   O   O      O = BGA Pad
    |   |   |   |   |      | = Short trace to via
    v   v   v   v   v      v = Via (dog-bone)

  Row 1: All pads escape directly down to via on same layer or adjacent layer
  Row 2: Route between Row 1 pads (1 trace channel)
  Row 3: Route through via field (requires inner signal layers)
  Row 4+: Must use inner layers (blind/buried vias or through-hole vias)

Via-in-Pad (0.8mm and below):
  No dog-bone needed - via is IN the pad
  Requires via fill + planarization (adds cost)
  Enables escape from any row on inner layers directly
            

Neck-Down Rule Configuration

  1. Define a "BGA Breakout" region/room around each BGA component
  2. Create width/space rules for this region that allow reduced values:
    • Width: manufacturing minimum (3.5-4 mil typically)
    • Space: manufacturing minimum (3.5-4 mil typically)
  3. These region rules override the default net class rules ONLY within the BGA area
  4. Traces return to full width (impedance-controlled) once they exit the breakout zone
  5. Document the neck-down zone clearly for DRC review (short neck-down lengths minimize impedance impact)
Good: Controlled Neck-Down

BGA breakout region defined with 3.5mil/3.5mil rules. Traces neck down for maximum 2mm before transitioning to full 5-mil controlled-impedance width. Via fan-out uses consistent dog-bone pattern. All inner-row signals escape on dedicated signal layers with short uncoupled segments.

Bad: Uncontrolled Routing

No breakout region defined. Some traces at 3 mil (below fab minimum), others at 8 mil. Inconsistent via placement. Some traces remain at neck-down width for 20mm (severe impedance mismatch). DRC shows violations but they are waived without engineering justification.

Industry Standards References
  • IPC-2221B: Section 6 - Conductor spacing and width requirements
  • IPC-2222: Sectional Design Standard for Rigid Organic Printed Boards
  • IPC-7095D: Design and Assembly Process Implementation for BGAs - escape routing guidelines
  • IPC-2152: Standard for Determining Current-Carrying Capacity in Printed Board Design
  • IEC 62368-1: Audio/video, information and communication technology equipment - Safety (creepage/clearance)

Routing Rules Configuration Summary

Complete Rule Set Template

A well-configured design should have the following constraint categories defined:

Rule CategoryWhat It ControlsPriority
Default ClearanceMinimum spacing for all copperLowest (baseline)
Net Class WidthTrace width per functional groupMedium
Net Class ClearanceSpacing per voltage/function groupMedium
Differential PairWidth, spacing, max uncoupled lengthHigh
Length MatchingMatching tolerance per groupHigh
Net-SpecificOverride for individual critical netsHigher
Region OverrideBGA breakout, connector area rulesHighest

DRC Rule Configuration Checklist

  1. Minimum trace width: Set to fabricator minimum (never below 3.5mil for standard fabs)
  2. Minimum clearance: Set to fabricator minimum (never below 3.5mil)
  3. Power net widths: Calculated from IPC-2152 for required current/temperature rise
  4. Impedance-controlled widths: Calculated from field solver based on stackup
  5. Differential pair rules: Width, spacing, max skew per interface specification
  6. Length matching: Groups defined per interface, tolerances per specification
  7. Voltage-based clearance: IPC-2221B or IEC 62368-1 per voltage difference
  8. BGA breakout region: Reduced rules for escape routing with fabricator approval
  9. Annular ring: Minimum per IPC-6012 class (4mil for Class 2, same for Class 3)
  10. Acid trap angle: No angles less than 90 degrees at trace junctions

BGA Fan-Out Strategy Comparison

Strategy 1: Dog-Bone (Standard Through-Via)
=============================================
Pitch: 1.0mm | Pad: 0.5mm | Via: 0.3mm drill / 0.6mm pad

  Outer 2 rows: Escape on surface layer via dog-bone
  Inner rows: Via down, escape on inner signal layers
  Pros: Simple, standard process, low cost
  Cons: Uses signal layer area below BGA

Strategy 2: Via-in-Pad (HDI)
============================
Pitch: 0.8mm or less | Pad: 0.35-0.4mm | Via: 0.1mm laser drill

  All rows: Via directly in BGA pad (microvia to next layer)
  Escape on layer 2 (immediately below)
  Pros: Enables fine-pitch escape, no surface routing needed
  Cons: Higher cost (laser drill + fill + plate)

Strategy 3: Dog-Bone with Channel Routing
==========================================
Pitch: 1.0mm | 1-2 traces between pads

  Row 1: Direct escape (no via, route to perimeter on top layer)
  Row 2: Dog-bone via, escape between Row 1 pads
  Row 3-4: Route down to inner layer, channel between vias
  Rows 5+: Must use dedicated inner signal layers

  Channel Capacity:
    1.0mm pitch, 0.5mm pad: gap = 0.5mm
    Trace+Space: 4+4 mil = 8mil = 0.2mm per channel
    Channels between pads: 2 (with 0.1mm margin)
            

Routing Rules Verification Procedure

  1. Export the complete design rule set as a document/report
  2. Verify each rule against its justification:
    • Width rules: vs IPC-2152 calculation or impedance calculation
    • Clearance rules: vs IPC-2221B table or safety standard
    • Length matching: vs interface specification datasheet
  3. Confirm no rules conflict (e.g., net class rule wider than region rule allows)
  4. Run DRC with ALL rules enabled to verify compliance
  5. Document any waivers or exceptions with engineering justification

Common Pitfall: Default Rules Never Updated from Tool Defaults

Many designers start a new project and never update the default design rules from the EDA tool's factory settings. These defaults are often extremely conservative (10mil/10mil) or extremely permissive (no clearance checks), neither of which matches the actual fabricator's capabilities or the design's requirements. The FIRST step after creating a new PCB project should be configuring ALL design rules to match the selected fabricator's capabilities and the design's electrical requirements.