launch_simulation - 2022.2 English

Vivado Design Suite Tcl Command Reference Guide (UG835)

Document ID
UG835
Release Date
2022-10-19
Version
2022.2 English

Generate simulation scripts of the design and launch steps for the target simulator.

Syntax

launch_simulation [‑step <arg>] [‑simset <arg>] [‑mode <arg>] [‑type <arg>]
    [‑scripts_only] [‑gui] [‑exec] [‑of_objects <args>] [‑absolute_path]
    [‑install_path <arg>] [‑gcc_install_path <arg>] [‑noclean_dir] [‑quiet]
    [‑verbose]

Usage

Name Description
[-step] Launch a simulation step. Values: all, compile, elaborate, simulate. Default:all (launch all steps). Default: all
[-simset] Name of the simulation fileset
[-mode] Simulation mode. Values: behavioral, post-synthesis, post-implementation Default: behavioral
[-type] Netlist type. Values: functional, timing. This is only applicable when mode is set to post-synthesis or post-implementation
[-scripts_only] Only generate scripts
[-gui] Invoke simulator GUI (applicable for -scripts_only mode)
[-exec] Execute existing script for the step specified with the -step switch
[-of_objects] Generate compile order file for this object (applicable with -scripts_only option only)
[-absolute_path] Make design source file paths in 'absolute' format
[-install_path] Custom installation directory path
[-gcc_install_path] Specify GNU compiler installation directory path for the g++/gcc executables
[-noclean_dir] Do not remove simulation run directory files
[-quiet] Ignore command errors
[-verbose] Suspend message limits during command execution

Categories

ToolLaunch

Description

Launch a simulator to perform analysis and verification of a design.

The launch_simulation command creates a script file for the target simulator and then executes this file in the simulation run directory. The simulation results are saved in the log files created in the run directory.

To run simulation for a specific simulator, you must first define the target simulator by setting the TARGET_SIMULATOR property on the design project:
set_property TARGET_SIMULATOR <name> [current_project]

The TARGET_SIMULATOR property can have a value of XSim, ModelSim, Xcelium, VCS, Riviera, or ActiveHDL. The default value is XSim, the Vivado® simulator.

The target simulator can also be defined from the Vivado IDE. Create or open a project, select Tools > Settings > Simulation menu item, and select the Target simulator from the drop-down menu. The available choices are: Vivado simulator, ModelSim Simulator, Questa Advanced Simulator, Xcelium Parallel Simulator, Verilog Compiler Simulator (VCS), Riviera-PRO Simulator, and Active-HDL Simulator.
Tip: Some of these simulators are only available on Linux and some are only available on Windows.
The launch_simulation command uses a three-step process comprised of compile, elaborate, and simulate steps. A script file for the target simulator is created for each step in the process, (compile.bat, elaborate.bat, simulate.bat), and written to the simulation run directory.
Tip: On Linux the script files are named with the .sh suffix instead of .bat.

By default, launch_simulation will run these script files in sequence to run the simulation. You can create the scripts without running them by using the -scripts_only option.

This command returns a transcript of its process, or returns an error if it fails.

Arguments

-simset <arg> - (Optional) The name of the simulation fileset containing the simulation test benches and sources to be used during simulation. If not specified, the current simulation fileset is used.

-mode [ behavioral | post-synthesis | post-implementation ] - (Optional) Specifies either a behavioral simulation of the HDL design sources to verify syntax and confirm that the design performs as intended, a functional or timing simulation of the post-synthesis netlist, or a functional or timing simulation of the post implementation design to verify circuit operation after place and route. The default mode is behavioral.

-type [ functional | timing ] - (Optional) Specifies functional simulation of just the netlist, or timing simulation of the netlist and SDF file. This option must be specified with -mode for post-synthesis or post-implementation, but cannot be used with -mode behavioral. Post-synthesis timing simulation uses SDF component delays from the synth_design command. Post-implementation timing simulation uses SDF delays from the place_design and route_design commands.
Important: Do not use -type with -mode behavioral, or the tool will return an error.

-scripts_only - (Optional) Only generate the simulation scripts for the target simulator, rather than actually launching these scripts to start the "compile", "elaborate" and "simulate" steps. You can use the scripts to launch the simulation flow at a later time.

-of_objects <arg> - (Optional) Run simulation for a single specified sub-design, or composite file. The sub-design must be specified as a design object as returned by the get_files command, rather than simply specified by name.

-absolute_path - (Optional) Specify this option to define the source and include paths used in the simulation scripts as absolute paths. By default, all paths are written as relative to the simulation run directory. Relative paths include an "origin_dir" variable that is set in the simulation script to the current run directory, but you can edit the $origin_dir variable to point to a path of your choice when relocating the design and simulation scripts.

-install_path <arg> - (Optional) Specifies the directory containing simulator executables ( e.g. vlog.exe, ncvlog, vlogan). If this option is not specified, the target simulator will be looked for in the current $PATH.

-gcc_install_path <arg> - (Optional) Specifies the directory containing simulator GCC executables (e.g. gcc, g++). If this switch is not specified, then the directory path will be determined from the project property named "simulator.<name>_gcc_install_dir". If this property is not set, then the path set by the GCC_SIM_EXE_PATH environment variable will be used. If this variable is not set, then launch_simulation will automatically try to calculate the path from the simulator installation. If not able to determine, the path will then be searched from the $PATH (Linux) or %PATH% (Windows) environment variable.

Supported GCC versions.
  • questa - 5.3.0
  • xcelium - 6.3
  • vcs - 6.2.0

-noclean_dir - (Optional) Do not remove files from the simulation run directory prior to launching the simulator. The default behavior is to remove files from the simulation run directory to create a clean start. With the -noclean_dir option, existing files in the run directory are left in place. However, some of the files generated for use by the simulator will be overwritten or updated by re-launching the simulator.

-step - (Optional) Specifies the simulation step to be launched. The valid steps are: compile, elaborate, and simulate.
Tip: By default, all the steps will be executed.

-exec – (Optional) Execute script for the step specified with the -step switch. The script must be generated first and should be present in the simulation run directory.

Note: This switch is applicable with the -step only.
-quiet - (Optional) Execute the command quietly, returning no messages from the command. The command also returns TCL_OK regardless of any errors encountered during execution.
Note: Any errors encountered on the command-line, while launching the command, will be returned. Only errors occurring inside the command will be trapped.
-verbose - (Optional) Temporarily override any message limits and return all messages from this command.
Note: Message limits can be defined with the set_msg_config command.

Examples

The following commands run behavioral simulation of the design using the Vivado simulator:
set_property target_simulator "XSim" [current_project]
launch_simulation
The following commands run post-synthesis functional simulation of the design using the ModelSim Simulator:
set_property target_simulator "ModelSim" [current_project]
launch_simulation -mode "post-synthesis" -type "functional"
The following commands run post-implementation functional simulation of the design using the Cadence Xcelium Simulator:
set_property target_simulator "Xcelium" [current_project]
launch_simulation -mode "post-implementation" -type "functional"
The following commands run post-implementation timing simulation of the design using the Synopsys VCS Simulator:
set_property target_simulator "VCS" [current_project]
launch_simulation -mode "post-implementation" -type "timing"
The following command generates behavioral simulation scripts for the target simulator in the simulation run directory:
launch_simulation -scripts_only

The following command will generate and execute compile step:

launch_simulation -step compile

The following command will execute elaborate step by executing the existing elaborate script in the simulation run directory:

launch_simulation -step elaborate -exec
The following commands run behavioral simulation flow of the design for the my_simset simulation fileset for the target simulator in the simulation run directory:
launch_simulation -simset [get_filesets my_simset]
The following command runs behavioral simulation flow for the char_fifo.xci IP for the target simulator in the simulation run directory, and does not clean up prior simulation files:
launch_simulation -noclean_dir -of_objects [get_files char_fifo.xci]
The following command generates absolute paths for the source files in the generated script files:
launch_simulation -absolute_path
The following command will pick the simulator tools from the specified installation path instead of from the PATH variable:
launch_simulation -install_path /tools/ius/13.20.005/tools/bin

The following command will pick the Xcelium simulator tools from the specified installation path instead of from the PATH variable:

launch_simulation -install_path /tools/20.09.006/tools/xcelium/bin