diff --git a/docs/py/opts.rst b/docs/py/opts.rst index e52e9a8eb8..3cce2ea15c 100644 --- a/docs/py/opts.rst +++ b/docs/py/opts.rst @@ -7,10 +7,13 @@ Compilation options allow customization of compilation behavior. Since simulator differing options available, generic options may be specified through this interface. The following compilation options are known. -``ghdl.flags`` +``ghdl.a_flags`` Extra arguments passed to ``ghdl -a`` command during compilation. Must be a list of strings. +``ghdl.flags`` + Deprecated alias of ``ghdl.a_flags``. It will be removed in future releases. + ``incisive.irun_vhdl_flags`` Extra arguments passed to the Incisive ``irun`` command when compiling VHDL files. Must be a list of strings. diff --git a/vunit/sim_if/ghdl.py b/vunit/sim_if/ghdl.py index 92c091304d..6e83521ec7 100644 --- a/vunit/sim_if/ghdl.py +++ b/vunit/sim_if/ghdl.py @@ -14,6 +14,7 @@ import subprocess import shlex from sys import stdout # To avoid output catched in non-verbose mode +from warnings import warn from ..exceptions import CompileError from ..ostools import Process from . import SimulatorInterface, ListOfStringOption, StringOption, BooleanOption @@ -32,7 +33,10 @@ class GHDLInterface(SimulatorInterface): supports_gui_flag = True supports_colors_in_gui = True - compile_options = [ListOfStringOption("ghdl.flags")] + compile_options = [ + ListOfStringOption("ghdl.a_flags"), + ListOfStringOption("ghdl.flags"), + ] sim_options = [ ListOfStringOption("ghdl.sim_flags"), @@ -213,7 +217,20 @@ def compile_vhdl_file_command(self, source_file): ] for library in self._project.get_libraries(): cmd += ["-P%s" % library.directory] - cmd += source_file.compile_options.get("ghdl.flags", []) + + a_flags = source_file.compile_options.get("ghdl.a_flags", []) + flags = source_file.compile_options.get("ghdl.flags", []) + if flags != []: + warn( + ( + "'ghdl.flags' is deprecated and it will removed in future releases; " + "use 'ghdl.a_flags' instead" + ), + Warning, + ) + a_flags += flags + + cmd += a_flags cmd += [source_file.name] return cmd