19 #include <boost/test/unit_test.hpp>
26 BOOST_AUTO_TEST_SUITE(physical)
31 void setName(
const string& inName) { mName = inName; }
33 return reinterpret_cast<RenamableInstanceSharedPtr&
>(inInstancePtr);
50 BOOST_REQUIRE(circuitPtr.get() != 0);
51 BOOST_CHECK(circuitPtr->getInstanceCount() == 0);
52 BOOST_CHECK(circuitPtr->getNetCount() == 0);
53 BOOST_CHECK(circuitPtr->instancesBegin() == circuitPtr->instancesEnd());
54 BOOST_CHECK(circuitPtr->netsBegin() == circuitPtr->netsEnd());
62 net1Ptr->addPip(
Factory::newPip(
"CLBLL_X16Y59",
"L_DQ",
"SITE_LOGIC_OUTS3",
76 BOOST_CHECK_EQUAL(circuitPtr->addInstance(instance1aPtr),
true);
77 BOOST_CHECK_EQUAL(circuitPtr->addInstance(instance1bPtr),
false);
78 BOOST_CHECK_EQUAL(circuitPtr->addNet(net1Ptr),
true);
79 BOOST_CHECK_EQUAL(circuitPtr->addNet(net2aPtr),
true);
80 BOOST_CHECK_EQUAL(circuitPtr->addNet(net2bPtr),
false);
81 BOOST_CHECK_EQUAL(circuitPtr->addNet(net3Ptr),
true);
82 BOOST_CHECK(circuitPtr->getInstanceCount() == 1);
83 BOOST_CHECK(circuitPtr->getNetCount() == 3);
89 BOOST_CHECK(instance1aPtr->getTile().length() != 0);
90 BOOST_CHECK(instance1aPtr->getSite().length() != 0);
91 BOOST_CHECK(net1Ptr->getPipCount() != 0);
92 circuitPtr->unplace();
93 circuitPtr->unroute();
94 BOOST_CHECK(instance1aPtr->getTile().length() == 0);
95 BOOST_CHECK(instance1aPtr->getSite().length() == 0);
96 BOOST_CHECK(net1Ptr->getPipCount() == 0);
104 BOOST_CHECK(circuitPtr->removeInstance(*circuitPtr->findInstance(
"instance")));
105 BOOST_CHECK(circuitPtr->removeNet(*circuitPtr->findNet(
"net1")));
106 BOOST_CHECK(circuitPtr->removeNet(*circuitPtr->findNet(
"net2")));
107 BOOST_CHECK(circuitPtr->removeNet(*circuitPtr->findNet(
"net3")));
108 BOOST_CHECK(circuitPtr->getInstanceCount() == 0);
109 BOOST_CHECK(circuitPtr->getNetCount() == 0);
112 BOOST_AUTO_TEST_SUITE_END()
static NetSharedPtr newNetPtr(const string &inName, ENetType inNetType=eNetTypeNormal)
Create and return a new Net share pointer.
BOOST_AUTO_TEST_CASE(XdlUnpackUnitTest)
Unit test for the XdlUnpack class.
boost::shared_ptr< Module > ModuleSharedPtr
Shared pointer encapsulation of a Module.
Physical design instance.
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.
boost::shared_ptr< class RenamableInstance > RenamableInstanceSharedPtr
static ModuleSharedPtr newModulePtr(const string &inName, const string &inAnchor)
Create and return a new Module shared pointer.
Header for the Circuit class.
static RenamableInstanceSharedPtr & recast(InstanceSharedPtr &inInstancePtr)
Header for the Factory class.
void setName(const string &inName)