fault icon indicating copy to clipboard operation
fault copied to clipboard

Add SHM waveform dumping for irun/xrun

Open sgherbst opened this issue 4 years ago • 0 comments

Looks like setting dump_waveforms=True for the ncsim target does not dump data types like arrays and structs, which can make it challenging to debug some kinds of hand-written designs and testbenches. Also, while VCD waveforms are well-supported by various tools, they are not very space-efficient.

Here's how I work around these issues today using the SHM format for irun/xrun.

  1. Set dump_waveforms=False
  2. Use flags=['-access', '+r'] (since this is not normally set when dump_waveforms is False)
  3. Add this code to the testbench (at the beginning of an initial block). This is possible because I am working with a hand-written testbench, rather than a fault-generated testbench.
$shm_open("waves.shm");
$shm_probe("ASM");

One way to support this more directly would be to examine the extension of the waveform_file argument and modify the TCL commands generated by write_ncsim_tcl accordingly. I think we should also add a user option that can cause the -memories option to be added to the probe command. In fact the probe command has many interesting options that are documented starting on on page 908 here.

This concept could be extended in the future to support other tool-specific formats like *.lxt for Icarus Verilog / GTKWave.

sgherbst avatar Apr 28 '20 18:04 sgherbst