Technical data
Tcl/Tk and ModelSim
ModelSim EE Tutorial ModelSim EE Lessons
-
121
Example shortcuts
To save some typing, copy the commands from the PDF version of these
instructions and paste them at the Model
Sim
prompt. Paste with the right (2 button
mouse), or middle (3 button mouse). You can also select a Model
Sim
or VSIM
prompt from the Main transcript to paste a previous command to the current
command line.
Make a transcript DO file
You can rerun the commands executed during the current session with a Do file
created from the Main transcript. Make the DO file by saving the transcript with
the
File > Save Main As
menu selection at any time during the exercises. Run the
DO file to repeat the commands (do <do filename>).
Preparin
g
for the Tcl/Tk examples
These steps must be completed before running the Tcl examples.
1
Create, and change to a new working directory for the Tcl/Tk exercises. Copy the
lesson files in the following directory (include all subdirectories and files) to your new
directory:
<install_dir>/<modelsim_dir>/examples/tcl_tutorial
2
Make the new directory the current directory, then invoke Model
Sim
:
for UNIX
vsim -gui
for Windows (from a shortcut or Start > Run, etc.)
modelsim.exe
3
At the ModelSim prompt, create a
work
library in the
/vhdl
directory:
vlib vhdl/work
4
Map the
work
library.
vmap work vhdl/work
5
Compile the VHDL example files with these commands (or the Compile dialog box):
vcom vhdl/traffic.vhd
vcom vhdl/queue.vhd
vcom vhdl/tb_traffic.vhd
Now you’re now ready to run the examples.