Animating Logic Simulations

-- written by D. Bouldin and Narayanan Raghuraman -- 4/07/04


Copy the following files:

/usr/cad/course/nraghura-altera.tar.gz /usr/cad/course/nraghura-debug.tar.gz /usr/cad/course/nraghura-traffic.tar.gz

Part 1: Animation of an UpDown Counter

In this section, you will be shown how an animation interface works
Download this file
Unzip it to any folder say hw2a
cd hw2a
vsim &
source altera.tcl
Press Run Button
Press 'dip1' to make the counter count down
Press 'dip2' to disable the counter

Part 2: Modification of the Animation Interface

In this section, you will be taught how to modify the interface using TCL/TK programming
Read the instructions and follow the steps
Make the necessary changes to the file 'altera.tcl'
source the file in the ModelSim command line
Press Run Button
Press 'dip1' to make the counter count down
Press 'dip2' to disable the counter
Press 'Reset' button to reset the count to '0'.
Capture a few images depicting that you have made the changes
You can modify any of the lines and see what effect it has in the interface
Comments have been provided in the file 'altera.tcl' to explain the significance of the various commands

Example Images

Counting Up - part 1 - interface
Counting Down - part 1 - interface
Counting Up - part 2 - interface
Counting down - part 2 - disabled - interface
Counting Up - wave
Counting Up - wave - disabled
Counting Down - wave - part 2
Reset pressed - wave - part 2

Part 3a: Animation of a Traffic Light Controller

In this section, you will be taught how to animate a more complex vhdl block - A Traffic Light Controller
Download this file

Unzip it to any folder say hw2b cd hw2b vsim & source runsim.do Press Run Button You should see the cars moving through the intersection according to the light states. Read the 'tcl' files and understand how the interface works(comments have been provided in the tcl files)

Part 3b: Debugging of VHDL logic using ModelSim - an example

In this section, you will be taught how to animate the debugging of vhdl logic
Download this file

Unzip it to any folder say hw2c cd hw2c vsim & source runsim.do Select any of the 'light' signals in the wave window (Press 'shift' to select multiple signals) Press the button 'trafficd' in the wave window You should see the number of signals selected in the top-right corner of the traffic interface Press Run Button Let the simulation run for 200 ms Now click on any light signal wave in the wave window which you had selected before bringing up the interface You should see the light state change in the traffic interface To select more signals, select them and press 'Reload Selected' in the traffic interface This method can be very useful in debugging vhdl logic Read the 'tcl' files and understand how the debugging interface works(comments have been provided in the tcl files)

More Information on Animation

To learn more about animating Logic, Read this presentation (pdf) Be sure to read the notes provided below the slides. This presentation provides a detailed explanation on how to create Animation Interfaces using TCL/TK and ModelSim