BlockParameter* p;\r
AbstractInterface* inter;\r
\r
+ // create parameters from reference block\r
QList<BlockParameter*> lstParam = reference->getParameters();\r
for(i=0;i<lstParam.size();i++) {\r
p = lstParam.at(i)->clone();\r
addParameter(p);\r
}\r
\r
- QList<AbstractInterface *> lstInter = reference->getInterfaces();\r
- for(i=0;i<lstInter.size();i++) {\r
+ // create interfaces from reference block\r
+ QList<AbstractInterface *> lstRef = reference->getInterfaces();\r
+ // store relation between functional and reference\r
+ QHash<AbstractInterface *, AbstractInterface *> hashIface;\r
+ for(i=0;i<lstRef.size();i++) {\r
try {\r
- inter = new FunctionalInterface(this, (ReferenceInterface*)lstInter.at(i));\r
+ inter = new FunctionalInterface(this, AI_TO_REF(lstRef.at(i)));\r
}\r
catch(Exception e) {\r
cerr << "Abnormal case: " << qPrintable(e.getDefaultMessage()) << endl << "Aborting execution." << endl;\r
exit(1);\r
}\r
+ hashIface.insert(lstRef.at(i),inter);\r
\r
addInterface(inter);\r
}\r
-\r
+ \r
+ AbstractInterface* funCtlIface = NULL;\r
+ AbstractInterface* funDataIface = NULL;\r
+ \r
+ for(i=0;i<lstRef.size();i++) { \r
+ AbstractInterface* refIface = lstRef.at(i); \r
+ if (refIface->getPurpose() == AbstractInterface::Control) {\r
+ funCtlIface = hashIface.value(refIface);\r
+ funDataIface = hashIface.value(refIface->getAssociatedIface());\r
+ if (! funCtlIface->setAssociatedIface(funDataIface)) {\r
+ cerr << "Abnormal case when associating a control interface to data" << endl << "Aborting execution." << endl;\r
+ exit(1);\r
+ } \r
+ }\r
+ }\r
}\r
\r
\r