fault
fault copied to clipboard
Add SHM waveform dumping for irun/xrun
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.
- Set
dump_waveforms=False
- Use
flags=['-access', '+r']
(since this is not normally set whendump_waveforms
isFalse
) - 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.