118118 A list of PLI file names.
119119
120120``ghdl.flags``
121- Extra arguments passed to ``ghdl --elab-run`` command *before* executable specific flags. Must be a list of strings.
121+ Extra arguments passed to ``ghdl --elab-run`` command *before* executable specific flags.
122122 Must be a list of strings.
123123
124124``incisive.irun_sim_flags``
@@ -290,12 +290,17 @@ class VUnit(object): # pylint: disable=too-many-instance-attributes, too-many-p
290290 """
291291
292292 @classmethod
293- def from_argv (cls , argv = None , compile_builtins = True , vhdl_standard = None ):
293+ def from_argv (cls , argv = None , compile_builtins = True , vhdl_standard = None , use_external = None , impls = None ):
294294 """
295295 Create VUnit instance from command line arguments.
296296
297297 :param argv: Use explicit argv instead of actual command line argument
298298 :param compile_builtins: Do not compile builtins. Used for VUnit internal testing.
299+ :param vhdl_standard: The VHDL standard used to compile files into this library,
300+ if None the VUNIT_VHDL_STANDARD environment variable is used
301+ :param use_external: list of Booleans, to select whether to enable external models for string and/or
302+ integer_vector, respectively; if None, all of them are disabled
303+ :param impls: optional list of lists containing alternative implementations for external models
299304 :returns: A :class:`.VUnit` object instance
300305
301306 :example:
@@ -307,10 +312,16 @@ def from_argv(cls, argv=None, compile_builtins=True, vhdl_standard=None):
307312
308313 """
309314 args = VUnitCLI ().parse_args (argv = argv )
310- return cls .from_args (args , compile_builtins = compile_builtins , vhdl_standard = vhdl_standard )
315+ return cls .from_args (
316+ args ,
317+ compile_builtins = compile_builtins ,
318+ vhdl_standard = vhdl_standard ,
319+ use_external = use_external ,
320+ impls = impls
321+ )
311322
312323 @classmethod
313- def from_args (cls , args , compile_builtins = True , vhdl_standard = None ):
324+ def from_args (cls , args , compile_builtins = True , vhdl_standard = None , use_external = None , impls = None ):
314325 """
315326 Create VUnit instance from args namespace.
316327 Intended for users who adds custom command line options.
@@ -319,12 +330,23 @@ def from_args(cls, args, compile_builtins=True, vhdl_standard=None):
319330
320331 :param args: The parsed argument namespace object
321332 :param compile_builtins: Do not compile builtins. Used for VUnit internal testing.
333+ :param vhdl_standard: The VHDL standard used to compile files into this library,
334+ if None the VUNIT_VHDL_STANDARD environment variable is used
335+ :param use_external: list of Booleans, to select whether to enable external models for string and/or
336+ integer_vector, respectively; if None, all of them are disabled
337+ :param impls: optional list of lists containing alternative implementations for external models
322338 :returns: A :class:`.VUnit` object instance
323- """
324339
325- return cls (args , compile_builtins = compile_builtins , vhdl_standard = vhdl_standard )
340+ """
341+ return cls (
342+ args ,
343+ compile_builtins = compile_builtins ,
344+ vhdl_standard = vhdl_standard ,
345+ use_external = use_external ,
346+ impls = impls
347+ )
326348
327- def __init__ (self , args , compile_builtins = True , vhdl_standard = None ):
349+ def __init__ (self , args , compile_builtins = True , vhdl_standard = None , use_external = None , impls = None ):
328350 self ._args = args
329351 self ._configure_logging (args .log_level )
330352 self ._output_path = abspath (args .output_path )
@@ -371,8 +393,9 @@ def test_filter(name, attribute_names):
371393 self ._test_bench_list = TestBenchList (database = database )
372394
373395 self ._builtins = Builtins (self , self ._vhdl_standard , simulator_class )
396+ self ._compile_builtins = compile_builtins
374397 if compile_builtins :
375- self .add_builtins ()
398+ self .add_builtins (use_external = use_external , impls = impls )
376399
377400 def _create_database (self ):
378401 """
@@ -858,7 +881,6 @@ def _main(self, post_run):
858881 """
859882 Base vunit main function without performing exit
860883 """
861-
862884 if self ._args .export_json is not None :
863885 return self ._main_export_json (self ._args .export_json )
864886
@@ -1056,11 +1078,15 @@ def _run_test(self, test_cases, report):
10561078 no_color = self ._args .no_color )
10571079 runner .run (test_cases )
10581080
1059- def add_builtins (self ):
1081+ def add_builtins (self , use_external = None , impls = None ):
10601082 """
10611083 Add vunit VHDL builtin libraries
1084+
1085+ :param use_external: list of Booleans, to select whether to enable external models for string and/or
1086+ integer_vector, respectively.
1087+ :param impls: optional list of lists containing alternative implementations for external models.
10621088 """
1063- self ._builtins .add_vhdl_builtins ()
1089+ self ._builtins .add_vhdl_builtins (use_external = use_external , impls = impls )
10641090
10651091 def add_com (self ):
10661092 """
0 commit comments