Tutorial: Autoroute and layout¶
NOTE: Before starting this tutorial, you should have built the design from Tutorial: Create a circuit
You can follow along with this tutorial in the video above. Below is a transcript to make the code and text easier to read.
JITX Quickstart 4: Layout and Routing¶
This guide covers the basic functions for layout and routing in JITX. You'll learn how to set up board constraints, place components, and create efficient routing strategies for your PCB design.
1. Board Setup¶
Mechanical Constraints¶
The board shape defines your PCB outline and can be modified to match your mechanical requirements.
- Update Board Shape:
# Change from
val board-shape = RoundedRectangle(30.0, 18.5, 0.25)
# To
val board-shape = RoundedRectangle(100.0, 70.0, 3.0)
- First two parameters define width and height in millimeters
- Last parameter sets corner radius
-
Can use any valid shape, including imported mechanical constraints
-
Component Placement Constraints:
# Make usb-if public first
public inst usb-if : ...
# Add placement constraint
place(core.usb-if.USBC.J) at loc(10.0, -30.5) on Top
- Use
place
to fix component locations - Components with placement constraints cannot be moved in the UI
- Useful for maintaining alignment with mechanical features
- Access component names by selecting and pressing 'E'
Board-Level Pours¶
Create power and ground planes using copper pours:
# Make net public
public net GND
# Add copper pours
geom(core.GND):
copper-pour(LayerIndex(1), isolate = 0.125, rank = 1) = board-shape
copper-pour(LayerIndex(2), isolate = 0.125, rank = 1) = board-shape
isolate
sets clearance from other copperrank
determines pour priority (higher numbers have priority)- Can create pours on any layer
- Shape can match board outline or be custom defined
2. Selection and Movement Tools¶
Basic Selection Commands¶
A
: Select all pads on the same net- Useful for identifying connected components
- Can be combined with other selection tools
R
: Rotate clockwiseShift + R
: Rotate counter-clockwiseF
: Flip to opposite side of boardU
: Select parent module- Press multiple times to select larger hierarchical groups
- Helpful for moving related components together
Advanced Selection¶
Shift
+ drag: Add to selectionCtrl
+ drag: Subtract from selectionCtrl + Shift
+ drag: Intersect selection- Useful for selecting specific components from a larger group
- Example: Select all ground pads, then intersect to get only FTDI ground pads
3. Component Fanout¶
Via Creation¶
- Select pads requiring vias
- Press
Shift + V
to auto-create vias - Vias automatically connect to correct layers
- Vias maintain connection when component is moved
- Useful for connecting ground pads to planes
Differential Pairs¶
- Select related pads
- Press
Shift + I
to add insertion points - Creates transition points for single-ended to differential pairs
- Points move with components automatically
- Helps maintain proper differential pair geometry
4. Routing¶
Auto-routing¶
- Select routable objects
- Press
Q
to auto-route - Creates optimal paths automatically
- Routes update when components move
- Respects design rules and constraints
Manual Routing (Shift + Q)¶
- Path Redraw:
- Click on existing route to start new path
- Draw desired path
- Connect back to original route
-
Route automatically updates
-
Control Points:
- Hold
2
+ click on route - Creates movable control point
- Forces route through specific location
- Useful for controlling trace exit angles
- Helps maintain specific routing patterns
Route Adjustments¶
- Select routes to modify properties:
- Adjust trace width
- Change clearance values
- Modify layer assignments
- Convert to adaptive traces for power routing
5. Layer Management¶
Layer Navigation¶
W
: Move up layer stackS
: Move down layer stack- Click layers in stack to activate
- Multiple layer selection possible
Layer-specific Features¶
- Copper Layers:
- Selection limited to active layer
- Routing only on active layer
- Layer visibility can be toggled
-
Different rules per layer possible
-
Silkscreen:
Shift + L
: Autoplace labels- Drag to adjust positions
- Size and style configurable in code
- Automatic text collision avoidance
6. Component Organization¶
Alignment Tools¶
# Custom alignment command
bind b align first
- Aligns subsequent selections to first selected object
- Maintains fixed component positions
- Useful for organizing similar components
Power Routing¶
# Custom routing command for power traces
bind g route with adaptive
- Creates wide traces for power connections
- Automatically adjusts to pad sizes
- Maintains proper clearances
- Optimizes copper area for current capacity
Practical Tips¶
- Use multiple windows for efficiency:
- Keep schematic and board views open
- Use cross-reference for component selection
-
Arrange windows to see both views simultaneously
-
Organized Workflow:
- Place major components first
- Add fanout for complex parts
- Route critical signals
- Complete power and ground connections
- Fine-tune trace routing and clearances
Common Operations Reference¶
Operation | Command | Description |
---|---|---|
Auto Via | Shift + V |
Create connected vias automatically |
Auto Route | Q |
Route selected objects with auto-router |
Manual Route | Shift + Q |
Enter manual routing mode for custom paths |
Layer Up | W |
Move up one layer in stack |
Layer Down | S |
Move down one layer in stack |
Flip | F |
Move component to opposite side |
Select All on Net | A |
Select all pads on same net |
Parent Select | U |
Select parent module (repeatable) |
Auto Label | Shift + L |
Automatically place reference labels |
Command Menu | ` |
Open command interface for custom commands |
Help Menu | ? |
View all available commands |
Remember that all commands can be customized to match your preferred workflow, and the help menu (?
) provides quick access to command documentation.