Beruflich Dokumente
Kultur Dokumente
com
ModelSim Tcl/Tk Examples
You can run this example in any of the following ways:
1. Copy the example and paste it directly into ModelSim (at the ModelSim> or VSIM>
prompt).
2. Copy the example and paste it into a file called "modelsim.tcl" in the directory that
ModelSim will be invoked from (ModelSim looks for a file of this name in the current
directory and in the users home directory).
3. Copy the example and paste it into a file with any name and then use the "source"
command from the ModelSim prompt to load that Tcl/Tk code.
4. Copy the example and paste it into a file with any name and then set the environment
variable MODELSIM_TCL to the name of the file prior to invoking ModelSim. [Note:
MODELSIM_TCL can be a ":" separated list of Tcl/Tk files to load].
5. [Not recommended] You copy and add the example to the file "<ModelSim Install
Directory>/tcl/vsim/pref.tcl". This file gets loaded every time ModelSim is invoked. Care
should be taken when editing this file because every user who uses ModelSim from that
directory will load the Tcl/Tk that you have added.
Place the following Tcl/Tk code into your modelsim.tcl file either in the project directory or in your
home directory. Alternatively, you can set the environment variable MODELSIM_TCL to the
name of the file containing:
Note: If you get a message stating that "apply_button_adder" is an invalid command then you are
probably on release 5.1f or before. To make the above example work with that release, replace
the call to "apply_button_adder" with a call to "_add_menu" with the same arguments.