Technical data

Tcl/Tk and ModelSim
ModelSim EE/SE Tutorial 6-53
2 Drag the mouse across the buttons and notice what happens in the Main transcript.
Push one of the buttons; you will see an error dialog box. You can solve this
problem by modifying the images.tcl file.
3 To view the source file press the See Source Code button at the bottom of the image
display or invoke notepad at the ModelSim prompt:
notepad images.tcl
You’ll find that the pushme procedure is missing; it’s commented out in
images.tcl.
4 Search for "proc push" using the Edit > Find menu selection in the notepad.
Remove the comments (the "#" symbols) to return the function to your source,
then close the image window with the Destroy button.
5 Once the pushme procedure is in place it will print its one parameter, the object name,
to the transcript.
After you have added the pushme procedure to your source, you need to resource
and rerun the Tcl procedure with these commands (use the up arrow to scroll
through the commands or do !source):
source images.tcl
image_example
Press all the buttons and notice the object names in the Main transcript. Close the
image example window when you’re done.
Example 3 - Simulate an intersection with traffic lights.
In this example you’ll simulate an intersection with traffic lights. The simulation
interface you create allows you to run "what if" scenarios efficiently.
Introduction of the traffic intersection widget
This portion of our example introduces the traffic intersection widget. You’ll add
other widgets to the intersection to create a custom traffic simulation environment.
Once again, make sure you have completed "Preparing for the Tcl/Tk examples"
(p51) before working this example.
1 Draw the intersection by invoking this command and procedure at the ModelSim
prompt: