Creating a route follows a procedure similar to that used when creating a schematic symbol. In this case we find the physical net in the PhysicalNets collection of the Layout object.
Using the PhysicalNet.Routes.CreateRouteRecord() we create an instance of a RouteRecord object to hold the route shapes.
Next we add segments that will make up the route connecting two points in the layout.
Finally we call the PhysicalNet.Routes.AddRoute() method providing the RouteRecord object as the argument.
This will create a route with the specified segments and associate that route with the PhysicalNet object making it part of the connectivity for that Net. Because a route represents only a point-to-point connection, it may be necessary to create several routes to complete the connections between a set of pins. If so repeat the procedure outlined above to associate additional routes with the physical net. The case we'd like to handle looks like Figure 1
Figure 1 Net connection before adding route. Red flight-line shows area to be connected
Let's look at a routine to perform the steps outlined above:
The arguments to the routine are first the PhysicalNet with which we want to associate the Route and second the flight-line associated with that PhysicalNet we want to replace:
Next we dimension some values to use for coordinates and determine the x and y distances between the flight line end points:
These values will be used as we compute the locations for the segments in the Route object. Next we use the PhysicalNet object's Routes collection to create the RouteRecord object.
The RouteRecord object will serve as a temporary container for the segments of the route until we are ready to create the actual route on the physical net. Now that we have a RouteRecord we can begin to compute the end points for the segments. First set a width value to be use for all segments of 20um. And for this case we'll make a three section route so the first segment will go horizontally in the positive X direction from the first end of the flight line to the middle of X distance between the ends of the flight line.
We add this first segment with end styles such that the segment starts truncated and then ends with a half width extension. The half width extension will overlap the width of the next vertical segment when it is added.
For the next segment we just need to update a couple of values. First the x position will be at the end of the initial segment. The initial Y value is the same and the second y value will be equal to the y value at the end of the line. So with x1 = x2 and different Y values this will be a vertical segment which stretches from the flight line begin y to the flight line end y value. This time both ends will be half-width extended.
Finally, we add the third segment which will be horizontal from the end of the vertical segment to the end of the flight line. So y1 gets updated to match y2 and we position the end x value an the flight line end x position. Here we added the values with the start end extended half width and the end truncated to be flush with the pin.
With this routine in place we can create a driver program to call it:
The results of running this program are shown in Figure 2. We get a three segment route connecting the two lines:
Figure 2 After routing flight-line replaced with three segment route.
So the three steps to create a Route are:
Create a RouteRecord object using the Routes collection on the PhysicalNet the Route will be associated with.
Add segments to the route record to form the route connecting two points.
Create the route using the PhysicalNet.Routes.AddRoute() method.
Creating the Route on a PhysicalNet make the Route object part of the physical connectivity for that net and allows the route to replace the flight line. Or if it does not completely connect the points then it will be included in the connectivity and the flight-lines will connect not only the Pins but also the Route object.