11 class FunctionalBlock;
12 class AbstractInterface;
13 #include "Exception.h"
26 inline GroupBlock* getTopGroup() { return topGroup; }
27 inline QList<GroupBlock*> getAllGroups() { return groups; }
28 inline double getClock(int id) { return clocks.at(id); }
29 inline QList<double>& getClocks() { return clocks; }
32 inline void resetClocks() { clocks.clear(); }
34 // methods for group blocks
35 GroupBlock* createChildGroupBlock(GroupBlock* parent, bool createGroupIface = true);
36 void removeGroupBlock(GroupBlock *group);
37 GroupBlock* getGroupBlockByName(QString name);
39 // methods for functional blocks
40 FunctionalBlock* createFunctionalBlock(GroupBlock *group, ReferenceBlock *ref, bool createIfaces = true);
41 FunctionalBlock* duplicateFunctionalBlock(FunctionalBlock *block);
42 bool removeFunctionalBlock(FunctionalBlock* block);
43 FunctionalBlock* getFunctionalBlockByName(QString name, GroupBlock* parent = NULL); //! if parent = NULL, search in the whole graph
45 // methods for stimulis blocks
46 FunctionalBlock* createStimuliBlock(ReferenceBlock *ref, bool createIfaces = true);
47 FunctionalBlock* duplicateStimuliBlock(FunctionalBlock *block);
48 FunctionalBlock* getStimuliBlockByName(QString name);
49 bool removeStimuliBlock(FunctionalBlock* block);
52 void createTopGroup(bool createTopGroupIfaces = true);
53 inline void addClock(double freq) { clocks.append(freq); }
54 QList<AbstractInterface *> getOutsideInterfaces();
55 QList<QString> getExternalResources(); // returns the list of all external files needed for VHDL generation
58 * \brief createPatterns
59 * createPatterns() crosses the graph and for each functional block, it computes
60 * the consumptionPattern, the productionPattern, the production counter and delta
61 * using the parameters fo the block.
63 void createPatterns() throw(Exception);
64 void resetPatternComputed();
65 void computeOutputPatterns(int nbExec) throw(Exception);
67 void generateVHDL(const QString& path) throw(Exception);
68 void generateTestbench(const QString& projectName, const QString& benchFile) throw(Exception);
72 QList<GroupBlock *> groups; //! usefull to avoid recursive methods to find a particular group.
73 QList<FunctionalBlock*> stimulis; //! source for the top group
74 QList<double> clocks; // clocks[0] is the main clock.