19 #include <boost/test/unit_test.hpp>
26 BOOST_AUTO_TEST_SUITE(physical)
49 BOOST_REQUIRE(net1Ptr != 0);
50 BOOST_REQUIRE(net2Ptr != 0);
55 BOOST_CHECK(net1Ptr->getNetType() == normal);
56 BOOST_CHECK(net2Ptr->getNetType() == power);
57 net2Ptr->setNetType(ground);
58 BOOST_CHECK(net2Ptr->getNetType() == ground);
73 net1Ptr->addSource(pin1Ptr);
74 net1Ptr->addSink(pin2Ptr);
75 net1Ptr->addSink(pin3Ptr);
76 net1Ptr->addSink(pin4Ptr);
77 BOOST_CHECK_EQUAL(net1Ptr->containsSource(pin1Ptr),
true);
78 BOOST_CHECK_EQUAL(net1Ptr->containsSink(pin1Ptr),
false);
79 BOOST_CHECK_EQUAL(net1Ptr->containsSink(pin2Ptr),
true);
80 BOOST_CHECK_EQUAL(net1Ptr->containsSink(pin3Ptr),
true);
81 BOOST_CHECK_EQUAL(net1Ptr->containsSink(pin4Ptr),
true);
82 BOOST_CHECK_EQUAL(net1Ptr->hasAnySources(),
true);
83 BOOST_CHECK_EQUAL(net1Ptr->hasOneSource(),
true);
84 BOOST_CHECK_EQUAL(net1Ptr->hasMultipleSources(),
false);
85 BOOST_CHECK(net1Ptr->getSourceCount() == 1);
86 BOOST_CHECK_EQUAL(net1Ptr->hasAnySinks(),
true);
87 BOOST_CHECK_EQUAL(net1Ptr->hasOneSink(),
false);
88 BOOST_CHECK_EQUAL(net1Ptr->hasMultipleSinks(),
true);
89 BOOST_CHECK(net1Ptr->getSinkCount() == 3);
100 BOOST_CHECK(*op++ == pin1Ptr);
101 BOOST_CHECK(op == oe);
102 BOOST_CHECK_EQUAL(net1Ptr->removeSource(pin1Ptr),
true);
103 BOOST_CHECK_EQUAL(net1Ptr->removeSource(pin2Ptr),
false);
104 BOOST_CHECK(net1Ptr->getSourceCount() == 0);
107 BOOST_CHECK(*ip++ == pin2Ptr);
108 BOOST_CHECK(*ip++ == pin3Ptr);
109 BOOST_CHECK(*ip++ == pin4Ptr);
110 BOOST_CHECK(ip == ie);
111 BOOST_CHECK_EQUAL(net1Ptr->removeSink(pin1Ptr),
false);
112 BOOST_CHECK_EQUAL(net1Ptr->removeSink(pin2Ptr),
true);
113 BOOST_CHECK_EQUAL(net1Ptr->removeSink(pin3Ptr),
true);
114 BOOST_CHECK_EQUAL(net1Ptr->removeSink(pin4Ptr),
true);
115 BOOST_CHECK(net1Ptr->getSinkCount() == 0);
124 net1Ptr->addPip(pip1);
125 net1Ptr->addPip(pip2);
126 net1Ptr->addPip(pip3);
127 BOOST_CHECK_EQUAL(net1Ptr->containsPip(pip1),
true);
128 BOOST_CHECK_EQUAL(net1Ptr->containsPip(pip2),
true);
129 BOOST_CHECK_EQUAL(net1Ptr->containsPip(pip3),
true);
130 BOOST_CHECK_EQUAL(net1Ptr->hasAnyPips(),
true);
131 BOOST_CHECK_EQUAL(net1Ptr->isRouted(),
true);
132 BOOST_CHECK_EQUAL(net1Ptr->isUnrouted(),
false);
133 BOOST_CHECK(net1Ptr->getPipCount() == 3);
145 BOOST_CHECK(*pp++ == pip1);
146 BOOST_CHECK(*pp++ == pip2);
147 BOOST_CHECK(*pp++ == pip3);
148 BOOST_CHECK(pp == pe);
149 BOOST_CHECK_EQUAL(net1Ptr->removePip(pip1),
true);
150 BOOST_CHECK_EQUAL(net1Ptr->removePip(pip1),
false);
151 BOOST_CHECK_EQUAL(net1Ptr->isRouted(),
true);
152 BOOST_CHECK_EQUAL(net1Ptr->isUnrouted(),
false);
153 BOOST_CHECK(net1Ptr->getPipCount() == 2);
155 BOOST_CHECK_EQUAL(net1Ptr->isRouted(),
false);
156 BOOST_CHECK_EQUAL(net1Ptr->isUnrouted(),
true);
157 BOOST_CHECK(net1Ptr->getPipCount() == 0);
160 BOOST_AUTO_TEST_SUITE_END()
ENetType
Enumeration of net power types.
PipVector::const_iterator PipConstIterator
Constant iterator to Pip objects.
static NetSharedPtr newNetPtr(const string &inName, ENetType inNetType=eNetTypeNormal)
Create and return a new Net share pointer.
boost::shared_ptr< class InstancePin > InstancePinSharedPtr
Shared pointer encapsulation of an InstancePin.
BOOST_AUTO_TEST_CASE(XdlUnpackUnitTest)
Unit test for the XdlUnpack class.
static torc::physical::Pip newPip(const string &inTileName, const string &inSourceWireName, const string &inSinkWireName, EPipDirection inPipDirection, RoutethroughSharedPtr inRoutethroughPtr=RoutethroughSharedPtr())
Construct a pip and return it.
boost::shared_ptr< Net > NetSharedPtr
Shared pointer encapsulation of a Net.
static InstanceSharedPtr newInstancePtr(const string &inName, const string &inType, const string &inTile, const string &inSite, EInstanceBonding inBonding=eInstanceBondingUnknown, InstanceReferenceSharedPtr inInstanceReferencePtr=InstanceReferenceSharedPtr())
Construct and return a new Instance shared pointer.
boost::shared_ptr< Instance > InstanceSharedPtr
Shared pointer encapsulation of an Instance.
InstancePinSharedPtrVector::const_iterator InstancePinSharedPtrConstIterator
Constant iterator to InstancePin shared pointer objects.
Physical design programmable interconnect point.
Header for the Net class.
static InstancePinSharedPtr newInstancePinPtr(InstanceSharedPtr inInstancePtr, const string &inPinName)
Construct and return a new InstancePin shared pointer.
Header for the Factory class.