Questa* Intel® FPGA Edition Simulation User Guide

ID 730191
Date 4/01/2024
Public
Document Table of Contents

3.5. Generating a msim_setup.tcl Simulation Script for RTL Simulation

Understanding this section is a prerequisite for performing RTL simulation of designs that include Intel FPGA IP. Platform designer generates a msim_setup.tcl simulation script in the mentor directory by default when you generate simulation files for IP variants or Platform Designer systems. You can also run the ip-setup-simulation command to generate a single msim_setup.tcl file for all IPs in the Quartus® Prime design. The msim_setup.tcl script is suitable for both Questasim and Questa* Intel® FPGA Edition.

The msim_setup.tcl script defines “aliases” (similar to Tcl procedures, or Tcl commands), for performing compilation and elaboration. This document refers to these aliases as Tcl commands. You can call these Tcl commands from another Tcl script after sourcing msim_setup.tcl, as Example Simulation Script illustrates.

msim_setup.tcl also defines variables that you can use to customize the commands. For example, you can add your own Verilog HDL compilation options to all the files you are compiling, and you can add your own elaboration options to the elaboration commands.

Example ip-setup-simulation Command

The following shows an example ip-setup-simulation command:

ip-setup-simulation --quartus-project=foo.qpf 

This command creates multiple subdirectories in the directory that you run the command. The subdirectories for Questa* Intel® FPGA Edition are the common and mentor directories. The mentor directory contains the msim_setup.tcl simulation setup script.

The following shows an example command with several options:

ip-setup-simulation --quartus-project=<my proj> --output-directory=<my_dir> \
     --use-relative-paths --compile-to-work

The following are some useful command-line options for ip-setup-simulation:

  • compile-to-work—compiles all simulation files into a single work library.
  • use-relative-paths—uses relative paths whenever possible.
  • output-directory—specifies the directory where the output generates.
  • ip-setup-simulation –-help—lists all command-line options.
Note: You can alternatively invoke ip-setup-simulation from the Quartus® Prime software GUI by opening the project, then selecting Tools > generate Simulator Setup Script for IP and entering appropriate values in the dialog box.