export_simulation - 2023.2 English

Vivado Design Suite User Guide: Logic Simulation (UG900)

Document ID
UG900
Release Date
2023-10-18
Version
2023.2 English

Export a simulation script file for the target simulator. The generated script contains simulator commands for compiling, elaborating and simulating the design.

This command retrieves the simulation compile order of specified objects, and export this information in a shell script with the compiler commands and default options for the target simulator. The specified object can be either a simulation fileset or an IP. If you want to run simulation outside Vivado IDE, export_simulation can be used in place of launch_simulation -scripts_only to generate scripts file.
export_simulation [-simulator <arg>] [-of_objects <arg>]
[-step <arg>] [-ip_user_files_dir <arg>] [-
ipstatic_source_dir <arg>]
[-lib_map_path <arg>] [-script_name <arg>]
[-directory <arg>] [-runtime <arg>] [-define <arg>]
[-generic <arg>] [-include <arg>] [-use_ip_compiled_libs]
[-absolute_path] [-export_source_files]
[-generate_hier_access] [-single_step] [-exec] [-force] [-quiet]
[-verbose][-gcc_install_path <arg>] [-more_options <arg>]

Usage

Table 1. export_simulation Options
Name   Description
[-simulator]  

Simulator for which the simulation script will be created. Allowed values are all, xsim, modelsim, questa, vcs, xcelium, riviera, and activehdl.

Default: all

[-of_objects]  

Export simulation script for the specified object.

Default: None

[-step]  

Name of the step for which the simulation script needs to be generated.

Default: None

[-ip_user_files_dir]  

Directory path to exported IP/BD user files (for static, dynamic and data files). For a managed-IP project, the default path is ip_user_files.

Default: Empty

[-ipstatic_source_dir]  

Directory path to the exported IP/BD static files.

Default: Empty

[-lib_map_path]  

Precompiled simulation library directory path. If not specified, follow the instructions in the generated script header to manually provide the simulation library mapping information.

Default: Empty

[-gcc_install_path]   GNU compiler installation directory path for the g++/gcc executables. If not specified, the tool attempts to find based on simulator install path settings.

Default: Empty

[-script_name]  

Output shell script filename. If not specified, then file with a default name is created.

Default: top_module.sh

[-directory]  

Directory where the simulation script will be generated.

Default: export_sim

[-runtime]  

Simulation run time.

Default: full simulation run or until a logical break or finish condition

[-define]  

Read Verilog defines from the list specified with this switch.

Default: Empty

[-generic]  

Read VHDL generics from the list specified with this switch.

Default: Empty

[-include]  

Read include directory paths from the list specified with this switch.

Default: Empty

[-more_options]   Pass specified options to the simulator tool.

Default: Empty

-single_step   Writes out a single-step script. This is supported for Xcelium only.
[-use_ip_compiled_libs]   Reference pre-compiled IP static library during compilation. This switch also works with -ip_user_files_dir and -ipstatic_source_dir switches also for generating scripts using pre-compiled IP library.
[-absolute_path]   Make all file paths absolute with respect to the reference directory.
[-export_source_files]   Copy IP/BD design files to output directory.
[-generate_hier_access]   Extract path for hierarchical access simulation.
-exec   Executes the generated script.
[-force]   Overwrite previous files.
[-quiet]   Ignore command errors.
[-verbose]   Suspend message limits during command execution.

Description

Export a simulation script file for the target simulator (see the list of supported simulators below). The generated script contains simulator commands for compiling, elaborating, and simulating the design.

The command retrieves the simulation compile order of specified objects, and export this information in a shell script with the compiler commands and default options for the target simulator. The specified object can be either a simulation fileset, IP, or a BD (block design).

If the object is not specified, then this command generates the script for the active simulation top. Any Verilog including directories or file paths for the files containing Verilog define statements are added to the compiler command line.

By default, the design source file and include directory paths in the compiler command line are set relative to the ref_dir variable that is set in the generated script. To make these paths absolute, specify the -absolute_path switch.

The command also copies data files (if any) from the fileset, or from an IP to the output directory. If the design contains Verilog sources, then the generated script also copies the glbl.v file from the software installation path to the output directory.

A default .do file that is used in the compiler commands in the simulation script for the target simulator, is written to the output directory.

Note: To perform simulation with the generated script, the simulation libraries must be compiled first using the compile_simlib Tcl command. The compiled library directory path must be specified when generating this script. The generated script automatically includes the setup files for the target simulator from the compiled library directory.

Supported Simulators

  • Vivado simulator (xsim)
  • ModelSim Simulator (modelsim)
  • Questa Advanced Simulator (questa)
  • Verilog Compiler Simulator (vcs)
  • Riviera-PRO Simulator (riviera)
  • Active-HDL Simulator (activehdl)
  • Cadence Xcelium Parallel Simulator (xcelium)

Arguments

-of_objects
(Optional) Specify the target object for which the simulation script file needs to be generated. The target object can be either a simulation fileset (simset) or an IP. If this option is not specified then this command generates file for the current simulation fileset.
-step
(Optional) Specify the name of the step for which the simulation script needs to be generated. The valid step values are : compile, elaborate, and simulate. If this is not specified, the script executes all the steps applicable.
-ip_user_files_dir
(Optional) Specify the directory path to the extracted design files for the generated IP/BD source. For a managed IP project, the default path is ip_user_files. If this is not specified, the extracted design files are picked from the default directory path that is set by the IP.USER_FILES_DIR project property.
-ipstatic_source_dir
(Optional) specify the directory path to the exported IP/BD generated static source files. For a managed IP project, the default path is ip_user_files/ipstatic. If this option is not specified, the extracted design file are picked from the default directory path that is set by the SIM.IPSTATIC_SOURCE_DIR project property.
-lib_map_path
(Optional) Specify path to the AMD pre-compiled simulation library for the selected simulator. The simulation library is compiled using compile_simlib. See the header section in the generated script for more information. If this switch is not specified, then the generated script will not reference the pre-compiled simulation library and the static IP files will be locally compiled.
-gcc_install_path
(Optional) Specify the directory path to the GNU executable for the target simulator. This option is required for designs that contain SystemC, C++ or C source. If this option is not specified, the tool attempts to calculate the path to the GNU executagble based on the simulator install path settings.
-script_name
(Optional) Specify name of the generated script. Default name is <simulation_top>.sh. If the -of_objects switch is specified, then the default syntax of the script is as follows:

-of_objects [current_fileset -simset] .sh
-of_objects [get_ips ] .sh
-of_objects [get_files .xci] .sh
-of_objects [get_files .bd] .sh
-absolute_path
(Optional) Specify this option to make source and include directory paths absolute. By default, all paths are set relative to the output directory specified with the -directory switch.
-force
(Optional) Overwrite an existing script file of the same name. If the script file already exists, the tool returns an error unless the -force argument is specified.
-directory
(Required) Specify the directory path where the script file is exported.
-simulator
(Required) Specify the target simulator name for the simulation script. The valid simulators names are xsim, modelsim, questa, vcs (or vcs_mx), xcelium, riviera, and activehdl.
-quiet
(Optional) Execute the command quietly, ignoring any command line errors and returning no messages. The command also returns TCL_OK regardless of any errors encountered during execution.
-verbose
(Optional) Temporarily override any message limits and return all messages from this command.
-generate_hier_access
(Optional) Extract path for hierarchical access simulation.
-runtime
(Optional) Specify simulation runtime. If not specified, then simulation will run until finding a logic break or finish declaration. Alternatively, the runtime can be specified using the "<simulator>.simulate.runtime" fileset property
-define
(Optional) Specify the list of Verilog defines used in the design. Alternatively, defines can be specified using the "verilog_defines" fileset property.
-generic
(Optional) Specify the list of VHDL generics used in the design. Alternatively, can be specified using the "vhdl_generic" fileset property.
-include
(Optional) Specify the list of include directory paths for verilog include files in the design. Alternativiely, can be specified using the include_dirs fileset property.
-export_source_files
(Optional) Specify this option to copy the IP design files to the generated script directory in a sub-directory named srcs. The generated script references the design files from this srcs directory.