72 "requirements of applications are not reached anymore.");
81 addParameter(frequencyPN_,
UINT);
98 virtual std::vector<RowID>
100 std::vector<RowID> result;
105 if (frequency_ < 1) {
106 result.push_back(configurationID);
110 RowID min = minimizeMachine(configurationID);
112 result.push_back(min);
136 readCompulsoryParameter(frequencyPN_, frequency_);
138 readOptionalParameter(minBusPN_, minBus_);
139 readOptionalParameter(minFUPN_, minFU_);
140 readOptionalParameter(minRFPN_, minRF_);
161 std::vector<ClockCycleCount> maxCycleCounts;
163 std::set<RowID>::const_iterator applicationIter;
164 for (applicationIter = applicationIDs.begin();
165 applicationIter != applicationIDs.end();
172 maxCycleCounts.push_back(0);
174 maxCycleCounts.push_back(
177 static_cast<double>(frequency_) *
178 static_cast<double>(1000000)));
182 RowID orgConfToMinimize = confToMinimize;
184 confToMinimize = minimizeBuses(confToMinimize, maxCycleCounts);
190 confToMinimize = minimizeFunctionUnits(
198 confToMinimize = minimizeRegisterFiles(
205 if (orgConfToMinimize == confToMinimize) {
207 std::string(
"No new config could be generated by "
208 "MinimizeMachine plugin."));
212 return confToMinimize;
229 RowID confToMinimize,
230 std::vector<ClockCycleCount>& maxCycleCounts) {
241 debugLog(std::string(
"No machine architecture found in config id "
242 "by MimimizeMachine plugin. "));
244 return confToMinimize;
250 int origBusCount = busNav.
count();
251 if (origBusCount < 2) {
252 return confToMinimize;
265 if (!explorer.
evaluate(startConf, estimates,
false)) {
269 return confToMinimize;
273 if (!checkCycleCounts(startConf, maxCycleCounts)) {
277 return confToMinimize;
283 int busHigh = origBusCount;
285 int busMid = (busLow + busHigh) /2;
288 RowID lastArchID = 0;
289 RowID lastConfID = 0;
290 RowID lastOKArchID = 0;
291 RowID lastOKConfID = 0;
293 std::list<std::string> removedBusNames;
302 int busesToRemove = (origBusCount - busMid);
304 if (!modifier.
removeBuses(busesToRemove, *newMach, removedBusNames)) {
331 bool newConfigOK =
false;
332 if (explorer.
evaluate(newConfiguration, newEstimates,
false)) {
335 checkCycleCounts(newConfiguration, maxCycleCounts);
339 busHigh = busMid - 1;
340 busMid = (busLow + busMid) / 2;
341 lastOKArchID = lastArchID;
342 lastOKConfID = lastConfID;
345 busMid = (busMid + busHigh) / 2;
347 }
while (busLow <= busHigh && busLow <= busMid);
358 if (lastOKArchID == 0) {
359 return confToMinimize;
368 std::list<std::string>::const_iterator busNameIter =
369 removedBusNames.begin();
370 while (busNameIter != removedBusNames.end()) {
379 if (explorer.
evaluate(newConfiguration, newEstimates,
false)) {
392 return confToMinimize;
415 RowID confToMinimize,
416 std::vector<ClockCycleCount>& maxCycleCounts) {
419 RowID latestConfID = 0;
432 debugLog(std::string(
"No machine architecture found in config id "
433 "by MimimizeMachine plugin. "));
435 return confToMinimize;
448 if (!explorer.
evaluate(startConf, estimates,
false)) {
452 return confToMinimize;
456 if (!checkCycleCounts(startConf, maxCycleCounts)) {
459 return confToMinimize;
462 MachineResourceModifier::RegisterMap::const_iterator registerMapIter =
463 origRegisterMap.begin();
467 for (; registerMapIter != origRegisterMap.end(); registerMapIter++) {
476 while (i < rfNav.
count()) {
477 if (((*registerMapIter).second)->isArchitectureEqual(
482 std::list<std::string> socketList;
491 if (!evalNewConfigWithoutImplementation(explorer, mach,
492 dsdb, newConfiguration, confID, newEstimates)) {
501 if (!checkCycleCounts(newConfiguration, maxCycleCounts)) {
506 latestConfID = confID;
524 if (latestConfID != 0) {
528 return confToMinimize;
545 RowID confToMinimize,
546 std::vector<ClockCycleCount>& maxCycleCounts) {
549 RowID latestConfID = 0;
562 debugLog(std::string(
"No machine architecture found in config id "
563 "by MimimizeMachine plugin. "));
565 return confToMinimize;
576 if (!explorer.
evaluate(startConf, estimates,
false)) {
580 return confToMinimize;
584 if (!checkCycleCounts(startConf, maxCycleCounts)) {
587 return confToMinimize;
590 MachineResourceModifier::FunctionUnitMap::const_iterator fuMapIter =
596 for (; fuMapIter != origFUMap.end(); fuMapIter++) {
603 while (i < fuNav.
count()) {
604 if (((*fuMapIter).second)->isArchitectureEqual(
605 fuNav.
item(i),
true)) {
608 std::list<std::string> socketList;
617 if (!evalNewConfigWithoutImplementation(explorer, mach,
618 dsdb, newConfiguration, confID, newEstimates)) {
626 if (!checkCycleCounts(newConfiguration, maxCycleCounts)) {
631 latestConfID = confID;
648 if (latestConfID != 0) {
652 return confToMinimize;
688 return explorer.
evaluate(newConfiguration, newEstimates,
false);
703 const std::vector<ClockCycleCount>& maxCycleCounts) {
706 std::vector<ClockCycleCount> cycleCounts;
707 std::set<RowID> appIds = db().applicationIDs();
708 for (std::set<RowID>::const_iterator appI = appIds.begin();
709 appI != appIds.end(); ++appI) {
714 cycleCounts.push_back(
718 for (
int i = 0; i < (int)cycleCounts.size(); i++) {
720 if (maxCycleCounts.at(i) < 1) {
724 if (maxCycleCounts.at(i) < cycleCounts.at(i)) {