Configuration
Settings Files
OSVVMOpen Source VHDL Verification Methodology’s default settings are in Scripts/OsvvmSettingsDefault.tcl. Don’t change that file; it’s
replaced with every OSVVM release. Put your settings into your own files instead, which OSVVM loads after the
defaults:
OsvvmSettingsLocal.tcl: settings for all simulators.OsvvmSettingsLocal_<ScriptBaseName>.tcl: settings for one simulator.<ScriptBaseName>is the name of the vendor script,VendorScripts_<ScriptBaseName>.tcl, for exampleNVC,GHDL,Siemens,QuestaorRivieraPro.
Scripts/OsvvmSettingsLocal_example.tcl lists all settings with their defaults; copy it to start.
Like the defaults, the files set variables inside namespace eval ::osvvm; they may also call Set*
commands.
# File: OsvvmSettings/OsvvmSettingsLocal.tcl
namespace eval ::osvvm {
variable DefaultVHDLVersion "2019"
variable AnalyzeErrorStopCount 1
variable SimulateErrorStopCount 1
}
# File: OsvvmSettings/OsvvmSettingsLocal_Siemens.tcl
namespace eval ::osvvm {
SetExtendedAnalyzeOptions "-quiet"
SetExtendedSimulateOptions "-quiet"
}
Settings Directory
OSVVM looks for the settings files in the first of these directories:
the directory named by the environment variable
OSVVM_SETTINGS_DIR;OsvvmSettingsnext toOsvvmLibraries, if it exists;OsvvmLibraries/Scripts.
A directory outside OsvvmLibraries keeps the settings out of OSVVM’s repositories and survives updates.
The former names LocalScriptDefaults.tcl and LocalScriptDefaults_<ScriptBaseName>.tcl in
Scripts are still read, but deprecated.
Callbacks
OSVVM calls callback procedures before and after its main commands (CallbackBefore_Build,
CallbackAfter_Analyze, …) and when an error occurs (CallbackOnError_Build, …). Their defaults are in
Scripts/CallbackDefaults.tcl; don’t change that file.
To change a callback, define a procedure of the same name in LocalCallbacks.tcl (all simulators) or
LocalCallbacks_<ScriptBaseName>.tcl (one simulator), in the settings directory. They are loaded after the
defaults and replace them.
# File: OsvvmSettings/LocalCallbacks.tcl
namespace eval ::osvvm {
proc CallbackAfter_Build {Path_Or_File args} {
puts "Build of $Path_Or_File finished."
}
}
Scripts that Run with Each Simulation
Often a simulation needs custom steps: a waveform file for all designs or one design, or settings for one simulator. When simulate (or RunTest) starts a simulation, it runs these files, if they exist, in this order:
<ToolVendor>.tcl<ToolName>.tclwave.do(not in batch mode, for examplevsim -c)<LibraryUnit>.tcl<LibraryUnit>_<ToolName>.tcl<TestCaseName>.tcl, if the test case name differs from the design unit<TestCaseName>_<ToolName>.tcl, ditto
<LibraryUnit> is the design unit given to simulate, <TestCaseName> the name set by
TestName; for <ToolVendor> and <ToolName> see Tool Variables.
OSVVM looks for them in the working directory, then in the simulation directory, then in
OsvvmLibraries/Scripts.
Only the simulators with a TclTool Command Language console run them: the Aldec and Siemens simulators.
# File: TbAxi4_QuestaSim.tcl
add wave -r /TbAxi4/*
Tool Variables
Every vendor script sets these variables, to adapt scripts to a tool:
ToolVendorThe tool’s vendor, for example
Aldec,Siemens,Cadence,Synopsys,Xilinx,GHDL,NVC.ToolNameThe tool, for example
ActiveHDL,RivieraPRO,VSimSA,ModelSim,QuestaSim,Visualizer,VCS,Xcelium,XSIM,GHDL,NVC.ToolTypesimulator, orsynthesisfor Vivado.ToolNameVersion<ToolName>-<Version>, for exampleNVC-1.23.0; also the name of the library subdirectory.
The variable simulator is the former name of ToolName; it’s deprecated.
if {$::osvvm::ToolName eq "GHDL"} {
# GHDL specific steps
}
if {$::osvvm::ToolVendor eq "Siemens"} {
SetExtendedAnalyzeOptions "-quiet"
SetExtendedSimulateOptions "-quiet"
}