]> AND Private Git Repository - blast.git/blobdiff - AbstractBlock.h
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
added patterns and started OP computation
[blast.git] / AbstractBlock.h
index acdc1c8ab8771953a7c180b1d72656ed299b8a76..c8aa0235dd989cb85708eedaad66bbf5a5b9fd70 100644 (file)
@@ -18,7 +18,7 @@ using namespace Qt;
 class AbstractBlock {\r
 \r
 public:  \r
-\r
+      \r
   AbstractBlock();\r
   AbstractBlock(const QString& _name);\r
   virtual ~AbstractBlock();\r
@@ -35,14 +35,22 @@ public:
   QList<BlockParameter *> getPortParameters();\r
   QList<BlockParameter *> getWishboneParameters();\r
   inline AbstractBlock* getParent() { return parent; }\r
+  inline QList<int> getProductionCounter() { return productionCounter; }\r
+  inline int getDelta() { return delta; }\r
+  \r
   // setters\r
   void setName(const QString& str);\r
   virtual void setParent(AbstractBlock* _parent);\r
+  inline void setProductionCounter(QList<int> pattern) { productionCounter = pattern; }\r
+  inline void setDelta(int _delta) { delta = _delta; }\r
 \r
   // testers\r
   virtual bool isReferenceBlock();\r
   virtual bool isFunctionalBlock();\r
   virtual bool isGroupBlock();\r
+  virtual bool isSourceBlock(); //! a source block is outside the top group and simulates a peripheral (NB: this is also a generator)\r
+  virtual bool isTopGroupBlock();\r
+  bool isGeneratorBlock(); //! a generator block has no data inputs and thus executes infinitely\r
   bool isWBConfigurable();\r
 \r
   // others\r
@@ -54,10 +62,16 @@ public:
   void removeAllInterfaces();\r
   void defineBlockParam(BlockParameter *param);\r
 \r
-  QList<AbstractInterface *> getInterfaces();\r
+  QList<AbstractInterface *> getInterfaces(); //! return all interfaces\r
+  QList<AbstractInterface *> getDataInputs(); //! return all inputs of type data\r
+  QList<AbstractInterface *> getControlInputs(); //! return all inputs of type control\r
+  QList<AbstractInterface *> getControlOutputs(); //! return all outputs of type control\r
   AbstractInterface* getIfaceFromName(QString name);\r
   BlockParameter* getParameterFromName(QString name);\r
 \r
+  // patterns\r
+  virtual void computeOutputPattern(int nbExec = -1) = 0;\r
+  \r
 protected:\r
 \r
 \r
@@ -70,10 +84,14 @@ protected:
   QList<AbstractInterface*> inputs;\r
   QList<AbstractInterface*> outputs;\r
   QList<AbstractInterface*> bidirs;\r
-\r
+  \r
   // others\r
-\r
-  // NB: only GroupBlock and FunctionalBlock have a real parent\r
+  \r
+  // patterns\r
+  QList<int> productionCounter; //! only usefull for output interfaces\r
+  int delta;\r
+  \r
+  // NB: only GroupBlock and FunctionalBlock have a real parent, except sources that have no parents\r
   AbstractBlock* parent;\r
 };\r
 \r