User`s manual

A quick ModelSim tutorial
Start Here for ModelSim PE, Software Version 5.7
37
A quick ModelSim tutorial
Here are the basic steps to simulation. These commands work within ModelSim at
the ModelSim prompt, or on your operating system command line. You must be
in the modeltech/examples directory to run the examples. (Go to "Licensing" (p8)
if ModelSim is NOT ready to run.)
Use these commands at the VSIM prompt within ModelSim:
For more simulation exercises and lessons, consult the ModelSim SE Tutorial.
Command Description
vlib work creates a work library for holding your
compiled designs
vcom counter.vhd
or
vlog counter.v tcounter.v
compiles the HDL source code, use vcom for
VHDL or vlog for Verilog
vsim counter
or
vsim test_counter
loads and simulates the design unit, use
counter for VHDL or test_counter for
Verilog
view * opens all ModelSim windows
add wave -r /* adds all signals in the design to the Wave
window
force clk 1 50, 0 100 -repeat
100
(this command must be
invoked on one line)
forces the clock (VHDL design only) to
value 1 after 50 ns after the current time,
then to 0 at 100 ns after the current time
and repeats every 100 ns
run 1000 runs the design for 1000 ns
quit exits ModelSim (use quit -f to exit
ModelSim without confirmation)