#include "Exception.h"\r
class Exception;\r
\r
-\r
using namespace std;\r
using namespace Qt;\r
\r
BlockImplementation(const QString& _xmlFile);\r
BlockImplementation(const QString& _xmlFile, const QString& _referenceXml, const QString& _referenceMd5);\r
\r
+ // getters \r
inline QString getXmlFile() { return xmlFile; }\r
inline QString getReferenceXml() { return referenceXml; }\r
inline QString getReferenceMd5() { return referenceMd5; }\r
+ inline QString getDelta() { return delta; }\r
+ inline QHash<QString,QString> getConsumptionPattern() { return consumptionPattern; }\r
+ inline QHash<QString,QString> getProductionPattern() { return productionPattern; }\r
+ inline QString getProductionCounter() { return productionCounter; }\r
+\r
+ // setters\r
+ inline void setDelta(QString _delta) { delta = _delta; }\r
+ inline void setConsumptionPattern(QHash<QString,QString> pattern) { consumptionPattern = pattern; }\r
+ inline void setProductionPattern(QHash<QString,QString> pattern) { productionPattern = pattern; }\r
+ inline void setProductionCounter(QString pattern) { productionCounter = pattern; }\r
+ \r
+ // testers\r
+\r
+ inline bool hasNoPatterns() { return noPatterns; }\r
+\r
QString eval(QString line, QTextStream& out);\r
QString evalComplex(QString line, int num);\r
QString evalString(QString s);\r
\r
inline void setReference(ReferenceBlock* _reference) { reference = _reference; }\r
\r
- void assignPatterns(FunctionalBlock* _block) throw(Exception); // called during output pattern computation\r
- void generateVHDL(FunctionalBlock* _block, const QString& path) throw(Exception); // main entry to generate the VHDL code\r
+ void loadPatterns(QDomElement &root) throw(Exception);\r
+ bool checkPatterns(); \r
\r
-\r
+ inline void addSource(QString file) { sources.append(file); }\r
private: \r
QString xmlFile;\r
QString referenceXml;\r
QString referenceMd5;\r
- QString nameEnt, line;\r
+\r
+ QList<QString> sources;\r
+\r
QMap<QString, int> paramMap;\r
ArithmeticEvaluator* evaluator;\r
ReferenceBlock* reference;\r
FunctionalBlock* block; // the current functional block for which this implementation is used.\r
-\r
- void generateComments(QDomElement &elt,QString coreFile, QTextStream& out) throw(Exception); // generates comments from <comments> element\r
- void generateLibraries(QDomElement &elt, QTextStream& out) throw(Exception); // generates libraries from <libraries> element\r
- void generateEntity(QTextStream& out, bool hasController=false) throw(Exception); // generate the entity using reference\r
- void generateArchitecture(QDomElement &elt, QTextStream& out) throw(Exception); // generate the architecture using <architecture> element\r
- void generateController(QTextStream& out) throw(Exception); // generate the wishbone controller of the block\r
+ bool noPatterns;\r
+ QString delta;\r
+ QHash<QString,QString> consumptionPattern; // key = reference interface name, value = pattern expression\r
+ QHash<QString,QString> productionPattern; // key = reference interface name, value = pattern expression\r
+ QString productionCounter;\r
\r
QString getIfaceUserName(AbstractInterface* refIface); // get the name of an interface given by the user, from the reference interface\r
\r