X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/blast.git/blobdiff_plain/7b1c7e44123b9b2626205a89e27b2a4712ea30c6..77e28a24d444098399304f0175b1aba43c83017f:/FunctionalBlock.h

diff --git a/FunctionalBlock.h b/FunctionalBlock.h
index 440c154..c51ff77 100644
--- a/FunctionalBlock.h
+++ b/FunctionalBlock.h
@@ -33,6 +33,7 @@ public:
   inline QList<int> getProductionCounter() { return productionCounter; }
   inline QMap<AbstractInterface*, QList<char>* > getConsumptionPattern() { return consumptionPattern; }
   inline QMap<AbstractInterface*, QList<char>* > getProductionPattern() { return productionPattern; }
+  inline QMap<AbstractInterface*, QList<int>* > getAdmittanceDelays() { return admittanceDelays; }
   inline int getConsumptionPatternLength() { return lengthCP; }
   inline int getProductionPatternLength() { return lengthPP; }
   inline int getDelta() { return delta; }
@@ -59,7 +60,8 @@ public:
   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);
-  
+  void computeAdmittanceDelays() throw(Exception); // compute differences between IP and admittance
+
 private:  
   // patterns
   void createDelta() throw(Exception);
@@ -67,15 +69,19 @@ private:
   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 clearConsumptionPattern();
   void clearProductionPattern();
   void createInputPattern() throw(Exception);
   void clearInputPattern();
+  void clearOutputPattern();
+  void clearAdmittanceDelays();
   int createTriggers(); // compute the clock cycle at which the block is triggered
   
   double evaluateExpression(const QString& expression) throw(Exception);
   QList<char>* expandPattern(const QString& patternIn) throw(Exception);
-  void expandPatternRecur(const QString& patternIn, int* offset, QList<char> *patternOut)  throw(Exception);
+  QList<char> expandPatternRecur(const QString& patternIn, int* offset)  throw(Exception);
+  QString replaceExpressions(const QString& patternIn) throw(Exception);
   /*!
    * \brief samePatterns
    * \param patternSrc the pattern that must be tested with patternDest (is patternDest == patternDest)  
@@ -86,6 +92,7 @@ private:
    leaving the dest pattern in an inconsistent state. Thus, it is a good idea to call canCombine before.
    */
   bool samePatterns(const QMap<AbstractInterface*, QList<char>* >& patternSrc, int srcCol, const QMap<AbstractInterface*, QList<char>* >& patternDest, int destCol);
+  bool samePatterns(const QMap<AbstractInterface*, QList<char>* >& patternSrc, const QList<int>& srcCols, const QMap<AbstractInterface*, QList<char>* >& patternDest, int destCol);
   /*!
    * \brief canCombinePatterns
    * \param patternSrc the pattern that must be combined with patternDest (patternDest = patternDest OR patternSrc)  
@@ -129,6 +136,7 @@ private:
   * isValidGroup checks if there is at least one 1 in the column offset of pattern.
   */
   bool isValidDataGroup(const QMap<AbstractInterface*, QList<char>* >& pattern, int offset);
+  bool isValidDataGroup(const QMap<AbstractInterface*, QList<char>* >& pattern, const QList<int> offsets);
   /*!
   * \brief isOnlyXGroup
   * \param pattern the pattern to test
@@ -146,8 +154,9 @@ private:
   void shiftRightPattern(const QMap<AbstractInterface*, QList<char>* >& pattern, int offset);
 
   QMap<AbstractInterface*, QList<char>* > consumptionPattern;
-  QMap<AbstractInterface*, QString > admittanceCyclic; // the admittance expressed as prologue-cyclic part-eppilogue, deduced from admittance
+  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.
+  QMap<AbstractInterface*, QList<int>* > admittanceDelays; // the delay between what should be consumed and IP
   QMap<AbstractInterface*, QList<char>* > productionPattern;
   QMap<AbstractInterface*,QList<char>* > inputPattern;
   QMap<AbstractInterface*, QList<char>* > outputPattern; // CAUTION: the QList<char>* must also be stored in the outputPattern attributes of AbstractInterface