19 #include <boost/test/unit_test.hpp>
25 BOOST_AUTO_TEST_SUITE(router)
39 Arc arc1(tilewire1, tilewire2);
40 Arc arc2(tilewire2, tilewire3);
41 string name1 =
"Name1";
42 string name2 =
"Name2";
43 TilewireVector sources;
45 sources.push_back(tilewire1);
46 sinks.push_back(tilewire2);
47 sinks.push_back(tilewire3);
51 BOOST_CHECK_EQUAL(
sizeof(
RouteNet),
sizeof(
string) +
sizeof(TilewireVector)
53 +
sizeof(boost::unordered_map<boost::uint32_t, boost::any>));
84 BOOST_CHECK_EQUAL(rn1.
getName(), name1);
96 BOOST_CHECK_EQUAL(rn1.
removeSink(tilewire2),
false);
97 BOOST_CHECK_EQUAL(rn1.
removeArc(arc1),
false);
99 BOOST_CHECK_EQUAL(rn2.
getName(), name2);
115 BOOST_CHECK_EQUAL(rn2.
removeSink(tilewire2),
true);
127 BOOST_AUTO_TEST_SUITE_END()
Encapsulation of a tile index in an unsigned 32-bit integer.
Encapsulation of an arc between two tilewires.
std::vector< Tilewire > TilewireVector
Vector of Tilewire objects.
std::vector< RouteNode * > RouteNodePtrVector
Vector of RouteNode pointers.
size_t getArcCount(void) const
Returns the number of arcs on the net.
const string & getName() const
Returns the name of the net.
bool containsSink(Tilewire inTilewire) const
Determines whether the given Tilewire is a sink of this net.
bool removeSource(Tilewire inTilewire)
Removes the given Tilewire from the sources of this net.
Encapsulation of a wire index in an unsigned 16-bit integer.
bool hasMultipleSinks(void) const
Returns true if the next has more than one sink.
std::vector< Arc > ArcVector
Vector of Arc objects.
Encapsulation of a device tile and wire pair.
bool hasAnySources(void) const
Returns true if the net has any sources.
bool hasAnyArcs(void) const
Returns true if the net has any arcs.
bool hasOneSink(void) const
Returns true if the net has exactly one sink.
bool removeSink(Tilewire inTilewire)
Removes the given instance pin from the sinks of this net.
bool hasOneSource(void) const
Returns true if the net has exactly one source.
void addSource(Tilewire inTilewire)
Adds the given Tilewire as a source for this net.
bool containsArc(const Arc &inArc) const
Determines whether the net contains the given arc.
void addArc(const Arc &inArc)
Adds the given arc to this net.
bool hasMultipleSources(void) const
Returns true if the net has more than one source.
BOOST_AUTO_TEST_CASE(NetRouterHeuristicT)
Unit test for the Heuristic.
void addSink(Tilewire inTilewire)
Adds the given Tilewire as a sink for this net.
bool removeArc(const Arc &inArc)
Removes the given arc from this net.
bool hasAnySinks(void) const
Returns true if the net has any sinks.
bool containsSource(Tilewire inTilewire) const
Determines whether the given Tilewire is a source of this net.
Header for the Net class.