1 #ifndef __FUNCTIONALBLOCK_H__
\r
2 #define __FUNCTIONALBLOCK_H__
\r
8 #include "AbstractBlock.h"
\r
10 class ReferenceBlock;
\r
12 #include "Exception.h"
\r
16 using namespace std;
\r
20 - NEVER forget to call populate() after creating an instance of GraphBlock.
\r
23 class FunctionalBlock : public AbstractBlock {
\r
26 FunctionalBlock(GroupBlock* _parent, ReferenceBlock* _reference) throw(Exception);
\r
29 inline ReferenceBlock* getReference() { return reference; }
\r
34 bool isFunctionalBlock();
\r
35 bool isSourceBlock(); //! a source block has no parent and has no data inputs
\r
39 void populate(); // create parameters and interface from reference block
\r
40 void parametersValidation(QList<AbstractBlock *> *checkedBlocks, QList<AbstractBlock*>* blocksToConfigure);
\r
42 QString getReferenceXmlFile();
\r
43 QString getReferenceHashMd5();
\r
46 void initConsumptionPattern(); // initialize a char** from patterns defined for each interface
\r
47 void initProductionPattern(); // initialize a char** from patterns defined for each interface
\r
48 void clearConsumptionPattern();
\r
49 void clearProductionPattern();
\r
53 void computeOutputPattern(int nbExec = -1);
\r
54 bool isValidDataGroup(char** pattern, int nbPorts, int clock);
\r
56 * \brief combinePatterns
\r
57 * \param patternSrc the pattern that must be combined with patternDest (patternDest = patternDest OR patternSrc)
\r
58 * \param srcCol the column index within patternSrc
\r
59 * \param patternDest the pattern that is modified by the combination (patternDest = patternDest OR patternSrc)
\r
60 * \param destClock the column index within patternDest
\r
61 * \param nbCols the numer of columns to combine
\r
62 * \param nbPorts the number of rows in both patterns
\r
63 * BEWARE: no check is done if nbCols is consistent with the real length of both patterns, thus an access outside
\r
64 * the patterns is possible.
\r
66 void combinePatterns(char** patternSrc, int srcCol, char** patternDest, int destCol, int nbCols, int nbPorts );
\r
68 char** consumptionPattern;
\r
69 int nbConsumingPorts;
\r
71 char** productionPattern;
\r
72 int nbProducingPorts;
\r
75 ReferenceBlock* reference;
\r
79 #endif // __FUNCTIONALBLOCK_H__
\r