Table of Contents Previous page Next page Index

ModelSim Documentation Bookcase

Model Technology Inc.


Running the simulation

We will start the simulation by applying stimulus to the clock input.

  1. Click in the Main window and enter the following command at the VSIM prompt:

  2. 
    force clk 1 50, 0 100 -repeat 100 
    
    

(MENU: Signals > Edit > Clock)

ModelSim interprets this force command as follows:

  1. Now you will exercise two different Run functions from the toolbar buttons on either the Main or Wave window. (The Run functions are identical in the Main and Wave windows.) Select the Run button first. When the run is complete, select Run All.

  2. Run. This causes the simulation to run and then stop after 100 ns.
    (PROMPT: run 100) (MENU: Run > Run 100ns)

    Run -All. This causes the simulator to run forever. To stop the run, go on to the next step.
    (PROMPT: run -all) (MENU: Run > Run -All)

  3. Select the Break button on either the Main or Wave toolbar to interrupt the run. The simulator will stop running as soon as it gets to an acceptable stopping point.

The arrow in the Source window points to the next HDL statement to be executed. (If the simulator is not evaluating a process at the time the Break occurs, no arrow will be displayed in the Source window.)

Next, you will set a breakpoint in the function on line 18.

  1. Move the pointer to the Source window. Scroll the window vertically until line 18 is visible. Click on or near line number 18 to set the breakpoint. You should see a red dot next to the line number where the breakpoint is set. The breakpoint can be toggled between enabled and disabled by clicking it. When a breakpoint is disabled, the circle appears open. To delete the breakpoint, click the line number with your right mouse button and select Remove Breakpoint 18.

  2. (PROMPT: bp counter.vhd 18)


    Note: Breakpoints can be set only on executable lines - denoted by green line numbers.

  3. Select the Continue Run button to resume the run that you interrupted. ModelSim will hit the breakpoint, as shown by an arrow in the Source window and by a Break message in the Main window.

  4. (PROMPT: run -continue) (MENU: Run > Continue)

  5. Click the Step button to single-step through the simulation. Notice that the values change in the Variables window. You can keep clicking Step if you wish.

  6. (PROMPT: run -step) (PROMPT: step)

  7. When you're done, quit the simulator by entering the command:

  8. 
    quit -force 
    
    

This command exits ModelSim without asking for confirmation.


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