113 const std::string& name,
int start,
int duration) {
114 const string procName =
"ExecutionPipeline::addResourceUse";
142 const string procName =
"ExecutionPipeline::addPortRead";
168 const string procName =
"ExecutionPipeline::addPortWrite";
171 throw OutOfRange(__FILE__, __LINE__, procName);
190 const string procName =
"ExecutionPipeline::removeResourceUse";
216 const string procName =
"ExecutionPipeline::removeResourceUse";
223 throw OutOfRange(__FILE__, __LINE__, procName);
230 if (cycle == 0 || cycle == 1) {
254 for (ResourceSet::const_iterator iter =
usedResources.begin();
256 parent->
cleanup((*iter)->name());
273 const string procName =
"ExecutionPipeline::removeOperandUse";
275 if (cycle < 0 || operand < 1) {
276 throw OutOfRange(__FILE__, __LINE__, procName);
302 const string procName =
"ExecutionPipeline::isResourceUsed";
303 throw OutOfRange(__FILE__, __LINE__, procName);
311 if (resource == NULL) {
329 const string procName =
"ExecutionPipeline::isResourceUsed";
330 throw OutOfRange(__FILE__, __LINE__, procName);
364 const string procName =
"ExecutionPipeline::isPortRead";
365 throw OutOfRange(__FILE__, __LINE__, procName);
388 const string procName =
"ExecutionPipeline::isPortRead";
389 throw OutOfRange(__FILE__, __LINE__, procName);
410 const string procName =
"ExecutionPipeline::readOperands";
411 throw OutOfRange(__FILE__, __LINE__, procName);
431 const string procName =
"ExecutionPipeline::readOperands";
432 throw OutOfRange(__FILE__, __LINE__, procName);
450 for (
int i = 0; i <
latency(); i++) {
452 operands.insert(cycleOperands.begin(), cycleOperands.end());
466 for (
int i = 0; i <
latency(); i++) {
468 operands.insert(cycleOperands.begin(), cycleOperands.end());
500 for (IOUsage::const_reverse_iterator iter =
opWrites_.rbegin();
509 (boost::format(
"Latency for operand index %d was not found for "
510 "operation '%s' on unit '%s'!") % output %
parent_->
name()
530 for (IOUsage::const_iterator iter =
opReads_.begin();
538 const string errMessage =
"Propably broken operand binding in operation:"
541 const string procName =
"ExecutionPipeline::slack";
557 for (ResourceUsage::const_iterator resUsageIter =
resourceUsage_.begin();
561 for (ResourceSet::const_iterator cycleUsageIter = cycleUsage.begin();
562 cycleUsageIter != cycleUsage.end(); cycleUsageIter++) {
571 for (IOUsage::const_iterator readsIter =
opReads_.begin();
572 readsIter !=
opReads_.end(); readsIter++) {
575 for (OperandSet::const_iterator opIter = operands.begin();
576 opIter != operands.end(); opIter++) {
577 int operand = *opIter;
586 for (IOUsage::const_iterator writesIter =
opWrites_.begin();
587 writesIter !=
opWrites_.end(); writesIter++) {
590 for (OperandSet::const_iterator opIter = operands.begin();
591 opIter != operands.end(); opIter++) {
592 int operand = *opIter;
599 return pipelineState;
612 const string procName =
"ExecutionPipeline::loadState";
623 for (ObjectStateTable::const_iterator iter = childTable.begin();
624 iter != childTable.end(); iter++) {
645 __FILE__, __LINE__, procName);
649 format errorMsg = textGen.
text(
654 __FILE__, __LINE__, procName, errorMsg.str());
657 format errorMsg = textGen.
text(
659 errorMsg % resourceName;
661 __FILE__, __LINE__, procName, errorMsg.str());
664 format errorMsg = textGen.
text(
669 __FILE__, __LINE__, procName, errorMsg.str());
672 format errorMsg = textGen.
text(
676 __FILE__, __LINE__, errorMsg.str());
682 __FILE__, __LINE__, procName, exception.
errorMessage());
724 const string procName =
"ExecutionPipeline::checkStartCycle";
726 if (startCycle < 0) {
727 throw OutOfRange(__FILE__, __LINE__, procName);
730 if (startCycle > 1) {
753 const string procName =
"ExecutionPipeline::checkDuration";
754 throw OutOfRange(__FILE__, __LINE__, procName);
767 const string procName =
"ExecutionPipeline::checkResourceName";
783 const string procName =
"ExecutionPipeline::checkInputOperand";
786 throw OutOfRange(__FILE__, __LINE__, procName);
805 const string procName =
"ExecutionPipeline::checkOutputOperand";
808 throw OutOfRange(__FILE__, __LINE__, procName);
827 const std::string& resource,
int start,
int duration)
const {
829 if (element == NULL) {
833 int end = start + duration - 1;
838 for (
int cycle = start; cycle <= end; cycle++) {
840 const string procName =
841 "ExecutionPipeline::checkResourceAvailability";
859 int operand,
int start,
int duration)
const {
860 int end = start + duration - 1;
865 for (
int cycle = start; cycle <= end; cycle++) {
868 const string procName =
869 "ExecutionPipeline::checkOperandAvailability";
885 const std::string& name,
896 for (
int cycle = start; cycle < start + duration; cycle++) {
917 if (start + duration >
latency()) {
921 for (
int cycle = start; cycle < start + duration; cycle++) {
922 toModify[cycle].insert(operand);
937 const std::string& name,
942 if (toRemove == NULL) {
946 int end = start + duration - 1;
951 for (
int cycle = start; cycle <= end; cycle++) {
976 int end = start + duration - 1;
981 for (
int cycle = start; cycle <= end; cycle++) {
1010 }
else if (newLatency <
latency()) {
1011 for (
int cycle =
latency() - 1; cycle >= newLatency; cycle--) {
1039 for (OperandSet::const_iterator iter = operands.begin();
1040 iter != operands.end(); iter++) {
1059 for (
int cycle = 0; cycle <
latency; cycle++) {
1078 for (
int cycle = 0; cycle <
latency; cycle++) {
1101 for (
int cycle = 0; cycle <
latency; cycle++) {
1122 const std::string& resource)
const {
1125 if (element == NULL) {
1130 for (
int i = 0; i <
latency; i++) {
1157 const std::string& resource,
1161 if (currentFirstCycle != cycle) {
1162 return currentFirstCycle;
1166 if (element == NULL) {
1167 return currentFirstCycle;
1180 for (
int i = cycle + 1; i <
latency; i++) {
1206 if (currentFirstCycle != cycle) {
1207 return currentFirstCycle;
1222 for (
int i = cycle + 1; i <
latency; i++) {
1243 for (
int cycle = 0; cycle <
latency; cycle++) {
1245 resources.insert(cycleResources.begin(), cycleResources.end());
1295 string elementName = element->
name();
1296 bool resourceFound =
false;
1298 for (
int i = 0; i < pipelineState->
childCount(); i++) {
1307 resourceFound =
true;
1313 if (!resourceFound) {
1338 const std::string& osName) {
1342 for (
int i = 0; i < pipelineState->
childCount(); i++) {
1344 if (child->
name() == osName &&
1359 pipelineState->
addChild(operandUsage);
1380 for (
int i = 0; i < pipelineState->
childCount(); i++) {
1405 for (ObjectStateTable::iterator iter = usages.begin();
1406 iter != usages.end(); iter++) {
1409 if (startCycle < usageStart) {
1410 usages.insert(iter, usageState);
1415 string procName =
"ExecutionPipeline::addResourceUsage";
1417 __FILE__, __LINE__, procName, exception.
errorMessage());
1420 usages.push_back(usageState);