torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
NetVectorRouterBase.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 NetVectorRouterBase class.
18 
19 #ifndef TORC_ROUTER_NETVECTORROUTERBASE_HPP
20 #define TORC_ROUTER_NETVECTORROUTERBASE_HPP
21 
25 #include "torc/router/RouteNet.hpp"
26 
27 #include <algorithm>
28 #include <queue>
29 #include <boost/cstdint.hpp>
30 #include <boost/timer.hpp>
31 #include <boost/unordered_map.hpp>
33 #include "NetRouterBase.hpp"
34 
35 namespace torc {
36 namespace router {
37 
38  /// \brief Abstract class for a net router.
39  /// \details This base class provides a virtual route function.
41  // types
42  /// \brief Imported type names
46 
47  protected:
48  // members
49  /// \brief Database reference.
50  DDB& mDB;
51  /// \brief Pointer to the heuristic for making routing decisions.
53  /// \brief Pointer to the underlying net router.
55  /// \brief Timer object for performance analysis.
56  boost::timer mRouteTimer;
57  /// \brief Total routing time since construction.
59 
60  public:
61  // constructor
62  /// \brief Public Constructor
64  NetRouterBase* inNetRouter) : mDB(inDB), mHeuristic(inHeuristic),
65  mNetRouter(inNetRouter) {
66  mTotalRouteTime = 0;
67  }
68  /// \brief Destructor.
69  virtual ~NetVectorRouterBase() {}
70 
71  /// \brief Primary route call
72  void route(RouteNetVector& inNets) {
73  mRouteTimer.restart();
74  routeNets(inNets);
75  mTotalRouteTime += mRouteTimer.elapsed();
76  }
77  /// \brief Accessor for the heuristic.
79  /// \brief Set method for the heuristic.
80  void setHeuristic(NetVectorRouterHeuristicBase* inHeuristic) { mHeuristic = inHeuristic; }
81  /// \brief Accessor for the underlying Net Router.
83  /// \brief Set method for the net router.
84  void setNetRouter(NetRouterBase* inNetRouter) { mNetRouter = inNetRouter; }
85 
86  protected:
87  /// brief protected routing call
88  virtual void routeNets(RouteNetVector& inNets) = 0;
89 
90  }; // class SignalRouterBase
91 
92 
93 } // namespace router
94 } // namespace torc
95 
96 #endif // TORC_ROUTER_NETVECTORROUTERBASE_HPP
void route(RouteNetVector &inNets)
Primary route call.
void setHeuristic(NetVectorRouterHeuristicBase *inHeuristic)
Set method for the heuristic.
boost::timer mRouteTimer
Timer object for performance analysis.
Device database, including complete wiring and logic support.
Definition: DDB.hpp:42
std::vector< RouteNet > RouteNetVector
Vector of RouteNet objects.
Definition: RouteNet.hpp:205
NetRouterBase * mNetRouter
Pointer to the underlying net router.
Header for the NetVectorRouterHeuristicBase class.
Encapsulation the design wire usage.
Definition: WireUsage.hpp:35
Header for the RouteNode class.
Header for the BasicRouter class.
Provides net routing based on the Nillson graphsearch algorithm.
Encapsulation of a device tile and wire pair.
Definition: Tilewire.hpp:39
architecture::DDB DDB
Imported type names.
virtual ~NetVectorRouterBase()
Destructor.
NetRouterBase * getNetRouter()
Accessor for the underlying Net Router.
NetVectorRouterHeuristicBase * mHeuristic
Pointer to the heuristic for making routing decisions.
void setNetRouter(NetRouterBase *inNetRouter)
Set method for the net router.
NetVectorRouterBase(DDB &inDB, NetVectorRouterHeuristicBase *inHeuristic, NetRouterBase *inNetRouter)
Public Constructor.
Abstract class for a net router.
Abstract class for a net router.
Header for the DDB class.
NetVectorRouterHeuristicBase * getHeuristic()
Accessor for the heuristic.
virtual void routeNets(RouteNetVector &inNets)=0
brief protected routing call
double mTotalRouteTime
Total routing time since construction.
Header for the Net class.