Compilation Options¶
Compilation options allow customization of compilation behavior. Since simulators have differing options available, generic options may be specified through this interface. The following compilation options are known.
ghdl.a_flagsExtra arguments passed to
ghdl -acommand during compilation. Must be a list of strings.incisive.irun_vhdl_flagsExtra arguments passed to the Incisive
iruncommand when compiling VHDL files. Must be a list of strings.incisive.irun_verilog_flagsExtra arguments passed to the Incisive
iruncommand when compiling Verilog files. Must be a list of strings.modelsim.vcom_flagsExtra arguments passed to ModelSim
vcomcommand when compiling VHDL files. Must be a list of strings.modelsim.vlog_flagsExtra arguments passed to ModelSim
vlogcommand when compiling Verilog files. Must be a list of strings.nvc.a_flagsExtra arguments passed to
nvc -acommand during compilation. Must be a list of strings.nvc.global_flagsExtra global arguments to pass to
nvcbefore the-acommand. Must be a list of strings.rivierapro.vcom_flagsExtra arguments passed to Riviera PRO
vcomcommand when compiling VHDL files. Must be a list of strings.rivierapro.vlog_flagsExtra arguments passed to Riviera PRO
vlogcommand when compiling Verilog files. Must be a list of strings.activehdl.vcom_flagsExtra arguments passed to Active HDL
vcomcommand when compiling VHDL files. Must be a list of strings.activehdl.vlog_flagsExtra arguments passed to Active HDL
vcomcommand when compiling Verilog files. Must be a list of strings.enable_coverageEnables compilation flags needed for code coverage and tells VUnit to handle the coverage files created at compilation. Only used for coverage with GHDL. Must be a boolean value. Default is False.
Note
Only affects source files added before the option is set.
Simulation Options¶
Simulation options allow customization of simulation behavior. Since simulators have differing options available, generic options may be specified through this interface. The following simulation options are known.
vhdl_assert_stop_levelWill stop a VHDL simulation for asserts on the provided severity level or higher. Valid values are
"warning","error", and"failure". This option takes precedence over the fail_on_warning attribute.disable_ieee_warningsDisable ieee warnings. Must be a boolean value. Default is False.
enable_coverageEnables code coverage collection during simulator for the run affected by the sim_option. Must be a boolean value. Default is False.
When coverage is enabled VUnit only takes the minimal steps required to make the simulator create a unique coverage file for the simulation run.
For RiverieraPRO and Modelsim/Questa, the VUnit users must still set sim and compile options to configure the simulator specific coverage options they want. The reason for this to allow the VUnit users maximum control of their coverage settings.
For GHDL with GCC backend there is less configurability for coverage, and all necessary flags are set by the
enable_coveragesim and compile options.An example of a
run.pyfile using coverage can be found here.pliA list of PLI file names.
incisive.irun_sim_flagsExtra arguments passed to the Incisive
iruncommand when loading the design. Must be a list of strings.modelsim.vsim_flagsExtra arguments passed to
vsimwhen loading the design. Must be a list of strings.modelsim.vsim_flags.guiExtra arguments passed to
vsimwhen loading the design in GUI mode where it takes precedence overmodelsim.vsim_flags. Must be a list of strings.modelsim.init_files.after_loadA list of user defined DO/TCL-files that is sourced after the design has been loaded. They will be executed during
vunit_load, after the top level has been loaded using thevsimcommand. During script evaluation thevunit_tb_pathvariable is defined as the path of the folder containing the test bench. Additionally, thevunit_tb_namevariable is defined as the name of the test bench. Must be a list of strings.modelsim.init_files.before_runA list of user defined DO/TCL-files that is sourced before the simulation is run. They will be executed at the start of
vunit_run(and therefore also re-executed byvunit_restart). Must be a list of strings.modelsim.init_file.guiA user defined TCL-file that is sourced after the design has been loaded in the GUI. For example this can be used to configure the waveform viewer. During script evaluation the
vunit_tb_pathvariable is defined as the path of the folder containing the test bench. Additionally, thevunit_tb_namevariable is defined as the name of the test bench. Must be a string.modelsim.three_step_flowEnable 3-step flow where a separate
voptstep is executed beforevsimis called. Must be a boolean value. Default is False.modelsim.vopt_flagsExtra arguments passed to
voptwhenmodelsim.three_step_flowisTrue. Must be a list of strings.modelsim.vsim_flags.guiExtra arguments passed to
voptwhenmodelsim.three_step_flowisTrueand GUI mode is enabled. Takes precedence overmodelsim.vopt_flags. Must be a list of strings.rivierapro.vsim_flagsExtra arguments passed to
vsimwhen loading the design. Must be a list of strings.rivierapro.vsim_flags.guiExtra arguments passed to
vsimwhen loading the design in GUI mode where it takes precedence overrivierapro.vsim_flags. Must be a list of strings.rivierapro.init_files.after_loadA list of user defined DO/TCL-files that is sourced after the design has been loaded. They will be executed during
vunit_load, after the top level has been loaded using thevsimcommand. During script evaluation thevunit_tb_pathvariable is defined as the path of the folder containing the test bench. Additionally, thevunit_tb_namevariable is defined as the name of the test bench. Must be a list of strings.rivierapro.init_files.before_runA list of user defined DO/TCL-files that is sourced before the simulation is run. They will be executed at the start of
vunit_run(and therefore also re-executed byvunit_restart). Must be a list of strings.rivierapro.init_file.guiA user defined TCL-file that is sourced after the design has been loaded in the GUI. For example this can be used to configure the waveform viewer. During script evaluation the
vunit_tb_pathvariable is defined as the path of the folder containing the test bench. Additionally, thevunit_tb_namevariable is defined as the name of the test bench. Must be a string.activehdl.vsim_flagsExtra arguments passed to
vsimwhen loading the design. Must be a list of strings.activehdl.vsim_flags.guiExtra arguments passed to
vsimwhen loading the design in GUI mode where it takes precedence overactivehdl.vsim_flags. Must be a list of strings.activehdl.init_file.guiA user defined TCL-file that is sourced after the design has been loaded in the GUI. For example this can be used to configure the waveform viewer. During script evaluation the
vunit_tb_pathvariable is defined as the path of the folder containing the test bench. Additionally, thevunit_tb_namevariable is defined as the name of the test bench. Must be a string.ghdl.elab_flagsExtra elaboration flags passed to
ghdl --elab-run. Must be a list of strings.ghdl.sim_flagsExtra simulation flags passed to
ghdl --elab-run. Must be a list of strings.ghdl.elab_eWith
--elaborate, executeghdl -einstead ofghdl --elab-run --no-run. Must be a boolean.ghdl.viewer.guiName of waveform viewer to use. The command line argument
--viewerwill have precedence if provided. If neither is provided,gtkwaveorsurferwill be used.ghdl.viewer_script.guiA user defined file that is sourced after the design has been loaded in the GUI. For example this can be used to configure the waveform viewer. Must be a string.
There are currently limitations in the HEAD revision of GTKWave that prevent the user from sourcing a list of scripts directly. The following is the current work around to sourcing multiple user TCL-files:
source <path/to/script.tcl>nvc.elab_flagsExtra elaboration flags passed to
nvc -e. Must be a list of strings.nvc.global_flagsExtra global arguments to pass to
nvcbefore the-eor-rcommands. Must be a list of strings.nvc.heap_sizeSimulation heap size. Must be a string, for example
"64m".nvc.sim_flagsExtra simulation flags passed to
nvc -r. Must be a list of strings.nvc.viewer.guiName of waveform viewer to use. The command line argument
--viewerwill have precedence if provided. If neither is provided,gtkwaveorsurferwill be used.nvc.viewer_script.guiA user defined file that is sourced after the design has been loaded in the GUI. For example this can be used to configure the waveform viewer. Must be a string.
There are currently limitations in the HEAD revision of GTKWave that prevent the user from sourcing a list of scripts directly. The following is the current work around to sourcing multiple user TCL-files:
source <path/to/script.tcl>