19 #include <boost/test/unit_test.hpp>
25 BOOST_AUTO_TEST_SUITE(router)
36 Arc arc2(tilewire2, tilewire3);
37 boost::int32_t cost1 = 4;
38 boost::int32_t cost2 = 5;
43 +
sizeof(
RouteTreeNode*) +
sizeof(std::vector<RouteTreeNode*>*));
44 BOOST_CHECK_EQUAL(
sizeof(
RouteNode), 32u);
47 BOOST_CHECK_EQUAL(
sizeof(std::vector<RouteTreeNode*>*), 8u);
48 BOOST_CHECK_EQUAL(
sizeof(boost::int32_t), 4u);
59 BOOST_CHECK_EQUAL(routenode1 != 0,
true);
60 BOOST_CHECK_EQUAL(routenode2 != 0,
true);
61 BOOST_CHECK_EQUAL(routenode3 != 0,
true);
62 BOOST_CHECK_EQUAL(routenode4 != 0,
true);
63 BOOST_CHECK_EQUAL(routenode5 != 0,
true);
73 std::vector<RouteTreeNode*> vec1;
74 vec1.push_back(routenode2);
75 std::vector<RouteTreeNode*> vec2;
76 vec2.push_back(routenode3);
77 vec2.push_back(routenode4);
80 BOOST_CHECK_EQUAL(routenode1->
getDepth() == 0,
true);
81 BOOST_CHECK_EQUAL(routenode2->
getDepth() == 1,
true);
82 BOOST_CHECK_EQUAL(routenode3->
getDepth() == 2,
true);
83 BOOST_CHECK_EQUAL(routenode4->
getDepth() == 2,
true);
84 BOOST_CHECK_EQUAL(routenode5->
getDepth() == -1,
true);
89 BOOST_CHECK_EQUAL(routenode1->
getChild(0) == routenode2,
true);
90 BOOST_CHECK_EQUAL(routenode2->
getChild(0) == routenode3,
true);
91 BOOST_CHECK_EQUAL(routenode2->
getChild(1) == routenode4,
true);
97 BOOST_CHECK_EQUAL(tilewire4 == parentnode->getSourceTilewire(),
true);
98 BOOST_CHECK_EQUAL(tilewire3 == parentnode->getSinkTilewire(),
true);
99 BOOST_CHECK_EQUAL(parentnode->getDepth() == -1,
true);
101 BOOST_CHECK_EQUAL(parentnode->getDepth() == 0,
true);
102 BOOST_CHECK_EQUAL(routenode1->
getDepth() == 1,
true);
103 BOOST_CHECK_EQUAL(routenode2->
getDepth() == 2,
true);
104 BOOST_CHECK_EQUAL(routenode3->
getDepth() == 3,
true);
105 BOOST_CHECK_EQUAL(routenode4->
getDepth() == 3,
true);
106 BOOST_CHECK_EQUAL(routenode5->
getDepth() == -1,
true);
109 BOOST_AUTO_TEST_SUITE_END()
Encapsulation of a tile index in an unsigned 32-bit integer.
Encapsulation of an arc between two tilewires.
void addChildren(const std::vector< RouteTreeNode * > &newChildren)
Add children to the node.
RouteNode * getParent() const
Get the node's parent.
const boost::int32_t getDepth() const
Get the node depth.
Encapsulation of a wire index in an unsigned 16-bit integer.
const Tilewire & getSinkTilewire() const
Get the sink Tilewire.
Encapsulation of a device tile and wire pair.
const Tilewire & getSourceTilewire() const
Get the source Tilewire.
boost::uint16_t getNumChildren()
Get the number of children.
An object that holds more complete path information for routing and tracing.
An object that holds an arc and path information for routing.
void makeParent(const Tilewire &inSource, const Tilewire &inSink)
Allocate a new node and make it the parent of this node.
RouteTreeNode * getChild(unsigned int index)
Get a child by index, returns 0 for invalid index.
BOOST_AUTO_TEST_CASE(NetRouterHeuristicT)
Unit test for the Heuristic.
void normalizeDepth()
Normalize depth of nodes.
Header for the RouteTreeNode class.