Tcl Programming/Modelsim

TCL SCRIPT FOR MODELSIM USERS

I tried to find a TCL script, which helps in compilation and simulation of Modelsim programs and has both GUI and single letter commands but I didn't find any.

Later I learned TCL and wrote a small script for Modelsim users, which makes icons on the Modelsim GUI. Just by clicking on the icons your project files will get compiled, simulated and so on.

The icons and its description are

·compile    c is for compilation, simulation, add wave and run, simply do everything

·com-restart  r      does compilation and restarts the already run code, we do this whenever we change code and want to compile and execute it

·Quitsim        q     quits the simulation

·QuitModel sim  Q     quits Modelsim

You can do all the afore said things just by clicking on the icon as we use 'save' and 'open'-like icons in general GUI.

And also you can do these things just by typing c, r, q & Q (defined above) on the command prompt, only one letter will do. For these things, you just have to execute one command on the command prompt of Modelsim after opening Modelsim: source filename.tcl

TCL CODE:

This is a very generic code suited for all projects of Modelsim but unfortunately only Modelsim DE and Questa sim supports button command   you just have to change the bold and italic font statements(.vhd files). These statements are for files of a counter project here. So you have to replace those counter example files with your project files.

Then save your file as script.tcl (file with .tcl extension) and execute the file with “source “ command as said above.

Now your GUI and single letter commands are ready to simplify your work. For any assistance contact: mohan@tataelxsi.co.in