Install - GTK wave

Overview

๋””์ง€ํ„ธํšŒ๋กœ ๋””๋ฒ„๊น…์„ ์œ„ํ•ด์„œ value change dump ํŒŒ์ผ๋กœ ํด๋ก, ์ž…์ถœ๋ ฅ ๋“ฑ์„ ๋ณด์—ฌ์ฃผ๋Š” GTK Wave ๋ฅผ ์„ค์น˜ํ•ฉ๋‹ˆ๋‹ค.

์ด ํŒจํ‚ค์ง€๋Š” ์ตœ์‹  ๋ฆด๋ฆฌ์ฆˆ๊ฐ€ ์„ฑ๋Šฅ์—๋Š” ํฐ ์˜ํ–ฅ์ด ์—†๋‹ค๊ณ  ์ƒ๊ฐ์ด ๋“ค์–ด์„œ ๊ทธ๋ƒฅ ํŒจํ‚ค์ง€ ๋งค๋‹ˆ์ €๋กœ ์„ค์น˜ํ–ˆ์Šต๋‹ˆ๋‹ค.

Install gtkwave on ubuntu

1
$ sudo apt -y install gtkwave

ํ…Œ์ŠคํŠธ ํŒŒ์ผ์„ ์ž‘์„ฑํ•ด๋ด…๋‹ˆ๋‹ค.

trace.v

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/*
 * 4bit_unssigned_adder & bit detector
 *
 * output : 
 * @clk : internal clock
 * @a : 
 * @b
 * 
 */

module trace;
    
    reg clk = 0;
    reg[3:0] a = 4'd0;
    reg b = 0;
    
    always #1 clk = ~clk;
    
    always @(posedge clk) begin
        a = a + 1;
        b = a[2];
    end
    
    initial begin
        $dumpfile("trace.vcd");
        $dumpvars(0, trace); // all vars dump
        #100 $finish; // 100 second end time
    end 
    
endmodule

$finish ๋ถ€๋ถ„์€ ์ข…๋ฃŒ๋˜๋Š” ์‹œ์ ์„ ์ •ํ•ฉ๋‹ˆ๋‹ค.

ํ•ด๋‹น ๊ตฌ๋ฌธ์ด ์—†์œผ๋ฉด ์‹œ๋ฎฌ๋ ˆ์ด์…˜์ด ๊ณ„์† ์ง„ํ–‰ ๋˜๋ฒ„๋ฆฝ๋‹ˆ๋‹ค.

setup.sh

1
2
3
4
$ iverilog trace.v -o trace

$ vvp trace
VCD info: dumpfile trace.vcd opened for output.

๋งŒ๋“ค์–ด์ง„ trace.vcd ํŒŒ์ผ gtkwave ์—์„œ ์‹คํ–‰ํ•ฉ๋‹ˆ๋‹ค.

trace.v ๋ฅผ ์‹œ๋ฎฌ๋ ˆ์ด์…˜ํ•œ ๊ฒฐ๊ณผ๋ฅผ GTKWave ๋กœ ํ™•์ธํ•˜๊ธฐ

dumpvars ์—์„œ ๋ชจ๋“  ๋ณ€์ˆ˜๋ฅผ ๋คํ”„ํ•˜๋ฏ€๋กœ,

SST ์— ๋ชจ๋“ˆ์„ ์„ ํƒํ•˜๊ณ , ๋คํ”„ํ•œ signal ๋“ค์˜ ํŒŒํ˜•์„ ์กฐํšŒํ•  ์ˆ˜ ์žˆ๊ฒŒ signal ๋ฉ”๋‰ด๋กœ ๋“œ๋ž˜๊ทธ ๋“œ๋กญํ•ฉ๋‹ˆ๋‹ค.

๊ทธ๋ฆฌ๊ณ  ๋ฉ”๋‰ด ํ•ญ๋ชฉ์—์„œ Time โ†’Zoom โ†’ Zoom In ์œผ๋กœ ํ™•๋Œ€ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.