40 #include <boost/format.hpp>
106 icDec_(
"DefaultICDecoder"),
107 icDecHDB_(
"asic_130nm_1.5V.hdb"),
111 addParameter(startMHzPN_,
UINT);
112 addParameter(endMHzPN_,
UINT);
113 addParameter(stepMHzPN_,
UINT);
116 addParameter(icDecPN_,
STRING,
false, icDec_);
117 addParameter(icDecHDBPN_,
STRING,
false, icDecHDB_);
118 addParameter(superiorityPN_,
UINT,
false,
135 virtual std::vector<RowID>
142 std::vector<RowID> result;
144 RowID startPointConfID = startPointConfigurationID;
149 "SimpleICOptimizer", &db());
152 "MinimizeMachine", &db());
155 "GrowMachine", &db());
161 if (startMHz_ > endMHz_) {
162 int tempMHz = startMHz_;
175 vector<RowID> cycleOptimizedConfs =
176 growMachine->
explore(startPointConfID);
178 std::ostringstream msg(std::ostringstream::out);
179 msg <<
"GrowMachine plugin produced initial configs: ";
180 for (
unsigned int i = 0; i < cycleOptimizedConfs.size(); ++i) {
181 msg << cycleOptimizedConfs.at(i) <<
" ";
190 vector<RowID>::const_iterator archIter;
191 while (currentFrequencyMHz != 0) {
194 currentFrequencyMHz), 3)
198 for (archIter = cycleOptimizedConfs.begin();
199 archIter != cycleOptimizedConfs.end();
202 verboseLogC(
"Testing (fast enough) init config: " +
205 if (fastEnough(*archIter, currentFrequencyMHz, dsdb)) {
206 verboseLogC(
"Calling minimize machine for init config: " +
214 callPlugin(minimizeMachine, *archIter, dsdb);
217 RowID selectedConf = createImplementationAndStore(minConf,
218 currentFrequencyMHz, 0,
true, icDec_, icDecHDB_);
220 verboseLogC(
"Implementation selection produced a config: "
224 if (selectedConf == 0) {
225 verboseLogC(
"Component selection failed for minimized"
232 vector<RowID> icOptimizedResult =
233 icOptimizer->
explore(selectedConf);
234 if (icOptimizedResult.size() == 1) {
236 std::ostringstream msg(std::ostringstream::out);
237 msg <<
"Config " << icOptimizedResult.at(0)
238 <<
" created for frequency "
239 << currentFrequencyMHz <<
"." << endl;
242 result.push_back(icOptimizedResult.at(0));
269 delete minimizeMachine;
270 minimizeMachine = NULL;
288 static const int busCountDefault_ = 4;
290 static const unsigned int immSlotBusIndexDefault_ = 0;
292 static const int registerFileSizeDefault_ = 4;
293 static const int maxNumberOfRegisterFilesDefault_ = 16;
294 static const int rfReadPortsDefault_ = 1;
295 static const int rfWritePortsDefault_ = 1;
325 readCompulsoryParameter(startMHzPN_, startMHz_);
326 readCompulsoryParameter(endMHzPN_, endMHz_);
327 readCompulsoryParameter(stepMHzPN_, stepMHz_);
330 readOptionalParameter(icDecPN_, icDec_);
331 readOptionalParameter(icDecHDBPN_, icDecHDB_);
332 readOptionalParameter(superiorityPN_, superiority_);
340 HDBRegistry& hdbRegistry = HDBRegistry::instance();
357 set<RowID>::const_iterator applicationIter;
361 for (applicationIter = applicationIDs.begin();
362 applicationIter != applicationIDs.end();
375 if ((
static_cast<double>(cycleCount) / (
static_cast<double>(freq) *
static_cast<double>(1000000))) >
398 vector<RowID> resultConfs = plugin->
explore(arch);
401 if (resultConfs.size() == 1) {
407 "%s failed to optimize "
408 "configuration %d. Possible bug in Optimizer,"
409 " Estimator or missing data from HDB."
410 ) % arch % plugin->
name()).str());
414 std::ostringstream msg(std::ostringstream::out);
415 msg << plugin->
name()
416 <<
" plugin produced config: "
417 << resultConfs.at(0) << endl;