Dump SHM waveform in irun/ncsim

SHM Waveform


Below are the two ways to dump waveform in shm format.

  • Using system tasks
  • Using TCL File

Using system tasks


Below syntax should be placed in top file to generate shm wavedump.

$shm_open("waves.shm");
$shm_probe("AS");

 Example: 

initial begin //{
  $shm_open("waves.shm");
  $shm_probe("AS");
end //}

Command to run:
irun -sv +access+rwc top.sv




Using TCL File


database -open waves -into waves.shm -default
probe -create -shm <scope_name> -all

 Example: 

database -open waves -into waves.shm -default
probe -create -shm top -all
run
exit

Place above code in run.tcl file.

Command to run:
irun -sv +access+rwc -input run.tcl top.sv




Delay the shm dump


In few situations its required to enable the wave dump only after some time.

For example,

  • Enabling the dump will cause slowness of simulation time so it might not be required to enable initialization dump
  • if the dump size going to be more, user need to enable waveform dump only after some time 

This can be achieved by mentioning delay in run.tcl file

 Example: 

database -open waves -into waves.shm -default
run 1000ns
probe -create -shm top -all
run
exit

In above example, "run 1000ns" will enables wave dump only after  1000ns



Related Article: