Table of Contents Previous page Next page Index

ModelSim Documentation Bookcase

Model Technology Inc.


Preparing the simulation

  1. Start by creating a new directory for this exercise (in case other users will be working with these lessons). Create the directory, then copy all of the VHDL (.vhd) files from \<install_dir>\modeltech\examples to the new directory.

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

  1. 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

Note: if you didn't add ModelSim to your search path during installation, you will have to include the full path when you type this command at a DOS prompt.

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

  1. Before you compile any HDL code, you'll need a design library to hold the compilation results. To create a new design library, make this menu selection in the Main window: Design > Create a New Library.

  2. Make sure Create: a new library and a logical mapping to it is selected. Type "work" in the Library Name field and then select OK.

    This creates a subdirectory named work - your design library - within the current directory. ModelSim saves a special file named _info in the subdirectory.

    (PROMPT: vlib work
    vmap work work)


    Note: Do not create a Library directory using UNIX or Windows commands, because the _info file will not be created. Always use the Design menu or the vlib command from either the ModelSim or UNIX/DOS prompt.)

  3. Compile the file counter.vhd into the new library by selecting the Compile button on the toolbar:

  4. (PROMPT: vcom counter.vhd)


    This opens the Compile HDL Source Files dialog box. (You won't see this dialog box if you invoke vcom from the command line.)

    Complete the compilation by selecting counter.vhd from the file list and clicking Compile. Select Done when you are finished.

    You can compile multiple files in one session from the file list. Individually select and Compile the files in the order required by your design.

  5. Now let's load the design unit. Select the Load Design button from the toolbar:

  6. (PROMPT: vsim counter)

    The Load Design dialog box comes up, as shown below (you won't see this dialog box if you invoke vsim with counter from the command line).

    The Load Design dialog box lets you select the library and top-level design unit to simulate. You can also select the resolution limit for this simulation. By default, the following will appear for this simulation run:

  7. Select the entity counter and choose Load to accept these settings.

  8. Next, select View > All from the Main window menu to open all ModelSim windows.

(PROMPT: view *)

For descriptions of the windows, consult the ModelSim User's Manual.

  1. From the Signals window menu, select View > List > Signals in Region. This command displays the top-level signals in the List window.

  2. (PROMPT: add list /counter/*)

  3. Next add top-level signals to the Wave window by selecting View > Wave > Signals in Region from the Signals window menu.

(PROMPT: add wave /counter/*)


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