Skip to content

Commit

Permalink
Add GHDL backend detection support for mcode JIT (VUnit#1005)
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasVik committed Mar 20, 2024
1 parent 3063a2d commit f38c1e3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/news.d/1005.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[GHDL] Add support for mcode JIT in backend detection.
13 changes: 13 additions & 0 deletions tests/unit/test_ghdl_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,19 @@ def test_parses_mcode_backend(self, check_output):
Copyright (C) 2003 - 2014 Tristan Gingold.
GHDL is free software, covered by the GNU General Public License. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
"""
check_output.return_value = version
self.assertEqual(GHDLInterface.determine_backend("prefix"), "mcode")

version = b"""\
GHDL 5.0.0-dev (4.0.0.r9.g77785e49e) [Dunoon edition]
Compiled with GNAT Version: 10.5.0
static elaboration, mcode JIT code generator
Written by Tristan Gingold.
Copyright (C) 2003 - 2024 Tristan Gingold.
GHDL is free software, covered by the GNU General Public License. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
"""
check_output.return_value = version
self.assertEqual(GHDLInterface.determine_backend("prefix"), "mcode")
Expand Down
2 changes: 1 addition & 1 deletion vunit/sim_if/ghdl.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def determine_backend(cls, prefix):
Determine the GHDL backend
"""
mapping = {
r"mcode code generator": "mcode",
r"mcode (JIT )?code generator": "mcode",
r"llvm (\d+\.\d+\.\d+ )?code generator": "llvm",
r"GCC (back-end|\d+\.\d+\.\d+) code generator": "gcc",
}
Expand Down

0 comments on commit f38c1e3

Please sign in to comment.