com.sun.electric.tool.generator.flag.router
Class Channel

java.lang.Object
  extended by com.sun.electric.tool.generator.flag.router.Channel
All Implemented Interfaces:
java.lang.Comparable<Channel>

public class Channel
extends java.lang.Object
implements java.lang.Comparable<Channel>

rectangular region for routing


Constructor Summary
Channel(boolean horizontal, double l1, double l2, double w1, double w2, java.lang.String description)
           
 
Method Summary
 Segment allocate(double xy1, double xy2, double boundXY1, double boundXY2)
          Find an unused part of a track that can connect xy1 with xy2.
 Segment allocateBiggestFromTrack(double min, double src, double max, double trackCenter)
          Metal-2 only PortInst don't allow us to chose the track center.
 int compareTo(Channel c)
           
 double getMaxTrackCenter()
           
 double getMaxTrackEnd()
           
 double getMinTrackCenter()
           
 double getMinTrackEnd()
           
 boolean hasTracks()
           
 boolean isHorizontal()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Channel

public Channel(boolean horizontal,
               double l1,
               double l2,
               double w1,
               double w2,
               java.lang.String description)
Method Detail

compareTo

public int compareTo(Channel c)
Specified by:
compareTo in interface java.lang.Comparable<Channel>

allocate

public Segment allocate(double xy1,
                        double xy2,
                        double boundXY1,
                        double boundXY2)
Find an unused part of a track that can connect xy1 with xy2. Any track whose center lies outside the bounds boundXY1 and boundXY2 increases the manhatten distance of the route. If we need to select from two tracks that both minimize the manhatten distance, then choose the track closest to the center of the channel. This will tend to pack the segments into the smallest number of channels.


allocateBiggestFromTrack

public Segment allocateBiggestFromTrack(double min,
                                        double src,
                                        double max,
                                        double trackCenter)
Metal-2 only PortInst don't allow us to chose the track center. Allocate the largest segment in the interval [min, max] that covers src


isHorizontal

public boolean isHorizontal()

hasTracks

public boolean hasTracks()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getMinTrackCenter

public double getMinTrackCenter()

getMaxTrackCenter

public double getMaxTrackCenter()

getMinTrackEnd

public double getMinTrackEnd()

getMaxTrackEnd

public double getMaxTrackEnd()