1
0
mirror of https://github.com/cclassic/model-ghdl synced 2024-11-29 09:13:28 +01:00

Added custom options to vsim (-ghdl and -gtkwave)

This commit is contained in:
Makise Kurisu 2015-01-23 19:57:05 +01:00
parent 389534dd6a
commit e09ebc825f

View File

@ -92,6 +92,8 @@ int main(int argc, char **argv) {
string top = ""; string top = "";
string work = ""; string work = "";
string simtime = ""; string simtime = "";
string ghdlargs = "";
string wvargs = "";
int i; int i;
char tempdir[256] = ""; // Compile dir char tempdir[256] = ""; // Compile dir
@ -103,6 +105,12 @@ int main(int argc, char **argv) {
for (i=1; i < argc; ++i) { for (i=1; i < argc; ++i) {
if (ISOPT("-gui")) { if (ISOPT("-gui")) {
}
else if (GETOPT("-ghdl")) {
ghdlargs = argv[i];
}
else if (GETOPT("-gtkwave")) {
wvargs = argv[i];
} }
else { else {
if (argv[i][0] == '-') { if (argv[i][0] == '-') {
@ -154,7 +162,7 @@ int main(int argc, char **argv) {
//bool ex = false; //bool ex = false;
//while (!ex) { //while (!ex) {
cout << "Compiling..." << endl; cout << "Compiling..." << endl;
string cargs = "cd " + string(tempdir) + "; ghdl -m --ieee=synopsys --warn-no-vital-generic -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)) { if (run(cargs)) {
cerr << "Error: Compilation failed." << endl; cerr << "Error: Compilation failed." << endl;
run("zenity --error --text \"Compilation failed.\""); run("zenity --error --text \"Compilation failed.\"");
@ -165,7 +173,7 @@ int main(int argc, char **argv) {
string st = getSimulationTime(); string st = getSimulationTime();
if (st != "") { if (st != "") {
cout << "Simulating..." << endl; cout << "Simulating..." << endl;
if (run("cd " + string(tempdir) + "; ./" + top + " --stop-time=" + st + " --vcd=" + top + ".vcd")) { if (run("cd " + string(tempdir) + "; ./" + top + " " << wvargs << " --stop-time=" + st + " --vcd=" + top + ".vcd")) {
cerr << "Error: Simulation failed." << endl; cerr << "Error: Simulation failed." << endl;
} }
else { else {