Automated TCL simulation of Modelsim

Source: Internet
Author: User

The biggest advantage of Modelsim's Tcl is that it allows the entire simulation to run automatically, saving you from the trouble of performing various user interface control operations each time. With TCL, You can automatically create databases, map databases to physical directories, and compileSource code, Start the simulator, run the simulation and a series of other operations.

The following describes the operation steps based on the instance:
1. Compile the source file. Including camera. V and its test.pdf file camera_tb.v
2. Compile the. Do file (camera_tb.do) with the following content:
# Create the work Library
Vlib work
Vmap work

# Compile the OpenGL files
Vlog-Work work camera. v
Vlog-Work work camera_tb.v

# Run simulation
Vsim-lib work camera_tb
View Wave
Add wave SIM:/camera_tb /*
Run 55 ms
3. Compile A. bat batch file for running the entire Modelsim simulation in Windows cmd. The source code is as follows:
Vsim-Do camera_tb.do
Save the file as camera_tb.bat.
4. Run camera_tb.bat in Windows cmd.
Note: The preceding files (camera_tb.do, camera_tb.bat) should be stored in the corresponding project directory.
In the project directory, click camera_tb.bat to run the program.

The DOS window is displayed as follows:

The simulation results are as follows:

The following information is displayed in the Command window:

During debugging, If you modify the source file and need to re-run the simulation, you only need to enter the do camera_tb.do command in the Command window and press enter to automatically complete the simulation process again, very convenient.
In addition, if the DOS window is closed, Modelsim is also closed, and the two are correlated.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.