mirror of
https://github.com/cclassic/model-ghdl
synced 2024-11-29 09:13:28 +01:00
Added tempdir caching for vsim
This commit is contained in:
parent
70d7449f30
commit
708b7c5e1d
@ -3,6 +3,7 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include <fstream>
|
||||||
//#include <regex>
|
//#include <regex>
|
||||||
|
|
||||||
//#define DEBUG_EN DEBUG_EN
|
//#define DEBUG_EN DEBUG_EN
|
||||||
@ -149,6 +150,13 @@ int main(int argc, char **argv)
|
|||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Write temp path to /tmp
|
||||||
|
ofstream myfile;
|
||||||
|
myfile.open ("/tmp/workdir-ghdl");
|
||||||
|
myfile << tempdir;
|
||||||
|
myfile.flush();
|
||||||
|
myfile.close();
|
||||||
|
|
||||||
string cargs = "ghdl -i --ieee=synopsys --warn-no-vital-generic --workdir=" + string(tempdir) + " --work=" + work + " " + vhdl + " 2>&1";
|
string cargs = "ghdl -i --ieee=synopsys --warn-no-vital-generic --workdir=" + string(tempdir) + " --work=" + work + " " + vhdl + " 2>&1";
|
||||||
string sargs = "ghdl -s --ieee=synopsys --warn-no-vital-generic --workdir=" + string(tempdir) + " --work=" + work + " " + vhdl + " 2>&1";
|
string sargs = "ghdl -s --ieee=synopsys --warn-no-vital-generic --workdir=" + string(tempdir) + " --work=" + work + " " + vhdl + " 2>&1";
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include <fstream>
|
||||||
|
|
||||||
#define DEBUG_EN DEBUG_EN
|
#define DEBUG_EN DEBUG_EN
|
||||||
|
|
||||||
@ -43,10 +44,10 @@ int main(int argc, char **argv) {
|
|||||||
int i;
|
int i;
|
||||||
char tempdir[256] = ""; // Compile dir
|
char tempdir[256] = ""; // Compile dir
|
||||||
|
|
||||||
if (!getcwd(tempdir, sizeof(tempdir))) {
|
ifstream myfile;
|
||||||
cerr << "Error getting current working dir!" << endl;
|
myfile.open ("/tmp/workdir-ghdl");
|
||||||
return 1;
|
myfile.getline(tempdir, sizeof(tempdir));
|
||||||
}
|
myfile.close();
|
||||||
|
|
||||||
for (i=1; i < argc; ++i) {
|
for (i=1; i < argc; ++i) {
|
||||||
if (ISOPT("-gui")) {
|
if (ISOPT("-gui")) {
|
||||||
@ -99,6 +100,7 @@ int main(int argc, char **argv) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
string cargs = "ghdl -m --ieee=synopsys --warn-no-vital-generic --workdir=" + string(tempdir) + " --work=" + work + " " + top;
|
string cargs = "ghdl -m --ieee=synopsys --warn-no-vital-generic --workdir=" + string(tempdir) + " --work=" + work + " " + top;
|
||||||
|
|
||||||
if (!run(cargs)) {
|
if (!run(cargs)) {
|
||||||
cerr << "Error: Compilation failed." << endl;
|
cerr << "Error: Compilation failed." << endl;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user