交互式布线
Parent article: The Routing
Routing is the process of defining a connective path between the nodes in each net. This path is defined by placing PCB design objects, such as tracks, arcs and vias, on the copper layers to create a continuous connection between the nodes. Rather than placing these objects one by one to build up the connective path, you interactively route the connection.
In the PCB editor, interactive routing is an intelligent process. After launching the command, click on a pad to select a connection to be routed. The interactive router then attempts to define a route path from that pad, all the way to the current cursor location.
The size of the track that is placed is controlled by the applicable routing width design rule and your current Track Width Mode setting. How the interactive router responds to existing objects, such as pads on other nets, depends on the current Routing Conflict Resolution mode. When it encounters an object, the Interactive Router handle this conflict by applying a Walkaround, Hug and Push, Push, Ignore, or Stop conflict resolution strategy.
Interactive routing can be performed on:
- a single net - Route » Interactive Routing, or
- two nets defined as a differential pair - Route » Interactive Differential Pair Routing, or
- a set of selected nets - Route » Interactive Multi-Routing.
This article describes the process of interactively routing a single net and the settings that control that process. If you are looking for information on specialized routing techniques, such as differential pair or controlled impedance routing, refer to The Routing page.
Understanding Connectivity
An important part of understanding the interactive router is to understand how connectivity is managed in the PCB editor.
When the design is transferred from the schematic (Design » Update PCB), the components are placed on the PCB workspace and the connection lines are displayed, indicating which pads connect to each other in each net.
- The arrangement, or pattern, of the connection lines in a net is called the topology. The topology is defined by the applicable Routing Topology design rule, with the default rule targeting All nets and applying a topology of Shortest.
- The PCB Editor includes a net analyzer that constantly monitors the location of all objects in the workspace and updates the connection lines when any net-type object is edited (including an object being moved). For example, when a component is moved, the far end of each connection from that component can jump from one target pad to another target pad, as they are updated to maintain the topology defined by the applicable design rule. An example of this is shown for the 3V3 net in the video below; this net has a topology of shortest.
- The net analyzer monitors all the objects attached to a net, for example, when a connection is routed, the connection line between those two pads is automatically removed by the net analyzer. Or if a net is partially routed, then a shorter connection line will be displayed between the two closest route points on the net.
- It does not matter if you choose to ignore the connection line and route the net from/to a different location. As soon as routing is terminated, the net analyzer runs and removes the connection line if it is no longer required, as shown in the video below.
- Because the arrangement of connection lines is determined by the routing topology design rule, it is possible that the connection line will not attach to the end of the track and instead attach to some other point in the net that is closer to another point in the net. If preferred, connection lines can be forced to the track ends by enabling the Smart Track Ends option on the PCB Editing – General page of the Preferences dialog. The video below demonstrates this. Note that you can force the net analyzer to run and update the connection lines by performing an action that the software sees as you editing an object belonging to that net. Edit actions include: moving an object, clicking and holding on an object, or double clicking to display that object's properties in the Properties panel.
To learn more about how the connectivity is created in the schematic, refer to the Creating Connectivity article.
Finding a Net and Controlling the Color of the Connection Lines
Main article: The Routing, Finding a Net on the Board
An un-routed board can appear intimidating - a mass of connection lines crisscrossing all over the board. A good approach to routing is to work from the schematic, where you can easily locate important components and critical nets. You can cross-select and cross-probe directly from the schematic components and nets, highlighting the equivalent item on the PCB. To learn more, refer to the Working Between the Schematic and the Board article.
You can also control the display of the connection lines by masking or hiding the nets in which you are not interested. Setting the color of important connection lines will also help you manage the routing process. Refer to the Finding a Net on the Board section of The Routing article to learn more.
Controlling the Routing Width and Via Size as You Route
When you run the Interactive Routing command and click to start routing, a series of track objects are created from the nearest pad up to the current cursor location. The width of these tracks is determined by the current Track Width Mode setting, which is displayed on the status bar during routing (shown in the video below).
There are four possible Routing Width Source settings:
- the designer's preferred width (User Choice); or
- the minimum, preferred, or maximum value of the applicable Routing Width design rule.
The selection of User Choice / Min rule / Preferred rule / Max rule is stored in and can be selected using the Track Width Mode drop-down on the PCB Editor - Interactive Routing page of the Preferences dialog.
Changing the Track Width Mode While Routing
You can cycle through the four routing width options by pressing the 3 shortcut key during interactive routing, as shown in the video below. The current mode is displayed on the Status bar. If you forget any of the in-command shortcuts, press Shift+F1 to display a list while running the command.
When you change the track width mode, you move between the values defined in the applicable design rule (min/preferred/max), and User Choice.
If you select User Choice, the track width will be:
- the width of existing routing if the Pickup Track Width from Existing Routing option is enabled and the click location is on existing routing, or
- the last-used User-Choice width if it falls within the range defined by the applicable rule for the net you are routing. If it does not, the width will be clipped to the nearest value that is within the range allowed by the rule.
Changing the User Choice Routing Width While Routing
To change the width while routing, the following shortcuts are used. Note that if the Interactive Routing Width Sources options were set to one of the Rule-based width options, that option is changed to User Choice whenever one of these shortcuts is used.
- Shift+W - use this shortcut during routing to open the Choose Width dialog. Click on a new width to close the dialog and continue routing at the chosen width. Available widths can be edited by clicking the Favorite Interactive Routing Widths button on the PCB Editor - Interactive Routing page of the Preferences dialog.
- Tab - use this shortcut if the required width is not defined as a favorite. Pressing Tab will open the Properties panel in Interactive Routing mode. The current editing session will pause and the panel will open with the current Width selected. Type in a new value then press Enter to continue routing at the new width. Alternatively, after typing in a new width value, click the pause button overlay to resume routing. To resume routing without editing the value, press Esc.
Remember, if you use one of these techniques to change the width during routing, the Track Width Mode is automatically changed to User Choice.
The routing track width must be between the minimum and maximum values specified in the applicable Routing Width design rule. If you attempt to change the width to a value that is outside the range defined by the rule's Minimum and Maximum settings, the software will automatically clip it back to within Min-Max range.
Changing Layers and adding a Via While Routing
There are two approaches to interactively change layers during routing:
- Press the * key on the numeric keypad. Each press of that key will move you down to the next available signal layer.
- Use the Ctrl+Shift+Wheel Scroll shortcut combination. Hold Ctrl+Shift then scroll the mouse wheel forwards to move down through the available signal layers; scroll the mouse wheel backwards to move up through the available signal layers. Note that this shortcut can be used at anytime to change layers. If you are not currently routing, this shortcut combination will step through all enabled layers.
A via is automatically added at the last corner where the last hatched segment meets the hollow look-ahead segment. As with the routing width, the size of the via is determined by the current Via Size Mode as shown in the video below. The mode can be pre-configured in the Interactive Routing Width Sources option.
Changing the Via Size Mode While Routing
As with the routing width, there are four possible options for selecting the via size during interactive routing:
- the designer's preferred via size (User Choice); or
- the minimum preferred or maximum value of the applicable Routing Via Style design rule.
You can cycle through the four via size options by pressing the 4 shortcut key during interactive routing. The current mode is displayed on the Status bar as shown in the video above.
Changing the User Choice Via Size While Routing
To change the User Choice via size while routing:
- Shift+V - press this shortcut during interactive routing to open the Choose Via Size dialog. The dialog will automatically list all via sizes currently used in the design. Select a via size then click OK to make that the User Choice via size.
- Tab - as well as changing the track width during routing, when you press Tab to open the Properties panel in Interactive Routing mode , you can also change the via size. As with the track width, the size you enter must be between the minimum and maximum values defined in the applicable Routing Via Style design rule.
Changing the Via Stack While Routing
If there are multiple via types defined, during a layer change there might be more than one via type available for that layer change. An example would be when there is a blind via available between the top and mid1 layers and there is also a top-bottom via available. If you are performing a layer change from the top layer to the mid1 layer, you can press the 6 shortcut to cycle through the possible via type options. Refer to the Defining the Via Types page for more detailed information.
Controlling SMD Pad Entries
The SMD To Corner and SMD Entry design rules can impact the routing process. You will need to set up the necessary design rules before starting the routing process so that you can control how tracks enter and exit an SMD pad. Open the PCB Rules and Constraints Editor dialog (click Design » Rules from the main menus), select SMD To Corner and/or SMD Entry under the SMT Design Rules and enter the required values.
In the SMD to Corner design rule, the distance to corner value should be greater than the width of the track or the applicable clearance rule (whichever is greater). If it must be less than that, there are three ways you can approach this:
- Press the Spacebar while performing the pad entry. This can help align the last track segment along the pad center.
- Commit the routing close to pad then perform the pad entry without glossing (glossing can be temporary disabled by holding down Ctrl+Shift).
- If doing the pad entry with more than one possible entry, move the mouse inside the pad. That allows you to choose where you want your SMD entry.
Automatically Changing the Routing Width As You Route
A common challenge with modern component technology is needing to route a net at different widths as the routing travels across the board. For example, routing into or out of a BGA will often require narrower escape routes, switching to the preferred width at the edge of the BGA footprint.
This can be achieved manually during interactive routing using the techniques described previously on this page. You can also automate this width-switching behavior by adding a placement room and a room-based routing width rule. Once this has been done, tracks will automatically neck and expand as the room is entered or exited.
The feature works by:
- Defining a Placement Room rule for the region of the board that requires narrower routes.
- Defining a Width Constraint rule of a higher priority that defines the width of the routes within the room. This rule will use the TouchesRoom scope as discussed below.
Once this has been done, the width will change automatically as you route into or out of the placement room as shown in the videos below.
Room-based routing requires a placement room to be defined first. A placement room is also a design rule. While you can create the rule then define the room from the design rule dialog, it can be more efficient to do it the other way around, interactively create the room; Altium Designer creates the design rule for you.
Creating the Room Rule
The Design » Rooms submenu has a number of room definition commands.
A room created around selected components will result in the following:
- A Component Class of the selected components is created. Review the class (Design » Classes) and update the Component Class Name as required.
- A Placement Room Definition design rule is created. The rule is scoped to target the Component Class created in step 1. If you changed the Component Class name, the rule scope (Full Query) must be updated to match.
- The Placement Room Definition design rule is also automatically named. Update the name as required and take note of the name because the room will be referenced in other design rules by its Name.
- If required, resize the room. To do this, click once to select it then click and hold on a vertex to move a corner or an edge. After clicking on a vertex to move it, you can also press Shift to perform a symmetrical resize.
Creating the Room-based Routing Rule
Once the room that defines the area requiring a different routing width has been defined, the routing width rule can then be created. The image below shows an example of a Routing Width rule that is scoped to instruct the PCB editor to set the routing width to 0.075mm whenever the routing touches the room named Room_BGA. Altium Designer's interactive routing engine will automatically terminate the current track segment and start a new segment at the room boundary to satisfy a rule such as this.
Adjust Location of a Routed Component
Component Re-route
While routing the board, it is not uncommon to need to adjust the location of a routed component to create space for new routing. This feature is accessed by enabling the Component re-route checkbox in the Dragging region on the PCB Editor - Interactive Routing page of the Preferences dialog.
During the move process, the following shortcuts can be used to invoke the specified actions:
- Component Re-route Mode (Shift+R) - toggles post-drop connectivity restoration. After the moving set has been released, the software will attempt to re-route the component(s) to reconnect any broken nets. Use the Shift+R shortcut to inhibit the re-route behavior (or disable the Component re-route option on PCB Editor - Interactive Routing page of the Preferences dialog). Current Status is displayed in the Heads Up display and on the Status bar.
- Change Component Selection (Shift+Tab) - while dragging, the set of objects being moved can still be changed. Press Shift+Tab to cycle through the following selection sets:
- Components only, then
- Components +Via Fanouts +Escapes +Interconnects, then
- Initial selection set (if different from the previous two), then
- Back to Components only.
- Display / Hide Connection Lines (N) - the N shortcut cycles through three states: no connection lines, pad-to-pad connection lines, and route-to-route connection lines. The last mode indicates where the connection lines have been severed and will possibly be restored after the selection being moved is released.
- Change Gloss Effort (Shift+Ctrl+G) - cycle through the available Routing Gloss Effort options to control the amount of gloss applied during component re-routing.
Move Component with Relevant Routing
Enable the Move component with relevant routing option in the Dragging region on the PCB Editor - Interactive Routing page of the Preferences dialog to start the move component action with the relevant routing (Components +Via Fanouts +Escapes +Interconnects). Use the Shift+Tab shortcut to cycle the selection set as described in the above section.
Disable the option to start the move component action with components only selected. Because the set of relevant routing objects is detected prior to the move commencing, it is not possible to use Shift+Tab to cycle through the selection set when the option is disabled.
Interactive Router Follow Mode
A common requirement during routing is to place a route so that it follows an existing shape or contour. The contour could be an obstacle, a cutout or the board edge, or an existing route.
Rather than having to route "against" the contour using careful and accurate mouse movements and click actions to ensure the new route hugs the contour, in Follow mode, you click to nominate the contour then move the cursor along the contour to define the route direction. In Follow mode, the interactive router will add track and arc segments so that the new route follows the contour in compliance with applicable design rules. This feature is particularly useful when placing curved routes.
To use the feature:
- Launch interactive routing, click to pick a connection to route and switch to the required corner style (Shift+Spacebar).
- To follow a contour, position the cursor over the required object and press Shift+F. The Interactive Router will detect the object under the cursor and switch to Follow Mode.
- Move the cursor in the required direction; the software will automatically place track and arc segments to follow the contour in that direction.
- Left-click to place the Follow segments and drop out of Follow mode.
- Complete the route as required.
The Routing Conflict Resolution Mode
As mentioned, how the interactive router responds to objects already in the PCB workspace, such as pads on other nets, depends on the current Routing Conflict Resolution mode. Configure which conflict resolution modes are available during routing on the PCB Editor - Interactive Routing page of the Preferences dialog.
Conflict resolution modes include:
- Ignore Obstacles – ignore existing objects (routing can be freely placed). Violations are highlighted.
- Push Obstacles – push existing tracks and vias to make room for the new route.
- Walkaround Obstacles – attempt to find a path around existing objects. The clearance to other objects is defined by the applicable Clearance design rule.
- Stop At First Obstacle – in this mode, the routing engine will stop at the first obstacle that gets in the way.
- Hug And Push Obstacles – in this mode, the routing engine will closely follow existing objects and only push them when there is insufficient room for the track being routed.
- AutoRoute on Current Layer – this mode applies auto-router intelligence to the interactive router, automatically selecting between pushing and walking around to give the shortest overall route length.
- AutoRoute on Multiple Layers – this mode applies auto-router intelligence to the interactive router, automatically selecting between pushing, walking around or switching layers to give the shortest overall route length.
Dynamic Display of Clearance Boundaries During Routing
Have you ever wondered why a route won't fit through a gap during interactive routing? Is it an incorrect rule constraint or is the net being targeted by the wrong rule? Designed to help interpret and understand the impact of design rules, the dynamic display of clearance boundaries feature shows just how much space is available during interactive routing.
The Display Clearance Boundaries feature has two modes: either display the clearance boundaries as a shaded, no-go area around all objects on the entire PCB; or reduce the clearance display area to a circular zone around the cursor.
Enabling the Dynamic Display of Clearance Boundaries
Enable the Display Clearance Boundaries option on the PCB Editor - Interactive Routing page of the Preferences dialog.
- When the Display Clearance Boundaries option is enabled, the no-go clearance area defined by the existing objects + the applicable clearance rule is displayed as shaded polygons within a local viewing circle as as you interactively route.
- If the Reduce Clearance Display Area option is disabled, the no-go clearance area is displayed for the entire layer, as shown in the video below.
Improving the Quality of the Routing
The PCB editor includes powerful tools for improving the quality of existing routing. These tools are known as Glossing and Retracing; both are available in the Route menu.
- Gloss - focuses on improving the trace geometry in an attempt to reduce the number of corners and shorten the overall route length. Gloss preserves the existing trace width and differential pair gap.
- Retrace - assumes the overall geometry is satisfactory, focusing instead on verifying that the routing meets the design rules. Where Gloss preserves the existing trace width and pair gap, Retrace changes them to Preferred. Retrace is an excellent tool to use when a design rule has changed and that change needs to be applied to existing routing.
To learn more about Gloss and Retrace, read the Post-Route Glossing and Retracing page.
The video in the Demonstration of Selection Techniques section below includes a simple demonstration of glossing.
Strategies for Selecting the Routing
Selection is a core activity in all areas of the design process, including working with existing routing. Whether you are about to gloss or you want to delete some routing, the routes need to be selected first.
Select Within or Select Touching
In the PCB editor, selection can either be objects that are Within the selection rectangle or Touching the selection rectangle. This is controlled by the direction you move the mouse as you draw the selection rectangle:
Select Within - click and drag a blue rectangle from left to right to select all visible, unlocked objects that are completely within the selection rectangle. | |
Select Touching - click and drag a green rectangle from right to left to select all visible, unlocked objects that touch the selection rectangle. |
Extending the Selection
A common situation is needing to select many objects that are touching, for example, the track segments in a routed net or the connection lines in an un-routed net. It is relatively easy to select a set of track segments that run parallel to each other using the Select Touching technique just described, but interactively selecting entire routes can be difficult.
However, this can easily be achieved by selecting one or more track segments, then extending the selection to include touching track segments. This is done using the Tab key as demonstrated in the video below.
Demonstration of Routing Selection Techniques
Other Interactive Routing Options and Features
There are a number of other options for the interactive router that are configured on the PCB Editor - Interactive Routing page of the Preferences dialog. It is important to understand the role of these options to get the maximum benefit from the Interactive Router.
Restrict to 90/45
- Pressing Shift+Spacebar cycles through the available routing corner modes, which include arc and any angle modes. If these modes are not required, enable the Restrict to 90/45 option to limit corners to 90 or 45 degrees.
Follow Mouse Trail
- If this option is enabled, the route path tends to follow the path drawn with the cursor.
- Use the 5 shortcut key to toggle the Follow Mouse Trail feature on and off. When using the 5 shortcut key, it is recommended to use the Tab key to open the Properties panel in order to discern if the feature is on or off.
Automatically Terminate Routing
- Enable this option to automatically drop the current net when the target pad is reached. If this option is not enabled, use the Right Mouse button or Esc key to drop the current connection (typically this option is enabled).
Automatically Remove Loops
- An existing route path can be redefined by simply routing a new path. Start interactively routing anywhere along the existing route path, route the new path, returning to meet the old path where required. As soon as the new path meets the existing path, all segments in the redundant loop are automatically removed if the Automatically Remove Loops option is enabled (typically this option is enabled).
- Note that certain nets may require loops (multiple paths to the same point), such as a power or ground net. For these nets, the Automatically Remove Loops feature can be selectively disabled by double-clicking on the net name in the PCB panel (set the panel mode to Nets) to open the Edit Net dialog in which the Remove Loops option can be turned off for only that net.
- Loop Removal - press the Shift+D shortcut while routing to switch to allow loops mode. The interactive router will remain in this mode until toggled off (toggle feature only available during interactive routing). Existing loops will be retained if loop removal is re-enabled and a net containing loops continues to be re-routed.
Routing Gloss Effort
- As the cursor is moved during interactive routing, the routing engine continually attempts to find the shortest path from the last click location up to the current cursor location. How well it can smooth the routing and reduces the number corners is determined by the Routing Gloss Effort.
- The current Routing Gloss Effort setting is displayed on the Status bar. Use the Ctrl+Shift+G shortcut to cycle the setting. Note that the stronger the setting, the fewer corners in the final route. The current mode is shown in the Heads Up display and on the Status bar.
- Gloss can also be temporarily inhibited during interactive routing while holding the Ctrl+Alt keys.
- Glossing is a calculation and an intensive task that runs in the background. It can affect the performance of the Interactive Router particularly when routing multiple nets simultaneously. The stronger the Gloss setting, the more time it takes to perform the calculations.
Look Ahead Behavior
- During interactive routing for the net currently being routed, the track segments are either displayed as hatched or hollow (empty). All hatched segments are placed with the next mouse click.
- The hollow segment is called the Look Ahead segment. Its purpose is to allow designers to plan ahead, i.e. to consider where the next segment might be placed without needing to commit to it. The Look Ahead mode is toggled on and off using the 1 shortcut key (while routing).
Shortcuts Available During Interactive Routing
- Use * on the numeric keypad to switch to the next available routing layer and insert a via.
- Hold Ctrl+Shift while scrolling the mouse wheel to cycle to the next available routing layer and insert a via. Each mouse wheel click moves one layer.
- Use Shift+R to cycle through the available routing conflict resolution modes.
- Use Shift+Spacebar to cycle available corner modes (learn more). For the arc in corner options, use the "," and "." keyboard buttons to decrease or increase the arc size.
- Spacebar toggles the direction of the last corner.
- Use Backspace to "rip up" the last-placed segment(s).
- Use Shift+W to open the Choose Width dialog to change the routing width.
- To switch to the next available signal layer and insert a via:
- Press the * key on the numeric keypad, or
- Use the Ctrl+Shift+Wheel Scroll shortcut combination.
- If you click to start routing from a thru-hole pad or a via and realize you are on the wrong layer, press the L shortcut to step through the available signal layers without adding a via.
- Use Ctrl+Click to instruct the interactive router to attempt to automatically complete the current route.
- Press Shift+F1 while routing to display the interactive routing shortcuts (or tilde (~)).
- Commands available during a layer change are:
- Use Ctrl+L to open a list of available layers then click to select the target layer.
- Use the 1 to 10 number pad keys to switch immediately to that layer number.
- Open the Properties panel to display a Z-plane view of the via that will be used for the layer change.
For a complete list of shortcuts for all of the editors, refer to the Shortcut Keys article.
Where to Next?