Advanced Waveform Tips - CMU-18240/240-How-to GitHub Wiki

See the 18-240 page Waveform Viewer for a refresher on the waveform viewer and some basic commands! The best way to get better with the waveform viewer is to use it. If you hover on a button, it should display text that tells you what it does. If you're still not sure, try it and find out!

Recompiling within the waveform viewer

It may be easier in some cases to recompile your code from within the waveform viewer without having to open it with a new executable compiled externally.

  1. Click Simulator → Rebuild and Start.
  2. In the popup window titled "Simulation Setup," check the "Custom command" option
  3. Enter your compilation command in the custom command box, which is likely of the form: vcs -sverilog -debug <filename>.sv for 18-240 and some variant of make full for 18-341.
  4. Either use the "Browse" button or type the directory you wish this command to be run in. Ensure that the filenames/paths in step 3 are relative to this directory. (Usually you don't need to modify this.)
  5. Ensure the Action on OK option is set to "Rebuild and Start" and click "OK."
  6. You will receive compilation messages at the bottom of the primary DVE window (under the "DVE Console" tab). After compilation completes, you can execute the new simulation. Remember that if you made syntax errors etc. compilation will fail, errors will be reported in that tab. If you don't fix them you will of course not see an updated simulation.

Saving signals across sessions

You may find it irritating to have to close the waveform viewer, recompile your code, and read the signals you were looking at. Thankfully you can save the set of signals viewed on the waveform viewer to load later.

  1. On the waveform viewer window (not the DVE window with the individual panes), click File → Save Session.
  2. This will create a .tcl file. Name it to something appropriate and put it somewhere where you can find it later.
  3. The next time you open up DVE (i.e. after recompiling), simply click File → Load Session, and open up that .tcl file you saved.

Find when a signal goes to a specific value.

  1. Find this option in the top menu bar. image

  2. Click on the drop down that says "Any Edge" and change it to "Value..."

  3. You should get a pop-up window that says value search. Enter the value you're looking for. You can use verilog syntax like 'h1234 to specify a hex number. Click OK.

  4. Click on the signal you're searching in the left bar of the main view. (See below.)

  5. The image buttons now find the next and previous instances of this value. Click around to see different times it appears.

image

Trace Drivers

"Trace Drivers" means "My signal is doing the wrong thing, what is the SV/other signals that are causing it to do the wrong thing". Sometimes it works better than other times.

  1. Right click on a signal (in the left pane above, in the code, wherever). If you're interested in a specific time step set the time cursor first (pink line above).
  2. Click on "trace drivers". It will show the code that is driving this signal. You can click on signals in the code too and trace them.

Setting Breakpoints

What is this, GDB? More like... better GDB...

  1. Click Simulator → Breakpoints. You can also do things like right click a line of code and set a breakpoint there.
  2. You have a ton of options here including stopping at certain points in the code, on value changes, etc. You can even drag signals from the waveform viewer into the Breakpoints window. This can be especially useful for simulations that take a long time or loop infinitely. (You can always stop simulation prematurely with the red octagonal stop button too.)
⚠️ **GitHub.com Fallback** ⚠️