referenceMd5 = _referenceMd5;\r
}\r
\r
+void BlockImplementation::assignPatterns(FunctionalBlock *_block) throw(Exception) {\r
+ \r
+ block = _block;\r
+\r
+ QFile implFile(xmlFile);\r
+\r
+ // reading in into QDomDocument\r
+ QDomDocument document("implFile");\r
+\r
+ if (!implFile.open(QIODevice::ReadOnly)) {\r
+ throw(Exception(IMPLFILE_NOACCESS));\r
+ }\r
+ if (!document.setContent(&implFile)) {\r
+ implFile.close();\r
+ throw(Exception(IMPLFILE_NOACCESS));\r
+ }\r
+ implFile.close();\r
+ QDomElement impl = document.documentElement();\r
+ QDomNodeList patternNode = impl.elementsByTagName("patterns");\r
+ if (patternNode.isEmpty()) return;\r
+ QDomElement patternElt = patternNode.at(0).toElement();\r
+ \r
+}\r
+\r
void BlockImplementation::generateVHDL(FunctionalBlock* _block, const QString &path) throw(Exception) {\r
\r
block = _block;\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
+ \r
\r
private: \r
QString xmlFile;\r
case BLOCKFILE_NOACCESS : ret = tr("Block file cannot be read"); break;
case IMPLFILE_CORRUPTED : ret = tr("Implementation file is corrupted"); break;
case IMPLFILE_NOACCESS : ret = tr("Implementation file cannot be read"); break;
+ case IMPLFILE_NOPATTERN : ret = tr("Implementation file does not contains pattern definitions"); break;
case BLOCK_NULL : ret = tr("A parameter of type AbstractBlock* has been provided with NULL value."); break;
case BLOCK_INVALID_TYPE : ret = tr("A parameter of type AbstractBlock* is used with an incorrect instance type."); break;
case IFACE_NULL : ret = tr("A parameter of type AbstractInterface* has been provided with NULL value."); break;
#include <QtCore>
// exceptions for file accesses
-#define CONFIGFILE_NOACCESS 1
-#define CONFIGFILE_CORRUPTED 2
+#define CONFIGFILE_NOACCESS 101
+#define CONFIGFILE_CORRUPTED 102
-#define PROJECTFILE_NOACCESS 3
-#define PROJECTFILE_CORRUPTED 4
+#define PROJECTFILE_NOACCESS 201
+#define PROJECTFILE_CORRUPTED 202
-#define BLOCKPATH_NOACCESS 5
-#define IMPLPATH_NOACCESS 6
+#define BLOCKFILE_NOACCESS 301
+#define BLOCKFILE_CORRUPTED 302
-#define BLOCKFILE_NOACCESS 7
-#define BLOCKFILE_CORRUPTED 8
+#define IMPLFILE_NOACCESS 401
+#define IMPLFILE_CORRUPTED 402
+#define IMPLFILE_NOPATTERN 403
-#define IMPLFILE_NOACCESS 9
-#define IMPLFILE_CORRUPTED 10
+#define VHDLFILE_NOACCESS 501
-#define VHDLFILE_NOACCESS 11
+#define BLOCKPATH_NOACCESS 601
+
+#define IMPLPATH_NOACCESS 701
// exceptions for block manipulations
-#define BLOCK_NULL 100
-#define BLOCK_INVALID_TYPE 101
+#define BLOCK_NULL 1001
+#define BLOCK_INVALID_TYPE 1002
// exceptions for interfaces manipulations
-#define IFACE_NULL 200
-#define IFACE_INVALID_TYPE 201
-#define IFACE_MULTIPLICITY_REACHED 202
+#define IFACE_NULL 2001
+#define IFACE_INVALID_TYPE 2002
+#define IFACE_MULTIPLICITY_REACHED 2003
// exceptions for block items manipulations
-#define BLOCKITEM_NULL 300
-#define BLOCKITEM_INVALID_TYPE 301
+#define BLOCKITEM_NULL 3001
+#define BLOCKITEM_INVALID_TYPE 3002
// exceptions for width interfaces validation
-#define WIDTHS_NOT_EQUALS 400
+#define WIDTHS_NOT_EQUALS 4001
// exceptions for VHDL generation
-#define INVALID_VALUE 500
+#define INVALID_VALUE 5001
using namespace std;
using namespace Qt;
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
-<!-- Written by QtCreator 3.2.1, 2017-05-11T17:54:38. -->
+<!-- Written by QtCreator 3.2.1, 2017-05-11T21:36:51. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
- <value type="QByteArray">{1d077e47-e3a1-47fd-8b12-4de650e39df5}</value>
+ <value type="QByteArray">{c8006d66-d34f-42be-ad10-d0207752286d}</value>
</data>
<data>
<variable>ProjectExplorer.Project.ActiveTarget</variable>
<valuemap type="QVariantMap">
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop</value>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{451ee8a3-56ff-4aba-8a8e-3da882cc142e}</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{2c9bf876-3476-44eb-8065-1f0844704dda}</value>
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
<value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
- <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/localhome/sdomas/Projet/Blast/code/blast</value>
+ <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/sdomas/Projet/Blast/code/blast</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<valuelist type="QVariantList" key="GenericProjectManager.GenericMakeStep.BuildTargets">