Table of Contents Previous page Next page Index

ModelSim Documentation Bookcase

Model Technology Inc.


Lesson 6 - Executing commands at startup


The goals for this lesson are:


Important: Start this lesson from either the UNIX or DOS prompt in the same directory in which you completed Running a batch-mode simulation chapter .

  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:

  2. 
    \<install_dir>\modeltech\examples\startup.do 
    
    
  3. Next, you will edit the modelsim.ini file in the \modeltech directory (or the modelsim.ini file in your current directory if one exists) to specify a command that is to be executed after the design is loaded. To do this, open <install_dir>\modeltech\modelsim.ini using a text editor and uncomment the following line (by deleting the leading ;) in the [vsim] section of the file:

  4. 
    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 dialog box, uncheck the Read-only box and click OK. (You can also copy the file to your current directory.)

  1. Take a look at the DO file. It uses the predefined variable $entity to do different things at startup for different designs.

  2. Start the simulator and specify the top-level design unit to be simulated by entering the following command at the UNIX/DOS prompt:

  3. 
    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. Also notice that all the windows are open. This is because the view * command is included in the startup macro.

  1. If you plan to continue with the following practice sessions, keep ModelSim running. If you would like to quit the simulator, enter the following command at the VSIM prompt:

  2. 
     quit -f 
    
    
  3. You won't need the startup.do file for any other examples, so use your text editor to comment out the "Startup" line in modelsim.ini.


Model Technology Inc.
Model Technology Incorporated
Voice: (503) 641-1340
Fax: (503)526-5410
www.model.com
sales@model.com
Table of Contents Previous page Next page Index

ModelSim