torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
torc::router::RouteNet Class Reference

Router net. More...

#include <RouteNet.hpp>

+ Collaboration diagram for torc::router::RouteNet:

Public Types

typedef ArcVector::const_iterator ArcConstIterator
 
typedef ArcVector::iterator ArcIterator
 
typedef
TilewireVector::const_iterator 
TilewireConstIterator
 
typedef TilewireVector::iterator TilewireIterator
 
typedef
RouteNodePtrVector::const_iterator 
RouteNodePtrConstIterator
 
typedef
RouteNodePtrVector::iterator 
RouteNodePtrIterator
 

Public Member Functions

 RouteNet (string &inName)
 Name only constructor. More...
 
 RouteNet (string &inName, const TilewireVector &inSources, const TilewireVector &inSinks)
 Populated constructor. More...
 
bool containsSource (Tilewire inTilewire) const
 Determines whether the given Tilewire is a source of this net. More...
 
bool containsSink (Tilewire inTilewire) const
 Determines whether the given Tilewire is a sink of this net. More...
 
bool containsArc (const Arc &inArc) const
 Determines whether the net contains the given arc. More...
 
void addSource (Tilewire inTilewire)
 Adds the given Tilewire as a source for this net. More...
 
void addSink (Tilewire inTilewire)
 Adds the given Tilewire as a sink for this net. More...
 
bool removeSource (Tilewire inTilewire)
 Removes the given Tilewire from the sources of this net. More...
 
bool removeSink (Tilewire inTilewire)
 Removes the given instance pin from the sinks of this net. More...
 
void addArc (const Arc &inArc)
 Adds the given arc to this net. More...
 
bool removeArc (const Arc &inArc)
 Removes the given arc from this net. More...
 
void unroute (void)
 Unroute the net. More...
 
bool hasAnySources (void) const
 Returns true if the net has any sources. More...
 
bool hasOneSource (void) const
 Returns true if the net has exactly one source. More...
 
bool hasMultipleSources (void) const
 Returns true if the net has more than one source. More...
 
size_t getSourceCount (void) const
 Returns the number of sources on the net. More...
 
bool hasAnySinks (void) const
 Returns true if the net has any sinks. More...
 
bool hasOneSink (void) const
 Returns true if the net has exactly one sink. More...
 
bool hasMultipleSinks (void) const
 Returns true if the next has more than one sink. More...
 
size_t getSinkCount (void) const
 Returns the number of sinks on the net. More...
 
bool hasAnyArcs (void) const
 Returns true if the net has any arcs. More...
 
size_t getArcCount (void) const
 Returns the number of arcs on the net. More...
 
bool isRouted (void) const
 Returns true if the net has any arcs. More...
 
bool isUnrouted (void) const
 Returns true if the net has no arcs. More...
 
TilewireConstIterator sourcesBegin (void) const
 Returns the begin constant iterator for source Tilewires. More...
 
TilewireConstIterator sourcesEnd (void) const
 Returns the end constant iterator for source Tilewires. More...
 
TilewireIterator sourcesBegin (void)
 Returns the begin non-constant iterator for source Tilewires. More...
 
TilewireIterator sourcesEnd (void)
 Returns the end non-constant iterator for source Tilewires. More...
 
TilewireConstIterator sinksBegin (void) const
 Returns the begin constant iterator for sink Tilewires. More...
 
TilewireConstIterator sinksEnd (void) const
 Returns the end constant iterator for sink Tilewires. More...
 
TilewireIterator sinksBegin (void)
 Returns the begin non-constant iterator for sink Tilewires. More...
 
TilewireIterator sinksEnd (void)
 Returns the end non-constant iterator for sink Tilewires. More...
 
ArcConstIterator arcsBegin (void) const
 Returns the begin constant iterator for arcs. More...
 
ArcConstIterator arcsEnd (void) const
 Returns the end constant iterator for arcs. More...
 
ArcIterator arcsBegin (void)
 Returns the begin non-constant iterator for arcs. More...
 
ArcIterator arcsEnd (void)
 Returns the end non-constant iterator for arcs. More...
 
const stringgetName () const
 Returns the name of the net. More...
 
RouteNodePtrVectorrouteNodes ()
 Returns a reference to the RouteNodePtrVector. More...
 

Data Fields

boost::unordered_map
< boost::uint32_t, boost::any > 
mProperties
 Net annotation structure. More...
 

Protected Attributes

string mName
 Name of the net. More...
 
TilewireVector mSources
 Vector of net source Tilewires. More...
 
TilewireVector mSinks
 Vector of net sink Tilewires. More...
 
ArcVector mArcs
 Vector of arcs representing net connectivity. More...
 
RouteNodePtrVector mRouteNodes
 Vector of RouteNodes representing net connectivity. More...
 

Private Types

typedef std::string string
 Imported type names. More...
 
typedef architecture::Tilewire Tilewire
 
typedef
architecture::TilewireVector 
TilewireVector
 
typedef architecture::Arc Arc
 
typedef architecture::ArcVector ArcVector
 

Detailed Description

Router net.

The RouteNet class contains architecture specific sources and sinks.

Definition at line 40 of file RouteNet.hpp.

Member Typedef Documentation

Definition at line 46 of file RouteNet.hpp.

typedef ArcVector::const_iterator torc::router::RouteNet::ArcConstIterator

Definition at line 49 of file RouteNet.hpp.

typedef ArcVector::iterator torc::router::RouteNet::ArcIterator

Definition at line 50 of file RouteNet.hpp.

Definition at line 47 of file RouteNet.hpp.

typedef RouteNodePtrVector::const_iterator torc::router::RouteNet::RouteNodePtrConstIterator

Definition at line 53 of file RouteNet.hpp.

typedef RouteNodePtrVector::iterator torc::router::RouteNet::RouteNodePtrIterator

Definition at line 54 of file RouteNet.hpp.

typedef std::string torc::router::RouteNet::string
private

Imported type names.

Definition at line 43 of file RouteNet.hpp.

Definition at line 44 of file RouteNet.hpp.

typedef TilewireVector::const_iterator torc::router::RouteNet::TilewireConstIterator

Definition at line 51 of file RouteNet.hpp.

typedef TilewireVector::iterator torc::router::RouteNet::TilewireIterator

Definition at line 52 of file RouteNet.hpp.

Constructor & Destructor Documentation

torc::router::RouteNet::RouteNet ( string inName)
inline

Name only constructor.

Definition at line 75 of file RouteNet.hpp.

75 : mName(inName) {}
string mName
Name of the net.
Definition: RouteNet.hpp:59
torc::router::RouteNet::RouteNet ( string inName,
const TilewireVector inSources,
const TilewireVector inSinks 
)
inline

Populated constructor.

Copies the contents of the input vectors.

Definition at line 78 of file RouteNet.hpp.

78  :
79  mName(inName), mSources(inSources), mSinks(inSinks) {}
string mName
Name of the net.
Definition: RouteNet.hpp:59
TilewireVector mSources
Vector of net source Tilewires.
Definition: RouteNet.hpp:61
TilewireVector mSinks
Vector of net sink Tilewires.
Definition: RouteNet.hpp:63

Member Function Documentation

void torc::router::RouteNet::addArc ( const Arc inArc)
inline

Adds the given arc to this net.

Duplicate arcs are not currently discarded.

Definition at line 128 of file RouteNet.hpp.

128  {
129  mArcs.push_back(inArc);
130  }
ArcVector mArcs
Vector of arcs representing net connectivity.
Definition: RouteNet.hpp:65

+ Here is the caller graph for this function:

void torc::router::RouteNet::addSink ( Tilewire  inTilewire)
inline

Adds the given Tilewire as a sink for this net.

Duplicate sinks are not currently discarded.

Definition at line 103 of file RouteNet.hpp.

103  {
104  mSinks.push_back(inTilewire);
105  }
TilewireVector mSinks
Vector of net sink Tilewires.
Definition: RouteNet.hpp:63

+ Here is the caller graph for this function:

void torc::router::RouteNet::addSource ( Tilewire  inTilewire)
inline

Adds the given Tilewire as a source for this net.

Duplicate sources are not currently discarded.

Definition at line 98 of file RouteNet.hpp.

98  {
99  mSources.push_back(inTilewire);
100  }
TilewireVector mSources
Vector of net source Tilewires.
Definition: RouteNet.hpp:61

+ Here is the caller graph for this function:

ArcConstIterator torc::router::RouteNet::arcsBegin ( void  ) const
inline

Returns the begin constant iterator for arcs.

Definition at line 190 of file RouteNet.hpp.

190 { return mArcs.begin(); }
ArcVector mArcs
Vector of arcs representing net connectivity.
Definition: RouteNet.hpp:65

+ Here is the caller graph for this function:

ArcIterator torc::router::RouteNet::arcsBegin ( void  )
inline

Returns the begin non-constant iterator for arcs.

Definition at line 194 of file RouteNet.hpp.

194 { return mArcs.begin(); }
ArcVector mArcs
Vector of arcs representing net connectivity.
Definition: RouteNet.hpp:65
ArcConstIterator torc::router::RouteNet::arcsEnd ( void  ) const
inline

Returns the end constant iterator for arcs.

Definition at line 192 of file RouteNet.hpp.

192 { return mArcs.end(); }
ArcVector mArcs
Vector of arcs representing net connectivity.
Definition: RouteNet.hpp:65

+ Here is the caller graph for this function:

ArcIterator torc::router::RouteNet::arcsEnd ( void  )
inline

Returns the end non-constant iterator for arcs.

Definition at line 196 of file RouteNet.hpp.

196 { return mArcs.end(); }
ArcVector mArcs
Vector of arcs representing net connectivity.
Definition: RouteNet.hpp:65
bool torc::router::RouteNet::containsArc ( const Arc inArc) const
inline

Determines whether the net contains the given arc.

Returns
true if the net contains the given arc, or false otherwise.

Definition at line 93 of file RouteNet.hpp.

93  {
94  return std::find(arcsBegin(), arcsEnd(), inArc) != arcsEnd();
95  }
ArcConstIterator arcsEnd(void) const
Returns the end constant iterator for arcs.
Definition: RouteNet.hpp:192
ArcConstIterator arcsBegin(void) const
Returns the begin constant iterator for arcs.
Definition: RouteNet.hpp:190

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool torc::router::RouteNet::containsSink ( Tilewire  inTilewire) const
inline

Determines whether the given Tilewire is a sink of this net.

Returns
true if the given Tilewire is a sink of this net, or false otherwise.

Definition at line 88 of file RouteNet.hpp.

88  {
89  return std::find(sinksBegin(), sinksEnd(), inTilewire) != sinksEnd();
90  }
TilewireConstIterator sinksEnd(void) const
Returns the end constant iterator for sink Tilewires.
Definition: RouteNet.hpp:184
TilewireConstIterator sinksBegin(void) const
Returns the begin constant iterator for sink Tilewires.
Definition: RouteNet.hpp:182

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool torc::router::RouteNet::containsSource ( Tilewire  inTilewire) const
inline

Determines whether the given Tilewire is a source of this net.

Returns
true if the given Tilewire is a source of this net, or false otherwise.

Definition at line 83 of file RouteNet.hpp.

83  {
84  return std::find(sourcesBegin(), sourcesEnd(), inTilewire) != sourcesEnd();
85  }
TilewireConstIterator sourcesEnd(void) const
Returns the end constant iterator for source Tilewires.
Definition: RouteNet.hpp:176
TilewireConstIterator sourcesBegin(void) const
Returns the begin constant iterator for source Tilewires.
Definition: RouteNet.hpp:174

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

size_t torc::router::RouteNet::getArcCount ( void  ) const
inline

Returns the number of arcs on the net.

Definition at line 167 of file RouteNet.hpp.

167 { return mArcs.size(); }
ArcVector mArcs
Vector of arcs representing net connectivity.
Definition: RouteNet.hpp:65

+ Here is the caller graph for this function:

const string& torc::router::RouteNet::getName ( void  ) const
inline

Returns the name of the net.

Definition at line 199 of file RouteNet.hpp.

199 { return mName; }
string mName
Name of the net.
Definition: RouteNet.hpp:59

+ Here is the caller graph for this function:

size_t torc::router::RouteNet::getSinkCount ( void  ) const
inline

Returns the number of sinks on the net.

Definition at line 163 of file RouteNet.hpp.

163 { return mSinks.size(); }
TilewireVector mSinks
Vector of net sink Tilewires.
Definition: RouteNet.hpp:63
size_t torc::router::RouteNet::getSourceCount ( void  ) const
inline

Returns the number of sources on the net.

Definition at line 155 of file RouteNet.hpp.

155 { return mSources.size(); }
TilewireVector mSources
Vector of net source Tilewires.
Definition: RouteNet.hpp:61
bool torc::router::RouteNet::hasAnyArcs ( void  ) const
inline

Returns true if the net has any arcs.

Definition at line 165 of file RouteNet.hpp.

165 { return !mArcs.empty(); }
ArcVector mArcs
Vector of arcs representing net connectivity.
Definition: RouteNet.hpp:65

+ Here is the caller graph for this function:

bool torc::router::RouteNet::hasAnySinks ( void  ) const
inline

Returns true if the net has any sinks.

Definition at line 157 of file RouteNet.hpp.

157 { return !mSinks.empty(); }
TilewireVector mSinks
Vector of net sink Tilewires.
Definition: RouteNet.hpp:63

+ Here is the caller graph for this function:

bool torc::router::RouteNet::hasAnySources ( void  ) const
inline

Returns true if the net has any sources.

Definition at line 149 of file RouteNet.hpp.

149 { return !mSources.empty(); }
TilewireVector mSources
Vector of net source Tilewires.
Definition: RouteNet.hpp:61

+ Here is the caller graph for this function:

bool torc::router::RouteNet::hasMultipleSinks ( void  ) const
inline

Returns true if the next has more than one sink.

Definition at line 161 of file RouteNet.hpp.

161 { return mSinks.size() > 1; }
TilewireVector mSinks
Vector of net sink Tilewires.
Definition: RouteNet.hpp:63

+ Here is the caller graph for this function:

bool torc::router::RouteNet::hasMultipleSources ( void  ) const
inline

Returns true if the net has more than one source.

Definition at line 153 of file RouteNet.hpp.

153 { return mSources.size() > 1; }
TilewireVector mSources
Vector of net source Tilewires.
Definition: RouteNet.hpp:61

+ Here is the caller graph for this function:

bool torc::router::RouteNet::hasOneSink ( void  ) const
inline

Returns true if the net has exactly one sink.

Definition at line 159 of file RouteNet.hpp.

159 { return mSinks.size() == 1; }
TilewireVector mSinks
Vector of net sink Tilewires.
Definition: RouteNet.hpp:63

+ Here is the caller graph for this function:

bool torc::router::RouteNet::hasOneSource ( void  ) const
inline

Returns true if the net has exactly one source.

Definition at line 151 of file RouteNet.hpp.

151 { return mSources.size() == 1; }
TilewireVector mSources
Vector of net source Tilewires.
Definition: RouteNet.hpp:61

+ Here is the caller graph for this function:

bool torc::router::RouteNet::isRouted ( void  ) const
inline

Returns true if the net has any arcs.

Definition at line 169 of file RouteNet.hpp.

169 { return hasAnyArcs(); }
bool hasAnyArcs(void) const
Returns true if the net has any arcs.
Definition: RouteNet.hpp:165

+ Here is the call graph for this function:

bool torc::router::RouteNet::isUnrouted ( void  ) const
inline

Returns true if the net has no arcs.

Definition at line 171 of file RouteNet.hpp.

171 { return !hasAnyArcs(); }
bool hasAnyArcs(void) const
Returns true if the net has any arcs.
Definition: RouteNet.hpp:165

+ Here is the call graph for this function:

bool torc::router::RouteNet::removeArc ( const Arc inArc)
inline

Removes the given arc from this net.

Returns
true if the arc was removed from this net, or false if it was not found.

Definition at line 133 of file RouteNet.hpp.

133  {
134  ArcIterator e = arcsEnd();
135  ArcIterator result = std::find(arcsBegin(), e, inArc);
136  // do nothing if the arc doesn't exist
137  if(result == e) return false;
138  // erase the arc
139  mArcs.erase(result);
140  return true;
141  }
ArcVector mArcs
Vector of arcs representing net connectivity.
Definition: RouteNet.hpp:65
ArcConstIterator arcsEnd(void) const
Returns the end constant iterator for arcs.
Definition: RouteNet.hpp:192
ArcVector::iterator ArcIterator
Definition: RouteNet.hpp:50
ArcConstIterator arcsBegin(void) const
Returns the begin constant iterator for arcs.
Definition: RouteNet.hpp:190

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool torc::router::RouteNet::removeSink ( Tilewire  inTilewire)
inline

Removes the given instance pin from the sinks of this net.

Returns
true if the instance pin was removed from the sink list, or false if it was not found.

Definition at line 119 of file RouteNet.hpp.

119  {
121  TilewireIterator result = std::find(sinksBegin(), e, inTilewire);
122  if(result == e) return false;
123  mSinks.erase(result);
124  return true;
125  }
TilewireConstIterator sinksEnd(void) const
Returns the end constant iterator for sink Tilewires.
Definition: RouteNet.hpp:184
TilewireVector::iterator TilewireIterator
Definition: RouteNet.hpp:52
TilewireConstIterator sinksBegin(void) const
Returns the begin constant iterator for sink Tilewires.
Definition: RouteNet.hpp:182
TilewireVector mSinks
Vector of net sink Tilewires.
Definition: RouteNet.hpp:63

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool torc::router::RouteNet::removeSource ( Tilewire  inTilewire)
inline

Removes the given Tilewire from the sources of this net.

Returns
true if the Tilewire was removed from the source list, or false if it was not found.

Definition at line 109 of file RouteNet.hpp.

109  {
111  TilewireIterator result = std::find(sourcesBegin(), e, inTilewire);
112  if(result == e) return false;
113  mSources.erase(result);
114  return true;
115  }
TilewireVector mSources
Vector of net source Tilewires.
Definition: RouteNet.hpp:61
TilewireVector::iterator TilewireIterator
Definition: RouteNet.hpp:52
TilewireConstIterator sourcesEnd(void) const
Returns the end constant iterator for source Tilewires.
Definition: RouteNet.hpp:176
TilewireConstIterator sourcesBegin(void) const
Returns the begin constant iterator for source Tilewires.
Definition: RouteNet.hpp:174

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

RouteNodePtrVector& torc::router::RouteNet::routeNodes ( )
inline

Returns a reference to the RouteNodePtrVector.

Definition at line 201 of file RouteNet.hpp.

201 { return mRouteNodes; }
RouteNodePtrVector mRouteNodes
Vector of RouteNodes representing net connectivity.
Definition: RouteNet.hpp:67

+ Here is the caller graph for this function:

TilewireConstIterator torc::router::RouteNet::sinksBegin ( void  ) const
inline

Returns the begin constant iterator for sink Tilewires.

Definition at line 182 of file RouteNet.hpp.

182 { return mSinks.begin(); }
TilewireVector mSinks
Vector of net sink Tilewires.
Definition: RouteNet.hpp:63

+ Here is the caller graph for this function:

TilewireIterator torc::router::RouteNet::sinksBegin ( void  )
inline

Returns the begin non-constant iterator for sink Tilewires.

Definition at line 186 of file RouteNet.hpp.

186 { return mSinks.begin(); }
TilewireVector mSinks
Vector of net sink Tilewires.
Definition: RouteNet.hpp:63
TilewireConstIterator torc::router::RouteNet::sinksEnd ( void  ) const
inline

Returns the end constant iterator for sink Tilewires.

Definition at line 184 of file RouteNet.hpp.

184 { return mSinks.end(); }
TilewireVector mSinks
Vector of net sink Tilewires.
Definition: RouteNet.hpp:63

+ Here is the caller graph for this function:

TilewireIterator torc::router::RouteNet::sinksEnd ( void  )
inline

Returns the end non-constant iterator for sink Tilewires.

Definition at line 188 of file RouteNet.hpp.

188 { return mSinks.end(); }
TilewireVector mSinks
Vector of net sink Tilewires.
Definition: RouteNet.hpp:63
TilewireConstIterator torc::router::RouteNet::sourcesBegin ( void  ) const
inline

Returns the begin constant iterator for source Tilewires.

Definition at line 174 of file RouteNet.hpp.

174 { return mSources.begin(); }
TilewireVector mSources
Vector of net source Tilewires.
Definition: RouteNet.hpp:61

+ Here is the caller graph for this function:

TilewireIterator torc::router::RouteNet::sourcesBegin ( void  )
inline

Returns the begin non-constant iterator for source Tilewires.

Definition at line 178 of file RouteNet.hpp.

178 { return mSources.begin(); }
TilewireVector mSources
Vector of net source Tilewires.
Definition: RouteNet.hpp:61
TilewireConstIterator torc::router::RouteNet::sourcesEnd ( void  ) const
inline

Returns the end constant iterator for source Tilewires.

Definition at line 176 of file RouteNet.hpp.

176 { return mSources.end(); }
TilewireVector mSources
Vector of net source Tilewires.
Definition: RouteNet.hpp:61

+ Here is the caller graph for this function:

TilewireIterator torc::router::RouteNet::sourcesEnd ( void  )
inline

Returns the end non-constant iterator for source Tilewires.

Definition at line 180 of file RouteNet.hpp.

180 { return mSources.end(); }
TilewireVector mSources
Vector of net source Tilewires.
Definition: RouteNet.hpp:61
void torc::router::RouteNet::unroute ( void  )
inline

Unroute the net.

The net is unrouted by clearing its arc list.

Definition at line 144 of file RouteNet.hpp.

144  {
145  mArcs.clear();
146  }
ArcVector mArcs
Vector of arcs representing net connectivity.
Definition: RouteNet.hpp:65

Field Documentation

ArcVector torc::router::RouteNet::mArcs
protected

Vector of arcs representing net connectivity.

Definition at line 65 of file RouteNet.hpp.

string torc::router::RouteNet::mName
protected

Name of the net.

Definition at line 59 of file RouteNet.hpp.

boost::unordered_map<boost::uint32_t, boost::any> torc::router::RouteNet::mProperties

Net annotation structure.

Definition at line 70 of file RouteNet.hpp.

RouteNodePtrVector torc::router::RouteNet::mRouteNodes
protected

Vector of RouteNodes representing net connectivity.

Definition at line 67 of file RouteNet.hpp.

TilewireVector torc::router::RouteNet::mSinks
protected

Vector of net sink Tilewires.

Definition at line 63 of file RouteNet.hpp.

TilewireVector torc::router::RouteNet::mSources
protected

Vector of net source Tilewires.

Definition at line 61 of file RouteNet.hpp.


The documentation for this class was generated from the following file: