X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/blast.git/blobdiff_plain/abbc64cf04a35ab3549d5c516f44c7c5921baa63..8f0bedf735fe2b306c11c3f4a168245a05e37ccd:/BlockImplementation.h diff --git a/BlockImplementation.h b/BlockImplementation.h index df0e499..72776e3 100644 --- a/BlockImplementation.h +++ b/BlockImplementation.h @@ -17,7 +17,6 @@ class ArithmeticEvaluator; #include "Exception.h" class Exception; - using namespace std; using namespace Qt; @@ -28,9 +27,25 @@ 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; } + + // testers + + inline bool hasNoPatterns() { return noPatterns; } + QString eval(QString line, QTextStream& out); QString evalComplex(QString line, int num); QString evalString(QString s); @@ -40,23 +55,26 @@ public: inline void setReference(ReferenceBlock* _reference) { reference = _reference; } - void generateVHDL(FunctionalBlock* _block, const QString& path) throw(Exception); // main entry to generate the VHDL code - + void loadPatterns(QDomElement &root) throw(Exception); + bool checkPatterns(); + + inline void addSource(QString file) { sources.append(file); } private: QString xmlFile; QString referenceXml; QString referenceMd5; - QString nameEnt, line; + + QList sources; + QMap paramMap; 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 + bool noPatterns; + 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