X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/blast.git/blobdiff_plain/8d3e09e430e829b9d847847334cbfe37790baca3..18fecf25efe710631fabecbb9f689c2997fdfe18:/BlockImplementation.h?ds=sidebyside diff --git a/BlockImplementation.h b/BlockImplementation.h index 852cc63..fb9c77c 100644 --- a/BlockImplementation.h +++ b/BlockImplementation.h @@ -28,9 +28,20 @@ public: BlockImplementation(const QString& _xmlFile); BlockImplementation(const QString& _xmlFile, const QString& _referenceXml, const QString& _referenceMd5); + // getters inline QString getXmlFile() { return xmlFile; } inline QString getReferenceXml() { return referenceXml; } inline QString getReferenceMd5() { return referenceMd5; } + inline QString getDelta() { return delta; } + inline QHash getConsumptionPattern() { return consumptionPattern; } + inline QHash getProductionPattern() { return productionPattern; } + inline QString getProductionCounter() { return productionCounter; } + // setters + inline void setDelta(QString _delta) { delta = _delta; } + inline void setConsumptionPattern(QHash pattern) { consumptionPattern = pattern; } + inline void setProductionPattern(QHash pattern) { productionPattern = pattern; } + inline void setProductionCounter(QString pattern) { productionCounter = pattern; } + QString eval(QString line, QTextStream& out); QString evalComplex(QString line, int num); QString evalString(QString s); @@ -40,8 +51,8 @@ public: inline void setReference(ReferenceBlock* _reference) { reference = _reference; } - void assignPatterns(FunctionalBlock* _block) throw(Exception); // called during output pattern computation - void generateVHDL(FunctionalBlock* _block, const QString& path) throw(Exception); // main entry to generate the VHDL code + void loadPatterns(QDomElement &root) throw(Exception); + bool checkPatterns(); private: @@ -53,12 +64,10 @@ private: ArithmeticEvaluator* evaluator; ReferenceBlock* reference; FunctionalBlock* block; // the current functional block for which this implementation is used. - - void generateComments(QDomElement &elt,QString coreFile, QTextStream& out) throw(Exception); // generates comments from element - void generateLibraries(QDomElement &elt, QTextStream& out) throw(Exception); // generates libraries from element - void generateEntity(QTextStream& out, bool hasController=false) throw(Exception); // generate the entity using reference - void generateArchitecture(QDomElement &elt, QTextStream& out) throw(Exception); // generate the architecture using element - void generateController(QTextStream& out) throw(Exception); // generate the wishbone controller of the block + QString delta; + QHash consumptionPattern; // key = reference interface name, value = pattern expression + QHash productionPattern; // key = reference interface name, value = pattern expression + QString productionCounter; QString getIfaceUserName(AbstractInterface* refIface); // get the name of an interface given by the user, from the reference interface