Class Net - Net.h, Net.cc


Definition:
A Net is a collection of Pins that should be connected.  Once a routing for the net is found the class will contain a collection of Edges that make up the routing.
Typedefs:
typedef list<EdgeHolder *> EdgeList;
typedef EdgeList::iterator EdgeListItr;
typedef vector<Pin *> PinVector;
typedef PinVector::iterator PinVectorItr;
typedef vector<Segment> SegmentVector;
typedef SegmentVector::iterator SegmentVectorItr;
Included:
#include <vector>
#include <list>
#include <string.h>
#include <iostream>
#include "Pin.h"
#include "Box.h"
#include "Segment.h"



Variable Index

oPinVector * pinVect
STL Vector class for holding the pins of the net.
o int id
A identifying integer for the net.
o char[] name
The alphanumeric name for the net.
o EdgeList * edgeList
A list of the edges for the routed net.  NOTE: the net must be routed in order to have a non-empty edge list.
o bool permanent
A boolean variable used during rip-up and reroute (R+R).  If set, this net will not be considered for R+R.  This variable is initially unset.
o Box * boundingBox
The bounding box of the net.  NOTE: this variable is NULL until the function calculateBoundingBox is called.

Constructor Index

o Net()
Default constructor.
o Net(int numPins)
Constructor which instiantiates the pinVect list with size "numPins".  The actual pins within the pin vector are set as NULL.
o Net(int numPins, int netID, char *netName)
Constructor which instiantiates the pinVect list with size "numPins".  The actual pins within the pin vector are set as NULL.  Also, the id and the name are set as "netID" and "netName", respectively.
o ~Net()
Deconstructor.  Deallocates the Pin pointers in the pin vector, the Edge pointers in the edge list as well as the pin vector and the edge list.

Method Index

o Pin * getPin(int pinNum)
Returns the Pin pointer at the specified index.
o int getNumPins()
Returns the size of the pin vector (pinVect)i.e. the number of pins in this net.
o int getID()
Returns the id of this net
o char * getName()
Returns the name of this net.
o PinVector * getPinVector()
Returns a pointer to the pin vector, pinVect.
o EdgeList * getEdgeList()
Returns a pointer to the edge list, edgeList.
o int getNumEdges()
Returns the size of the edge list, edgeList, i.e. the number of edges currently connecting the net.
o bool isPermanent()
Returns the permanancy status of the net stored in permanent.  A 'true' value indictates that the net will NOT be considered for ripup and reroute;  ripup and reroute will possibly reroute nets with a 'false' value.
o Box * getBoundingBox()
Returns a pointer to the bounding box variable, boundingBox.  If the variable boundingBox is NULL, the function calls calculateBoundingBox() and returns that bounding box.  Hence this function should never return NULL, though it may not always return the proper bounding box.  To be insure that the bounding box returned is correct, you should first call calculateBoundingBox() and then this function.  An incorrect bounding box will be returned only when the pins of the net are altered.
o void calculateBoundingBox()
Calculates the bounding box of the net and sets the variable boundingBox.  This should be called after every pin insertion/deletion to insure that the boundingBox variable is correct.
o SegmentVector * getUpperLSegments()
Returns a vector (of size 2) containing the vertical and horizontal segments associated with an "upper-L" routing.  Returns NULL when the net is not of size 2 (it makes no sense otherwise).
o SegmentVector * getLowerLSegments()
Returns a vector (of size 2) containing the vertical and horizontal segments associated with an "lower-L" routing.  Returns NULL when the net is not of size 2 (it makes no sense otherwise).
o void setPin(int pinNum, Pin * thePin)
Sets the pin located at position 'pinNum' to the pin specified by 'thePin'
o void setID(int newID)
Sets id to the specified id, 'newID'.
o void setName(char *newName)
Sets name to the specified name, 'newName'.
o void addEdge(bool horiz, int trackNum, int edgeNum)
Adds an edge to the edge list, edgeList.  'horiz' determines the direction of the edge (true = horizontal edge, false = vertical edge), 'trackNum' and 'edgeNum' specify the location in the grid graph.
o void addEdgesBetween(bool horiz, int trackNum, int start, int end)
Adds end - start number of edges to the edge list, edgeList.  'horiz' determines the direction of the edge (true = horizontal edge, false = vertical edge), 'trackNum' specifies the track number and 'start' and 'end' specify the edges which should be added to the list.
o void removeEdge(bool horiz, int trackNum, int edgeNum)
Removes the edges specified by the passed variables.  'horiz' determines the direction of the edge (true = horizontal edge, false = vertical edge), 'trackNum' and 'edgeNum' specify the location in the grid graph.
o void removeAllEdges()
Clears the edge list, edgeList ,of all of the edges it contained, effectively unrouting the net.
o void removeLastPin()
Removes the last pin from the pin vector, pinVect.
o void printEdges()
Debugging function.  Prints the edges to cout.
o void printPins()
Debugging function.  Prints the pins to cout.