Technical data
ModelSim EE/SE Tutorial  5-43
Lesson 5 - Executing commands at startup 
The goals for this lesson are:
• Specify the design unit to be simulated on the command line.
• Edit the modelsim.ini file.
• Execute commands at startup with a DO file.
Start this lesson from either the UNIX or DOS prompt.
1 For this lesson, you will use a macro (DO) file that provides startup information. For 
convenience, a startup file has been provided with the ModelSim program. You need 
to copy this DO file from the installation directory to your current directory:
\<install_dir>\modeltech\examples\startup.do
2 Next, you will edit the system initialization file in the \modeltech directory to specify 
a command that is to be executed after the design is loaded. To do this, open the 
modelsim.ini file using a text editor and uncomment the following line in the [vsim] 
section of the file:
Startup = do startup.do
Then save modelsim.ini.
Note:The modelsim.ini file must be write-enabled for this change to take place. Using MS Explorer, right-
click on \<install_dir>\modeltech\modelsim.ini, then click Properties. In the modelsim.ini Properties 
dialog box, uncheck the Read-only box and click OK.
3 Take a look at the DO file. It uses the predefined variable $entity to do different things 
at startup for different designs.
4 Start the simulator and specify the top-level design unit to be simulated by entering the 
following command at the UNIX/DOS prompt:
vsim counter
Notice that the simulator loads the design unit without displaying the Load Design 
dialog box. This is handy if you are simulating the same design unit over and over. 










