com.sun.electric.tool.routing
Class Router

java.lang.Object
  extended by com.sun.electric.tool.routing.Router
Direct Known Subclasses:
InteractiveRouter

public abstract class Router
extends java.lang.Object

Parent Class for all Routers. I really have no idea what this should look like because I've never written a real router, but I've started it off with a few basics.

A Route is a List of RouteElements. See RouteElement for details of the elements.

User: gainsley Date: Mar 1, 2004 Time: 2:48:46 PM


Nested Class Summary
protected static class Router.CreateRouteJob
          Job to create the route.
 
Field Summary
protected  Tool tool
          the tool that is making routes
protected  boolean verbose
          set to tell user short info on what was done
 
Constructor Summary
Router()
           
 
Method Summary
 void createRoute(Route route, Cell cell)
          Create the route within a Job.
static PortInst createRouteNoJob(Route route, Cell cell, boolean highlightRouteEnd, java.util.Map<ArcProto,java.lang.Integer> arcsCreatedMap, java.util.Map<NodeProto,java.lang.Integer> nodesCreatedMap)
          Method to create the route.
static ArcProto getArcToUse(PortProto port1, PortProto port2)
          Determine which arc type to use to connect two ports NOTE: for safety, will NOT return a Generic.tech.universal_arc, Generic.tech.invisible_arc, or Generic.tech.unrouted_arc, unless it is the currently selected arc.
static double getArcWidthToUse(PortInst pi, ArcProto ap)
          Get arc width to use to connect to PortInst pi.
protected static double getArcWidthToUse(Route route, ArcProto ap)
          Get arc width to use by searching for largest arc of passed type connected to any elements in the route.
protected static double getArcWidthToUse(RouteElement re, ArcProto ap)
          Get arc width to use to connect to RouteElement re.
protected static Dimension2D getContactSize(RouteElement re)
           
protected static Dimension2D getContactSize(RouteElement startRE, RouteElement endRE)
          Get the dimensions of a contact that will connect between startRE and endRE.
static void reportRoutingResults(java.lang.String prefix, java.util.Map<ArcProto,java.lang.Integer> arcsCreatedMap, java.util.Map<NodeProto,java.lang.Integer> nodesCreatedMap)
           
 void setTool(Tool tool)
          Method to set the tool associated with this router
protected static void useWidestWire(Route route, ArcProto ap)
          Convert all new arcs of type 'ap' in route to use width of widest arc of that type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

verbose

protected boolean verbose
set to tell user short info on what was done


tool

protected Tool tool
the tool that is making routes

Constructor Detail

Router

public Router()
Method Detail

createRoute

public void createRoute(Route route,
                        Cell cell)
Create the route within a Job.

Parameters:
route - the route to create
cell - the cell in which to create the route

createRouteNoJob

public static PortInst createRouteNoJob(Route route,
                                        Cell cell,
                                        boolean highlightRouteEnd,
                                        java.util.Map<ArcProto,java.lang.Integer> arcsCreatedMap,
                                        java.util.Map<NodeProto,java.lang.Integer> nodesCreatedMap)
Method to create the route. Does not wrap Job around it (useful if already being called from a Job). This still must be called from within a Job context, however.

Parameters:
route - the route to create
cell - the cell in which to create the route
highlightRouteEnd - highlights end of route (last object) if true, otherwise leaves highlights alone.
arcsCreatedMap - a map of arcs to integers which is updated to indicate the number of each arc type created.
nodesCreatedMap - a map of nodes to integers which is updated to indicate the number of each node type created.

reportRoutingResults

public static void reportRoutingResults(java.lang.String prefix,
                                        java.util.Map<ArcProto,java.lang.Integer> arcsCreatedMap,
                                        java.util.Map<NodeProto,java.lang.Integer> nodesCreatedMap)

setTool

public void setTool(Tool tool)
Method to set the tool associated with this router


getArcToUse

public static ArcProto getArcToUse(PortProto port1,
                                   PortProto port2)
Determine which arc type to use to connect two ports NOTE: for safety, will NOT return a Generic.tech.universal_arc, Generic.tech.invisible_arc, or Generic.tech.unrouted_arc, unless it is the currently selected arc. Will instead return null if no other arc can be found to work.

Parameters:
port1 - one end point of arc (ignored if null)
port2 - other end point of arc (ignored if null)
Returns:
the arc type (an ArcProto). null if none or error.

useWidestWire

protected static void useWidestWire(Route route,
                                    ArcProto ap)
Convert all new arcs of type 'ap' in route to use width of widest arc of that type.


getArcWidthToUse

protected static double getArcWidthToUse(Route route,
                                         ArcProto ap)
Get arc width to use by searching for largest arc of passed type connected to any elements in the route.

Parameters:
route - the route to be searched
ap - the arc type
Returns:
the largest width

getArcWidthToUse

public static double getArcWidthToUse(PortInst pi,
                                      ArcProto ap)
Get arc width to use to connect to PortInst pi. Arc type is ap. Uses the largest width of arc type ap already connected to pi, or the default width of ap if none found.

You may specify pi as null, in which case it just returns ap.getDefaultLambdaFullWidth().

Parameters:
pi - the PortInst to connect to
ap - the Arc type to connect with
Returns:
the width to use to connect

getArcWidthToUse

protected static double getArcWidthToUse(RouteElement re,
                                         ArcProto ap)
Get arc width to use to connect to RouteElement re. Uses largest width of arc already connected to re.

Parameters:
re - the RouteElement to connect to
ap - the arc type (for default width)
Returns:
the width of the arc to use to connect

getContactSize

protected static Dimension2D getContactSize(RouteElement startRE,
                                            RouteElement endRE)
Get the dimensions of a contact that will connect between startRE and endRE.


getContactSize

protected static Dimension2D getContactSize(RouteElement re)