X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/blast.git/blobdiff_plain/624231601a0f5daea9b8809993ad3503beafce4f..8e89ca269960b7bb43ccc054696dfc28e84d409a:/FunctionalBlock.h diff --git a/FunctionalBlock.h b/FunctionalBlock.h index c122dcf..f898990 100644 --- a/FunctionalBlock.h +++ b/FunctionalBlock.h @@ -11,6 +11,9 @@ class ReferenceBlock; class GroupBlock; #include "Exception.h" class Exception; +class BlockImplementation; +class ArithmeticEvaluator; + using namespace std; @@ -29,10 +32,11 @@ public: inline ReferenceBlock* getReference() { return reference; } // setters + inline void setImplementation(BlockImplementation* impl) { implementation = impl; } // testers bool isFunctionalBlock(); - bool isSourceBlock(); //! a source block has no parent + bool isSourceBlock(); //! a source block has no parent and has no data inputs // others @@ -41,9 +45,45 @@ public: QString getReferenceXmlFile(); QString getReferenceHashMd5(); - + + // patterns + bool createPatterns(); + bool createDelta(); + bool createConsumptionPattern(); // initialize a QList for each interface from patterns defined in implementation + bool createProductionPattern(); // initialize a QList for each interface from patterns defined in implementation + bool createProductionCounter(); // initialize a QList from counter defined in implementation + void initConsumptionPattern(); // initialize a char** from patterns defined for each interface + void initProductionPattern(); // initialize a char** from patterns defined for each interface + void clearConsumptionPattern(); + void clearProductionPattern(); + private: + // patterns + bool computeOutputPattern(int nbExec = -1); + bool isValidDataGroup(char** pattern, int nbPorts, int clock); + /*! + * \brief combinePatterns + * \param patternSrc the pattern that must be combined with patternDest (patternDest = patternDest OR patternSrc) + * \param srcCol the column index within patternSrc + * \param patternDest the pattern that is modified by the combination (patternDest = patternDest OR patternSrc) + * \param destClock the column index within patternDest + * \param nbCols the numer of columns to combine + * \param nbPorts the number of rows in both patterns + * BEWARE: no check is done if nbCols is consistent with the real length of both patterns, thus an access outside + * the patterns is possible. + */ + void combinePatterns(char** patternSrc, int srcCol, char** patternDest, int destCol, int nbCols, int nbPorts ); + + char** consumptionPattern; + int nbConsumingPorts; + int lengthCP; + char** productionPattern; + int nbProducingPorts; + int lengthPP; + ArithmeticEvaluator* evaluator; + ReferenceBlock* reference; + BlockImplementation* implementation; };