Tell me more ×
Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It's 100% free, no registration required.

Is there a way to dump the memory in verilog using vcd dump? Since now i have written this:

module sampler(clk, pixel);

    input clk;
    input[7:0] pixel;

    wire[7:0] pixel;
    reg [7:0] macro_block [0:63];
    reg [5:0] address;

    always @ (posedge clk or negedge clk) begin
        macro_block[address]=pixel;
        address<=address+1;
    end
endmodule

module tb();

    reg clk;
    reg[7:0] pixel;

    sampler s(clk,pixel);

    initial begin
        $dumpfile("test.vcd");
        $dumpvars(0,tb);
        clk=0;
        pixel=1;
        $monitor("%g %b",$time, clk);
        #5 $finish;
    end

    always begin
        #1 clk <= ~clk;
    end

endmodule

but the array macro_block is not shown in gtkwave, is it possible to shown?

share|improve this question

1 Answer

Depends on your simulator. For Icarus, I think you need an explicit dumpvars statement for every array row you want to dump. I don't recall if you need the [msb:lsb] subscript. For CVC, you can use the +dump_arrays plusarg. I use CVC all the time and view arrays in gtkwave.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.