From 673b0d3066115b8a1d2f400dbcdcd72c90776863 Mon Sep 17 00:00:00 2001 From: Martin Whitaker Date: Fri, 25 Mar 2022 21:54:53 +0000 Subject: [PATCH] vvp: Only support one path separator in IVERILOG_VPI_MODULE_PATH (issue #608) Previously both ':' and ';' were recognised as path separators on all platforms, but ':' can't be used in Windows. So now we only recognise ';' when running in Windows and ':' when running in any other OS. --- vvp/vpi_modules.cc | 8 +++++++- vvp/vvp.man.in | 6 +++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/vvp/vpi_modules.cc b/vvp/vpi_modules.cc index 9d3fb470a..6c96ad7d3 100644 --- a/vvp/vpi_modules.cc +++ b/vvp/vpi_modules.cc @@ -64,12 +64,18 @@ void vpip_add_env_and_default_module_paths() if (disable_default_paths) return; +#ifdef __MINGW32__ + const char path_sep = ';'; +#else + const char path_sep = ':'; +#endif + 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 (*ptr == 0 || *ptr == path_sep) { if (len > 0) { vpip_add_module_path(strndup(var, len)); } diff --git a/vvp/vvp.man.in b/vvp/vvp.man.in index add5faf4e..4c3be7e88 100644 --- a/vvp/vvp.man.in +++ b/vvp/vvp.man.in @@ -1,4 +1,4 @@ -.TH vvp 1 "May 10th, 2015" "" "Version %M.%n %E" +.TH vvp 1 "March 25th, 2022" "" "Version %M.%n %E" .SH NAME vvp - Icarus Verilog vvp runtime engine @@ -171,7 +171,7 @@ output, a time-saver for regression tests. 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. +colons (semicolons if using Windows). .SH INTERACTIVE MODE .PP @@ -196,7 +196,7 @@ iverilog\-vpi(1), .SH COPYRIGHT .nf -Copyright \(co 2001\-2015 Stephen Williams +Copyright \(co 2001\-2022 Stephen Williams This document can be freely redistributed according to the terms of the GNU General Public License version 2.0