lengthPP = -1;\r
delta = -1;\r
evaluator = NULL;\r
+\r
}\r
\r
FunctionalBlock::~FunctionalBlock() {\r
addParameter(p);\r
}\r
\r
+ ConnectedInterface* toClk = NULL;\r
+ ConnectedInterface* toRst = NULL;\r
// create interfaces from reference block\r
QList<AbstractInterface *> lstRef = reference->getInterfaces();\r
// store relation between functional and reference\r
exit(1);\r
}\r
hashIface.insert(lstRef.at(i),inter);\r
-\r
addInterface(inter);\r
+ /* WARNING FOR THE FUTURE :\r
+ in case of there are several clock interfaces ofr that block\r
+ it would be a godd idea to make the user choose which one\r
+ must be connected to defautl clk.\r
+ Presently, the first encountered is chosen\r
+ */\r
+ if ((toClk == NULL) && (inter->getPurpose() == AbstractInterface::Clock)) {\r
+ toClk = AI_TO_CON(inter);\r
+ }\r
+ if ((toRst == NULL) && (inter->getPurpose() == AbstractInterface::Reset)) {\r
+ toRst = AI_TO_CON(inter);\r
+ }\r
}\r
\r
AbstractInterface* funCtlIface = NULL;\r
} \r
}\r
}\r
-}\r
\r
+ // connect clk and rst to group clk/rst or to clkrstgen\r
+ if ((name != "clkrstgen") && (parent != NULL)) {\r
+ try {\r
+ connectClkReset();\r
+ }\r
+ catch(Exception e) {\r
+ AbstractBlock* source = (AbstractBlock *)(e.getSource());\r
+ cerr << qPrintable(source->getName()) << ":" << qPrintable(e.getMessage()) << endl;\r
+ throw(e);\r
+ }\r
+ }\r
+}\r
\r
QString FunctionalBlock::getReferenceXmlFile() {\r
return ((ReferenceBlock *)reference)->getXmlFile();\r
}\r
// get the precursor output pattern\r
QList<char>* out = connIface->getConnectedFrom()->getOutputPattern();\r
-\r
- ConnectedInterface* assoIface = AI_TO_CON(connIface->getAssociatedIface());\r
- AbstractInputModifier* modifier = assoIface->getInputModifier();\r
+ AbstractInputModifier* modifier = connIface->getInputModifier();\r
// check if the input is modified\r
if (modifier != NULL) {\r
\r
#ifdef DEBUG_FCTNAME\r
cout << "call to " << qPrintable(fctName) << endl;\r
#endif\r
- \r
+\r
+ clearOutputPattern();\r
+\r
/* case 1: the block is a generator for which output pattern\r
must be computed for a nbExec following executions\r
*/\r
- \r
- \r
+\r
if (nbExec > 0) {\r
cout << "computing output pattern of " << qPrintable(name) << " for " << nbExec << " executions" << endl;\r
foreach(AbstractInterface* iface, getControlOutputs()) {\r
lengthIP = -1;\r
}\r
\r
+void FunctionalBlock::clearOutputPattern() {\r
+\r
+ QMapIterator<AbstractInterface*,QList<char>* > iterO(outputPattern);\r
+ while (iterO.hasNext()) {\r
+ iterO.next();\r
+ ConnectedInterface* connIface = AI_TO_CON(iterO.key());\r
+ connIface->resetOutputPattern();\r
+ QList<char>* pattern = iterO.value();\r
+ if (pattern != NULL) delete pattern;\r
+ }\r
+ outputPattern.clear();\r
+ lengthOP = -1;\r
+}\r
+\r
void FunctionalBlock::clearAdmittanceDelays() {\r
QMapIterator<AbstractInterface*, QList<int>* > iterA(admittanceDelays);\r
while (iterA.hasNext()) {\r
} \r
return triggers.size();\r
}\r
+\r
+void FunctionalBlock::generateVHDL(const QString& path) throw(Exception){\r
+ }\r
+\r
+void FunctionalBlock::generateComments(QTextStream& out, QDomElement &elt, QString coreFile) throw(Exception) {\r
+\r
+}\r
+\r
+void FunctionalBlock::generateLibraries(QTextStream& out, QDomElement &elt) throw(Exception) {\r
+\r
+}\r
+\r
+void FunctionalBlock::generateEntity(QTextStream& out, bool hasController=false) throw(Exception) {\r
+\r
+}\r
+\r
+void FunctionalBlock::generateArchitecture(QTextStream& out, QDomElement &elt ) throw(Exception) {\r
+\r
+}\r