diff --git a/vunit/sim_if/nvc.py b/vunit/sim_if/nvc.py index 7f7168a53..3d11721f4 100644 --- a/vunit/sim_if/nvc.py +++ b/vunit/sim_if/nvc.py @@ -78,11 +78,14 @@ def __init__( # pylint: disable=too-many-arguments if gui and (not self.find_executable("gtkwave")): raise RuntimeError("Cannot find the gtkwave executable in the PATH environment variable. GUI not possible") + (major, minor) = self.determine_version(prefix) + if not (major >= 1 and minor >= 9): + raise RuntimeError(f"Minimum supported NVC version is 1.9 (have {major}.{minor})") + self._gui = gui self._gtkwave_args = gtkwave_args self._vhdl_standard = None self._coverage_test_dirs = set() - self._supports_jit = self.determine_version(prefix) >= 1.9 if self.use_color: environ["NVC_COLORS"] = "always" @@ -105,12 +108,12 @@ def determine_version(cls, prefix): """ Determine the NVC version """ - return float( - re.match( - r"nvc ([0-9]*\.[0-9]*).*\(.*\)", - cls._get_version_output(prefix), - ).group(1) - ) + raw = cls._get_version_output(prefix) + m = re.match(r"nvc ([0-9]+)\.([0-9]+).*", raw) + if not m: + raise RuntimeError("Cannot determine NVC version: " + raw) + + return (int(m.group(1)), int(m.group(2))) @classmethod def supports_vhpi(cls): @@ -261,8 +264,7 @@ def simulate(self, output_path, test_suite_name, config, elaborate_only): if not elaborate_only: cmd += ["--no-save"] - if self._supports_jit: - cmd += ["--jit"] + cmd += ["--jit"] cmd += ["-r"] cmd += config.sim_options.get("nvc.sim_flags", []) cmd += [f"--exit-severity={config.vhdl_assert_stop_level}"]