X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/blast.git/blobdiff_plain/756baf5c8eaf003e8271dab9c395de2b0e704857..a13795fc34cd1e74f94695d35253c3d00abec9bc:/FunctionalBlock.h?ds=sidebyside

diff --git a/FunctionalBlock.h b/FunctionalBlock.h
index c51ff77..e3b8167 100644
--- a/FunctionalBlock.h
+++ b/FunctionalBlock.h
@@ -26,7 +26,7 @@ using namespace Qt;
 class FunctionalBlock : public AbstractBlock {
 public:
 
-  FunctionalBlock(GroupBlock* _parent, ReferenceBlock* _reference) throw(Exception);
+  FunctionalBlock(Graph* _graph, GroupBlock* _parent, ReferenceBlock* _reference, bool createIfaces = true) throw(Exception);
   ~FunctionalBlock();
   // getters
   inline ReferenceBlock* getReference() { return reference; }
@@ -46,11 +46,16 @@ public:
 
   // testers
   bool isFunctionalBlock();
-  bool isSourceBlock(); //! a source block has no parent and has no data inputs
+  bool isStimuliBlock(); //! a stimuli block has no parent and has no data inputs
 
   // others
 
   void populate(); // create parameters and interface from reference block
+
+  QList<QString> getExternalResources();
+  void generateVHDL(const QString& path) throw(Exception); // main entry to generate the VHDL code  
+  QString getIfaceUserName(AbstractInterface* refIface); // get iface name from reference interface
+
   void parametersValidation(QList<AbstractBlock *> *checkedBlocks, QList<AbstractBlock*>* blocksToConfigure);
 
   QString getReferenceXmlFile();
@@ -58,21 +63,21 @@ public:
   
   // patterns
   void createPatterns() throw(Exception); // called in Graph, before checking compatibility and computing output pattern
-  void checkInputPatternCompatibility() throw(Exception);
-  void computeOutputPattern(int nbExec = -1) throw(Exception);
+  virtual void checkInputPatternCompatibility() throw(Exception);
+  virtual void computeOutputPattern(int nbExec = -1) throw(Exception);
   void computeAdmittanceDelays() throw(Exception); // compute differences between IP and admittance
 
-private:  
+protected:
   // patterns
   void createDelta() throw(Exception);
   void createConsumptionPattern() throw(Exception); // initialize a QList<char> for each interface from patterns defined in implementation
   void createProductionPattern() throw(Exception); // initialize a QList<char> for each interface from patterns defined in implementation
   void createProductionCounter() throw(Exception); // initialize a QList<int> from counter defined in implementation
   void createAdmittance(int nbExec) throw(Exception); // initialize a QList<char> from consumption pattern and delta
+  void createInputPattern() throw(Exception);
 
   void clearConsumptionPattern();
-  void clearProductionPattern();
-  void createInputPattern() throw(Exception);
+  void clearProductionPattern(); 
   void clearInputPattern();
   void clearOutputPattern();
   void clearAdmittanceDelays();
@@ -153,6 +158,12 @@ private:
   */
   void shiftRightPattern(const QMap<AbstractInterface*, QList<char>* >& pattern, int offset);
 
+  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 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
+  void generateEntityOrComponentBody(QTextStream& out, int indentLevel, bool hasController=false) throw(Exception); // generate the entity/compo body using reference
+
   QMap<AbstractInterface*, QList<char>* > consumptionPattern;
   QMap<AbstractInterface*, QString > admittanceCyclic; // the admittance expressed as prologue-cyclic part-epilogue, deduced from admittance
   QMap<AbstractInterface*, QList<char>* > admittance; // the admittance taking into account nb exec.