Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GHDL Interface can not detect GCC backend with newer GHDL/LLVM #898 #901

Closed
LeFl0w opened this issue Feb 20, 2023 · 5 comments
Closed

GHDL Interface can not detect GCC backend with newer GHDL/LLVM #898 #901

LeFl0w opened this issue Feb 20, 2023 · 5 comments

Comments

@LeFl0w
Copy link

LeFl0w commented Feb 20, 2023

Hi this error seems related to the issue #898 .
When trying Vunit using the ghdl/ghdl:fedora36-gcc-11.3.0 docker image I got the following error.
Everything was working propperly with an older self compiled GHDL gcc.

WARNING - /usr/local/lib/python3.10/site-packages/vunit/vhdl/osvvm/ScoreboardPkg_slv_c.vhd: package 'scoreboardpkg_slv' previously defined in /usr/local/lib/python3.10/site-packages/vunit/vhdl/osvvm/ScoreboardPkg_slv.vhd
  ERROR - Could not detect known LLVM backend by parsing 'ghdl --version'
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/vunit/ui/__init__.py", line 672, in main
    all_ok = self._main(post_run)
  File "/usr/local/lib/python3.10/site-packages/vunit/ui/__init__.py", line 716, in _main
    all_ok = self._main_run(post_run)
  File "/usr/local/lib/python3.10/site-packages/vunit/ui/__init__.py", line 741, in _main_run
    simulator_if = self._create_simulator_if()
  File "/usr/local/lib/python3.10/site-packages/vunit/ui/__init__.py", line 735, in _create_simulator_if
    return self._simulator_class.from_args(args=self._args, output_path=self._simulator_output_path)
  File "/usr/local/lib/python3.10/site-packages/vunit/sim_if/ghdl.py", line 77, in from_args
    backend=cls.determine_backend(prefix),
  File "/usr/local/lib/python3.10/site-packages/vunit/sim_if/ghdl.py", line 145, in determine_backend
    raise AssertionError("No known GHDL back-end could be detected from running 'ghdl --version'")
AssertionError: No known GHDL back-end could be detected from running 'ghdl --version'
Expected to find one of dict_keys(['mcode code generator', 'llvm (\\d+\\.\\d+\\.\\d+ )?code generator', 'GCC back-end code generator'])
== Output of 'ghdl --version'============================================================
GHDL 3.0.0-dev (v2.0.0-1369-gf04182410) [Dunoon edition]
 Compiled with GNAT Version: 12.2.1 20221121 (Red Hat 12.2.1-
 GCC 11.3.0 code generator
Written by Tristan Gingold.

Copyright (C) 2003 - 2022 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.

Florent

@LarsAsplund
Copy link
Collaborator

Yes, that seems to be exactly the same. Does it work if you change this line from

mapping = {
            r"mcode code generator": "mcode",
            r"llvm (\d+\.\d+\.\d+ )?code generator": "llvm",
            r"GCC back-end code generator": "gcc",
        }

to

mapping = {
            r"mcode code generator": "mcode",
            r"llvm (\d+\.\d+\.\d+ )?code generator": "llvm",
            r"GCC (back-end|\d+\.\d+\.\d+) code generator": "gcc",
        }

?

@LeFl0w
Copy link
Author

LeFl0w commented Feb 20, 2023

indeed it is working.
thanks.

@LarsAsplund
Copy link
Collaborator

Ok, I will push this to GitHub and make a patch release.

@LarsAsplund
Copy link
Collaborator

This is now fixed on the main branch and a new release 4.6.2 is being built as we speak. It should be on PyPi shortly.

@eine eine added this to the v4.7.0 milestone Feb 26, 2023
@tristanitschner
Copy link

Since ghdl got a JIT backend the issue still occurs. Output of ghdl --version:

GHDL 5.0.0-dev (4.0.0.r24.g14b411c57) [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.

I'd suggest using mcode( JIT)? code generator regular expression.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants