+void MainWindow::slotGraphAnalysis() {
+ bool compat = true;
+ try {
+ params->getGraph()->computeOutputPatterns(1);
+ }
+ catch(Exception e) {
+ cerr << qPrintable(e.getMessage()) << endl;
+ compat = false;
+ if (e.getType() == IP_AP_NOTCOMPAT) {
+ FunctionalBlock* toBlock = (FunctionalBlock*)(e.getSource());
+ QString msg = tr("");
+ msg.append(toBlock->getName());
+ msg += " is not compatible with its input pattern.\nDo you want to launch automatic modification process to ensure the compatibility ?";
+ int ret = QMessageBox::question(this,tr("Building references library"),msg, QMessageBox::Ok | QMessageBox::Cancel, QMessageBox::Ok);
+ if (ret == QMessageBox::Ok) {
+ dispatcher->findGraphModifications(toBlock);
+ }
+ }
+ }
+}
+
+void MainWindow::slotGenerateVHDL() {
+
+ QDir baseDir(params->projectPath);
+ if (!baseDir.exists()) {
+ cerr << "Project path " << qPrintable(params->projectPath) << " no longer exists. First, recreate it and put the project file within. Then retry to generate." << endl;
+ return;
+ }
+ if (! baseDir.exists("src")) {
+ baseDir.mkdir("src");
+ }
+ if (! baseDir.exists("testbench")) {
+ baseDir.mkdir("testbench");
+ }
+ if (! baseDir.exists("Makefile")) {
+ QFile make("/home/sdomas/Projet/Blast/code/blast/Makefile-isim");
+ QString dest = params->projectPath;
+ dest += "/Makefile";
+ make.copy(dest);
+ }
+
+ QString dest = params->projectPath;
+ dest += "/src/";
+ try {
+ params->getGraph()->generateVHDL(dest);
+ }
+ catch(Exception e) {
+ cerr << qPrintable(e.getMessage()) << endl;
+ }