torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
NetRouter.hpp
Go to the documentation of this file.
1 // Torc - Copyright 2011-2013 University of Southern California. All Rights Reserved.
2 // $HeadURL$
3 // $Id$
4 
5 // This program is free software: you can redistribute it and/or modify it under the terms of the
6 // GNU General Public License as published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
10 // without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
11 // the GNU General Public License for more details.
12 //
13 // You should have received a copy of the GNU General Public License along with this program. If
14 // not, see <http://www.gnu.org/licenses/>.
15 
16 /// \file
17 /// \brief Header for the NetRouter class.
18 
19 #ifndef TORC_ROUTER_NETROUTER_HPP
20 #define TORC_ROUTER_NETROUTER_HPP
21 
25 #include "torc/router/RouteNet.hpp"
28 #include <set>
29 #include <iostream>
30 #include <algorithm>
31 #include <queue>
32 #include <boost/cstdint.hpp>
33 #include <boost/timer.hpp>
34 #include <boost/unordered_map.hpp>
35 #include <boost/unordered_set.hpp>
36 #include <boost/functional/hash.hpp>
37 
38 namespace torc {
39 namespace router {
40  /// \brief Provides net routing based on the Nilsson graphsearch algorithm.
41  /// \details The router can either return a vector of nodes or directly populate DDB usage.
42  class NetRouter : public NetRouterBase {
43  // types
44  /// \brief Imported type names
52 
53  typedef std::priority_queue<RouteNode*, std::vector<RouteNode*>,
55  typedef boost::unordered_map<Tilewire, RouteNode*,
56  boost::hash<architecture::Tilewire> > RouteNodePtrMap;
57  typedef boost::unordered_set<Tilewire, boost::hash<architecture::Tilewire> > TilewireSet;
58 
59  protected:
60  // members
61  /// \brief Database reference.
62  //DDB& mDB;
63  /// \brief ArcUsage reference.
65  /// \brief WireUsage reference.
67 
68  /// \brief Pointer to the heuristic for making routing decisions.
69  //NetRouterHeuristicBase* mHeuristic;
70 
71  /// \brief Priority queue of nodes to explore during routing, mirrors mOpen.
73  /// \brief Collection of candidate nodes the router can expand.
75  /// \brief Collection of nodes that have been expanded.
77  /// \brief Collection of nodes skipped due to heuristic constraints.
79  /// \brief Vector of nodes created during pre-routing.
81  /// \brief Set of Closed Tilewires to avoid issues with bidir resources.
83 
84  /// \brief Scratch segment storage.
86  /// \brief Scratch arc storage
88 
89  /// \brief Maximum number of nodes to explore before failing.
90  boost::uint32_t mSearchLimit;
91  /// \brief Number of nets routed since construction.
92  boost::uint32_t mStatNets;
93  /// \brief Number of passes through the main loop since construction.
94  boost::uint32_t mStatLoopPasses;
95  /// \brief Number of nodes created from expansion.
96  boost::uint32_t mStatExpanded;
97  /// \brief Number of net sources seen since construction.
98  boost::uint32_t mStatSources;
99  /// \brief Number of net sinks seen since construction.
100  boost::uint32_t mStatSinks;
101 
102  public:
103  // constructor
104  /// \brief Public Constructor
105  NetRouter(DDB& inDB, NetRouterHeuristicBase* inHeuristic) :
106  NetRouterBase(inDB, inHeuristic), mArcUsage(inDB.getArcUsage()),
107  mWireUsage(inDB.getWireUsage()) {
108 
109  mSearchLimit = 0x001FFFFF;
110  mStatNets = 0u;
111  mStatLoopPasses = 0u;
112  mStatExpanded = 0u;
113  mStatSources = 0u;
114  mStatSinks = 0u;
115 
116  mTotalRouteTime = 0;
117  }
118  /// \brief Destructor.
120 
121  /// \brief Route a net.
122  void routeNet(RouteNet& net) {
123 //std::cout << "### ROUTING " << net.getName() << " ###" << std::endl;
124  if (!net.hasOneSource()) {
125  std::cout << "NetRouter does not support multiple sources" << std::endl;
126  throw;
127  }
128  Tilewire source = *net.sourcesBegin();
129  TilewireVector sinks;
130  TilewireVector::iterator p;
131  TilewireVector::iterator e = net.sinksEnd();
132  for (p = net.sinksBegin(); p != e; p++) {
133  sinks.push_back(*p);
134  }
135 
136  // test resources in use
137  if (source == Tilewire::sInvalid) {
138  std::cout << net.getName() << ": source is INVALID" << std::endl;
139  return;
140  }
141  if (mWireUsage.isUsed(source)) {
142  /// \todo Throw appropriate exception.
143  std::cout << "!Source already in use! " << source << std::endl;
144  throw;
145  }
146  e = sinks.end();
147  for (p = sinks.begin(); p != e; p++) {
148  if (*p == Tilewire::sInvalid) {
149  std::cout << net.getName() << ": sink is INVALID" << std::endl;
150  return;
151  }
152  if (mWireUsage.isUsed(*p)) {
153  /// \todo Throw appropriate exception.
154  std::cout << "!Sink already in use! " << *p << std::endl;
155  throw;
156  }
157  }
158 
159  // pre-routing
160 
161  if (sinks.size() == 1 && testDedicatedPath(source, sinks[0], mPreRoute)) {
162  RouteNodePtrVector::iterator p;
163  RouteNodePtrVector::iterator e;
164  e = mPreRoute.end();
165  // transfer preroute to the net.
166  for (p = mPreRoute.begin(); p != e; p++) {
167  net.routeNodes().push_back(*p);
168  }
169  mPreRoute.clear();
170  } else {
171  if (!expandNetTerminals(source, sinks, mPreRoute)) {
172  std::cout << "DISCARDED in expand function: " << net.getName() << std::endl;
173  throw;
174  }
175 
176  graphSearch(source, sinks, net.routeNodes());
177  }
178 
179  mStatNets++;
180  mStatSources++;
181  mStatSinks += sinks.size();
182  }
183  void resetStats() {
184  mStatNets = 0u;
185  mStatLoopPasses = 0u;
186  mStatExpanded = 0u;
187  mStatSources = 0u;
188  mStatSinks = 0u;
189  }
190  void printStats(std::ostream& out) {
191  out << "Nets routed: " << mStatNets
192  << " Sources: " << mStatSources
193  << " Sinks : " << mStatSinks
194  << " Arcs expanded: " << mStatExpanded
195  << " Loop passes: " << mStatLoopPasses
196  << " Total routing time: " << mTotalRouteTime
197  << std::endl;
198  }
199  protected:
200  /// \brief Internal top level route function.
201  void graphSearch(const Tilewire& inSource, TilewireVector& inSinks,
202  RouteNodePtrVector& outRoute) {
203 
204  clearContainers();
205 
206  mWireUsage.release(inSource);
207  TilewireVector::const_iterator p;
208  TilewireVector::const_iterator e = inSinks.end();
209  for (p = inSinks.begin(); p != e; p++) {
210  mWireUsage.release(*p);
211 
212  }
213  mHeuristic->reorderSinks(inSource, inSinks);
214  /// \todo Count new RouteNodes?
215  RouteNode* s = new RouteNode(inSource, inSource, 0, 0, 0, 0);
216 
217  mOpen.insert(std::pair<Tilewire, RouteNode*>(inSource, s));
218  mOrder.push(s);
219  e = inSinks.end();
220  for (p = inSinks.begin(); p != e; p++) {
221 
222  RouteNodePtrVector::iterator q;
223  RouteNodePtrVector::iterator f = outRoute.end();
224  for (q = outRoute.begin(); q != f; q++) {
225  /// \todo Set initial cost
226  mOpen.insert(std::pair<Tilewire, RouteNode*>((*q)->getSinkTilewire(), (*q)));
227  mOrder.push(*q);
228  }
229  mHeuristic->setSink(*p);
230  ////////////////
231  graphSearchLoop(inSource, *p, outRoute);
232  ////////////////
233  f = outRoute.end();
234  for (q = outRoute.begin(); q != f; q++) {
235  Tilewire tw = (*q)->getSinkTilewire();
236  mOpen.erase(tw);
237  mClosed.erase(tw);
238  mSkipped.erase(tw);
239  }
240  clearContainers();
241  }
242 
243  mWireUsage.use(inSource);
244  e = inSinks.end();
245  for (p = inSinks.begin(); p != e; p++) {
246  mWireUsage.use(*p);
247  }
248  }
249  /// \brief Routing loop function.
250  void graphSearchLoop(const Tilewire& inSource, const Tilewire& inSink,
251  RouteNodePtrVector& outRoute) {
252 
253  boost::uint32_t expanded = 0;
254  boost::uint32_t processed = 0;
255  while (true) {
256  mStatLoopPasses++;
257  if (mOrder.size() == 0) {
258  std::cout << "ROUTING FAILED!" << std::endl;
259  clearContainers();
260  /// \todo Throw route failed exception.
261  throw;
262  }
263 
264  if (++processed > mSearchLimit) {
265  std::cout << "ROUTE LIMIT!" << std::endl;
266  /// \todo Throw route limited exception.
267  throw;
268  }
269  RouteNode* n = mOrder.top();
270  Tilewire key = n->getSinkTilewire();
271  RouteNodePtrMap::iterator pk = mOpen.find(key);
272  mClosed.insert(std::pair<Tilewire, RouteNode*>(key, n));
273  mOpen.erase(pk);
274  mOrder.pop();
275 
276 //std::cout << key << " " << mOrder.size() << std::endl;
277  /// \todo adjust the node cost to be just the path cost?
278 
279  mSegmentBuf.clear();
281  TilewireVector::iterator p;
282  TilewireVector::iterator e = mSegmentBuf.end();
283  for (p = mSegmentBuf.begin(); p != e; p++) {
284  if (*p == inSink) {
285  recordPath(n, key, inSource, outRoute);
286  mStatExpanded += expanded;
287  return;
288  }
289  mAuxClosed.insert(*p);
290  }
291 
292  mArcsBuf.clear();
293 
295 //std::cout << "\t" << mArcsBuf.size() << std::endl;
296  ArcVector::iterator q;
297  ArcVector::iterator f = mArcsBuf.end();
298  for (q = mArcsBuf.begin(); q != f; q++) {
299  expanded++;
300  graphSearchFilter(n, *q, outRoute);
301  }
302  }
303  }
304  /// \brief Create a new node and put it into the appropriate structure
305  void graphSearchFilter(RouteNode* inParent, const Arc& inArc,
306  RouteNodePtrVector& outRoute) {
307 
308  const Tilewire& arcSink = inArc.getSinkTilewire();
309  /// \todo Need to check to see if we should be adjusting pointers in here.
310  if (mWireUsage.isUsed(arcSink)) return; // check if resources used
311  if (mOpen.find(arcSink) != mOpen.end()) return;
312  if (mClosed.find(arcSink) != mClosed.end()) return;
313  if (mSkipped.find(arcSink) != mSkipped.end()) return;
314 
315  if (mAuxClosed.find(arcSink) != mAuxClosed.end()) {
316 // std::cout << "FOUND SPECIAL CASE: " << arcSink << std::endl;
317  return;
318  }
319 
320  RouteNode* node = new RouteNode(inArc, 0, 0, inParent->getDepth() + 1, inParent);
321  /// \todo Heuristic check if node is filtered
322  /// \todo Heuristic cost of node
323  mHeuristic->nodeCost(*node);
324  /// \todo Cases for different places the node can go.
325  mOpen.insert(std::pair<Tilewire, RouteNode*>(arcSink, node));
326  mOrder.push(node);
327  }
328  /// \brief Add the newly found route to the outRoute vector
329  void recordPath(RouteNode* node, Tilewire key, Tilewire inSource,
330  RouteNodePtrVector& outRoute) {
331 
332  RouteNodePtrVector::iterator p;
333  RouteNodePtrVector::iterator e;
334  e = mPreRoute.end();
335  // transfer preroute to the outRoute;
336  for (p = mPreRoute.begin(); p != e; p++) {
337  outRoute.push_back(*p);
338  }
339  mPreRoute.clear();
340  while (true) {
341  node->setCost(0); // new wavefront?
342  e = outRoute.end();
343  for (p = outRoute.begin(); p != e; p++) {
344  if ((*p)->getSinkTilewire() == node->getSinkTilewire()) return;
345  }
346  outRoute.push_back(node);
347  if (key == inSource) return; // maybe a redundant check?
348  node = node->getParent();
349  if (node == 0) return;
350  key = node->getSinkTilewire();
351  }
352  }
353  /// \brief Delete nodes in containers and clear them.
355  /// \todo Report statistics on nodes deleted?
356  RouteNodePtrMap::iterator p;
357  RouteNodePtrMap::iterator e = mOpen.end();
358  for (p = mOpen.begin(); p != e; p++) { delete (*p).second; }
359  e = mClosed.end();
360  for (p = mClosed.begin(); p != e; p++) { delete (*p).second; }
361  e = mSkipped.end();
362  for (p = mSkipped.begin(); p != e; p++) { delete (*p).second; }
363  while (!mOrder.empty()) { mOrder.pop(); }
364  mOpen.clear();
365  mClosed.clear();
366  mSkipped.clear();
367  mAuxClosed.clear();
368  }
369  /// \brief Move net terminals out into the INT tiles.
370  bool expandNetTerminals(Tilewire& inSource, TilewireVector& inSinks,
371  RouteNodePtrVector& outRoute) {
372 
373  if (inSource == Tilewire::sInvalid) return false;
374  inSource = expandSourceTerminal(inSource, outRoute);
375  TilewireVector::iterator e = inSinks.end();
376  for (TilewireVector::iterator p = inSinks.begin(); p != e; p++) {
377  if (*p == Tilewire::sInvalid) return false;
378  *p = expandSinkTerminal(*p, outRoute);
379  }
380  return true;
381  }
382  /// \brief Test for a dedicated routing path.
383  bool testDedicatedPath(Tilewire inSource, Tilewire inSink, RouteNodePtrVector& outRoute) {
384  ArcVector arcs;
385  RouteNodePtrVector tempRoute;
386  Tilewire tempsink = inSink;
387  mDB.expandSegmentSources(inSink, arcs);
388  while (arcs.size() == 1) {
389  RouteNode* node = new RouteNode(arcs[0], 0, 0, 0, 0);
390  tempRoute.push_back(node);
391  mDB.useArc(arcs[0]);
392  tempsink = arcs[0].getSourceTilewire();
393  if (tempsink == inSource) {
394 // std::cout << "FOUND DEDICATED ROUTE!!! " << inSource << " to " << inSink
395 // << std::endl;
396  for (unsigned int i = 0; i < tempRoute.size(); i++) {
397  outRoute.push_back(tempRoute[i]);
398  }
399  return true;
400  }
401  arcs.clear();
402  mDB.expandSegmentSources(tempsink, arcs);
403  }
404  return false;
405  }
406  /// \brief Move the source terminal of a net in the sinkwards direction.
408  ArcVector arcs;
409  //bool movingsource = false;
410  Tilewire tempsource = inSource;
411  mDB.expandSegmentSinks(inSource, arcs);
412  while (arcs.size() == 1) {
413  //movingsource = true;
414  RouteNode* node = new RouteNode(arcs[0], 0, 0, 0, 0);
415  outRoute.push_back(node);
416  mDB.useArc(arcs[0]);
417  tempsource = arcs[0].getSinkTilewire();
418  arcs.clear();
419  mDB.expandSegmentSinks(tempsource, arcs);
420  }
421  return tempsource;
422  //return arcs[0].getSourceTilewire();
423  }
424  /// \brief Move the sink terminal of a net in the sourcewards direction.
426  ArcVector arcs;
427  //bool movingsink = false;
428  Tilewire tempsink = inSink;
429  mDB.expandSegmentSources(inSink, arcs);
430  while (arcs.size() == 1) {
431  //movingsink = true;
432  RouteNode* node = new RouteNode(arcs[0], 0, 0, 0, 0);
433  outRoute.push_back(node);
434  mDB.useArc(arcs[0]);
435  tempsink = arcs[0].getSourceTilewire();
436  arcs.clear();
437  mDB.expandSegmentSources(tempsink, arcs);
438  }
439  return arcs[0].getSinkTilewire();
440  }
441  }; // class NetRouter
442 } // namespace router
443 } // namespace torc
444 
445 #endif // TORC_ROUTER_NETROUTER_HPP
RouteNodePtrVector mPreRoute
Vector of nodes created during pre-routing.
Definition: NetRouter.hpp:80
TilewireConstIterator sinksEnd(void) const
Returns the end constant iterator for sink Tilewires.
Definition: RouteNet.hpp:184
double mTotalRouteTime
Total routing time since construction.
boost::uint32_t mStatNets
Number of nets routed since construction.
Definition: NetRouter.hpp:92
architecture::Arc Arc
Definition: NetRouter.hpp:49
RouteNodePtrQueue mOrder
Pointer to the heuristic for making routing decisions.
Definition: NetRouter.hpp:72
Encapsulation of an arc between two tilewires.
Definition: Arc.hpp:28
std::vector< Tilewire > TilewireVector
Vector of Tilewire objects.
Definition: Tilewire.hpp:101
architecture::WireUsage WireUsage
Definition: NetRouter.hpp:47
std::vector< RouteNode * > RouteNodePtrVector
Vector of RouteNode pointers.
Definition: RouteNode.hpp:115
RouteNode * getParent() const
Get the node's parent.
Definition: RouteNode.hpp:98
void clearContainers()
Delete nodes in containers and clear them.
Definition: NetRouter.hpp:354
Device database, including complete wiring and logic support.
Definition: DDB.hpp:42
boost::uint32_t mStatSinks
Number of net sinks seen since construction.
Definition: NetRouter.hpp:100
const string & getName() const
Returns the name of the net.
Definition: RouteNet.hpp:199
boost::uint32_t mSearchLimit
Maximum number of nodes to explore before failing.
Definition: NetRouter.hpp:90
Encapsulation the design wire usage.
Definition: WireUsage.hpp:35
Header for the RouteNode class.
boost::uint32_t mStatExpanded
Number of nodes created from expansion.
Definition: NetRouter.hpp:96
virtual void expandSegmentSinks(const Tilewire &inTilewire, ArcVector &outArcs)
Heuristically expand a segment.
void graphSearchFilter(RouteNode *inParent, const Arc &inArc, RouteNodePtrVector &outRoute)
Create a new node and put it into the appropriate structure.
Definition: NetRouter.hpp:305
const boost::int32_t getDepth() const
Get the node depth.
Definition: RouteNode.hpp:94
TilewireConstIterator sinksBegin(void) const
Returns the begin constant iterator for sink Tilewires.
Definition: RouteNet.hpp:182
Header for the BasicRouter class.
void expandSegmentSinks(const Tilewire &inTilewire, ArcVector &outSinks, EExpandDirection inExpandDirection=eExpandDirectionNone, bool inUseTied=true, bool inUseRegular=true, bool inUseIrregular=true, bool inUseRoutethrough=true)
Expands all sink arcs for the given tilewire's segment.
Definition: DDB.cpp:314
architecture::ArcUsage ArcUsage
Definition: NetRouter.hpp:46
void useArc(const Arc &inArc)
Marks the arc and all of its source and sink segment wires as used.
Definition: DDB.hpp:173
architecture::DDB DDB
Imported type names.
Definition: NetRouter.hpp:45
Binary predicate for comparing RouteNode pointers based on cost.
Definition: RouteNode.hpp:118
std::vector< Arc > ArcVector
Vector of Arc objects.
Definition: Arc.hpp:78
RouteNodePtrVector & routeNodes()
Returns a reference to the RouteNodePtrVector.
Definition: RouteNet.hpp:201
virtual void reorderSinks(const Tilewire &inSource, TilewireVector &inSinks)
Reorder the Sinks based on this heuristic.
const Tilewire & getSinkTilewire() const
Get the sink Tilewire.
Definition: RouteNode.hpp:84
bool expandNetTerminals(Tilewire &inSource, TilewireVector &inSinks, RouteNodePtrVector &outRoute)
Move net terminals out into the INT tiles.
Definition: NetRouter.hpp:370
NetRouterHeuristicBase * mHeuristic
Pointer to the heuristic for making routing decisions.
const Tilewire & getSinkTilewire(void) const
Returns the sink tilewire.
Definition: Arc.hpp:47
WireUsage & mWireUsage
WireUsage reference.
Definition: NetRouter.hpp:66
void recordPath(RouteNode *node, Tilewire key, Tilewire inSource, RouteNodePtrVector &outRoute)
Add the newly found route to the outRoute vector.
Definition: NetRouter.hpp:329
void setCost(boost::int32_t inHeuristicCost)
Set the heuristic node cost.
Definition: RouteNode.hpp:88
Header for torc::physical output stream helpers.
boost::unordered_map< Tilewire, RouteNode *, boost::hash< architecture::Tilewire > > RouteNodePtrMap
Definition: NetRouter.hpp:56
void graphSearch(const Tilewire &inSource, TilewireVector &inSinks, RouteNodePtrVector &outRoute)
Internal top level route function.
Definition: NetRouter.hpp:201
Encapsulation of a device tile and wire pair.
Definition: Tilewire.hpp:39
RouteNodePtrMap mSkipped
Collection of nodes skipped due to heuristic constraints.
Definition: NetRouter.hpp:78
Encapsulation the design arc usage.
Definition: ArcUsage.hpp:38
boost::unordered_set< Tilewire, boost::hash< architecture::Tilewire > > TilewireSet
Definition: NetRouter.hpp:57
ArcUsage & mArcUsage
Database reference.
Definition: NetRouter.hpp:64
void expandSegmentSources(const Tilewire &inTilewire, ArcVector &outSources, EExpandDirection inExpandDirection=eExpandDirectionNone, bool inUseTied=true, bool inUseRegular=true, bool inUseIrregular=true, bool inUseRoutethrough=true)
Expands all source arcs for the given tilewire's segment.
Definition: DDB.cpp:336
void use(const Tilewire &inTilewire)
Marks the specified tilewire as being used.
Definition: WireUsage.hpp:81
TilewireConstIterator sourcesBegin(void) const
Returns the begin constant iterator for source Tilewires.
Definition: RouteNet.hpp:174
TilewireVector mSegmentBuf
Scratch segment storage.
Definition: NetRouter.hpp:85
Tilewire expandSourceTerminal(Tilewire inSource, RouteNodePtrVector &outRoute)
Move the source terminal of a net in the sinkwards direction.
Definition: NetRouter.hpp:407
ArcVector mArcsBuf
Scratch arc storage.
Definition: NetRouter.hpp:87
void routeNet(RouteNet &net)
Route a net.
Definition: NetRouter.hpp:122
Header for the HeuristicBase class.
DDB & mDB
Database reference.
boost::uint32_t mStatSources
Number of net sources seen since construction.
Definition: NetRouter.hpp:98
virtual void setSink(const Tilewire &inSink)=0
Set the current routing target.
std::priority_queue< RouteNode *, std::vector< RouteNode * >, RouteNodePtrCostCompare > RouteNodePtrQueue
Definition: NetRouter.hpp:54
architecture::Tilewire Tilewire
Definition: NetRouter.hpp:48
architecture::ArcVector ArcVector
Definition: NetRouter.hpp:51
bool hasOneSource(void) const
Returns true if the net has exactly one source.
Definition: RouteNet.hpp:151
An object that holds an arc and path information for routing.
Definition: RouteNode.hpp:40
void graphSearchLoop(const Tilewire &inSource, const Tilewire &inSink, RouteNodePtrVector &outRoute)
Routing loop function.
Definition: NetRouter.hpp:250
NetRouter(DDB &inDB, NetRouterHeuristicBase *inHeuristic)
Public Constructor.
Definition: NetRouter.hpp:105
Provides net routing based on the Nilsson graphsearch algorithm.
Definition: NetRouter.hpp:42
RouteNodePtrMap mOpen
Collection of candidate nodes the router can expand.
Definition: NetRouter.hpp:74
void release(const Tilewire &inTilewire)
Marks the specified tilewire as being unused.
Definition: WireUsage.hpp:104
boost::uint32_t mStatLoopPasses
Number of passes through the main loop since construction.
Definition: NetRouter.hpp:94
~NetRouter()
Destructor.
Definition: NetRouter.hpp:119
Provides the interface for net routers.
Abstract class for a net router.
bool testDedicatedPath(Tilewire inSource, Tilewire inSink, RouteNodePtrVector &outRoute)
Test for a dedicated routing path.
Definition: NetRouter.hpp:383
Header for the DDB class.
static const Tilewire sInvalid
Definition: Tilewire.hpp:93
RouteNodePtrMap mClosed
Collection of nodes that have been expanded.
Definition: NetRouter.hpp:76
architecture::TilewireVector TilewireVector
Definition: NetRouter.hpp:50
Tilewire expandSinkTerminal(Tilewire inSink, RouteNodePtrVector &outRoute)
Move the sink terminal of a net in the sourcewards direction.
Definition: NetRouter.hpp:425
bool isUsed(const Tilewire &inTilewire)
Determines whether the specified tilewire is in use.
Definition: WireUsage.hpp:138
void printStats(std::ostream &out)
Definition: NetRouter.hpp:190
void expandSegment(const Tilewire &inTilewire, TilewireVector &outTilewires, EExpandDirection inExpandDirection=eExpandDirectionNone)
Expands the given tilewire's segment.
Definition: DDB.cpp:154
TilewireSet mAuxClosed
Set of Closed Tilewires to avoid issues with bidir resources.
Definition: NetRouter.hpp:82
Header for the Net class.
virtual void nodeCost(RouteNode &inNode)=0
Calculate the node cost based on distance to the sink and path length.