- cout << "input pattern array initialized with min. len " << lengthIP << endl;\r
- }\r
- \r
- // initialize the output pattern \r
- lengthOP = 0;\r
- foreach(AbstractInterface* iface, getControlOutputs()) {\r
- FunctionalInterface* connIface = AI_TO_FUN(iface); \r
- lengthOP = lengthIP+productionPattern.value(connIface)->size();\r
- QList<char>* pattern = new QList<char>();\r
- for(int i=0;i<lengthOP;i++) pattern->append(0);\r
- connIface->setOutputPattern(pattern);\r
- outputPattern.insert(connIface,pattern);\r
- }\r
- cout << "output pattern array initialized" << endl;\r
- \r
- int clock = 0;\r
- nbExec = 0;\r
- // search for the beginning of the first execution.\r
- while ((clock < lengthIP) && (! isValidDataGroup(inputPattern,clock))) clock++;\r
- cout << "found 1st exec clock: " << clock << endl;\r
- \r
- while (clock < lengthIP) {\r
- // initialize counters for current execution.\r
- int p = 0; // index in production pattern\r
- int o = 0; // clock+o will give the clock cycle of each output group\r
- int cip = 0; // clock+cip give the clock cycle of an input group\r
- int ccp = 0; // ccp give a column in the consumptio pattern\r
- int nip = 0; // number of input data groups already consumed during the current execution, used while exploring IP\r
- int ncp = 0; // number of input data groups already consumed during the current execution, used while exploring CP\r
- bool cannotCompleteExec = false;\r
- for(int m=0;m<productionCounter.size();m++) {\r
- // search for the first production in PP\r
- while (!isValidDataGroup(productionPattern,p)) {\r
- p += 1;\r
- o += 1;\r
+ int gap = 0; // count the number of extra null columns\r
+ // search for PC(m) valid input group in IP\r
+ while (nip < productionCounter.at(m)) {\r
+ if (clock+cip < lengthIP) {\r
+ if (isValidDataGroup(inputPattern,clock+cip)) nip += 1;\r
+ cip += 1;\r
+ gap += 1;\r