Dump VCD waveform in irun/ncsim

Below are the two ways to dump waveform in VCD (Value Change Dump) format.


 Method-1:  Using system tasks 

$dumpfile("filename");
$dumpvars();


 Example-1: 

initial begin //{
 $dumpfile("waves.vcd");
 $dumpvars();
end //}

 Example-2: 

initial begin //{
 $dumpfile("waves.vcd");
 $dumpvars(1,top);  //Dumps all variables within top, doesnt dump variables from modules instantiated inside top
end //}

 Example-3: 

initial begin //{
 $dumpfile("waves.vcd");
 $dumpvars(0,top);  //Dumps all variables in top and also from modules instantiated inside top 
end //}

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



 Method-2:  Using TCL File 

database -open -vcd <database name> -into <filename> -default
probe -create -vcd <scope_name> -all

 Example: 

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

Place above code in run.tcl file.

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



Related Article: