export_simulation - 2021.1 English

Vivado Design Suite Tcl Command Reference Guide (UG835)

Document ID
UG835
Release Date
2021-06-16
Version
2021.1 English

(User-written application) Export a script and associated data files (if any) for driving standalone simulation using the specified simulator.

Syntax

export_simulation [‑simulator <arg>] [‑of_objects <arg>]
    [‑ip_user_files_dir <arg>] [‑ipstatic_source_dir <arg>]
    [‑lib_map_path <arg>] [‑gcc_install_path <arg>] [‑script_name <arg>]
    [‑directory <arg>] [‑runtime <arg>] [‑define <arg>] [‑generic <arg>]
    [‑include <arg>] [‑more_options <arg>] [‑use_ip_compiled_libs]
    [‑absolute_path] [‑export_source_files] [‑generate_hier_access]
    [‑32bit] [‑force] [‑quiet] [‑verbose]

Returns

None

Usage

Name Description
[-simulator] Simulator for which the simulation script will be created (value=all|xsim|modelsim|questa|ies|xceliu m|vcs|riviera|activehdl) Default: all
[-of_objects] Export simulation script for the specified object Default: None
[-ip_user_files_dir] Directory path to the exported IP/BD (Block Design) user files (for static, dynamic and data 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, then please 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. Default: Empty
[-script_name] Output script filename. If not specified, then a file with a default name will be created. Default: top_module.sh
[-directory] Directory where the simulation script will be generated Default: export_sim
[-runtime] Run simulation for this time (default:full simulation run or until a logical break or finish condition) Default: Empty
[-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
[-use_ip_compiled_libs] Reference pre-compiled IP static library during compilation. This switch requires -ip_user_files_dir and -ipstatic_source_dir switches as well for generating scripts using pre-compiled IP library.
[-absolute_path] Make all file paths absolute
[-export_source_files] Copy IP/BD design files to output directory
[-generate_hier_access] Extract path for hierarchical access simulation
[-32bit] Perform 32bit compilation
[-force] Overwrite previous files
[-quiet] Ignore command errors
[-verbose] Suspend message limits during command execution

Categories

xilinxtclstore

Description

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

This command retrieves the simulation compile order of specified objects, and exports this information in a text file with the compiler commands and default options for the target simulator. The specified object can be a simulation fileset or an IP. If the object is not specified, the export_simulation command will generate the script for the simulation top.

By default, the design source file and include directory paths in the compiler command line will be set relative to the directory where the script file is generated. To make these paths absolute, specify the -absolute_path option.

The command will also copy data files (if any) from the fileset, or from an IP, to the output directory. If the design contains Verilog sources, the generated script will also copy glbl.v from the software installation path to the output directory.
Note: In order to perform simulation with the generated script, the simulation libraries must be compiled first using the compile_simlib command, with the compiled library directory path specified, when generating this script. The generated simulation script will automatically include the setup files for the target simulator from the compiled library directory. Use the -lib_map_path option to specify the compiled library directory.
Note: If a design contains IP/BD sources, these sources must be generated first before exporting the script. export_simulation does not generate output products of these sources, but checks for the status of these sources and print message accordingly.

This command returns nothing.

Arguments

-simulator <arg> - (Optional) Specify the target simulator name for which the simulation script needs to be generated. Valid simulator names are all, xsim, modelsim, questa, ies, xcelium, vcs, riviera, and activehdl. If this option is not specified the command will generate the script for all simulators.

-of_objects <arg> - (Optional) Specify the target object for which the simulation script file needs to be generated. The target object can be a simulation fileset (simset) or an IP/BD source. If this option is not specified the command will generate simulation scripts for the current simulation fileset.
Note: The -of_objects option requires objects to be specified using the get_files, get_ips, current_fileset, or current_fileset -simset commands rather than specifying objects by name. In addition, -of_objects cannot be used with a search <pattern>.

-ip_user_files_dir <arg> - (Optional) Specify the directory path to the exported IP/BD generated source files. This is generally the sub-directory named <project>.ip_user_files in the project directory structure.

-ipstatic_source_dir <arg> - (Optional) Specify the directory path to the exported IP/BD generated static source files. This is generally the sub-directory named <project>.ip_user_files/ipstatic in the project directory structure.

-lib_map_path <arg> - (Optional) Specify the pre-compiled simulation library directory path where the Xilinx simulation libraries are compiled.
  • To specify a library location if you specified a simulator name with the -simulator switchuse the following syntax.
    -lib_map_path <compiled-library>
  • To specify multiple library locations if you specified the all value with the -simulator switch, use the following syntax
    -lib_map_path [list {<simulator>=<compiled-library>}
                  {<simulator>=<compiled-library>}
                  ...
                  {<simulator>=<compiled-library>}]
    Where <simulator> is the name of the simulator and <compiled-library> is the path to the simulation library compiled for the simulator specified with <simulator>.

-gcc_install_path <arg> - (Optional) Specify the directory path to the GNU executables for the target simulator. This option is required for designs that contain SystemC, C++, or C sources.

-script_name <arg> - (Optional) Specify the name of the generated script. If this option is not specified, the filename is generated based on the object type selected using -of_objects, and will be in one of the following formats:
  • <simulation_top_name>_sim_<simulator>.sh
  • <ip_name>_sim_<simulator>.sh

-directory <arg> - (Optional) Specify the directory path where the script file needs to be generated. By default, the script will be generated in the export_sim/<simulator> directory.

-runtime <arg> - (Optional) Specify the simulation run time. If this option is not specified, then the simulation will run for infinite time or until a logical break or finish condition.

-define <arg> - (Optional) Specify the Verilog defines applicable for the current design. The syntax for specifying the defines is:
-define [list {<variable[=value]} ... [{<variable[=value]>}]]
-generic <arg> - (Optional) Specify the VHDL generics applicable for the current design. The syntax for specifying the generic variables is:
-generic [list {<variable[=value]} ... [{<variable[=value]>}]]

-include <arg> - (Optional) Specify the include directory paths to the source files in the design. The syntax for specifying the include file directory paths is:

-include [list {<include-directory} ... [{<include-directory>}]]
-more_options <arg> - (Optional) Specify additional switches/args for the simulator tools that need to be added when executing the script. The syntax for specifying the switches/args is:
-more_options [list {<simulator>.<step>.<tool>:<list of switches/args>}
              {<simulator>.<step>.<tool>:<list of switches/args>}
              ...
              {<simulator>.<step>.<tool>:<list of switches/args>}]
Where <simulator> is the name of the simulator, <step> is the name of the step (compile, elaborate, simulate), and <tool> is the name of the simulator tool (xvlog, vcom, vcs, etc.).

-use_ip_compiled_libs - (Optional) Reference precompiled IP static library during compilation. The IP static source will not be compiled but instead it is compiled version will be referenced during elaboration. This switch requires -ip_user_files_dir and the -ipstatic_source_dir switches as well.

-absolute_path - (Optional) Specify this option to make the source and include directory paths into absolute format in the generated script file. By default, all the paths are written relative to the script output directory specified with the -directory option.

-export_source_files - (Optional) Specify this option to copy the design, generated IP/BD, and data sources to the <output directory>/<simulator>/srcs directory. If -of_objects specifies an IP/BD, the sources will be copied to the <output directory>/<IP/BD>/<simulator>/srcs directory. The source and include file paths in the generated script will be set relative to the srcs directory (the file paths can be made absolute using the -absolute_path switch).

-generate_hier_access - (Optional) Specify this option to extract the path for hierarchical access simulation.

-32bit - (Optional) Specify this option to perform 32-bit simulation. If this option is not specified then by default a 64-bit option will be added to the simulation command line.

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

-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

Generate a script file named accum_0_sim_xsim.sh for the XSim simulator in test_sim directory.
export_simulation -simulator xsim -of_objects [get_ips accum_0] \
    -ip_user_files_dir <path> \
    -ipstatic_source_dir <path> \
    -directory test_sim
Generate a script file named test.sh for Questa simulator using the compiled simulation library from /test/questa/clibs. The command will also copy the accum_0 IP source files into the ./results/accum_0/questa/srcs directory.
export_simulation -simulator questa -of_objects [get_ips accum_0] \
-lib_map_path /test/questa/clibs \
-runtime 2000ns \
-define [list {FREQ=10} {RATE=20}] \
-generic [list {DATA=34} {LINE=21}] \
-script_name test.sh \
-directory ./results \
-export_source_files
Generate a script file named verify.sh for the Xcelium simulator for the current simulation fileset.
export_simulation -simulator xcelium -of_objects [current_fileset -simset] \
    -lib_map_path /test/xcelium/clibs \
    -include [list {/test/fifo/ver/incl_1} {/test/fifo/ver/incl_2}] \
    -script_name verify.sh \
    -directory ./results
Generate and execute the script for the VCS simulator:
  1. Export the script for the char_fifo IP.
    export_simulation -simulator vcs -of_objects [get_ips char_fifo] \
        -lib_map_path /test/vcs/clibs \
        -ip_user_files_dir <path> \
        -ipstatic_source_dir <path> \
        -runtime 5000ns \
        -more_options [list {vcs.compile.vlogan:-V} {vcs.elaborate.vcs:-timescale 1ps/1ps}] \
        -script_name verify.sh \
        -directory ./xp \
        -use_ip_compiled_libs
        -absolute_path \
        -force
  2. Verify the simulation for the char_fifo IP.
    cd xp/char_fifo/vcs
        ./verify.sh