]> AND Private Git Repository - blast.git/blobdiff - GroupBlock.cpp
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
after merge
[blast.git] / GroupBlock.cpp
index 6950b30fbdae11113e9237cad9b66e17e946be87..6cd76b9f3d1ee192a4c24eae858a52b8ca6ba787 100644 (file)
@@ -5,6 +5,7 @@
 #include "GroupInterface.h"
 #include "string.h"
 #include <sstream>
+#include "Parameters.h"
 
 int GroupBlock::counter = 1;
 
@@ -31,20 +32,21 @@ GroupBlock::GroupBlock(GroupBlock *_parent) throw(Exception) :  AbstractBlock()
     rst = new GroupInterface(this,"ext_reset", AbstractInterface::Input, AbstractInterface::Reset);
     addInterface(clk);
     addInterface(rst);
-    // creating clkrstgen block : done in Dispatcher since this has no access to library
+    // creating clkrstgen block and connecting it to this: done in Dispatcher since this has no access to library
   }
   parent = _parent;
+
   if (_parent != NULL) {
-    // adding this to the child blocks of parent    
-    _parent->addBlock(this);
-    // connect clk/rst ifaces to parent clk/rst or to clkrstgen if parent is top group
-    if (_parent->isTop()) {
-      
+    try {
+      connectClkReset();
     }
-    else {
-      
+    catch(Exception e) {
+      AbstractBlock* source = (AbstractBlock *)(e.getSource());
+      cerr << qPrintable(source->getName()) << ":" << qPrintable(e.getMessage()) << endl;
+      throw(e);
     }
   }
+
 }
 
 GroupBlock::~GroupBlock() {
@@ -268,7 +270,7 @@ void GroupBlock::generateVHDL(const QString& path) throw(Exception) {
   QString coreFile = "";
 
   coreFile = path;
-  coreFile.append(normalizeName(name));
+  coreFile.append(Parameters::normalizeName(name));
   coreFile.append(".vhd");
 
   QFile vhdlCore(coreFile);