13-05-2013, 02:25 PM
[color=#FF0000]Getting Started Using Mentor Graphic’s ModelSim[/color
Getting Started.pdf (Size: 330.38 KB / Downloads: 152)
INTRODUCTION
There are two modes in which to compile designs in ModelSim, classic/traditional mode and
project mode. This guide will give you a short tutorial in using classic/traditional mode. It is
broken down into the following sections
1. Part 1: Compiling a Design
2. Part 2: Simulating a Design
3. Transitioning to the Next Lab
4. Setting Simulator Resolution
5. Directory Structures and Running Scripts
Compile a Design
In order to run a simulation, all files (design and testbench) that are to be used in the simulation
must be compiled. Use the ModelSim menu command "Compile > Compile" to compile a
design (Inc.vhd for the first part of lab 1) into the work library. This causes the following
pop-up window to appear. In the pop-up window select Inc.vhd and press the compile button.
Recompiling and Rerunning a Simulation
VHDL designs are required to be compiled bottom-up. If you find and fix a bug in your design,
you will need to re-compile both the design (Inc.vhd) and the testbench (IncTb.vhd).
To re-run a simulation, instead of starting a simulation, use the restart command. Restarting a
simulation sets the time to 0, reloads any recompiled designs, and maintains the current context
(such as signals in the wave window). Restart a simulation by using ModelSim menu item
"Simulate > Restart". This will cause the following pop-up to appear. Press the Restart button.
Using the Waveform Window
All commands described in this section are done with the waveform window undocked. To
undock the wave window press on the undock button (see diagram in the Displaying
Waveforms section – it is the box with an arrow pointing out of it). The waveform window
menus should now look as below (you may need to stretch it some). Other changes made
to the wave window will be explained in this section. Note the same menu commands are
available when the wave window is docked, however, they are more difficult to find.