Skip to content

Commit

Permalink
rename compile option 'ghdl.flags' to 'ghdl.a_flags'; keep 'ghdl.flag…
Browse files Browse the repository at this point in the history
…s' as an alias and show a deprecation notice
  • Loading branch information
eine committed Feb 11, 2020
1 parent a7f2bbe commit d4112fc
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
5 changes: 4 additions & 1 deletion docs/py/opts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
21 changes: 19 additions & 2 deletions vunit/sim_if/ghdl.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"),
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit d4112fc

Please sign in to comment.