mirror of
				https://github.com/cclassic/model-ghdl
				synced 2025-11-04 02:49:33 +01:00 
			
		
		
		
	Allowed to manually set the compile dir
This commit is contained in:
		@@ -4,7 +4,7 @@
 | 
				
			|||||||
#include <stdio.h>
 | 
					#include <stdio.h>
 | 
				
			||||||
#include <vector>
 | 
					#include <vector>
 | 
				
			||||||
#include <fstream>
 | 
					#include <fstream>
 | 
				
			||||||
//#include <regex>
 | 
					#include <string.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// #define DEBUG_EN DEBUG_EN
 | 
					// #define DEBUG_EN DEBUG_EN
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -115,6 +115,9 @@ int main(int argc, char **argv)
 | 
				
			|||||||
            work = argv[i];
 | 
					            work = argv[i];
 | 
				
			||||||
            //++i;
 | 
					            //++i;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					        else if (GETOPT("-compiledir")) {
 | 
				
			||||||
 | 
					            strcpy(tempdir, argv[i]);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
        else if (ISOPT("-87")) {
 | 
					        else if (ISOPT("-87")) {
 | 
				
			||||||
            vhdlver = "--std=87";
 | 
					            vhdlver = "--std=87";
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -5,6 +5,7 @@
 | 
				
			|||||||
#include <stdlib.h>
 | 
					#include <stdlib.h>
 | 
				
			||||||
#include <vector>
 | 
					#include <vector>
 | 
				
			||||||
#include <fstream>
 | 
					#include <fstream>
 | 
				
			||||||
 | 
					#include <string.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// #define DEBUG_EN DEBUG_EN
 | 
					// #define DEBUG_EN DEBUG_EN
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -105,6 +106,9 @@ 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("-compiledir")) {
 | 
				
			||||||
 | 
					            strcpy(tempdir, argv[i]);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        else if (GETOPT("-ghdl")) {
 | 
					        else if (GETOPT("-ghdl")) {
 | 
				
			||||||
            ghdlargs = argv[i];
 | 
					            ghdlargs = argv[i];
 | 
				
			||||||
@@ -162,7 +166,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 " << 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)) {
 | 
					        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.\"");
 | 
				
			||||||
@@ -173,7 +177,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 + " " << 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;
 | 
					                    cerr << "Error: Simulation failed." << endl;
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                else {
 | 
					                else {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user