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

Added support for newer VHDL versions

This commit is contained in:
Makise Kurisu 2016-05-08 14:56:00 +02:00
parent 23a642820e
commit ea2dffbb6d

7
main.c
View File

@ -217,6 +217,7 @@ int vsim(int argc, char **argv)
char sourcedir[1 K];
char *params = NULL;
char *simtime = NULL;
char vhdlver[16] = "";
FILE *fp;
@ -242,6 +243,8 @@ int vsim(int argc, char **argv)
fp = fopen("/tmp/model-ghdl-vcom","r");
if (fp) {
fgets(workdir, sizeof(workdir), fp);
workdir[strlen(workdir)-1] = 0;
fgets(vhdlver, sizeof(vhdlver), fp);
fclose(fp);
}
else {
@ -291,7 +294,7 @@ int vsim(int argc, char **argv)
}
printf("[I] Compiling...\n");
if (run_ghdl("ghdl -m --work=%s --workdir=\"%s\" %s %s", work, workdir, params, toplevel)) {
if (run_ghdl("ghdl -m %s --work=%s --workdir=\"%s\" %s %s", vhdlver, work, workdir, params, toplevel)) {
fprintf(stderr, "[E] Compilation failed!");
showMessage(MESSAGE_ERROR, "Error! Compilation failed.", NULL, NULL);
}
@ -395,7 +398,7 @@ int vcom(int argc, char **argv)
// Info for vsim later on
fp = fopen("/tmp/model-ghdl-vcom","w");
if (fp) {
fprintf(fp, "%s", workdir);
fprintf(fp, "%s\n%s", workdir, vhdlver);
fclose(fp);
}
else {