Product Documentation
Virtuoso VHDL Toolbox User Guide
Product Version IC23.1, June 2023

5


Simulating a Netlisted VHDL Design

After netlisting, you can simulate and debug your VHDL design. In the Virtuoso Studio design environment, you can simulate a design by using the xrun utility or the XMVHDL (xmsim) simulator. While the xrun utility is a quick one-step process, the XMVHDL simulator is a three-step process, which involves compiling, elaborating, and simulating the design.

The executable and log file names will depend on the simulator being used. For the changes in the executable and log file names when using the Xcelium simulator, see Running Simulations with Xcelium.

You can set up and run the xrun utility from both, the command line interface and VHDL Toolbox, however, the XMVHDL simulator can be run only from the VHDL Toolbox.

The XMVHDL simulator enables you to:

This chapter describes the steps to simulate and debug your netlisted design using the VHDL Toolbox.

In this chapter, you will learn about the following topics:

For more information about using the command-line options for simulating your design, refer to Netlist and Simulate a VHDL Design. For information on the SKILL functions associated with VHDL Toolbox, see Digital Design Netlisting and Simulation SKILL Reference.

Simulating a Design Using the VHDL Toolbox

Before you can simulate a design by choosing Commands – Simulate, you need to set up the simulation options.

VHDL Setup - Simulation Form

To set simulation options for a VHDL design:

  1. In the VHDL Toolbox window, choose Setup – Simulation. The VHDL Setup - Simulation form appears, as shown in the figure below.

The VHDL Setup - Simulation form consists of two tabs:

General Options Tab

The figure displayed above shows the General Options tab of the VHDL Setup - Simulation form. This tab contains various options to control simulation.

When you enable the Xrun Options tab, the Cosimulation section of the General Options tab is disabled.

Xrun Options Tab

The following figure shows the Xrun Options tab on the VHDL Setup - Simulation form:

The Xrun Options tab provides options for the xrun utility integrated with Virtuoso. The xrun utility provides a simple invocation process that lets you run the simulator by specifying all input files and command-line options on a single command line.

By default, Virtuoso uses the xmsim simulator. Therefore, the Xrun Options tab is disabled. To enable the Xrun Options tab, set the vhdlSimSimulator SKILL variable to xrun. When you enable the Xrun Options tab, the Cosimulation section of the General Options tab is disabled.

When using the xrun utility, you need to set xrun specific options in addition to the options given in the settings done in the General Options tab. The various options on the Xrun Options tab are:

When you use the xrun utility, the settings done using the VHDL Setup - Simulation form are saved as a set of SKILL variables in the .vhdlrc file in the run directory. Inputs from this file are passed to the xrun utility. When you use the same run directory again, the options set in the .vhdlrc file are restored. For more details on the SKILL variables, refer to the Setting VHDL HNL Variables section in Appendix B.

Simulating the VHDL Design

Simulation first checks the design. If the check is successful, the VHDL simulator starts in batch or interactive mode on the local machine, as specified in the setup. The VHDL simulator triggers a three-step process to compile, elaborate, and simulate a design. When you click Simulate, the registered compiler (xmvhdl) is invoked on the generated netlist. A testbench, if available, is also compiled with the design. After the design is compiled, it is elaborated using the registered elaborator (xmelab). The elaborated design is then passed on to the registered simulator (xmsim). You can run the simulation either in interactive or batch mode as required.

To simulate your VHDL design:

For more information on the XM-VHDL simulator, refer to the XM-VHDL Simulator Help.

Debugging Your VHDL Design

You can use several tools to help in debugging your design. You can

Editing from the XM-VHDL Simulator

You can edit your design while debugging it. To edit a design unit from the XM-VHDL simulator:

  1. Choose File – Edit File from the pop-up menu. The Edit File form will be invoked.
  2. Specify the name of the design unit and click the OK button. The design will appear in the VHDL text editor.
  3. Edit your design.

Using Cross Selection

When debugging your design, you can set breakpoints or traces on certain objects. These commands prompt you to specify an object. You can specify an object by doing the following:

To debug your design using cross selection:

  1. From the Visrtuoso Schematic Editor, choose Options – Editor. The Editor Options form appears.
  2. Select Cross Selection check box.
  3. Click OK.
    You can also add the following line to your .cdsenv file:
    envSetVal("schematic" "broadcast" ’boolean t)
  4. From the XM-VHDL simulator, choose Show – Breakpoint...– Set... or Show – Probes...– Set... .

The following sections show you how to fill in the forms automatically through cross selection.

Setting Break Points

The Set Breakpoint command opens a form to create, delete, enable, or disable break points. A breakpoint listing includes the state of the breakpoint.

You can set break points on the form by identifying an object in the context of a schematic or symbol, as opposed to the netlisted VHDL text.

To use cross selection with the Set Breakpoint command in the XM-VHDL simulator, do the following:

  1. Choose Show – Breakpoints... . The Debug Settings form appears.
  2. Select Set... . The Set Break form appears. The Show form appears.
    Click Set to open the Set Break form to add a new breakpoint. The Set Break form appears. You can use this form to set breakpoints and specify options for breakpoints of various types. The options change, based on the type of breakpoint you set.
  3. Click a wire in the Virtuoso Schematic Editor L. The Set Break form fills in automatically, showing the breakpoint type name.
  4. Click OK on the Set Break form.

For details on this command, refer to the XM-VHDL Simulator Reference Manual.

The Show – Set Trace command is similar. You can select wires in the schematic window to set a trace on a signal.

Comparing Simulations

VHDL uses a tool, SimCompare, to compare two waveform databases and log the results of the simulation comparison. SimCompare is invoked in the background when you select the Simulation Compare option from the Fixed Menu or choose Commands – Sim Compare. SimCompare provides a text view of any differences found when two simulation results are compared. You can compare, for example, pre-synthesis and post-synthesis simulation results. For more information on using the SimCompare tool, refer to the SimCompare User Guide.

Choose Setup – Sim Comparison to open the VHDL Setup - Sim Comparison form in which you can specify names of the Simulation History Manager (SHM) databases that you need to compare and the name of a output log.

During simulation, the simulation database opens and traces signals. The current database becomes the golden database. Then, you run another simulation and compare it against the current database. You can compare the results of any two VHDL simulations that are able to generate SHM databases.

VHDL Setup - Sim Comparison Form

To set up the options for comparing two VHDL simulations:

  1. Choose Setup – Sim Comparison . The VHDL Setup - Sim Comparison form appears.

The various options on the VHDL Setup - Sim Comparison form are:

Comparing VHDL Simulations

To compare simulations:

Simulating a VHDL Design Using Non-Cadence VHDL Tools

To use non-Cadence VHDL tools, you need to define your own SKILL procedures and register this information with the toolbox using the SKILL routine, vhdlRegisterSimulator().

To register your callbacks, add the procedures for the callbacks in some file, say myfile.il that is in the /home/xyz directory and add the following lines to the .cdsinit file in your home directory:

(loadi "/home/xyz/myfile.il")
vhdlRegisterSimulator("myParserCallBack"
"myAnalyzerCallBack"
"myAnalyzerFileExt"
"myElaboratorCallBack"
"mySimulatorCallBack"
"myDataDirCallBack"
"myDataFileCallBack"
"myWorkLibCallBack")

If you do not provide your own callback routines to invoke any of the non-Cadence tools, namely, the parser/analyser/elaborator/simulator, then by default, the XM-VHDL tools such as the parser/analyzer xmvhdl, elaborator xmelab, and simulator xmsim are run.

Parser CallBack

procedure(myParserCallBack((t_filePath t_libName t_errorFile)
...
)
return value:
disembodied Property List(DPL)

This procedure takes the VHDL source file and the name of the library in which this file is contained and runs the parser on it. The parser produces a LISP file which can be loaded by the SKILL engine and referenced as the DPL disembodied property list.  If the parsing was unsuccessful, then errors/warnings from the parser are written to the error file.

Analyzer CallBack

procedure( myAnalyzerCallBack(t_filePath t_sourceFileName
t_workLibraryName x_maxErrors)
      ....
      )
return value:
t if successful
      nil if fatal error OR
      list( x_errCount t_errFileName ) if errors occurred

The procedure invokes the analyzer that analyzes the specified sourceFileName which exists in the specified directory filePath. The VHDL design unit is compiled into the library specified by the workLibraryName variable. The analysis aborts if the number of errors generated exceeds the specified maxErrors.

For incremental processing to avoid calling the analyzer if the file has already been analyzed, the analyzed file should exist or be linked to the specified filePath.

Analyzed File String

analyzerFileExt

It is a string representing the name of the analyzed file. For incremental netlisting you need to provide the name of the analyzed file so that the tool does not reanalyze the design.

Elaborator CallBack

procedure( myElaboratorCallBack(t_libName t_primaryName
t_secondaryName t_simModelName x_maxErrors)
....
)
return value:
t if successful
nil if fatal error OR
list( x_errCount t_errFileName ) if errors occurred

This procedure invokes the elaborator to elaborate the VHDL design unit specified by libName, primaryName and secondaryName variables. The result of the elaboration is a simulation model whose name is specified by the simModelName variable. Elaboration aborts if the number of errors generated exceeds the specified maxErrors. The VHDL design unit can be an architecture or configuration. In the latter case, the configuration name is configuration.

Simulator CallBack

procedure( mySimulatorCallBack(t_libName t_primaryName
t_secondaryName t_simModelName g_batchp
t_scriptFileName)
         ...
       )
return value:
t if successful
nil if unsuccessful

The procedure invokes the simulator that simulates the specified simulation model simModelName. You can either run the simulation in batch or interactive mode using the batchp variable.

In case of interactive simulation you need to quit any currently running simulations and start the simulator. You can also set the WORK library to specified libName. If scriptFileName is not an empty string, then it is sent to the simulator as a setup file.

In case of batch simulation the simulator starts the simulation in background. If scriptFileName is not empty string, then it is sent as the simulation run. Otherwise a scriptFile is created which starts the simulation. In this case the simulation is ended based on the testbench.

Data Directory CallBack

procedure( myDataDirCallBack(t_libName t_cellName t_viewName)
...
)
return value:
physical directory where the VHDL text file should be stored

If the library, cell, and view name are given this procedure returns the physical directory where the VHDL text file is to be stored.

Data File CallBack

procedure(myDataFileCallBack(t_libName t_cellName t_viewName)
...
)
return value: 
name of the file in which the VHDL text file should be stored.

If the library, cell and view names are given this procedure returns the physical file name under which the VHDL text file is to be stored.

Work Library CallBack

procedure(myWorkLibCallBack()
...
)
return value:
name of the work library

This procedure returns the library that contains the compiled design unit information.


Return to top
 ⠀
X