L- and H-Tile Transceiver PHY User Guide

ID 683621
Date 1/30/2024
Public
Document Table of Contents

2.7.2.2. Steps for a .do file for Simulation

The following procedure shows the steps required to generate a .do file for simulation.

STEP 3: Generate IP Simulation setup script and create top_level simulation script.

  1. From the Intel® Quartus® Prime Tools menu, select Generate Simulator Setup Script for IP.

  2. In the Generate Simulator Setup Script for IP dialog box, do not enable Compile all design files to the default library work.

  3. Leave Use relative paths whenever possible checked.
  4. Click OK.
  5. Once script generation is complete, in a file explorer window, go to the project directory.
  6. Inside the mentor directory, open the file msim_setup.tcl in a text editor.

  7. In the msim_setupt.tcl file, scroll up to the commented line that reads # # TOP-LEVEL TEMPLATE – BEGIN. Then scroll down to locate the line that reads # # TOP-LEVEL TEMPLATE – END.
  8. Copy the two commented lines above and all of the lines between them to the clipboard.
  9. Create a new text file in a text editor and paste the contents from the clipboard into this new file.

    Again, this new file should begin with # # TOP-LEVEL TEMPLATE – BEGIN and end with # # TOP-LEVEL TEMPLATE – END. (Doing so correctly aligns the upcoming modification instructions.)

  10. Save the file as mentor_top.do into the project directory (NOT the mentor directory).
  11. Make the following modifications to mentor_top.do:

    • Uncomment line 11 of the DO file, the setQSYS_SIMDIR… command.

      Change <script generation output directory> to the project directory in which the simulation runs.

    • Uncomment line 14, the source $QSYS_SIMDIR/mentor/msim_setup.tcl command.

      This command sources the ModelSim simulation setup script you generated.

    • Uncomment line 20, the dev_com command.

      This command uses the dev_com alias to compile all of the device-specific simulation library files.

    • Uncomment line 23, the com command.

      This command compiles all of the IP core-specific simulation files.

    • Uncomment line 29, the vlog command.

    • For this vlog command, type the following:

      vlog -work work -vlog01compat < all top_level design files > <test bench>

      This compiles the entire non-IP core files used in the simulation.

    • Uncomment line 34, the set TOP_LEVEL_NAME… command. Replace <simulation top > with <name of test bench file >. For example, if the test bench is design_tb.v, then issue the command as follows:

      set TOP_LEVEL_NAME design_tb

    • Uncomment line 37, the set USER_DEFINED_ELAB_OPTIONS…command. Replace <elaboration options> with voptargs="+acc".

      This line lets you specify arguments that get called with the simulator’s vsim command. In particular, you are allowing for simulator optimization while maintaining full visibility of internal signals.

    • Uncomment line 40, the elab command.

    • This alias launches the simulation.

    • Uncomment line 43, run –a command.
  12. Save the file mentor top.do.