Intel® Quartus® Prime Pro Edition User Guide: Third-party Simulation

ID 683870
Date 12/04/2023
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

2.3. QuestaSim* Simulation Setup Script Example

The Intel® Quartus® Prime software can generate a msim_setup.tcl simulation setup script for IP cores in your design. The script compiles the required device library models, compiles the design files, and elaborates the design with or without simulator optimization. To run the script, type source msim_setup.tcl in the simulator Transcript window.
Alternatively, if you are using the simulator at the command line, you can type the following command:
vsim -c -do msim_setup.tcl

In this example the top-level-simulate.do custom top-level simulation script sets the hierarchy variable TOP_LEVEL_NAME to top_testbench for the design, and sets the variable QSYS_SIMDIR to the location of the generated simulation files.

# Set hierarchy variables used in the IP-generated files
set TOP_LEVEL_NAME "top_testbench"
set QSYS_SIMDIR "./ip_top_sim" 
# Source generated simulation script which defines aliases used below
source $QSYS_SIMDIR/mentor/msim_setup.tcl 
# dev_com alias compiles simulation libraries for device library files
dev_com
# com alias compiles IP simulation or Platform Designer model files and/or Platform Designer model files in the correct order
com 
# Compile top level testbench that instantiates your IP
vlog -sv ./top_testbench.sv 
# elab alias elaborates the top-level design and testbench
elab
# Run the full simulation
run - all

In this example, the top-level simulation files are stored in the same directory as the original IP core, so this variable is set to the IP-generated directory structure. The QSYS_SIMDIR variable provides the relative hierarchy path for the generated IP simulation files. The script calls the generated msim_setup.tcl script and uses the alias commands from the script to compile and elaborate the IP files required for simulation along with the top-level simulation testbench. You can specify additional simulator elaboration command options when you run the elab command, for example, elab +nowarnTFMPC. The last command run in the example starts the simulation.