internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: cocotb/cocotb

Issue:
Test result message prints incorrectly
All messages in regression module use the test's `__qualname__` for the test name except the test result message, i.e. "Test passed/failed". In special cases, the missing `__qualname__` makes the test name print incorrectly.
Example from pyuvm development version:

```
#      0.00ns INFO     cocotb.regression                  running AluTest (1/4)
# 251000.00ns INFO     cocotb.regression                  test.<locals>.decorator.<locals>.test passed
```

With `__qualname__`:

```
#      0.00ns INFO     cocotb.regression                  running AluTest (1/4)
# 251000.00ns INFO     cocotb.regression                  AluTest passed
```
Test result message prints incorrectly
All messages in regression module use the test's `__qualname__` for the test name except the test result message, i.e. "Test passed/failed". In special cases, the missing `__qualname__` makes the test name print incorrectly.
Example from pyuvm development version:

```
#      0.00ns INFO     cocotb.regression                  running AluTest (1/4)
# 251000.00ns INFO     cocotb.regression                  test.<locals>.decorator.<locals>.test passed
```

With `__qualname__`:

```
#      0.00ns INFO     cocotb.regression                  running AluTest (1/4)
# 251000.00ns INFO     cocotb.regression                  AluTest passed
```


Discussion:

Resolving patch:
diff --git a/cocotb/regression.py b/cocotb/regression.py
--- a/cocotb/regression.py
+++ b/cocotb/regression.py
@@ -455,7 +455,9 @@ def _log_test_passed(
             result_was = ""
         else:
             result_was = f" (result was {type(result).__qualname__})"
-        self.log.info(f"{test} {start_hilight}passed{stop_hilight}{rest}{result_was}")
+        self.log.info(
+            f"{test.__qualname__} {start_hilight}passed{stop_hilight}{rest}{result_was}"
+        )
 
     def _log_test_failed(
         self, test: Test, result: Optional[Exception] = None, msg: Optional[str] = None
@@ -467,7 +469,8 @@ def _log_test_failed(
         else:
             rest = f": {msg}"
         self.log.info(
-            f"{test} {start_hilight}failed{stop_hilight}{rest}", exc_info=result
+            f"{test.__qualname__} {start_hilight}failed{stop_hilight}{rest}",
+            exc_info=result,
         )
 
     def _record_result(


Test patch:
Repository: cocotb/cocotb

Issue:
CI: Test building of the sdist
We currently produce a sdist, but don't test if it actually builds. The dev tests are installed directly from source, and the release tests are installed from wheels.

We probably don't want a full testing on the sdists, but a simple build test should be added to ensure #3071 doesn't repeat.


Discussion:

Resolving patch:
diff --git a/noxfile.py b/noxfile.py
--- a/noxfile.py
+++ b/noxfile.py
@@ -2,6 +2,7 @@
 # Licensed under the Revised BSD License, see LICENSE for details.
 # SPDX-License-Identifier: BSD-3-Clause
 import glob
+import shutil
 import sys
 from contextlib import suppress
 from pathlib import Path
@@ -270,6 +271,7 @@ def dev_coverage_report(session: nox.Session) -> None:
 #
 # Release pipeline.
 #
+# - Clean out the dist directory.
 # - Build wheels (release builds).
 # - Install cocotb from wheel.
 # - Run tests against cocotb installed from the wheel.
@@ -281,6 +283,12 @@ def dev_coverage_report(session: nox.Session) -> None:
 dist_dir = "dist"
 
 
+@nox.session
+def release_clean(session: nox.Session) -> None:
+    """Remove all build artifacts from the dist directory."""
+    shutil.rmtree(dist_dir, ignore_errors=True)
+
+
 @nox.session
 def release_build(session: nox.Session) -> None:
     """Build a release (sdist and bdist)."""
@@ -332,6 +340,36 @@ def release_build_sdist(session: nox.Session) -> None:
     session.log(f"Source distribution in release mode built into {dist_dir!r}")
 
 
+@nox.session
+def release_test_sdist(session: nox.Session) -> None:
+    """Build and install the sdist."""
+
+    # Find the sdist to install.
+    sdists = list(Path(dist_dir).glob("cocotb-*.tar.gz"))
+    if len(sdists) == 0:
+        session.error(
+            f"No *.tar.gz sdist file found in {dist_dir!r} "
+            f"Run the 'release_build' session first."
+        )
+    if len(sdists) > 1:
+        session.error(
+            f"More than one potential sdist found in the {dist_dir!r} "
+            f"directory. Run the 'release_clean' session first!"
+        )
+    sdist_path = sdists[0]
+    assert sdist_path.is_file()
+
+    session.log("Installing cocotb from sdist, which includes the build step")
+    session.run(
+        "pip",
+        "install",
+        str(sdist_path),
+    )
+
+    session.log("Running cocotb-config as basic installation smoke test")
+    session.run("cocotb-config", "--version")
+
+
 def release_install(session: nox.Session) -> None:
     """Helper: Install cocotb from wheels and also install test dependencies."""
 


Test patch:
Repository: cocotb/cocotb

Issue:
CI fail "ValueError: Ghdl: Simulator does not support Verilog"
We get a GHDL failure in the release CI pipeline on master:

Log: https://github.com/cocotb/cocotb/actions/runs/3816250240/jobs/6491822293

```
nox > Running simulator-specific tests against a simulator SIM=ghdl, HDL_TOPLEVEL_LANG=vhdl, TOPLEVEL_LANG=vhdl, VHDL_GPI_INTERFACE=vpi
nox > pytest -v -k simulator_required
============================= test session starts ==============================
platform linux -- Python 3.8.15, pytest-7.2.0, pluggy-1.0.0 -- /home/runner/work/cocotb/cocotb/.nox/release_test_sim-sim-ghdl-toplevel_lang-vhdl-gpi_interface-vpi/bin/python
cachedir: .pytest_cache
rootdir: /home/runner/work/cocotb/cocotb, configfile: setup.cfg, testpaths: tests/pytest, examples/simple_dff
collecting ... collected 109 items / 100 deselected / 9 selected

tests/pytest/test_cocotb.py::test_cocotb FAILED                          [ 11%]
tests/pytest/test_parallel_cocotb.py::test_cocotb_parallel_compile FAILED [ 22%]
tests/pytest/test_parallel_cocotb.py::test_cocotb_parallel[0] FAILED     [ 33%]
tests/pytest/test_parallel_cocotb.py::test_cocotb_parallel[1] FAILED     [ 44%]
tests/pytest/test_parallel_cocotb.py::test_cocotb_parallel[2] FAILED     [ 55%]
tests/pytest/test_parallel_cocotb.py::test_cocotb_parallel[3] FAILED     [ 66%]
tests/pytest/test_runner.py::test_runner[parameters0] FAILED             [ 77%]
tests/pytest/test_runner.py::test_runner[parameters1] FAILED             [ 88%]
examples/simple_dff/test_dff.py::test_simple_dff_runner FAILED           [100%]
```

Looks like somehow the chosen toplevel language doesn't make it to the runner.


Discussion:
It looks like it may be a missing `env=env` argument to the `session.run()` call for the pytest tests.

Resolving patch:
diff --git a/noxfile.py b/noxfile.py
--- a/noxfile.py
+++ b/noxfile.py
@@ -465,6 +465,7 @@ def release_test_sim(
         "-v",
         "-k",
         "simulator_required",
+        env=env,
     )
 
     session.log(f"All tests passed with configuration {config_str}!")


Test patch:
Repository: cocotb/cocotb

Issue:
Bug in regression manager `_trim` function on empty docstrings
When the docstring is empty (i.e. `""""""`) the index in the following line causes an `IndexError`.

https://github.com/cocotb/cocotb/blob/3aa6777dd3d0ff221e6f6b4de70051fe20a7e414/cocotb/regression.py#L912



Discussion:
Looks like the change from
```py3
if not docstring:
  return ''
```
to
```py3
if docstring is None:
  return ""
```
missed the case for an empty string.
Hmmm... I'm guessing this was done to appease the type checker (the argument is `Optional`) without realizing it was supposed to cover both `None` and `""`. That should be made more explicitly:

```python
if docstring is None or docstring == "":
  return ""
```

Resolving patch:
diff --git a/cocotb/regression.py b/cocotb/regression.py
--- a/cocotb/regression.py
+++ b/cocotb/regression.py
@@ -897,7 +897,7 @@ def _trim(docstring: Optional[str]) -> str:
 
     Based on https://www.python.org/dev/peps/pep-0257/#handling-docstring-indentation.
     """
-    if docstring is None:
+    if docstring is None or docstring == "":
         return ""
     # Convert tabs to spaces (following the normal Python rules)
     # and split into a list of lines:


Test patch:
diff --git a/tests/test_cases/test_cocotb/test_tests.py b/tests/test_cases/test_cocotb/test_tests.py
--- a/tests/test_cases/test_cocotb/test_tests.py
+++ b/tests/test_cases/test_cocotb/test_tests.py
@@ -126,3 +126,8 @@ def throw(self, exception):
 
     def __await__(self):
         yield from self._coro.__await__()
+
+
+@cocotb.test()
+async def test_empty_docstring(dut) -> None:
+    """"""
Repository: cocotb/cocotb

Issue:
Improve support for assertion rewriting regardles of test name
The pull request #3011 added this support.

The following lines, written by @ktbarrett, force assertion rewriting of python modules listed in the `MODULE` env variable :
https://github.com/cocotb/cocotb/blob/4b5b80eb409c6f7e2a816784fe1086c785fb928f/cocotb/regression.py#L255-L258

This has 2 issues:

- It doesn't handle the case of `__init__.py` packages.
- It doesn't handle modules in packages : `pkg.module` => `pkg.module.py` which does not throw an error but does not allow for assertion rewriting.


Discussion:
@ktbarrett Out of curiosity, what would be the downside of assertion rewriting all files : `-o python_files=*.py` ?
asserts that have nothing to do with test failure (e.g. one's buried in support library code) would be rewritten. I guess such asserts are currently considered valid test-ending exceptions; meaning test checking and internal self checking are already munged together (yuck) so who cares if the assertion rewriting is not differentiated. You've convinced me, rewriting all files would be just fine by me.
@TrampHRC If you want to open a PR which changes the logic of the assertion rewriting I will review it. As discussed you can just change the pattern to `*.py`.

Resolving patch:
diff --git a/cocotb/regression.py b/cocotb/regression.py
--- a/cocotb/regression.py
+++ b/cocotb/regression.py
@@ -250,11 +250,8 @@ def _setup_pytest_assertion_rewriting(cls, test_modules: Iterable[str]) -> None:
             from _pytest.assertion import install_importhook
             from _pytest.config import Config
 
-            # Pass python_files to Config to support assertion rewriting only on test modules.
-            # See https://github.com/pytest-dev/pytest/discussions/10052.
-            test_modules_str = " ".join(f"{name}.py" for name in test_modules)
             pytest_conf = Config.fromdictargs(
-                {}, ["--capture=no", "-o", f"python_files={test_modules_str}"]
+                {}, ["--capture=no", "-o", "python_files=*.py"]
             )
             install_importhook(pytest_conf)
         except Exception:


Test patch:
Repository: cocotb/cocotb

Issue:
'public' decorator?
It's only used by the decorators module and the generators module (at risk in #1493). Should we remove it?

Alternatively, should we be using it more?


Discussion:
Has your question been resolved? If so please close this issue. If it has not been resolved, you may need to provide more information. If no more activity on this issue occurs in 7 days, it will be closed.

Resolving patch:
diff --git a/cocotb/decorators.py b/cocotb/decorators.py
--- a/cocotb/decorators.py
+++ b/cocotb/decorators.py
@@ -38,23 +38,6 @@
 from cocotb.utils import lazy_property
 
 
-def public(f):
-    """Use a decorator to avoid retyping function/class names.
-
-    * Based on an idea by Duncan Booth:
-    http://groups.google.com/group/comp.lang.python/msg/11cbb03e09611b8a
-    * Improved via a suggestion by Dave Angel:
-    http://groups.google.com/group/comp.lang.python/msg/3d400fb22d8a42e1
-    """
-    all = sys.modules[f.__module__].__dict__.setdefault("__all__", [])
-    if f.__name__ not in all:  # Prevent duplicates if run from an IDE.
-        all.append(f.__name__)
-    return f
-
-
-public(public)  # Emulate decorating ourself
-
-
 class coroutine:
     """Decorator class that allows us to provide common coroutine mechanisms:
 
@@ -88,7 +71,6 @@ def __str__(self):
         return str(self._func.__qualname__)
 
 
-@public
 class function:
     """Decorator class that allows a function to block.
 
@@ -114,7 +96,6 @@ def __get__(self, obj, owner=None):
         return type(self)(self._coro._func.__get__(obj, owner))
 
 
-@public
 class external:
     """Decorator to apply to an external function to enable calling from cocotb.
 
@@ -168,7 +149,6 @@ def decorator(f):
         return decorator
 
 
-@public
 class test(coroutine, metaclass=_decorator_helper):
     """
     Decorator to mark a Callable which returns a Coroutine as a test.
diff --git a/cocotb/scheduler.py b/cocotb/scheduler.py
--- a/cocotb/scheduler.py
+++ b/cocotb/scheduler.py
@@ -99,7 +99,6 @@ class external_state:
     EXITED = 3
 
 
-@cocotb.decorators.public
 class external_waiter:
     def __init__(self):
         self._outcome = None


Test patch:
Repository: cocotb/cocotb

Issue:
Allow not using parens on cocotb.test decorator
In many (if not the majority) of cases, users don't need to pass arguments to the test decorator. In this case it would be nice if they didn't need to "call" the decorator.

```python
@cocotb.test  # no call here
async def test_stuff(dut):
    ...
```

Standard library decorator support this (like `lru_cache`), so there is precedence to support this as well.


Discussion:

Resolving patch:
diff --git a/cocotb/decorators.py b/cocotb/decorators.py
--- a/cocotb/decorators.py
+++ b/cocotb/decorators.py
@@ -140,7 +140,8 @@ def __get__(self, obj, owner=None):
 class _decorator_helper(type):
     """
     Metaclass that allows a type to be constructed using decorator syntax,
-    passing the decorated function as the first argument.
+    passing the decorated function as the first argument. Supports
+    construction with or without having the type called.
 
     So:
 
@@ -154,6 +155,11 @@ def this_is_passed_as_f(...):
     """
 
     def __call__(cls, *args, **kwargs):
+        if len(args) == 1 and callable(args[0]):  # case without parenthesis
+            f = args[0]
+            return type.__call__(cls, f, **kwargs)
+
+        # case with parenthesis
         def decorator(f):
             # fall back to the normal way of constructing an object, now that
             # we have all the arguments


Test patch:
diff --git a/tests/test_cases/test_cocotb/test_tests.py b/tests/test_cases/test_cocotb/test_tests.py
--- a/tests/test_cases/test_cocotb/test_tests.py
+++ b/tests/test_cases/test_cocotb/test_tests.py
@@ -206,3 +206,8 @@ async def test_func():
 
     cocotb.start_soon(test_func())
     await NullTrigger()
+
+
+@cocotb.test
+async def test_without_parenthesis(dut):
+    pass
Repository: cocotb/cocotb

Issue:
Build with -Wsuggest-override in CI runs
Split from #1149. Using `-Wsuggest-override` would catch some additional errors.
Unfortunately not all compilers support this flag, so we cannot just add it to our default set of build flags.

The attempt there was to use:
```
# version-specific flags
# easiest to compare versions with python
version_less_than_equal = $(shell $(PYTHON_BIN) -c "import sys; from distutils.version import LooseVersion; print(LooseVersion(sys.argv[1]) <= LooseVersion(sys.argv[2]))" $(1) $(2))
GXX_VERSION = $(shell g++ -dumpversion)
ifeq ($(call version_less_than_equal,4.9,$(GXX_VERSION)),True)
CXX_WARNS += -Wsuggest-override
endif
```
but this assumed that the user was using GCC.

We might be able to get away with just adding to `tox.ini`, assuming all our CI compilers are new enough.


Discussion:
I'd simply pass it as environment variable which contains specific flags for CI runs. It's not uncommon to have more diagnostic output enabled in CI than in "normal" builds.
Let's have a go at this once #1306  is merged

Resolving patch:
diff --git a/noxfile.py b/noxfile.py
--- a/noxfile.py
+++ b/noxfile.py
@@ -104,7 +104,15 @@ def configure_env_for_dev_build(session: nox.session) -> None:
     - Enable coverage collection.
     - Build with more aggressive error checking.
     """
-    session.env["CFLAGS"] = "-Werror -Wno-deprecated-declarations -g --coverage"
+    session.env["CFLAGS"] = " ".join(
+        [
+            "-Werror",
+            "-Wno-deprecated-declarations",
+            "-Wsuggest-override",
+            "-g",
+            "--coverage",
+        ]
+    )
     session.env["COCOTB_LIBRARY_COVERAGE"] = "1"
     session.env["CXXFLAGS"] = "-Werror"
     session.env["LDFLAGS"] = "--coverage"


Test patch:
Repository: cocotb/cocotb

Issue:
Remove `cocotb.memdebug` and `MEMCHECK`
I'm not aware of anyone using it, it's simple enough for the user to add on their own.


Discussion:

Resolving patch:
diff --git a/src/cocotb/__init__.py b/src/cocotb/__init__.py
--- a/src/cocotb/__init__.py
+++ b/src/cocotb/__init__.py
@@ -179,12 +179,6 @@ def create_task(coro: Union[Task, Coroutine]) -> Task:
 _rlock = threading.RLock()
 
 
-def mem_debug(port):
-    import cocotb.memdebug
-
-    cocotb.memdebug.start(port)
-
-
 def _initialise_testbench(argv_):  # pragma: no cover
     """Initialize testbench.
 
@@ -249,10 +243,6 @@ def _initialise_testbench_(argv_):
 
     cocotb.log.info(f"Running on {SIM_NAME} version {SIM_VERSION}")
 
-    memcheck_port = os.getenv("MEMCHECK")
-    if memcheck_port is not None:
-        mem_debug(int(memcheck_port))
-
     log.info(
         "Running tests with cocotb v%s from %s"
         % (__version__, os.path.dirname(__file__))
diff --git a/src/cocotb/memdebug.py b/src/cocotb/memdebug.py
deleted file mode 100644
--- a/src/cocotb/memdebug.py
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright (c) 2013 Potential Ventures Ltd
-# Copyright (c) 2013 SolarFlare Communications Inc
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-#     * Redistributions of source code must retain the above copyright
-#       notice, this list of conditions and the following disclaimer.
-#     * Redistributions in binary form must reproduce the above copyright
-#       notice, this list of conditions and the following disclaimer in the
-#       documentation and/or other materials provided with the distribution.
-#     * Neither the name of Potential Ventures Ltd,
-#       SolarFlare Communications Inc nor the
-#       names of its contributors may be used to endorse or promote products
-#       derived from this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL POTENTIAL VENTURES LTD BE LIABLE FOR ANY
-# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-import cherrypy
-import dowser
-
-
-def start(port):
-    cherrypy.tree.mount(dowser.Root())
-    cherrypy.config.update({"environment": "embedded", "server.socket_port": port})
-    cherrypy.engine.start()


Test patch:
Repository: cocotb/cocotb

Issue:
NVC: Remove experimental status
After the current pending PRs we can move the next release of NVC out of the experimental CI group and update the docs.
- [x] #3553 / #3559
- [x] #3554 
- [x] NVC release (https://github.com/nickg/nvc/releases/tag/r1.11.0)
- [x] Update docs #3566



Discussion:

Resolving patch:
diff --git a/.github/generate-envs.py b/.github/generate-envs.py
--- a/.github/generate-envs.py
+++ b/.github/generate-envs.py
@@ -116,10 +116,10 @@
     {
         "lang": "vhdl",
         "sim": "nvc",
-        "sim-version": "master",  # Only master supported for now
+        "sim-version": "r1.11.0",
         "os": "ubuntu-latest",
         "python-version": "3.8",
-        "group": "experimental",
+        "group": "ci",
     },
     # Test Verilator on Ubuntu
     {


Test patch:
diff --git a/examples/matrix_multiplier/tests/test_matrix_multiplier.py b/examples/matrix_multiplier/tests/test_matrix_multiplier.py
--- a/examples/matrix_multiplier/tests/test_matrix_multiplier.py
+++ b/examples/matrix_multiplier/tests/test_matrix_multiplier.py
@@ -243,6 +243,8 @@ def test_matrix_multiplier_runner():
 
         if sim in ["questa", "modelsim", "riviera", "activehdl"]:
             build_args = ["-2008"]
+        elif sim == "nvc":
+            build_args = ["--std=08"]
     else:
         raise ValueError(
             f"A valid value (verilog or vhdl) was not provided for TOPLEVEL_LANG={hdl_toplevel_lang}"
diff --git a/examples/mixed_language/tests/test_mixed_language.py b/examples/mixed_language/tests/test_mixed_language.py
--- a/examples/mixed_language/tests/test_mixed_language.py
+++ b/examples/mixed_language/tests/test_mixed_language.py
@@ -117,7 +117,7 @@ async def mixed_language_functional_test(dut):
 
 
 @pytest.mark.skipif(
-    sim in ["icarus", "ghdl", "verilator"],
+    sim in ["icarus", "ghdl", "verilator", "nvc"],
     reason=f"Skipping example mixed_language since {sim} doesn't support this",
 )
 def test_mixed_language_runner():
diff --git a/tests/pytest/test_cocotb.py b/tests/pytest/test_cocotb.py
--- a/tests/pytest/test_cocotb.py
+++ b/tests/pytest/test_cocotb.py
@@ -57,6 +57,8 @@
     sim_args = ["-t", "ps"]
 elif sim == "xcelium":
     compile_args = ["-v93"]
+elif sim == "nvc":
+    compile_args = ["--std=08"]
 
 hdl_toplevel = "sample_module"
 sys.path.insert(0, os.path.join(tests_dir, "test_cases", "test_cocotb"))
Repository: cocotb/cocotb

Issue:
GHDL: Make COCOTB_HDL_TIMEPRECISION work with all backends
It seems that https://github.com/cocotb/cocotb/pull/3622 breaks using GHDL with other backend than mcode as the following check

```
ifneq ($(COCOTB_HDL_TIMEPRECISION),)
...
```

is always true because `COCOTB_HDL_TIMEPRECISION` is set in `Makefile.inc`:

```
COCOTB_HDL_TIMEPRECISION ?= 1ps
```

regardless if they are set in the users Makefile.

_Originally posted by @tmeissner in https://github.com/cocotb/cocotb/issues/3622#issuecomment-1875471041_
            


Discussion:

Resolving patch:
diff --git a/src/cocotb/runner.py b/src/cocotb/runner.py
--- a/src/cocotb/runner.py
+++ b/src/cocotb/runner.py
@@ -695,6 +695,17 @@ def _simulator_in_path() -> None:
         if shutil.which("ghdl") is None:
             raise SystemExit("ERROR: ghdl executable not found!")
 
+    def _is_mcode_backend(self) -> bool:
+        """Is GHDL using the mcode backend?"""
+        result = subprocess.run(
+            ["ghdl", "--version"],
+            check=True,
+            text=True,
+            stdout=subprocess.PIPE,
+            stderr=subprocess.STDOUT,
+        )
+        return "mcode" in result.stdout
+
     @staticmethod
     def _get_parameter_options(parameters: Mapping[str, object]) -> Command:
         return [f"-g{name}={value}" for name, value in parameters.items()]
@@ -725,7 +736,7 @@ def _build_command(self) -> List[Command]:
     def _test_command(self) -> List[Command]:
         ghdl_run_args = self.test_args
 
-        if self.timescale:
+        if self._is_mcode_backend() and self.timescale:
             _, precision = self.timescale
             # Convert the time precision to a format string supported by GHDL,
             # if possible.


Test patch: