Skip to main content

Verilog VCD: Waveform Dumping for Simulation Analysis

· loading · loading · ·
Hardware Design Verilog VCD Waveform Viewing Simulation Analysis Testbench GTKWave
Hardware Design
Axolot Logic
Author
Axolot Logic
Digital Design Engineer
Table of Contents
Verilog HDL Series - This article is part of a series.
Part 22: This Article

📉 VCD – Value Change Dump
#

VCD (Value Change Dump) is a standard waveform file format generated during Verilog simulation. It records signal transitions over time, which can be viewed in tools like GTKWave.

✅ How to Generate VCD:
#

Inside your testbench:

initial begin
  $dumpfile("wave.vcd");       // Output file name
  $dumpvars(0, tb_top);        // Dump all signals in tb_top hierarchy
end
  • $dumpfile: sets the filename.
  • $dumpvars(level, scope): sets how many levels of signals to record.

📊 View with GTKWave:
#

gtkwave wave.vcd

💡 Additional VCD Tasks
#

TaskDescription
$dumpfileSets the name of the output VCD file
$dumpvarsStarts recording value changes
$dumpoffTemporarily disables dumping
$dumponResumes dumping
$dumpallForces all current values to dump
$dumpflushFlushes data to file immediately
$dumpportsDumps only port-level signals

✅ Summary
#

ConceptPurposeUsed in
NamespaceLimits scope of identifiersModules
VCDStores signal changes for waveform viewTestbenches
$dumpfileSets VCD output fileSimulation
$dumpvarsStarts signal recordingSimulation

module tb_vcd_demo;

    reg clk = 0;
    reg rst = 1;
    reg [3:0] counter = 0;

    // Clock generation
    always #5 clk = ~clk;

    // Simple counter logic
    always @(posedge clk) begin
        if (rst)
            counter <= 0;
        else
            counter <= counter + 1;
    end

    // VCD dump setup
    initial begin
        $dumpfile("wave.vcd");
        $dumpvars(0, tb_vcd_demo);
        #10 rst = 0;
        #100 $finish;
    end

endmodule

Verilog HDL Series - This article is part of a series.
Part 22: This Article

Related

Verilog Command-Line Input: $plusargs for Testbench Control
· loading · loading
Hardware Design Verilog Command Line Plusargs Testbench Simulation Control Hardware Verification
Hardware Design
Verilog Delay Controls: #Delay, @Event, Wait
· loading · loading
Hardware Design Verilog Delay Event Control Wait Statement Simulation Testbench
Hardware Design
Verilog Hierarchical Reference: Accessing Internal Signals
· loading · loading
Hardware Design Verilog Hierarchical Reference Force Release Testbench Simulation Debugging Hardware Verification
Hardware Design
Verilog Simulation Basics & Testbench Design
· loading · loading
Hardware Design Verilog Simulation Testbench Timescale Simulation Regions Hardware Verification
Hardware Design
Verilog System Functions & Tasks for Simulation
· loading · loading
Hardware Design Verilog System Functions Verilog Tasks Simulation Testbench Randomization
Hardware Design
Hardware Design Abstraction Levels in Verilog
·238 words·2 mins· loading · loading
Hardware Design Hardware Abstraction RTL Design Gate Level Transistor Level Digital Design
Hardware Design