The testbench in Figure 3 generates printouts as shown in Figure 4. The printouts show values of digital signals, each having the value one or zero. We can represent these signals as waveforms, with the level of the waveform being one or zero. Thinking of the value one as a high voltage level, and the value zero as a low voltage level, we can think of the waveforms as representing actual voltages, in an actual digital system.
A waveform can be visualized using the GTKWave program. We can download a GTKWave version for Mac, in the form of a zip-file that contains an executable GTKWave program. The GTKWave program can be started from a Mac Terminal, by giving the command open followed by the app file name of the program. As an example, I could start the program by doing
A GTKWave version for Ubuntu can be installed in Ubuntu, by giving the command
sudo apt-get install gtkwave
The program can then be started by giving the command gtkwave.
A waveform can be generated from Verilog by insertion of a $dumpfile statement, followed by a $dumpvars statement indicating from which module the waveform data shall be recorded. An example is seen in the testbench code in Figure 3.
Figure 5. Waveforms, obtained from running the testbench in Figure 3.