18.104.22.168. 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.
From the Intel® Quartus® Prime Tools menu, select Generate Simulator Setup Script for IP.
In the Generate Simulator Setup Script for IP dialog box, do not enable Compile all design files to the default library work.
- Leave Use relative paths whenever possible checked.
- Click OK.
- Once script generation is complete, in a file explorer window, go to the project directory.
Inside the mentor directory, open the file msim_setup.tcl in a text editor.
- 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.
- Copy the two commented lines above and all of the lines between them to the clipboard.
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.)
- Save the file as mentor_top.do into the project directory (NOT the mentor directory).
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.
- Save the file mentor top.do.
Did you find the information on this page useful?