본문 바로가기

MY Study/Verilog

Verilog VCD Dump

# VCD Dump File 경로 및 이름 지정 

$dumpfile("./MY_DUMP/test.vcd");

 

# Dump 수행할 variable 지정 ($dumpfile 경로에 생성된 파일에 dump 됨)

- 특정 variable에 대해 구체적으로 지정할 수도 있고, module을 지정할 경우 해당 module의 variable을 dump 

 

  1. 현재  Testbench의 모든 variable dump 하기

$dumpvars;

  

  2. 특정 variable을 지정하여 dump 하기

$dumpvars( <levels>, <module_or_variable> );

module을 특정할 경우, 해당 module에 instantiated 되어있는 sub-module의 variable까지 모두 dump 할 것인지 Level을 지정하여 dump 범위를 정할 수 있다.

 

    (1) 지정한 module에 하위의 모든 sub-module dump하기

$dumpvars(0, testbench_module.top_module);

    testbench_module 내 intstantiated 되어있는 top_module과 top_module 하위 모든 module의 variable을 dump

 

    (2) 지정한 module의 variable 만 dump 하기 (sub-module 내부 variable dump 안 함)

$dumpvars(1, testbench_module.top_module);

    testbench_module 내 intstantiated 되어있는 top_module의 variable 만 dump (하위 module dump 안 함)

 

    (3) 지정한 module의 1 Level 하위 module까지의 variable 만 dump 하기

$dumpvars(2, testbench_module.top_module);

    testbench_module 내 intstantiated 되어있는 top_module의 하위 module의 하위 module은 dump 안 함

 

  3. 특정 timing에 대해서만 dump 하기 

  모든 timing에 대해서 dump 할 필요가 없을 경우 필요한 구간만 지정하여 dump 수행 가능

  $dumpoff;    // Dump stop 
  $dumpon;    // Dump start

 


[예시]

 

initial begin

    $dumpfile("./MY_DUMP/test.vcd"); 

    #1000;  

    $dumpvars(0, testbench_module.top_module);   // Dump start

    #1000;

    $dumpoff; // Dump stop

    #1000;

    $dumpon; // Dump start

    #1000;

    $dumpoff; // Dump stop

   

    $finish; // finish simulation

end

'MY Study > Verilog' 카테고리의 다른 글

Verilog force release  (0) 2019.06.11