00001 // Torc - Copyright 2011 University of Southern California. All Rights Reserved. 00002 // $HeadURL: https://torc-isi.svn.sourceforge.net/svnroot/torc-isi/branches/staging/0.9/src/torc/router/NetRouterHeuristicBase.hpp $ 00003 // $Id: NetRouterHeuristicBase.hpp 1 2011-02-25 22:11:16Z nsteiner $ 00004 00005 // This program is free software: you can redistribute it and/or modify it under the terms of the 00006 // GNU General Public License as published by the Free Software Foundation, either version 3 of the 00007 // License, or (at your option) any later version. 00008 // 00009 // This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 00010 // without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See 00011 // the GNU General Public License for more details. 00012 // 00013 // You should have received a copy of the GNU General Public License along with this program. If 00014 // not, see <http://www.gnu.org/licenses/>. 00015 00016 /// \file 00017 /// \brief Header for the HeuristicBase class. 00018 00019 #ifndef TORC_ROUTER_NETROUTERHEURISTICBASE_HPP 00020 #define TORC_ROUTER_NETROUTERHEURISTICBASE_HPP 00021 00022 #include "torc/router/RouterHeuristicBase.hpp" 00023 #include "torc/architecture/Tilewire.hpp" 00024 #include "torc/router/RouteNode.hpp" 00025 00026 namespace torc { 00027 namespace router { 00028 00029 /// \brief Provides the interface for net routers. 00030 class NetRouterHeuristicBase : public RouterHeuristicBase { 00031 // types 00032 /// \brief Imported type names 00033 typedef architecture::DDB DDB; 00034 typedef architecture::Tilewire Tilewire; 00035 typedef architecture::TilewireVector TilewireVector; 00036 typedef architecture::ArcVector ArcVector; 00037 00038 public: 00039 // constructor 00040 /// \brief Public Constructor 00041 NetRouterHeuristicBase(DDB& inDB) : RouterHeuristicBase(inDB) {} 00042 /// \brief Destructor. 00043 virtual ~NetRouterHeuristicBase() {} 00044 00045 /// \brief Set the current routing target 00046 virtual void setSink(const Tilewire& inSink) = 0; 00047 /// \brief Calculate the node cost based on distance to the sink and path length 00048 virtual void nodeCost(RouteNode& inNode) = 0; 00049 /// \brief Reorder the Sinks based on this heuristic 00050 virtual void reorderSinks(const Tilewire& inSource, TilewireVector& inSinks) {} 00051 /// \brief Heuristically expand a segment. 00052 virtual void expandSegmentSinks(const Tilewire& inTilewire, ArcVector& outArcs) { 00053 mDB.expandSegmentSinks(inTilewire, outArcs); 00054 } 00055 00056 }; // class HeuristicBase 00057 00058 00059 } // namespace router 00060 } // namespace torc 00061 00062 #endif // TORC_ROUTER_NETROUTERHEURISTICBASE_HPP