The Mentor Graphics Modelsim environment should be setup by
sourcing the script
$CLASS/setupfiles/setup_all
Click
on your file in the workspace window and then Compile à Compile Selected
You
can see the green check mark in the workspace window and the good message in
the transcript window.
The Start Simulation window will pop up. Click on the work library, then click on your design (traffic_light) then click OK
The
basic commands can be typed into the transcript window with the following
explanations:
Instruction |
Description |
add
wave * |
It
adds all the signals and variables to the wave window. |
force |
This
command allows you to apply stimulus interactively to the VHDL signals. |
run |
The
run command advances
the simulation by the specified number of timesteps. |
alias |
The
alias command displays
or creates user-defined aliases |
change |
The
change command modifies
the value of a constant, generic or a variable. |
delete |
The
delete command removes object from either list of wave window. |
do |
The
do command executes
commands contained in a macro file or the do file as it is commonly known to
us. |
exit |
The
exit command exits the
simulator and the ModelSim application. |
help |
The help command displays in the Transcript pane a brief
description and syntax for the specified
command. |
noforce |
The noforce command removes the effect of any active force
commands on the selected objects. |
restart |
The restart command reloads the design elements and resets
the simulation time to zero. |
pause |
The pause command placed within a macro interrupts the
execution of that macro, allowing
you to perform interactive debugging of the macro file. |
quit |
The quit command exits the simulator. |
vcom |
The vcom command compiles the source code into a specified
working library |
vsim |
The vsim command is used to invoke the VSIM simulator, to
view the results of a previous simulation run. |
write
report |
The write report command prints a summary of the design being
simulated including a list of all design units with the names of their source
files |
As
you start to type, help is provided in the transcript window with the required
arguments and options for each command
“*”
wild carding for signal names is allowed.
After
add wave *
The
basic commands and their description:
Instruction |
Description |
add
wave * |
It
adds all the signals and variables to the wave window. |
force |
This
command allows you to apply stimulus interactively to the VHDL signals. |
run |
The
run command advances
the simulation by the specified number of timesteps. |
alias |
The
alias command displays
or creates user-defined aliases |
change |
The
change command modifies
the value of a constant, generic or a variable. |
delete |
The
delete command removes object from either list of wave window. |
do |
The
do command executes
commands contained in a macro file or the do file as it is commonly known to
us. |
exit |
The
exit command exits the
simulator and the ModelSim application. |
help |
The help command displays in the Transcript pane a brief
description and syntax for the specified
command. |
noforce |
The noforce command removes the effect of any active force
commands on the selected objects. |
restart |
The restart command reloads the design elements and resets
the simulation time to zero. |
pause |
The pause command placed within a macro interrupts the execution
of that macro, allowing you to
perform interactive debugging of the macro file. |
quit |
The quit command exits the simulator. |
vcom |
The vcom command compiles the source code into a specified
working library |
vsim |
The vsim command is used to invoke the VSIM simulator, to
view the results of a previous simulation run. |
write
report |
The write report command prints a summary of the design being
simulated including a list of all design units with the names of their source
files |
To
covert some signal into a clock right
click on the signal name in the waveform
Then
click Clock in the popup
You
should be able to feed the clock parameters in the pop up.
One
can also use the force command for a
clock in the transcript window. You can see the command there as you set up the
popup.
force
–freeze sim:/<entityname>/clock_name 1 0, 0{Duty cycle in ns}
–r <time period in ns>
In
fact all your commands are kept in the transcript window AND in a transcript
file.
That
file can be edited and used as INPUT to the simulator so you do not have to
keep restoring your state. These command files are called “do”
files.
The
transcript file starts its lines with “#” for information messages,
these are comments for a do file. So you can keep them or delete them.
Edit
the transcript file and save the file with an extension of <filename>.do
then in the command line of ModelSim run the following command.
do <filename.do>
this
will re-play all the commands in the file.