Skip to content

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.

  1. 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 copper
  • rank 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 clockwise
  • Shift + R: Rotate counter-clockwise
  • F: Flip to opposite side of board
  • U: Select parent module
  • Press multiple times to select larger hierarchical groups
  • Helpful for moving related components together

Advanced Selection

  • Shift + drag: Add to selection
  • Ctrl + drag: Subtract from selection
  • Ctrl + 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

  1. Select pads requiring vias
  2. Press Shift + V to auto-create vias
  3. Vias automatically connect to correct layers
  4. Vias maintain connection when component is moved
  5. Useful for connecting ground pads to planes

Differential Pairs

  1. Select related pads
  2. Press Shift + I to add insertion points
  3. Creates transition points for single-ended to differential pairs
  4. Points move with components automatically
  5. Helps maintain proper differential pair geometry

4. Routing

Auto-routing

  1. Select routable objects
  2. Press Q to auto-route
  3. Creates optimal paths automatically
  4. Routes update when components move
  5. Respects design rules and constraints

Manual Routing (Shift + Q)

  1. Path Redraw:
  2. Click on existing route to start new path
  3. Draw desired path
  4. Connect back to original route
  5. Route automatically updates

  6. Control Points:

  7. Hold 2 + click on route
  8. Creates movable control point
  9. Forces route through specific location
  10. Useful for controlling trace exit angles
  11. 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 stack
  • S: Move down layer stack
  • Click layers in stack to activate
  • Multiple layer selection possible

Layer-specific Features

  1. Copper Layers:
  2. Selection limited to active layer
  3. Routing only on active layer
  4. Layer visibility can be toggled
  5. Different rules per layer possible

  6. Silkscreen:

  7. Shift + L: Autoplace labels
  8. Drag to adjust positions
  9. Size and style configurable in code
  10. 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

  1. Use multiple windows for efficiency:
  2. Keep schematic and board views open
  3. Use cross-reference for component selection
  4. Arrange windows to see both views simultaneously

  5. Organized Workflow:

  6. Place major components first
  7. Add fanout for complex parts
  8. Route critical signals
  9. Complete power and ground connections
  10. 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.