library->updateComboScene();
params->isCurrentProject = true;
enableProjectActions(true, PROJECT_CLOSE | PROJECT_SAVE | PROJECT_SAVEAS | PROJECT_LIB, OP_RAZ);
- enableAnalysisActions(true, ANALYSIS_ANALYZE, OP_RAZ);
+ enableAnalysisActions(true, ANALYSIS_ANALYZE | ANALYSIS_GENERATE, OP_RAZ);
}
else {
QMessageBox msgBox;
}
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(params->projectPath);
+ params->getGraph()->generateVHDL(dest);
}
catch(Exception e) {
cerr << qPrintable(e.getMessage()) << endl;