From 935294ab4179f582d9b328cd82efc275ec0b551f Mon Sep 17 00:00:00 2001 From: Makise Kurisu Date: Sat, 31 Jan 2015 14:46:51 +0100 Subject: [PATCH] Allowed to manually set the compile dir --- vcom/main.cpp | 7 +++++-- vsim/main.cpp | 10 +++++++--- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/vcom/main.cpp b/vcom/main.cpp index 598ef68..db735ab 100644 --- a/vcom/main.cpp +++ b/vcom/main.cpp @@ -4,9 +4,9 @@ #include #include #include -//#include +#include -//#define DEBUG_EN DEBUG_EN +// #define DEBUG_EN DEBUG_EN /* @@ -115,6 +115,9 @@ int main(int argc, char **argv) work = argv[i]; //++i; } + else if (GETOPT("-compiledir")) { + strcpy(tempdir, argv[i]); + } else if (ISOPT("-87")) { vhdlver = "--std=87"; } diff --git a/vsim/main.cpp b/vsim/main.cpp index d30ab80..d61ad3d 100644 --- a/vsim/main.cpp +++ b/vsim/main.cpp @@ -5,8 +5,9 @@ #include #include #include +#include -//#define DEBUG_EN DEBUG_EN +// #define DEBUG_EN DEBUG_EN using namespace std; @@ -105,6 +106,9 @@ int main(int argc, char **argv) { for (i=1; i < argc; ++i) { if (ISOPT("-gui")) { + } + else if (GETOPT("-compiledir")) { + strcpy(tempdir, argv[i]); } else if (GETOPT("-ghdl")) { ghdlargs = argv[i]; @@ -162,7 +166,7 @@ int main(int argc, char **argv) { //bool ex = false; //while (!ex) { cout << "Compiling..." << endl; - string cargs = "cd " + string(tempdir) + "; ghdl -m --ieee=synopsys --warn-no-vital-generic " << ghdlargs <<" -fexplicit --workdir=" + string(tempdir) + " --work=" + work + " " + top; + string cargs = "cd " + string(tempdir) + "; ghdl -m --ieee=synopsys --warn-no-vital-generic " + ghdlargs + " -fexplicit --workdir=" + string(tempdir) + " --work=" + work + " " + top; if (run(cargs)) { cerr << "Error: Compilation failed." << endl; run("zenity --error --text \"Compilation failed.\""); @@ -173,7 +177,7 @@ int main(int argc, char **argv) { string st = getSimulationTime(); if (st != "") { cout << "Simulating..." << endl; - if (run("cd " + string(tempdir) + "; ./" + top + " " << wvargs << " --stop-time=" + st + " --vcd=" + top + ".vcd")) { + if (run("cd " + string(tempdir) + "; ./" + top + " " + wvargs + " --stop-time=" + st + " --vcd=" + top + ".vcd")) { cerr << "Error: Simulation failed." << endl; } else {