class GroupBlock;\r
#include "Exception.h"\r
class Exception;\r
+class BlockImplementation;\r
+class ArithmeticEvaluator;\r
+ \r
\r
\r
using namespace std;\r
\r
// getters\r
inline ReferenceBlock* getReference() { return reference; }\r
-\r
+ inline QList<int> getProductionCounter() { return productionCounter; }\r
+ inline int getDelta() { return delta; }\r
+ \r
// setters\r
+ inline void setImplementation(BlockImplementation* impl) { implementation = impl; }\r
+ inline void setProductionCounter(QList<int> pattern) { productionCounter = pattern; }\r
+ inline void setDelta(int _delta) { delta = _delta; }\r
+ \r
\r
// testers\r
bool isFunctionalBlock();\r
+ bool isSourceBlock(); //! a source block has no parent and has no data inputs\r
\r
// others\r
\r
\r
QString getReferenceXmlFile();\r
QString getReferenceHashMd5();\r
-\r
+ \r
+ // patterns\r
+ bool createPatterns();\r
+ bool createDelta();\r
+ bool createConsumptionPattern(); // initialize a QList<char> for each interface from patterns defined in implementation\r
+ bool createProductionPattern(); // initialize a QList<char> for each interface from patterns defined in implementation\r
+ bool createProductionCounter(); // initialize a QList<int> from counter defined in implementation\r
+ void initConsumptionPattern(); // initialize a char** from patterns defined for each interface\r
+ void initProductionPattern(); // initialize a char** from patterns defined for each interface\r
+ void clearConsumptionPattern();\r
+ void clearProductionPattern();\r
+ bool computeOutputPattern(int nbExec = -1);\r
+ \r
private: \r
+ // patterns \r
+ bool isValidDataGroup(char** pattern, int nbPorts, int clock);\r
+ double evaluateExpression(const QString& expression, bool* ok);\r
+ QList<char> expandPattern(const QString& pattern, bool* ok);\r
+ QList<char> expandPatternRecur(const QString& pattern, int* offset, bool* ok);\r
+ /*!\r
+ * \brief combinePatterns\r
+ * \param patternSrc the pattern that must be combined with patternDest (patternDest = patternDest OR patternSrc) \r
+ * \param srcCol the column index within patternSrc\r
+ * \param patternDest the pattern that is modified by the combination (patternDest = patternDest OR patternSrc)\r
+ * \param destClock the column index within patternDest\r
+ * \param nbCols the numer of columns to combine\r
+ * \param nbPorts the number of rows in both patterns\r
+ * BEWARE: no check is done if nbCols is consistent with the real length of both patterns, thus an access outside\r
+ * the patterns is possible.\r
+ */\r
+ void combinePatterns(char** patternSrc, int srcCol, char** patternDest, int destCol, int nbCols, int nbPorts );\r
+\r
+ QList<int> productionCounter; //! only usefull for output interfaces\r
+ int delta;\r
+ \r
+ char** consumptionPattern;\r
+ int nbConsumingPorts;\r
+ int lengthCP;\r
+ char** productionPattern;\r
+ int nbProducingPorts;\r
+ int lengthPP;\r
+ ArithmeticEvaluator* evaluator;\r
+ \r
ReferenceBlock* reference;\r
+ BlockImplementation* implementation;\r
\r
};\r
\r