19 #include <boost/test/unit_test.hpp>
26 BOOST_AUTO_TEST_SUITE(physical)
38 modulePtr, instance2Ptr);
47 BOOST_REQUIRE(instance1Ptr != 0);
60 BOOST_CHECK(instance1Ptr->getType().empty());
61 BOOST_CHECK(instance1Ptr->getTile().empty());
62 BOOST_CHECK(instance1Ptr->getSite().empty());
64 instance1Ptr->setType(type);
65 instance1Ptr->setTile(tile);
66 instance1Ptr->setSite(site);
67 instance1Ptr->setBonding(bonding);
68 instance1Ptr->setInstanceReferencePtr(instanceReferencePtr);
69 BOOST_CHECK(instance1Ptr->getType() == type);
70 BOOST_CHECK(instance1Ptr->getTile() == tile);
71 BOOST_CHECK(instance1Ptr->getSite() == site);
72 BOOST_CHECK(instance1Ptr->getBonding() == bonding);
73 BOOST_CHECK(instance1Ptr->getInstanceReferencePtr() == instanceReferencePtr);
77 BOOST_CHECK(*instance1Ptr == *instance2Ptr);
81 instance1Ptr->unplace();
82 BOOST_CHECK(instance1Ptr->getTile().empty());
83 BOOST_CHECK(instance1Ptr->getSite().empty());
95 netPtr->addSource(instancePin1Ptr);
96 netPtr->addSource(instancePin2Ptr);
97 netPtr->addSink(instancePin3Ptr);
98 BOOST_CHECK_EQUAL(instance1Ptr->getPinCount(), 3u);
99 BOOST_CHECK_EQUAL(instance1Ptr->getPinCount(pinName1), 2u);
100 BOOST_CHECK_EQUAL(instance1Ptr->getPinCount(pinName2), 1u);
103 BOOST_REQUIRE(ipp != ipe);
104 BOOST_CHECK(ipp->second == instancePin1Ptr);
105 BOOST_CHECK_EQUAL(ipp->second->getPinName(), pinName1);
106 BOOST_CHECK_EQUAL(ipp->second->getPinName(), ipp->first);
107 BOOST_CHECK(ipp->second->getParentWeakPtr().lock() == netPtr);
109 Instance::InstancePinSharedPtrConstIterator> range = instance1Ptr->findPinRange(pinName1);
110 BOOST_REQUIRE(range.first != range.second);
111 BOOST_CHECK_EQUAL(range.first->second->getPinName(), pinName1); range.first++;
112 BOOST_CHECK_EQUAL(range.first->second->getPinName(), pinName1); range.first++;
113 BOOST_CHECK(range.first == range.second);
114 netPtr->removeSource(instancePin2Ptr);
115 netPtr->removeSink(instancePin3Ptr);
116 BOOST_CHECK_EQUAL(instance1Ptr->getPinCount(), 1u);
117 BOOST_CHECK_EQUAL(instance1Ptr->getPinCount(pinName1), 1u);
118 BOOST_CHECK_EQUAL(instance1Ptr->getPinCount(pinName2), 0u);
119 ipp = instance1Ptr->findPin(pinName1);
120 ipe = instance1Ptr->pinsEnd();
121 BOOST_REQUIRE(ipp != ipe);
122 BOOST_CHECK(ipp->second == instancePin1Ptr);
123 BOOST_CHECK_EQUAL(ipp->second->getPinName(), pinName1);
124 BOOST_CHECK_EQUAL(ipp->second->getPinName(), ipp->first);
125 BOOST_CHECK(ipp->second->getParentWeakPtr().lock() == netPtr);
128 BOOST_AUTO_TEST_SUITE_END()
EInstanceBonding
Enumeration of pad bonding types.
Encapsulation of a site pin name.
Header for the Instance class.
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.
boost::shared_ptr< Module > ModuleSharedPtr
Shared pointer encapsulation of a Module.
InstancePinMap::const_iterator InstancePinSharedPtrConstIterator
Constant iterator to InstancePin shared pointers.
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.
static InstancePinSharedPtr newInstancePinPtr(InstanceSharedPtr inInstancePtr, const string &inPinName)
Construct and return a new InstancePin shared pointer.
static ModuleSharedPtr newModulePtr(const string &inName, const string &inAnchor)
Create and return a new Module shared pointer.
Header for the Factory class.
boost::shared_ptr< InstanceReference > InstanceReferenceSharedPtr
Shared pointer encapsulation of an InstanceReference.
static InstanceReferenceSharedPtr newInstanceReferencePtr(const string &inInstantiationName, ModuleSharedPtr inModulePtr, InstanceSharedPtr inInstancePtr)
Create and return a new InstanceReference shared pointer.