1 #ifndef __GROUPBLOCK_H__
2 #define __GROUPBLOCK_H__
8 #include "AbstractBlock.h"
10 #include "Exception.h"
17 class GroupBlock : public AbstractBlock {
20 GroupBlock(GroupBlock* _parent, bool createIfaces = true) throw(Exception);
21 virtual ~GroupBlock();
24 inline QList<AbstractBlock*> getBlocks() { return blocks; }
26 void setParent(AbstractBlock *_parent);
30 bool isTopGroupBlock();
31 inline bool isTop() { return topGroup; }
34 inline void addBlock(AbstractBlock* block) { blocks.append(block); }
35 void removeBlock(AbstractBlock* block);
36 AbstractBlock* getFunctionalBlockByName(QString name);
38 void removeAllBlocks();
39 void parametersValidation(QList<AbstractBlock *> *checkedBlocks, QList<AbstractBlock*>* blocksToConfigure);
40 void addGenericParameter(QString name, QString type, QString value);
41 void removeGenericParameter(QString name);
45 void checkInputPatternCompatibility() throw(Exception);
46 void computeOutputPattern(int nbExec = -1) throw(Exception);
47 void computeAdmittanceDelays() throw(Exception);
49 QList<QString> getExternalResources();
50 void generateVHDL(const QString& path) throw(Exception); // main entry to generate the VHDL code
54 /* NB: in opposition to FunctionalBlock, the input pattern and output pattern of a block
55 is not computed but just deduced from the output pattern of functional interfaces that
56 are connected to some block interfaces. Thus, there is no need to have an outputPattern QMap linking
57 interfaces and patterns as in FunctionalBlock.
58 Thus, the output patterns are directly set/retrieved from interfaces.
62 * \brief createInputPattern
63 * Since input GroupInterface are just tunnels to input interfaces of inner blocks, they must
64 * have an output pattern that can be provided to inner interfaces. That outpu pattern is just
65 * found by taking the output pattern of the connectedFrom interface.
67 void createInputPattern();
69 void generateComments(QTextStream& out, QDomElement &elt, QString coreFile) throw(Exception); // generates comments from <comments> element
70 void generateLibraries(QTextStream& out, QDomElement &elt) throw(Exception); // generates libraries from <libraries> element
71 void generateArchitecture(QTextStream& out, QDomElement &elt ) throw(Exception); // generate the architecture using <architecture> element
72 void generateController(QTextStream& out) throw(Exception); // generate the wishbone controller of the block
73 void generateEntityOrComponentBody(QTextStream& out, int indentLevel, bool hasController=false) throw(Exception); // generate the entity/compo body using reference
75 QList<AbstractBlock*> blocks; // contains instances of FunctionalBlock or GroupBlock that are children of this group
79 #endif // __GROUPBLOCK_H__