19 #ifndef TORC_ROUTER_NETROUTERHEURISTIC_HPP
20 #define TORC_ROUTER_NETROUTERHEURISTIC_HPP
32 #include <boost/cstdint.hpp>
33 #include <boost/timer.hpp>
34 #include <boost/unordered_map.hpp>
35 #include <boost/functional/hash.hpp>
36 #include <boost/integer_traits.hpp>
98 boost::int32_t bestDistance = boost::integer_traits<boost::int32_t>::max();
99 boost::int32_t distance = boost::integer_traits<boost::int32_t>::max();
100 boost::int32_t cost = 0;
111 ArcVector::iterator p;
112 ArcVector::iterator e =
mArcsBuf.end();
113 for (p =
mArcsBuf.begin(); p != e; p++) {
120 if (distance < bestDistance) bestDistance = distance;
122 if (bestDistance == boost::integer_traits<boost::int32_t>::max()) {
126 cost += bestDistance;
129 std::cout <<
"NULL PARENT" << std::endl;
138 boost::int32_t bestDistance = boost::integer_traits<boost::int32_t>::max();
139 boost::int32_t distance = boost::integer_traits<boost::int32_t>::max();
140 boost::int32_t cost = 0;
151 ArcVector::iterator p;
152 ArcVector::iterator e =
mArcsBuf.end();
153 for (p =
mArcsBuf.begin(); p != e; p++) {
160 if (distance < bestDistance) bestDistance = distance;
162 if (bestDistance == boost::integer_traits<boost::int32_t>::max()) {
166 cost += bestDistance;
180 if (wireInfo.
isInput())
return;
183 true,
true,
true,
false);
184 unsigned int s = tempArcs.size();
187 for (
unsigned int i = t; i < s; i++) {
188 outArcs.push_back(tempArcs[i]);
190 for (
unsigned int i = 0; i < t; i++) {
191 outArcs.push_back(tempArcs[i]);
198 boost::int32_t distance = 0;
199 boost::int32_t iRow = tileInfo->
getRow();
200 boost::int32_t iCol = tileInfo->
getCol();
214 boost::int32_t distance = 0;
215 boost::int32_t pRow = parentInfo->
getRow();
216 boost::int32_t pCol = parentInfo->
getCol();
217 boost::int32_t cRow = currentInfo->
getRow();
218 boost::int32_t cCol = currentInfo->
getCol();
219 distance += pRow < cRow ? cRow - pRow : pRow - cRow;
220 distance += pCol < cCol ? cCol - pCol : pCol - cCol;
229 #endif // TORC_ROUTER_NETROUTERHEURISTIC_HPP
DDB & mDB
Database reference.
const WireIndex & getWireIndex(void) const
Returns the wire index.
const TileCol & getCol(void) const
Returns the column for this tile.
Encapsulation of a tile row in an unsigned 16-bit integer.
Encapsulation of an arc between two tilewires.
std::vector< Tilewire > TilewireVector
Vector of Tilewire objects.
const TileRow & getRow(void) const
Returns the row for this tile.
architecture::Tiles Tiles
ArcUsage & mArcUsage
ArcUsage reference.
const TileInfo * mSinkTileInfo
Target sink tile information.
Encapsulation of a tile column in an unsigned 16-bit integer.
~NetRouterHeuristic()
Destructor.
RouteNode * getParent() const
Get the node's parent.
architecture::xilinx::TileCol TileCol
architecture::ArcVector ArcVector
Device database, including complete wiring and logic support.
architecture::DDB DDB
Imported type names.
architecture::xilinx::TileRow TileRow
const TileInfo & getTileInfo(TileIndex inTileIndex) const
Returns the TileInfo object for the specified tile.
Encapsulation the design wire usage.
bool isInput(void) const
Returns true if the wire is a logic input.
Header for the RouteNode class.
virtual void nodeCostInitial(RouteNode &inNode)
const Array< const WireInfo > & getWireInfo(TileTypeIndex inTileTypeIndex) const
Returns the WireInfo array for the specified tile type.
virtual boost::int32_t distanceToSink(const Tilewire &inTilewire)
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.
architecture::TilewireVector TilewireVector
virtual void nodeCost(RouteNode &inNode)
Calculate the node cost based on distance to the sink and path length.
boost::int32_t distanceFromParent(const Tilewire &inParent, const Tilewire &inCurrent)
std::vector< Arc > ArcVector
Vector of Arc objects.
const Tilewire & getSinkTilewire() const
Get the sink Tilewire.
architecture::TileInfo TileInfo
void setCost(boost::int32_t inHeuristicCost)
Set the heuristic node cost.
architecture::ArcUsage ArcUsage
Header for torc::physical output stream helpers.
const Tiles & mTiles
Tiles reference.
Tilewire mTargetSink
Target sink tilewire.
architecture::Tilewire Tilewire
Encapsulation of a device tile and wire pair.
Encapsulation the design arc usage.
Tile map, tile type, and wire information for the family and device.
boost::int32_t mRow
Target row coordinate.
Encapsulation of a tile within a device tile map.
const TileTypeIndex & getTypeIndex(void) const
Returns the tile type index for this tile.
Provides net routing based on the Nillson graphsearch algorithm.
virtual void setSink(const Tilewire &inSink)
Set the current routing target.
Header for the HeuristicBase class.
An object that holds an arc and path information for routing.
virtual void reorderSinks(const Tilewire &inSource, TilewireVector &inSinks)
Reorder the Sinks based on this heuristic.
Provides the interface for net routers.
NetRouterHeuristic(DDB &inDB)
Public Constructor.
Header for the DDB class.
const TileIndex & getTileIndex(void) const
Returns the tile index.
Encapsulation of a wire within a tile type.
bool isUsed(const Arc &inArc)
Determines whether the specified arc is in use.
virtual boost::int32_t clkDistanceToSink(const Tilewire &inTilewire)
TilewireVector mSegmentBuf
Segment tilewire buffer.
boost::int32_t mCol
Target column coordinate.
virtual void expandSegmentSinks(const Tilewire &inTilewire, ArcVector &outArcs)
Heuristic handling of expansion of a node.
const boost::int32_t getCost() const
Get the heuristic node cost.
architecture::WireUsage WireUsage
ArcVector mArcsBuf
Arc buffer.
Device database types for Xilinx architectures.