Skip to content

Commit

Permalink
ui: remove 'compile_builtins'; to preserve previous behaviour users n…
Browse files Browse the repository at this point in the history
…eed to use 'add_vhdl_builtins' (VUnit#559)
  • Loading branch information
umarcor committed Oct 21, 2021
1 parent a6bebac commit eea6395
Show file tree
Hide file tree
Showing 17 changed files with 23 additions and 10 deletions.
1 change: 1 addition & 0 deletions examples/vhdl/array/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from vunit import VUnit

VU = VUnit.from_argv()
VU.add_vhdl_builtins()
VU.add_osvvm()

SRC_PATH = Path(__file__).parent / "src"
Expand Down
1 change: 1 addition & 0 deletions examples/vhdl/array_axis_vcs/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from vunit import VUnit

VU = VUnit.from_argv()
VU.add_vhdl_builtins()
VU.add_verification_components()

SRC_PATH = Path(__file__).parent / "src"
Expand Down
1 change: 1 addition & 0 deletions examples/vhdl/axi_dma/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from vunit import VUnit

VU = VUnit.from_argv()
VU.add_vhdl_builtins()
VU.add_osvvm()
VU.add_verification_components()

Expand Down
1 change: 1 addition & 0 deletions examples/vhdl/check/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from vunit import VUnit

VU = VUnit.from_argv()
VU.add_vhdl_builtins()

# Enable location preprocessing but exclude all but check_false to make the example less bloated
VU.enable_location_preprocessing(
Expand Down
1 change: 1 addition & 0 deletions examples/vhdl/com/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from vunit import VUnit

VU = VUnit.from_argv()
VU.add_vhdl_builtins()
VU.add_com()
VU.add_verification_components()
VU.add_osvvm()
Expand Down
1 change: 1 addition & 0 deletions examples/vhdl/composite_generics/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ def encode(tb_cfg):


VU = VUnit.from_argv()
VU.add_vhdl_builtins()

TB_LIB = VU.add_library("tb_lib")
TB_LIB.add_source_files(Path(__file__).parent / "test" / "*.vhd")
Expand Down
1 change: 1 addition & 0 deletions examples/vhdl/coverage/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def post_run(results):


VU = VUnit.from_argv()
VU.add_vhdl_builtins()

LIB = VU.add_library("lib")
LIB.add_source_files(Path(__file__).parent / "*.vhd")
Expand Down
2 changes: 2 additions & 0 deletions examples/vhdl/generate_tests/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ def generate_tests(obj, signs, data_widths):


VU = VUnit.from_argv()
VU.add_vhdl_builtins()

LIB = VU.add_library("lib")
LIB.add_source_files(Path(__file__).parent / "test" / "*.vhd")

Expand Down
1 change: 1 addition & 0 deletions examples/vhdl/json4vhdl/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
TEST_PATH = Path(__file__).parent / "src" / "test"

VU = VUnit.from_argv()
VU.add_vhdl_builtins()
VU.add_json4vhdl()

LIB = VU.add_library("test")
Expand Down
2 changes: 2 additions & 0 deletions examples/vhdl/logging/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
from vunit import VUnit

VU = VUnit.from_argv()
VU.add_vhdl_builtins()

VU.add_library("lib").add_source_files(Path(__file__).parent / "*.vhd")

VU.main()
1 change: 1 addition & 0 deletions examples/vhdl/run/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
ROOT = Path(__file__).parent

VU = VUnit.from_argv()
VU.add_vhdl_builtins()

LIB = VU.add_library("lib")
LIB.add_source_files(ROOT / "*.vhd")
Expand Down
3 changes: 3 additions & 0 deletions examples/vhdl/third_party_integration/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,8 @@
from vunit import VUnit

VU = VUnit.from_argv()
VU.add_vhdl_builtins()

VU.add_library("lib").add_source_files(Path(__file__).parent / "test" / "*.vhd")

VU.main()
1 change: 1 addition & 0 deletions examples/vhdl/uart/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from vunit import VUnit

VU = VUnit.from_argv()
VU.add_vhdl_builtins()
VU.add_osvvm()
VU.add_verification_components()

Expand Down
3 changes: 3 additions & 0 deletions examples/vhdl/user_guide/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,8 @@
from vunit import VUnit

VU = VUnit.from_argv()
VU.add_vhdl_builtins()

VU.add_library("lib").add_source_files(Path(__file__).parent / "*.vhd")

VU.main()
1 change: 1 addition & 0 deletions examples/vhdl/vivado/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
SRC_PATH = ROOT / "src"

VU = VUnit.from_argv()
VU.add_vhdl_builtins()

VU.add_library("lib").add_source_files(SRC_PATH / "*.vhd")
VU.add_library("tb_lib").add_source_files(SRC_PATH / "test" / "*.vhd")
Expand Down
1 change: 0 additions & 1 deletion tests/unit/test_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -1155,7 +1155,6 @@ def _create_ui_real_sim(self, *args):
"""Create an instance of the VUnit public interface class"""
return VUnit.from_argv(
argv=["--output-path=%s" % self._output_path, "--clean"] + list(args),
compile_builtins=False,
)

def _run_main(self, ui, code=0, post_run=None):
Expand Down
11 changes: 2 additions & 9 deletions vunit/ui/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,12 @@ class VUnit(object): # pylint: disable=too-many-instance-attributes, too-many-p
def from_argv(
cls,
argv=None,
compile_builtins: Optional[bool] = True,
vhdl_standard: Optional[str] = None,
):
"""
Create VUnit instance from command line arguments.
:param argv: Use explicit argv instead of actual command line argument
:param compile_builtins: Do not compile builtins. Used for VUnit internal testing.
:param vhdl_standard: The VHDL standard used to compile files,
if None the VUNIT_VHDL_STANDARD environment variable is used
:returns: A :class:`.VUnit` object instance
Expand All @@ -79,13 +77,12 @@ def from_argv(
"""
args = VUnitCLI().parse_args(argv=argv)
return cls.from_args(args, compile_builtins=compile_builtins, vhdl_standard=vhdl_standard)
return cls.from_args(args, vhdl_standard=vhdl_standard)

@classmethod
def from_args(
cls,
args,
compile_builtins: Optional[bool] = True,
vhdl_standard: Optional[str] = None,
):
"""
Expand All @@ -95,18 +92,16 @@ def from_args(
adding custom command line options.
:param args: The parsed argument namespace object
:param compile_builtins: Do not compile builtins. Used for VUnit internal testing.
:param vhdl_standard: The VHDL standard used to compile files,
if None the VUNIT_VHDL_STANDARD environment variable is used
:returns: A :class:`.VUnit` object instance
"""
return cls(args, compile_builtins=compile_builtins, vhdl_standard=vhdl_standard)
return cls(args, vhdl_standard=vhdl_standard)

def __init__(
self,
args,
compile_builtins: Optional[bool] = True,
vhdl_standard: Optional[str] = None,
):
self._args = args
Expand Down Expand Up @@ -156,8 +151,6 @@ def test_filter(name, attribute_names):
self._test_bench_list = TestBenchList(database=database)

self._builtins = Builtins(self, self._vhdl_standard, simulator_class)
if compile_builtins:
self.add_vhdl_builtins()

def _create_database(self):
"""
Expand Down

0 comments on commit eea6395

Please sign in to comment.