diff --git a/driver/main.c b/driver/main.c index b63f46616..93af52ac0 100644 --- a/driver/main.c +++ b/driver/main.c @@ -1035,6 +1035,7 @@ int main(int argc, char **argv) describes the system functions so that elaboration knows how to handle them. */ fprintf(iconfig_file, "sys_func:%s%csystem.sft\n", base, sep); + fprintf(iconfig_file, "sys_func:%s%cvhdl_sys.sft\n", base, sep); /* If verilog-2005/9 is enabled or icarus-misc or verilog-ams, * then include the v2005_math library. */ diff --git a/main.cc b/main.cc index cfec17b81..2c65eb46d 100644 --- a/main.cc +++ b/main.cc @@ -118,6 +118,22 @@ ivl_sfunc_as_task_t def_sfunc_as_task = IVL_SFUNC_AS_TASK_ERROR; map flags; char*vpi_module_list = 0; +void add_vpi_module(const char*name) +{ + if (vpi_module_list == 0) { + vpi_module_list = strdup(name); + + } else { + char*tmp = (char*)realloc(vpi_module_list, + strlen(vpi_module_list) + + strlen(name) + + 2); + strcat(tmp, ","); + strcat(tmp, name); + vpi_module_list = tmp; + } + flags["VPI_MODULE_LIST"] = vpi_module_list; +} map missing_modules; map library_file_map; @@ -615,19 +631,7 @@ static void read_iconfig_file(const char*ipath) library_file_map[path] = true; } else if (strcmp(buf,"module") == 0) { - if (vpi_module_list == 0) { - vpi_module_list = strdup(cp); - - } else { - char*tmp = (char*)realloc(vpi_module_list, - strlen(vpi_module_list) - + strlen(cp) - + 2); - strcat(tmp, ","); - strcat(tmp, cp); - vpi_module_list = tmp; - } - flags["VPI_MODULE_LIST"] = vpi_module_list; + add_vpi_module(cp); } else if (strcmp(buf, "out") == 0) { free((void *)flags["-o"]); @@ -779,8 +783,10 @@ int main(int argc, char*argv[]) library_suff.push_back(strdup(".v")); - vpi_module_list = strdup("system"); - flags["VPI_MODULE_LIST"] = vpi_module_list; + // Start the module list with the base system module. + add_vpi_module("system"); + add_vpi_module("vhdl_sys"); + flags["-o"] = strdup("a.out"); min_typ_max_flag = TYP; min_typ_max_warn = 10;