Class CoupleFree- CoupleFree.h, CoupleFree.cc



 
Definition:
.A class that routes two terminal nets without any coupling.  A net couples with another net iff it is coupleDistance bins close AND runs in parallel with that net for more than coupleLength bins.  NOTE: all the nets in (NetVect *) nets are assumed to be two terminal.  There is little checking for this in the code.  Criticality is defined as the perimeter of a net squared.  The CouplingInteractions hold the amount of coupling.  Therefore, they might have a coupling value less than the couple distance (which means that they don't actually couple).  The planar variable determines whether the routings must be planar.  Please see my paper for more explanation of the algorithms and uses for this class.
Typedefs:
typedef vector<bool> BoolVector;
typedef BoolVector::iterator BoolVectorItr;
typedef vector<Net *> NetVector;
typedef NetVector::iterator NetVectorItr;
typedef vector<int> IntVector;
typedef IntVector::iterator IntVectorItr;
typedef vector<UpperLowerCoupling> CoupleVector;
typedef CoupleVector::iterator CoupleVectorItr;

 
Included:
#include <vector>
#include <iostream.h>
#include <fstream.h>
#include "Net.h"
#include "Graph.h"



Variable Index
 
o NetVector * nets
The set of nets that are to be routed without coupling.
o int netsize
The number of nets that are considered for coupling-free routing.
o CoupleInteractions * interactions
Holds the amount of coupling that each net has with another net.  Indexing into this vector will give you the net at the same location as it is in the NetVector nets.  Each position holds a set conflicts corresponding to the upper-L routing and lower-L routing.  Indexing into these vectors gives you the amount of coupling with the current indexed net (both upper and lower L routes).  The coupling is determined by the amount of overlap with that net.  For example, if you want to see the coupling between nets at index 1 and 3, you can index the interaction vector at position 1 (3) and then choose the appropriate CoupleVector and index it at position 3.
o int coupleDistance
The maximum allowable distance for which two routes can couple.
o int coupleLength
The minimum allowable length for which two routes can run in parallel and considered as coupled.
o IntVector * routings
A vector which holds the routings of the net.  Holds 0 if the net is not routed, 1 if net is routed in upper-L and 2 if net is routed in lower-L.
o bool planar
Boolean variable which specifies that the set of nets should be planar as well as coupling-free.

Constructor Index
 
o CoupleFree()
Default constructor.
o CoupleFree(NetVector * netVect)
Finds a coupling-free routing on the specified set of nets.  Sets the coupleDistance to 1 and the coupleLength to 3.
o CoupleFree(NetVector * netVect, int distance, int length)
Finds a coupling-free routing on the specified set of nets.  Sets the coupleDistance and the coupleLength as specified.
o CoupleFree(NetVector * netVect, int distance, int length)
Finds a coupling-free routing on the specified set of nets.  Sets the coupleDistance and the coupleLength as specified.  Also, the planar switch is set as specified.
o ~CoupleFree()
Destructor.

Method Index
 
o void setNets(NetVector * netVect)
Sets nets to the specified vector of nets.
o void setCoupleParameters(int distance, int length)
Sets the variable coupleDistance and coupleLength to the specified values.
o void setCoupleDistance(int distance)
Sets the variable coupleDistance to the specified value.
o void setCoupleLength(int length)
Sets the variable coupleLength to the specified value.
o void setPlanar(bool plane)
Sets the planar switch to the specified value.
o NetVector * getNets()
Returns a pointer the set of nets ,nets, which coupling-free routing is performed.
o int getCoupleDistance()
Returns the value of coupleDistance.
o ing getCoupleLength()
Returns the value of coupleLength.
o bool isPlanar()
Returns the value of planar.
o int getNumNets()
Returns the number of nets which are being coupling-free routed, netsize.
o int getNumRoutedNets()
Returns the number of nets which were routed in a coupling-free manner.
o int getCriticalityRoutedNets()
Returns the summed criticality of the nets which were coupling-free routed.  Uses an routed length squared value as the criticality of a net.
o double getNRootNCriticalityRoutedNets()
Returns the summed criticality of the nets which were coupling-free routed.  Uses the n-root-n criticality for each net where n is the routed length of the net.
o int getRoutedNetLength()
Returns the summed routed length over all the nets which were coupling-free routed.
o int getNetIndex(Net * aNet)
Returns the index within nets of the specified net.
o static int getCriticality(Net * aNet)
Returns the criticality of the specified net (currently this function returns the routing length squared as its criticality).
o static double getNRootNCriticality(Net * aNet)
Returns the criticality, in n-root-n form, of the specified net.
o void findQuickCoupleFreeSet()
Finds a "quick" coupling-free set of nets.  This was my first heuristic for finding a couple-free set of nets.  What it does.  First, it routes any independant nets.  Second, it sorts the routes on the number of forcing (see my paper for more info) until all the routes have been considered.  This exactly the same as the findForcingFunctionCoupleFreeSet() function if you set the alpha to 0, but I implemented this heuristic first, hence the redundant functions.
o void findGreedyCoupleFreeSet()
Finds a set of coupling-free nets.  This function sorts the nets based on their criticality (largest to smallest) and then tries to route each net.
o void findImplicationCoupleFreeSet()
Creates an implication graph to and then uses the properties of the graph to find a set of couple-free nets.  Depending on the function parameters this is the same as the findForcingFunctionCoupleFreeSet() function.  I did it this way to compare the runtimes of the two methods of gathering the direct and indirect forcings.
o void findForcingFunctionCoupleFreeSet()
Initially this function went through some ridiculious searching measures to find the indirect forcings.  I found that it was easy and faster to make the implication graph to find the forcings, so now this function is essentially the same as the findImplicationCoupleFreeSet() function.  This function allows the use of a linear function based on direct and indirect forcings to sort the routes.  The routes are sorted on this function and then routed.