In Vivado tools, you can do this either in GUI or Tcl mode.
Starting in 2014.3, there is a feature in the GUI that allows you to generate the Xilinx simulation libraries for the target simulator.
Dialog Box Options
- Open Vivado in GUI mode.
- Select Tools >Compile Simulation Libraries to open the "Compile Simulation Libraries" dialog box.
- Set the options you need and click the Compile button to start the compilation.
- Simulator: From the Simulator drop-down menu, select a simulator.
- Language: Compiles libraries for the specified language.
If this option is not specified, then the language is set to correspond with the selected simulator (above).
For multi-language simulators, both Verilog and VHDL libraries are compiled.
- Library: Specifies the simulation library to compile.
By default, the compile_simlib command compiles all simulation libraries.
- Family: Compiles selected libraries to the specified device family.
All device families are generated by default.
- Compiled library location: Directory path for saving the compiled library results.
By default, the libraries are saved in the current working directory in Non-Project mode, and the libraries are saved in the <project>/<project>.cache/compile_simlib directory in Project mode.
- Simulator executable path: Specifies the directory to locate the simulator executable.
This option is required if the target simulator is not specified in the $PATH or %PATH% environment variable, or to override the path from the $PATH or %PATH% environment variable.
- Overwrite current pre-compiled libraries: Overwrites the current pre-compiled libraries.
- Compile 32-bit libraries: Performs simulator compilation in 32-bit mode instead of the default 64-bit compilation.
- Verbose: Temporarily overrides any message limits and return all messages from this command.
At the bottom of the Compile Simulation Libraries dialog box, there is a field labeled Command.
The value of the Command field changes is based on the options you select.
You can use the value of the Command field to generate a simulation library in Tcl/non-project mode.
Run the Tcl command "compile_simlib".
compile_simlib [-directory <arg>] [-family <arg>] [-force] [-language <arg>]
[-library <arg>] [-print_library_info <arg>] -simulator <arg>
[-simulator_exec_path <arg>] [-source_library_path <arg>]
[-32bit] [-quiet] [-verbose]
Tcl mode options:
||Directory path for saving the compiled results.|
||Selects device architecture. Default: all|
||Overwrites the pre-compiled libraries|
||Compiles libraries for this language. Default: all|
||Selects library to compile. Default: all|
||Prints pre-compiled library information|
||Compiles libraries for this simulator|
||Uses simulator executables from this directory|
||If specified, this directory is searched for the library source files before searching the default path(s) found in the environment variable XILINX_VIVADO for Vivado.|
||Performs the 32-bit compilation|
||Ignores command errors|
||Suspends message limits during command execution|
For complete details on this command, type "compile_simlib -help" on the Tcl command line.
Note: When this command is run with a project open, the tool will use the device family, target language, and library settings specified by the project as the default values, rather than the default settings of the command defined in the help manual.
The default settings can be overridden by specifying the necessary options when the command is run.