Reply To: Running AXI4 Simulation from OSVVM Libraries repository

Why OSVVM™? Forums OSVVM Running AXI4 Simulation from OSVVM Libraries repository Reply To: Running AXI4 Simulation from OSVVM Libraries repository

#2481
Jim Lewis
Member

The following are the primary OSVVM API commands. Note that library sets the active library for analyze and simulate.

- library <LibraryName> [<path>]
   - Make LibraryName found in library directory specified by path the active library. 
   - Create the LibraryName if it does not exist.
   - If path is not specified, use the library directory specified by SetLibraryDirectory.
- analyze [<path>/]<name> [options]
   - Analyze (aka compile) the design into the active library.
   - Name must be a file with an extension that is *.vhd or *.vhdl for vhdl, *.v for verilog, or *.sv for SystemVerilog.
   - Paths are relative to CurrentWorkingDirectory.
- simulate <TestName> [options]
   - Simulate (aka elaborate + run) the design using the active library.
   - TestName is a library unit (entity or configuration)
   - options may be one or more options to the simulator or see generic.
- TestName <test-name>
   - Identify the TestName that is active. 
   - Must match name in the testbench call to SetTestName (aka SetAlertLogName).
- RunTest [<path>/]<name> 
   - Combines analyze, TestName, and simulate into one step.
   - TestName and simulate are set to the base name of <code></code>file<code></code>.
   - Paths are relative to CurrentWorkingDirectory.
- SkipTest <test-name> Reason
   - Add Skip test to the Build Summary Reports with <code></code>Reason<code></code> as part of the report. 
- TestSuite <test-suite-name>
   - Identify the current TestSuite.  If not specified the name is <code>default</code>.
- include [<path>/]<name>
   - Include another project script.
     If <code></code>name<code></code> is a file and its extension is .pro, .tcl, or .do, it will be sourced. 
     If <code></code>name<code></code> is a directory then any file whose name is <code></code>name<code></code> and 
     extension is .pro, .tcl, or .do will be sourced. 
   - Paths are relative to CurrentWorkingDirectory.
- build [<path>/]<name>
   - Start a script from the simulator.  It is include + start a new log file for this script.
   - Paths are relative to CurrentWorkingDirectory.

In all commands that accept a path, relative paths (including no path) is
relative to the directory in which the current script is running.
With the command name, “[]” indicates a parameter is optional.
If shown in a highlighted code example [generic G1 5] then the code must contain the “[]”.

The following commands set options for analyze

- SetVHDLVersion [2008 | 2019 | 1993 | 2002]
   - Set VHDL analyze version.  OSVVM libraries require 2008 or newer.
- GetVHDLVersion
   - Return the current VHDL Version.
- SetCoverageAnalyzeEnable [true|false]
   - To collect coverage for a design, SetCoverageEnable and SetCoverageAnalyzeEnable must be enabled when it is analyzed. 
   - If true, enable coverage during analyze,
   - If false, disable coverage during analyze.
   - If not specified, true is the default.
   - Initialized to false (so simulations run faster)
- GetCoverageAnalyzeEnable
   - Returns the setting for coverage during analyze.
- SetCoverageAnalyzeOptions <options>
   - Use the string specified in <code></code>options<code></code> as the coverage options during analyze. 
- GetCoverageAnalyzeOptions 
   - Return the coverage options for analyze.
- SetCoverageEnable [true|false]
   - If true, set coverage enable to true.
   - If false, set coverage enable to false.
   - If not specified, true is the default.
   - Initialized to true.
   - Impacts both Analyze and Simulate
- GetCoverageEnable
   - Get the CoverageEnable value. 
- SetVhdlAnalyzeOptions <options>
   - Set the VHDL options for analyze to <code></code>options<code></code>.
- GetVhdlAnalyzeOptions 
   - Get the VHDL options for analyze.
- SetVerilogAnalyzeOptions <options>
   - Set the Verilog options for analyze to <code></code>options<code></code>.
- GetVerilogAnalyzeOptions 
   - Get the Verilog options for analyze.
- SetExtendedAnalyzeOptions <options> 
   - Set extended (additional) options for analyze to <code></code>options<code></code>.
- GetExtendedAnalyzeOptions
   - Get extended (additional) options for analyze.

The following impact simulate:

- generic <name> <value>
   - Called in the options part of simulate as <code></code>simulate tb1 [generic width 5]<code></code>
- DoWaves <wave1.do> ...
   - Called in the options part of simulate as <code></code>simulate tb1 [DoWaves wave1.do wave2.do]<code></code>
   - Paths used with wave files are relative to CurrentSimulationDirectory.
- SetSecondSimulationTopLevel <library>.<TestName>
   - Sets the name of a second library unit to use during simulation. 
   - Called before simulate.   
- SetDebugMode [true|false]
   - If true, add debugging options during analyze and simulate.
   - If false, do not add debugging options during analyze and simulate.
   - If not specified, true is the default.
   - Initialized to false (so simulations run faster)
- GetDebugMode
   - Returns the state of DebugMode.
- SetLogSignals [true|false]
   - If true, log signals during simulate.
   - If false, do not log signals during simulate.
   - If not specified, true is the default.
   - Initialized to false (so simulations run faster)
- GetLogSignals
   - Returns the state of LogSignals.
- SetInteractiveMode [true|false]
   - If DebugMode was not set with SetDebugMode, then set it using this value
   - If LogSignals was not set with SetLogSignals, then set it using this value.
   - If true, sets variables AnalyzeErrorStopCount and SimulateErrorStopCount to 1
   - If false, sets variables AnalyzeErrorStopCount and SimulateErrorStopCount to previous value
   - If not specified, true is the default.
   - Initialized to false (so simulations run faster)
- GetInteractiveMode
   - Returns the state of InteractiveMode.
- SetSimulatorResolution <value>
   - Set Simulator Resolution. Any value supported by the simulator is ok.
- GetSimulatorResolution
   - Return the current Simulator Resolution.
- SetCoverageSimulateEnable [true|false]
   - To collect coverage during a simulation, SetCoverageEnable and SetCoverageSimulateEnable must be enabled the simulation is started. 
   - If true, enable coverage during simulate,
   - If false, disable coverage during simulate.
   - If not specified, true is the default.
   - Initialized to false (so simulations run faster)
- GetCoverageSimulateEnable
   - Returns the setting for coverage during simulate.
- SetCoverageSimulateOptions <options>
   - Use the string specified in <code></code>options<code></code> as the coverage options during simulate. 
- GetCoverageSimulateOptions 
   - Return the coverage options for simulate.
- SetExtendedSimulateOptions <options>
   - Set extended (additional) options for simulate to <code></code>options<code></code>.
- GetExtendedSimulateOptions
   - Get extended (additional) options for simulate.

Note that SetInteractiveMode and SetDebugMode may also change analyze in some simulators (such as Aldec)

The following are options currently only for GHDL and NVC.

- SetExtendedElaborateOptions <options>
   - Set extended (additional) options for simulate to <code></code>options<code></code>.
- GetExtendedElaborateOptions
   - Get extended (additional) options for simulate.
- SetExtendedRunOptions <options>
   - Set extended (additional) options for simulate to <code></code>options<code></code>.
- GetExtendedRunOptions
   - Get extended (additional) options for simulate.
- SetSaveWaves [true|false]
   - If true, save waveforms during simulate.
     If not specified, true is the default.
     Initialized to false (so simulations run faster)
- GetSaveWaves
   - Returns the state of LogSignals.

BTW, this all comes from either README.rst in the scripts directory or from Script_user_guide.pdf in OsvvmLibraries/Documentation.