Table of Contents Previous page Next page Index

ModelSim Documentation Bookcase

Model Technology Inc.


Preparing the simulation

  1. Create a new directory for this exercise and copy the following VHDL (.vhd) files from \<install_dir>\modeltech\examples to the new directory.

  2. Make sure the new directory is the current directory. Do this by invoking ModelSim from the new directory or by using the File > Change Directory command from the ModelSim Main window.

  3. Start ModelSim with one of the following:

for UNIX at the shell prompt:

vsim 

for Windows - your option - from a Windows shortcut icon, from the Start menu, or from a DOS prompt:

modelsim.exe 

Select "Proceed to ModelSim" if the Welcome dialog appears.

  1. Enter the following command at the ModelSim prompt to create a new library:

  2. 
    vlib library_2 
    
    
  3. Compile the source files into the new library by entering this command at the ModelSim prompt:

  4. 
    vcom -work library_2 gates.vhd adder.vhd testadder.vhd 
    
    
  5. Now let's map the new library to the work library. To create a mapping you can edit the [Library] section of the modelsim.ini file, or you can create a logical library name with the vmap command:

  6. 
    vmap work library_2 
    
    

ModelSim modifies the modelsim.ini file for you.

  1. Start the simulator by selecting Design > Load Design from the Main window, or by clicking the Load Design icon. The Load Design dialog box is displayed, as shown below.

  2. Perform the following steps in the Load Design dialog box:

  3. To open all of the ModelSim windows, enter the following command in the Main window at the VSIM prompt:

  4. 
    view * 
    
    

(Main MENU: View > All)

  1. Drag and drop the top-level signals to the List window in the following manner: make sure the hierarchy is not expanded (no minus boxes), select all signals in the Signals window with Edit > Select All, then drag the selected signals to the List window.

  2. (Signals MENU: View > List > Signals in Region) (PROMPT: add list *)

  3. To add top-level signals to the Wave window, enter the command:

  4. 
    add wave * 
    
    

(Signals MENU: View > Wave > Signals in Region) (DRAG&DROP)

  1. Now change the default simulation run length to 1000 (ns) with the run length selector on the Main toolbar. Click on the field to edit the number to 1000 (notice how the arrows allow you to change the run length in increments).

  2. (Main MENU: Options > Simulation > Defaults)


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