class ReferenceBlock;
class FunctionalBlock;
class AbstractInterface;
-
+#include "Exception.h"
+class Exception;
using namespace std;
using namespace Qt;
class Graph {
public:
- Graph();
+ Graph(bool createTopGroupIface = true);
~Graph();
- QList<AbstractInterface *> getOutsideInterfaces();
+ // getters
inline GroupBlock* getTopGroup() { return topGroup; }
+ inline QList<GroupBlock*> getAllGroups() { return groups; }
+
+ // methods for group blocks
+ GroupBlock* createChildGroupBlock(GroupBlock* parent, bool createGroupIface = true);
+ void removeGroupBlock(GroupBlock *group);
+ GroupBlock* getGroupBlockByName(QString name);
+
+ // methods for functional blocks
+ FunctionalBlock* createFunctionalBlock(GroupBlock *group, ReferenceBlock *ref, bool createIfaces = true);
+ FunctionalBlock* duplicateFunctionalBlock(FunctionalBlock *block);
+ bool removeFunctionalBlock(FunctionalBlock* block);
+ FunctionalBlock* getFunctionalBlockByName(QString name, GroupBlock* parent = NULL); //! if parent = NULL, search in the whole graph
+
+ // methods for stimulis blocks
+ FunctionalBlock* createStimuliBlock(ReferenceBlock *ref, bool createIfaces = true);
+ FunctionalBlock* duplicateStimuliBlock(FunctionalBlock *block);
+ FunctionalBlock* getStimuliBlockByName(QString name);
+ bool removeStimuliBlock(FunctionalBlock* block);
+
+ // others
+ QList<AbstractInterface *> getOutsideInterfaces();
+ QList<QString> getExternalResources(); // returns the list of all external files needed for VHDL generation
- GroupBlock* createChildBlock(GroupBlock* parent);
- FunctionalBlock* addFunctionalBlock(GroupBlock *group, ReferenceBlock *ref);
- bool removeFunctionalBlock(FunctionalBlock* block, GroupBlock *group);
- bool removeGroupBlock(GroupBlock *group);
+ /*!
+ * \brief createPatterns
+ * createPatterns() crosses the graph and for each functional block, it computes
+ * the consumptionPattern, the productionPattern, the production counter and delta
+ * using the parameters fo the block.
+ */
+ void createPatterns() throw(Exception);
+ void resetPatternComputed();
+ void computeOutputPatterns(int nbExec) throw(Exception);
+
+ void generateVHDL(const QString& path) throw(Exception);
private:
GroupBlock* topGroup;
+ QList<GroupBlock *> groups; //! usefull to avoid recursive methods to find a particular group.
+ QList<FunctionalBlock*> stimulis; //! source for the top group
};