Support IVERILOG_VPI_MODULE_PATH environment variable

This commit is contained in:
Alex Forencich 2018-10-28 12:44:09 -07:00
parent a638d1eed0
commit a1ad6d4b51
2 changed files with 29 additions and 0 deletions

View File

@ -336,6 +336,28 @@ int main(int argc, char*argv[])
flag_errors += 1; flag_errors += 1;
} }
if (char *var = ::getenv("IVERILOG_VPI_MODULE_PATH")) {
char *ptr = var;
char *end = var+strlen(var);
int len = 0;
while (ptr <= end) {
if (*ptr == 0 || *ptr == ':' || *ptr == ';') {
if (len > 0) {
if (vpip_module_path_cnt >= VPIP_MODULE_PATH_MAX) {
fprintf(stderr, "Too many paths specified\n");
return -1;
}
vpip_module_path[vpip_module_path_cnt++] = strndup(var, len);
}
len = 0;
var = ptr+1;
} else {
len++;
}
ptr++;
}
}
#ifdef __MINGW32__ #ifdef __MINGW32__
/* Calculate the module path from the path to the command. /* Calculate the module path from the path to the command.
This is necessary because of the installation process on This is necessary because of the installation process on

View File

@ -166,6 +166,13 @@ select lxt format, which is far more compact, though limited to
GTKWave or compatible viewers. It can also be used to suppress VCD GTKWave or compatible viewers. It can also be used to suppress VCD
output, a time-saver for regression tests. output, a time-saver for regression tests.
.TP 8
.B IVERILOG_VPI_MODULE_PATH=\fI/some/path:/some/other/path\fP
This adds additional components to the VPI module search path. Paths
specified in this way are searched after paths specified with \-M, but
before the default search path. Multiple paths can be separated with
colons or semicolons.
.SH INTERACTIVE MODE .SH INTERACTIVE MODE
.PP .PP
The simulation engine supports an interactive mode. The user may The simulation engine supports an interactive mode. The user may