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:

  1. OsvvmSettingsLocal.tcl: settings for all simulators.

  2. OsvvmSettingsLocal_<ScriptBaseName>.tcl: settings for one simulator. <ScriptBaseName> is the name of the vendor script, VendorScripts_<ScriptBaseName>.tcl, for example NVC, GHDL, Siemens, Questa or RivieraPro.

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:

  1. the directory named by the environment variable OSVVM_SETTINGS_DIR;

  2. OsvvmSettings next to OsvvmLibraries, if it exists;

  3. 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.

  • OsvvmLibraries
    • Scripts
      • OsvvmSettingsDefault.tclOSVVM’s defaults
      • OsvvmSettingsLocal_example.tcl
  • OsvvmSettings
    • OsvvmSettingsLocal.tclyours
    • OsvvmSettingsLocal_NVC.tcl
    • LocalCallbacks.tcl

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:

  1. <ToolVendor>.tcl

  2. <ToolName>.tcl

  3. wave.do (not in batch mode, for example vsim -c)

  4. <LibraryUnit>.tcl

  5. <LibraryUnit>_<ToolName>.tcl

  6. <TestCaseName>.tcl, if the test case name differs from the design unit

  7. <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.

  • testbench
    • TbAxi4.pro
    • TbAxi4.vhd
    • TbAxi4.tclwith every simulation of TbAxi4
    • TbAxi4_QuestaSim.tclonly with QuestaSim
    • wave.dowith every simulation started here
# File: TbAxi4_QuestaSim.tcl
add wave -r /TbAxi4/*

Tool Variables

Every vendor script sets these variables, to adapt scripts to a tool:

ToolVendor

The tool’s vendor, for example Aldec, Siemens, Cadence, Synopsys, Xilinx, GHDL, NVC.

ToolName

The tool, for example ActiveHDL, RivieraPRO, VSimSA, ModelSim, QuestaSim, Visualizer, VCS, Xcelium, XSIM, GHDL, NVC.

ToolType

simulator, or synthesis for Vivado.

ToolNameVersion

<ToolName>-<Version>, for example NVC-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"
}