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

Private GIT Repository
started VHDL generation of GroupBlock
[blast.git] / Parameters.cpp
index c903f5d94be772d400ded37c64e1de0519b211b7..32bec53a4294bb1d377157de74cdf8a549862cb1 100644 (file)
@@ -949,45 +949,52 @@ void Parameters::loadSources() throw(Exception) {
     cout << "analyzing " << qPrintable(sourcePathes.at(i)) << endl;\r
     QDir dir(sourcePathes.at(i));\r
     QStringList filter;\r
     cout << "analyzing " << qPrintable(sourcePathes.at(i)) << endl;\r
     QDir dir(sourcePathes.at(i));\r
     QStringList filter;\r
-    filter << "*.vhd";\r
+    filter << "*.vhd" << "*.ngc";\r
     dir.setNameFilters(filter);\r
     QStringList list = dir.entryList();\r
     for(int j=0;j<list.size();j++) {\r
       QString fileName = dir.absolutePath();\r
       fileName.append("/"+list.at(j));\r
 \r
     dir.setNameFilters(filter);\r
     QStringList list = dir.entryList();\r
     for(int j=0;j<list.size();j++) {\r
       QString fileName = dir.absolutePath();\r
       fileName.append("/"+list.at(j));\r
 \r
-      cout << "parsing " << qPrintable(fileName) << " ... ";\r
-      QFile srcXML(fileName);\r
-      if (!srcXML.open(QIODevice::ReadOnly)) {\r
-        throw(Exception(IMPLFILE_NOACCESS));\r
+      if (list.at(j).endsWith(".ngc")) {\r
+        QString netName = list.at(j);\r
+        netName.truncate(list.at(j).size() -4);\r
+        cout << "found netlist " << qPrintable(netName) << endl;\r
+        availableSources.append(new ExternalSource(netName,fileName,ExternalSource::Netlist));\r
       }\r
       }\r
-      QTextStream in(&srcXML);\r
-\r
-      QString line = in.readLine();\r
-      while (!line.isNull()) {\r
-        if (line.contains("package", Qt::CaseInsensitive)) {\r
-          QRegularExpression rxPack("^package (.+) is$",QRegularExpression::CaseInsensitiveOption);\r
-          QRegularExpressionMatch matchPack = rxPack.match(line);\r
-          if (matchPack.hasMatch()) {\r
-            QString packName = matchPack.captured(1);\r
-            cout << "found package " << qPrintable(packName) << endl;\r
-            availableSources.append(new ExternalSource(packName,fileName,ExternalSource::Package));\r
-          }\r
+      else {\r
+        cout << "parsing " << qPrintable(fileName) << " ... ";\r
+        QFile srcXML(fileName);\r
+        if (!srcXML.open(QIODevice::ReadOnly)) {\r
+          throw(Exception(IMPLFILE_NOACCESS));\r
         }\r
         }\r
-        else if (line.contains("entity", Qt::CaseInsensitive)) {\r
-          QRegularExpression rxEnt("^entity (.+) is$",QRegularExpression::CaseInsensitiveOption);\r
-          QRegularExpressionMatch matchEnt = rxEnt.match(line);\r
-          if (matchEnt.hasMatch()) {\r
-            QString entityName = matchEnt.captured(1);\r
-            cout << "found entity " << qPrintable(entityName) << endl;\r
-            availableSources.append(new ExternalSource(entityName,fileName,ExternalSource::Code));\r
+        QTextStream in(&srcXML);\r
+\r
+        QString line = in.readLine();\r
+        while (!line.isNull()) {\r
+          if (line.contains("package", Qt::CaseInsensitive)) {\r
+            QRegularExpression rxPack("^package (.+) is$",QRegularExpression::CaseInsensitiveOption);\r
+            QRegularExpressionMatch matchPack = rxPack.match(line);\r
+            if (matchPack.hasMatch()) {\r
+              QString packName = matchPack.captured(1);\r
+              cout << "found package " << qPrintable(packName) << endl;\r
+              availableSources.append(new ExternalSource(packName,fileName,ExternalSource::Package));\r
+            }\r
           }\r
           }\r
+          else if (line.contains("entity", Qt::CaseInsensitive)) {\r
+            QRegularExpression rxEnt("^entity (.+) is$",QRegularExpression::CaseInsensitiveOption);\r
+            QRegularExpressionMatch matchEnt = rxEnt.match(line);\r
+            if (matchEnt.hasMatch()) {\r
+              QString entityName = matchEnt.captured(1);\r
+              cout << "found entity " << qPrintable(entityName) << endl;\r
+              availableSources.append(new ExternalSource(entityName,fileName,ExternalSource::Code));\r
+            }\r
+          }\r
+          line = in.readLine();\r
         }\r
         }\r
-        line = in.readLine();\r
+        srcXML.close();\r
+        cout << "OK" << endl;\r
       }\r
       }\r
-      srcXML.close();\r
-      cout << "OK" << endl;\r
-\r
     }\r
   }\r
 }\r
     }\r
   }\r
 }\r