19 #include <boost/test/unit_test.hpp>
20 #include <boost/filesystem/convenience.hpp>
31 BOOST_AUTO_TEST_SUITE(physical)
43 designPtr->setConfig(
"_DESIGN_PROP",
"P3_PLACE_OPTIONS",
"EFFORT_LEVEL:high");
44 designPtr->setConfig(
"_DESIGN_PROP",
"",
"P3_PLACED:");
45 designPtr->setConfig(
"_DESIGN_PROP",
"",
"P3_PLACE_OPTIONS:");
46 designPtr->setConfig(
"_DESIGN_PROP",
"",
"PK_NGMTIMESTAMP:1278102371");
47 BOOST_CHECK_EQUAL(designPtr->getConfigCount(), 4u);
53 const Config& config = p->second;
54 std::clog <<
"\t" << setting <<
":" << config.
getName() <<
":" << config.
getValue()
62 BOOST_CHECK_EQUAL(designPtr->getModuleCount(), 0u);
68 std::clog <<
"\tmodule " << modulePtr->getName() << std::endl;
76 clkInstPtr->setConfig(
"IMUX",
"",
"I");
77 clkInstPtr->setConfig(
"INBUF",
"clk_ibuf/IBUFG",
"");
78 clkInstPtr->setConfig(
"PAD",
"clk",
"");
79 clkInstPtr->setConfig(
"ISTANDARD",
"",
"LVCMOS25");
80 designPtr->addInstance(clkInstPtr);
84 resetInstPtr->setConfig(
"IMUX",
"",
"I");
85 resetInstPtr->setConfig(
"INBUF",
"reset_ibuf",
"");
86 resetInstPtr->setConfig(
"PAD",
"reset",
"");
87 resetInstPtr->setConfig(
"ISTANDARD",
"",
"LVCMOS25");
88 designPtr->addInstance(resetInstPtr);
92 outInstPtr->setConfig(
"OUSED",
"",
"0");
93 outInstPtr->setConfig(
"OUTBUF",
"out_obuf",
"");
94 outInstPtr->setConfig(
"PAD",
"out",
"");
95 outInstPtr->setConfig(
"DRIVE",
"",
"12");
96 outInstPtr->setConfig(
"OSTANDARD",
"",
"LVCMOS25");
97 outInstPtr->setConfig(
"SLEW",
"",
"SLOW");
98 designPtr->addInstance(outInstPtr);
102 clkIbufInstPtr->setConfig(
"BUFG",
"clk_ibuf/BUFG",
"");
103 designPtr->addInstance(clkIbufInstPtr);
107 blinkInstPtr->setConfig(
"CLKINV",
"",
"CLK");
108 blinkInstPtr->setConfig(
"D6LUT",
"blink_i",
"#LUT:O6=~A6");
109 blinkInstPtr->setConfig(
"DFF",
"blink",
"#FF");
110 blinkInstPtr->setConfig(
"DFFINIT",
"",
"INIT0");
111 blinkInstPtr->setConfig(
"DFFMUX",
"",
"O6");
112 blinkInstPtr->setConfig(
"DFFSR",
"",
"SRLOW");
113 blinkInstPtr->setConfig(
"SRUSED",
"",
"0");
114 blinkInstPtr->setConfig(
"SYNC_ATTR",
"",
"SYNC");
115 designPtr->addInstance(blinkInstPtr);
120 OLOGIC_X1Y118InstPtr->setConfig(
"_NO_USER_LOGIC",
"",
"");
121 OLOGIC_X1Y118InstPtr->setConfig(
"_ROUTETHROUGH",
"D1",
"OQ");
122 designPtr->addInstance(OLOGIC_X1Y118InstPtr);
127 ILOGIC_X1Y119InstPtr->setConfig(
"_NO_USER_LOGIC",
"",
"");
128 ILOGIC_X1Y119InstPtr->setConfig(
"_ROUTETHROUGH",
"D",
"O");
129 designPtr->addInstance(ILOGIC_X1Y119InstPtr);
134 ILOGIC_X1Y123InstPtr->setConfig(
"_NO_USER_LOGIC",
"",
"");
135 ILOGIC_X1Y123InstPtr->setConfig(
"_ROUTETHROUGH",
"D",
"O");
136 designPtr->addInstance(ILOGIC_X1Y123InstPtr);
138 BOOST_CHECK_EQUAL(designPtr->getInstanceCount(), 8u);
144 std::clog <<
"\tinstance " << instancePtr->getName() << std::endl;
152 blinkNetPtr->addSource(blinkNetPin1Ptr);
154 blinkNetPtr->addSink(blinkNetPin2Ptr);
156 blinkNetPtr->addSink(blinkNetPin3Ptr);
157 blinkNetPtr->addPip(
Factory::newPip(
"CLBLL_X16Y59",
"L_DQ",
"SITE_LOGIC_OUTS3",
159 blinkNetPtr->addPip(
Factory::newPip(
"CLBLL_X16Y59",
"SITE_IMUX_B47",
"L_D6",
161 blinkNetPtr->addPip(
Factory::newPip(
"INT_X16Y59",
"EL2BEG2",
"IMUX_B47",
163 blinkNetPtr->addPip(
Factory::newPip(
"INT_X16Y59",
"LOGIC_OUTS3",
"EL2BEG2",
165 blinkNetPtr->addPip(
Factory::newPip(
"INT_X17Y59",
"EL2MID2",
"IMUX_B41",
167 blinkNetPtr->addPip(
Factory::newPip(
"IOI_X17Y59",
"IOI_IMUX_B41",
"IOI_O11",
169 blinkNetPtr->addPip(
Factory::newPip(
"IOI_X17Y59",
"IOI_O11",
"IOI_O_PINWIRE1",
171 "D1",
"OQ", OLOGIC_X1Y118InstPtr,
"D1",
"OQ")));
172 blinkNetPtr->addPip(
Factory::newPip(
"IOI_X17Y59",
"IOI_O_PINWIRE1",
"IOI_O1",
174 designPtr->addNet(blinkNetPtr);
177 clkNetPtr->setConfig(
"_BELSIG",
"PAD,PAD,clk",
"clk");
178 designPtr->addNet(clkNetPtr);
182 clkCNetPtr->addSource(clkCNetPin1Ptr);
184 clkCNetPtr->addSink(clkCNetPin2Ptr);
185 clkCNetPtr->addPip(
Factory::newPip(
"CLBLL_X16Y59",
"SITE_CLK_B0",
"L_CLK",
187 clkCNetPtr->addPip(
Factory::newPip(
"CLK_BUFGMUX_X47Y44",
"CLK_BUFGMUX_POSTMUX_GCLKP30",
189 clkCNetPtr->addPip(
Factory::newPip(
"CLK_HROW_X17Y49",
"CLK_HROW_GCLK_BUF30",
191 clkCNetPtr->addPip(
Factory::newPip(
"HCLK_X16Y49",
"HCLK_G_HCLK_P5",
"HCLK_LEAF_GCLK5",
195 designPtr->addNet(clkCNetPtr);
199 clkIibufIbufgNetPtr->addSource(clkIibufIbufgNetPin1Ptr);
201 clkIibufIbufgNetPtr->addSink(clkIibufIbufgNetPin2Ptr);
203 "CLK_BUFGMUX_MUXED_IN_CLKT_P28",
"CLK_BUFGMUX_PREMUX0_CLK30",
205 clkIibufIbufgNetPtr->addPip(
Factory::newPip(
"CLK_BUFGMUX_X47Y44",
"CLK_BUFGMUX_PREMUX0_CLK30",
207 clkIibufIbufgNetPtr->addPip(
Factory::newPip(
"CLK_IOB_T_X17Y60",
"CLK_IOB_CLK_BUF1",
209 clkIibufIbufgNetPtr->addPip(
Factory::newPip(
"CLK_IOB_T_X17Y60",
"CLK_IOB_PAD_CLK1",
211 clkIibufIbufgNetPtr->addPip(
Factory::newPip(
"IOI_X17Y61",
"IOI_D0",
"IOI_I0",
213 "D",
"O", ILOGIC_X1Y123InstPtr,
"D",
"O")));
214 clkIibufIbufgNetPtr->addPip(
Factory::newPip(
"IOI_X17Y61",
"IOI_I0",
"IOI_I_2GCLK0",
216 clkIibufIbufgNetPtr->addPip(
Factory::newPip(
"IOI_X17Y61",
"IOI_IBUF0",
"IOI_D0",
218 designPtr->addNet(clkIibufIbufgNetPtr);
221 outNetPtr->setConfig(
"_BELSIG",
"PAD,PAD,out",
"out");
222 designPtr->addNet(outNetPtr);
225 resetNetPtr->setConfig(
"_BELSIG",
"PAD,PAD,reset",
"reset");
226 designPtr->addNet(resetNetPtr);
230 resetCNetPtr->addSource(resetCNetPin1Ptr);
232 resetCNetPtr->addSink(resetCNetPin2Ptr);
233 resetCNetPtr->addPip(
Factory::newPip(
"CLBLL_X16Y59",
"SITE_CTRL_B2",
"L_SR",
235 resetCNetPtr->addPip(
Factory::newPip(
"INT_INTERFACE_X17Y59",
"INT_INTERFACE_LOGIC_OUTS_B11",
241 resetCNetPtr->addPip(
Factory::newPip(
"INT_X17Y59",
"LOGIC_OUTS11",
"WS2BEG2",
245 "D",
"O", ILOGIC_X1Y119InstPtr,
"D",
"O")));
246 resetCNetPtr->addPip(
Factory::newPip(
"IOI_X17Y59",
"IOI_I0",
"IOI_LOGIC_OUTS11",
248 resetCNetPtr->addPip(
Factory::newPip(
"IOI_X17Y59",
"IOI_IBUF0",
"IOI_D0",
250 designPtr->addNet(resetCNetPtr);
252 BOOST_CHECK_EQUAL(designPtr->getNetCount(), 7u);
258 std::clog <<
"\tnet " << netPtr->getName() << std::endl;
264 /
"torc" /
"physical" /
"DesignUnitTest.reference.xdl";
266 /
"regression" /
"DesignUnitTest.generated.xdl";
268 std::fstream xdlExport(generatedPath.string().c_str(), std::ios_base::out);
270 fileExporter(designPtr);
277 BOOST_AUTO_TEST_SUITE_END()
Header for the DirectoryTree class.
InstanceSharedPtrVector::const_iterator InstanceSharedPtrConstIterator
Constant iterator to Instance shared pointers.
static NetSharedPtr newNetPtr(const string &inName, ENetType inNetType=eNetTypeNormal)
Create and return a new Net share pointer.
ModuleSharedPtrVector::const_iterator ModuleSharedPtrConstIterator
Constant iterator for Module shared pointers.
boost::shared_ptr< class InstancePin > InstancePinSharedPtr
Shared pointer encapsulation of an InstancePin.
BOOST_AUTO_TEST_CASE(XdlUnpackUnitTest)
Unit test for the XdlUnpack class.
const_iterator const_iterator
Constant iterator to {setting,Config} pairs.
Header for Boost.Test helper functions.
boost::shared_ptr< Module > ModuleSharedPtr
Shared pointer encapsulation of a Module.
Header for the XdlExport class.
Configuration. A {name:value} pair.
Header for torc::physical output stream helpers.
const string & getName(void) const
Returns the object name.
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.
const string & getValue(void) const
Return the configuration value.
boost::filesystem::path path
boost::shared_ptr< Instance > InstanceSharedPtr
Shared pointer encapsulation of an Instance.
boost::shared_ptr< Design > DesignSharedPtr
Shared pointer encapsulation of a Design.
static RoutethroughSharedPtr newRoutethroughPtr(const string &inSetting, const string &inName, const string &inValue, const InstanceWeakPtr &inInstancePtr, const string &inSourceWireName, const string &inSinkWireName)
Construct and return a new Routethrough shared pointer.
static InstancePinSharedPtr newInstancePinPtr(InstanceSharedPtr inInstancePtr, const string &inPinName)
Construct and return a new InstancePin shared pointer.
static DesignSharedPtr newDesignPtr(const string &inName, const string &inDevice, const string &inPackage, const string &inSpeedGrade, const string &inXdlVersion)
Create and return a new Design shared pointer.
bool fileContentsAreEqual(const boost::filesystem::path &inA, const boost::filesystem::path &inB)
Compare the raw contents of two files to determine whether they are identical.
Header for the Factory class.
static const boost::filesystem::path & getExecutablePath(void)
Returns the absolute path to the executable directory.
NetSharedPtrVector::const_iterator NetSharedPtrConstIterator
Constant iterator to Net shared pointers.
Physical design exporter for XDL.