[Verdi]Verdi使用方法技巧总结


Verdi使用方法技巧总结

前言:本文主要总结Verdi的常用方法,包扩使用技巧、快捷键、dump波形等等。下面着重介绍dump module中的signal、array、以及memory的wavefrom的方法。

  • 目录

一、下载波形(Dump fsdb)

1.1、基本用法

1.2、切割fsdb文件(How to split fsdb file)

1.3、保存特定时间间隔的fsdb

1.4、不保存特定实例的fsdb(How to not dump a certain instance)

1.5、不保存指定实的波形(How to not dump with instances listed in a file)

1.6、如何存储Assertion的波形(How to dump assertion)

1.7、存储Memory的波形(How to dump memory arrays)

1.8、How to dump lib cells signal to fsdb

1.9、How to dump fsdb by ucli mode

二、特殊需求总结

2.1、How to dump glitch information

2.2、How to dump force information

2.3、How to dump wreal type information

2.4、How to dump signals in Functions and Tasks


一、下载波形(Dump fsdb)

1.1、基本用法

  • $fsdbDumpfile(file_name, file_size(MB))
  • $fsdbDumpvars(depth, instance, options)

参数介绍:

Depth :

  • 0 : all signals in all scopes.
  • 1 : all signals in current scope.
  • 2 : all signals in the current scope and all scopes one level below.
  • n : all signals in the current scope and all scopes n-1 levels below.
  • Options (Optional) :
Options Description
+all Dump all signals including memory, MDA, packed array, structure, union, power-related, and packed structure
+mda Dump all memory and MDA signals
+strength Enable strength dumping
+struct Dump all structs (default on)
+power Dump power-related signals (default on)
+IO_Only Dump only input & output signals
+Reg_Only Dump only Reg signals
others check on verdi -doc //$VERDI_HOME/doc/linking_dumping.pdf
  • vcs compile option : -debug_access (-debug_pp for old VCS) is needed
  • Recommend :

VCS and Verdi should align at least same version:

Don't use $fsdbDumpvars(0, chip_tmdl) in post-sim pattern, it may traverse more than 12 hours according to WCD experience:

  • Example
1
2
$fsdbDumpfile("test.fsdb", 50)
$fsdbDumpvars(0, chip_top, "+power", "+struct", "+mda", "+IO_Only", "+Reg_Only");

1.2、切割fsdb文件(How to split fsdb file)

  • $fsdbAutoSwitchDumpfile(File_size(MB), File_name, number_of_file)
  • Recommend

RTL not over 2G, netlist not over 5G:

  • Example
1
2
3
4
initial begin
    $fsdbDumpvars(0, dut);
    $fsdbAutoSwitchDumpfile(2000, XXX, 20);
end
  • 通过时间周期切分fsdb
1
2
3
4
5
6
7
8
9
10
integer i;
initial begin
    $fsdbDumpvars(0, dut);
    i=0;
    forever begin
        $fsdbSwitchDumpfile($sformatf("XXX_%0d", i));
        #time period;
        i = i+1;
    end
end

1.3、保存特定时间间隔的fsdb

  • Use $fsdbDumpon, $fsdbDumpoff to specify time interval
  • Example
1
2
3
4
5
6
7
initial begin
    $fsdbDumpvars(0, dut, "+fsdbfile+interval.fsdb");
    #40 $fsdbDumpoff;
    #40 $fsdbDumpon;
    #40 $fsdbDumpoff;
    #40 $finish;
end

1.4、不保存特定实例的fsdb(How to not dump a certain instance)

  • $fsdbSupress(instance)
  • NOTE : $fsdbSuppress must be specified before $fsdbDumpvars
  • Example
1
2
3
4
initial begin
    $fsdbSuppress(dut.inst_a, dut.inst_b);
    $fsdbDumpvars(0, dut);
end

1.5、不保存指定实的波形(How to not dump with instances listed in a file)

1.6、如何存储Assertion的波形(How to dump assertion)

  • $fsdbDumpSVA(depth, instance)
  • vcs compile option :

-sverilog -debug_pp is needed

  • NOTE: After Verdi 1703SP1-1, please add runtime option "+fsdb+sva_success"
  • Example
1
2
3
initial begin
    $fsdbDumpSVA(0, dut);
end

1.7、存储Memory的波形(How to dump memory arrays)

  • $fsdbDumpMDA(depth, instance)

  • vcs compile option :
  • -debug_pp, +memcbk is needed
  • Example
1
2
3
initial begin
    $fsdbDumpMDA(1, dut.i_pram);
end

1.8、How to dump lib cells signal to fsdb

  • vcs compile option :
  • -debug_acc -debug_region=cell+lib is needed
  • Example
1
vcs -debug_acc -debug_region=cell+lib <other options>

1.9、How to dump fsdb by ucli mode

  • Add "call { System task of fsdb }" in ucli.do
  • Example
1
2
call {$fsdbDumpvars(0, dut)};
run;

二、特殊需求总结

2.1、How to dump glitch information

  • Before VCSMX/1509,

simv +fsdb+sequential +fsdb+glitch=0 +fsdb+region

  • After VCSMX/1509,

simv +fsdb+delta

  • Example
1
2
3
4
5
6
7
8
simv +fsdb+sequential +fsdb+glitch=0 +fsdb+region

//环境变量设定
setenv NOVAS_FSDB_ENV_DUMP_SEQ_NUM 1
setenv NOVAS_FSDB_ENV_MAX_GLITCH_NUM 0
setenv FSDB_REGION

//then re-run simulation

2.2、How to dump force information

  • simv +fsdb+force
  • Example
1
2
3
4
5
6
simv +fsdb+force

//环境变量设定
setenv FSDB_FORCE 1

//then re-run simulation

2.3、How to dump wreal type information

  • 1
    simv +fsdb+vams

2.4、How to dump signals in Functions and Tasks

  • Use VCS version newer than 1509, Verdi version newer than 1606
  • vcs compile option :
  • -debug_access+dmptf is needed
  • Example
1
simv +fsdb+functions