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

Private GIT Repository
moved vhdl gen. into block
[blast.git] / GroupBlock.h
index 33166377d639462d47b9dd3d5f0b939cb7e871a5..bb5e7710cb0adcc3b1f40d786cbe32160fab76e6 100644 (file)
@@ -21,26 +21,58 @@ public:
   virtual ~GroupBlock();
 
   // getters
-
+  inline QList<AbstractBlock*> getBlocks() { return blocks; }
   // setters
   void setParent(AbstractBlock *_parent);
 
   // testers
   bool isGroupBlock();
+  bool isTopGroupBlock();
   inline bool isTop() { return topGroup; }
 
   // others
   inline void addBlock(AbstractBlock* block) { blocks.append(block); }
   void removeBlock(AbstractBlock* block);
+  AbstractBlock* getFunctionalBlockByName(QString name);
+
+  void removeAllBlocks();
   void parametersValidation(QList<AbstractBlock *> *checkedBlocks, QList<AbstractBlock*>* blocksToConfigure);  
   void addGenericParameter(QString name, QString type, QString value);
   void removeGenericParameter(QString name);
   // public attributes
   static int counter;
 
-private:  
+  void checkInputPatternCompatibility() throw(Exception);
+  void computeOutputPattern(int nbExec = -1) throw(Exception);
+  void computeAdmittanceDelays() throw(Exception);
+  
+  void generateVHDL(const QString& path) throw(Exception); // main entry to generate the VHDL code
+
+private:    
+  // patterns  
+  /* NB: in opposition to FunctionalBlock, the input pattern and output pattern of a block
+     is not computed but just deduced from the output pattern of functional interfaces that
+     are connected to some block interfaces. Thus, there is no need to have an outputPattern QMap linking
+     interfaces and patterns as in FunctionalBlock.
+     Thus, the output patterns are directly set/retrieved from interfaces.
+    
+   */
+  /*!
+   * \brief createInputPattern
+   * Since input GroupInterface are just tunnels to input interfaces of inner blocks, they must
+   * have an output pattern that can be provided to inner interfaces. That outpu pattern is just
+   * found by taking the output pattern of the connectedFrom interface.
+   */   
+  void createInputPattern();
+
+  void generateComments(QTextStream& out, QDomElement &elt, QString coreFile) throw(Exception); // generates comments from <comments> element
+  void generateLibraries(QTextStream& out, QDomElement &elt) throw(Exception); // generates libraries from <libraries> element
+  void generateEntity(QTextStream& out, bool hasController=false) throw(Exception); // generate the entity using reference
+  void generateArchitecture(QTextStream& out, QDomElement &elt ) throw(Exception); // generate the architecture using <architecture> element
+  void generateController(QTextStream& out) throw(Exception); // generate the wishbone controller of the block
+  
   bool topGroup;  
-  QList<AbstractBlock*> blocks; // contains instances of FunctionalBlock or GroupBlock
+  QList<AbstractBlock*> blocks; // contains instances of FunctionalBlock or GroupBlock that are children of this group
 
 };