Skip to content

Commit f38c1e3

Browse files
authored
Add GHDL backend detection support for mcode JIT (#1005)
1 parent 3063a2d commit f38c1e3

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

docs/news.d/1005.feature.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[GHDL] Add support for mcode JIT in backend detection.

tests/unit/test_ghdl_interface.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,19 @@ def test_parses_mcode_backend(self, check_output):
8383
Copyright (C) 2003 - 2014 Tristan Gingold.
8484
GHDL is free software, covered by the GNU General Public License. There is NO
8585
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
86+
"""
87+
check_output.return_value = version
88+
self.assertEqual(GHDLInterface.determine_backend("prefix"), "mcode")
89+
90+
version = b"""\
91+
GHDL 5.0.0-dev (4.0.0.r9.g77785e49e) [Dunoon edition]
92+
Compiled with GNAT Version: 10.5.0
93+
static elaboration, mcode JIT code generator
94+
Written by Tristan Gingold.
95+
96+
Copyright (C) 2003 - 2024 Tristan Gingold.
97+
GHDL is free software, covered by the GNU General Public License. There is NO
98+
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
8699
"""
87100
check_output.return_value = version
88101
self.assertEqual(GHDLInterface.determine_backend("prefix"), "mcode")

vunit/sim_if/ghdl.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def determine_backend(cls, prefix):
125125
Determine the GHDL backend
126126
"""
127127
mapping = {
128-
r"mcode code generator": "mcode",
128+
r"mcode (JIT )?code generator": "mcode",
129129
r"llvm (\d+\.\d+\.\d+ )?code generator": "llvm",
130130
r"GCC (back-end|\d+\.\d+\.\d+) code generator": "gcc",
131131
}

0 commit comments

Comments
 (0)