fdsb那些事(转)

上一篇 / 下一篇  2016-06-21 22:04:45 / 个人分类:验证杂谈

在使用VCS 调用verdi dump波形时,可以在.v里面使用  
$fsdbDumpfile("abc.fsdb",1000);    后面的威尼斯人线上娱乐1000就表示1000M,表示限定这个fsdb最大1000M就不dump了
$fsdbAutoSwitchDumpfile(200,"abc.fsdb",5);表示dump 5个最大200M的fsdb,最后得到的应该是5个 abc***.fsdb
另外的通过hierarchical存多个fsdb
$fsdbDumpvars(1,top,"+fsdbfile+abc.fsdb"); dump top这一层到abc.fsdb这个文件里
$fsdbDumpvars(0,top.cpu,"+fsdbfile+cd.fsdb") ;  dump top.cpu全部到cd.fsdb里面

指定时间dump,,当你的pattern已经跑过一次之后,加入你只想从1ms才开始dump,
initial  begin
#1000_000;
$fsdbDumpvars("aa.fsdb");end

可以在先关闭dump,#delay 多少时间之后使用打开dump命令,来断断续续的dump.
$fsdbDumpon - 打开 FSDB dumping
$fsdbDumpoff - 关闭 FSDB dumping

Conventional Issues & Verdi’s Approach


Issues and Conventional Approach
• Today’s complex SOC designs usually require huge amounts of data
for verification which introduces some problems when dealing with big simulation dump files.
• A common problem with complex design dumping is that the dumped simulation file may exceed the OS limitation, or the simulation
process may exceed the OS memory limitation during dumping.
• The workarounds is to limit the signal number by dumping from a specified scope in hierarchy or start dumping after a certain time.

 

Verdi’s Approach
• Verdi provides various environment variables and system tasks to restrict the FSDB file size in different constraints, to get the best balance between data accuracy and performance
• Verdi also provides a parallel dumping mechanism to speed up the dumping performance in dual CPU machines.

 

Restrict the FSDB File Size (1/4)
NOVAS_FSDB_ENV_WRITER_MEM_LIMIT variable:
• The default value is 64.
• When the user uses the nWave auto-update feature, the recommendation is to set this environment variable to a smaller value before running the simulation. For example:
% setenv NOVAS_FSDB_ENV_WRITER_MEM_LIMIT 20


Skip dumping VHDL complex data.
• Including array of array and record signals.
% setenv IGNORE_COMPLEX 1


Skip dumping Verilog cell instances
• To skip the FSDB dumping for primitive cells, for example:
% setenv SKIP_CELL_INSTANCE 1

 

Restrict the FSDB File Size (2/4)
Use $fsdbAutoSwitchDumpfileto reduce the size and control the number of FSDB files.
• For example, if the maximum desired FSDB file size is 1G and at most 20 FSDB dump files can be created, add following task in source code:
$fsdbAutoSwitchDumpfile(1000, "ALU.fsdb", 20, "my.log");
• Where 1000 (1G) is the size of each file and 20 is the number of dump files.


Use $fsdbDumpvars to reduce the number of scopes to be dumped.
• For example, to start dumping from scope top.u_foo.u_bar with depth=3 and dumping location and file name of log/test1.u_bar.3.fsdb, add following task into source code (or testbench):
initial begin
$fsdbDumpfile ("log/test1.u_bar.3.fsdb");
$fsdbDumpvars (3, top.u_foo.u_bar);
end

 

Restrict the FSDB File Size (3/4)
Use $fsdbSuppress to suppress the scopes that should not be dumped.
• For example, if not going to dump scope “system.i_pram” and “system.i_cpu.i_CCU”, add following task into source code or testbench:
$fsdbSuppress(system.i_pram, system.i_cpu.i_CCU);
$fsdbDumpvars;


Use $fsdbDumpMem/$fsdbDumpMDA to dump the relevant cells of the memory/MDA at specific time intervals.
• Dump the memory cells from mem[0] to mem[31] at the time the system task is called:
$fsdbDumpMem(mem, 0, 32);
• Dump the memory cells from mem[0] to mem[31] after 23 simulation time units when the trigger signal, WR_ENABLE, changes to 1:
$fsdbDumpMem(mem, 0, 32, , WR_ENABLE, 23);
• Evaluate the value of signal WR_ENABLE at #0, #500, #1000... If WR_ENABLE=1, dump all memory cells of mem after 20 time units:
$fsdbDumpMem(mem, , , 500, WR_ENABLE, 20);

 

Restrict the FSDB File Size (4/4)
Use $fsdbDumpon and $fsdbDumpoffto change the start and stop dumping time for the needed time interval.
• For example, to generate a FSDB file that will record all the scopes from 1000 time units to 70000 time units, add the following to the testbench:
initial begin
$fsdbDumpvars;
#1000 $fsdbDumpoff;
#70000 $fsdbDumpon;
end


Use environment variables to prevent dumping of glitches and event sequence information.
• NOVAS_FSDB_ENV_MAX_GLITCH_NUM is used to specify glitch dumping:
• Default: does not record glitches
• 0: all glitches are stored.
• 1: the last glitch is stored.
• 2: the first and the last glitch are stored
• NOVAS_FSDB_ENV_DUMP_SEQ_NUM set to ‘on’ is used to enable event sequence dumping.

 

Parallel Dumping for FSDB
Two functions are includedin the process when dumping FSDB:
• Running the simulation and
• Writing the FSDB.
Use parallel dumping mechanism to separate these two process in a multi-processor system.
Two ways to run simulation in parallel mode:
• Add +fsdb_parallel option in command line when running
simulation.
• Set environment variable FSDB_PARALLEL before running
simulation.
• setenv FSDB_PARALLEL 1

 

Summary
Use environment variables and system tasks to get balance between accuracy and performance when dumping FSDB.
• NOVAS_FSDB_ENV_WRITER_MEM_LIMIT
• IGNORE_COMPLEX
• SKIP_CELL_INSTANCE
• $fsdbAutoSwitchDumpfile
• $fsdbDumpvars
• $fsdbSuppress
• $fsdbDumpMem/$fsdbDumpMDA
• $fsdbDumpon and $fsdbDumpoff
• NOVAS_FSDB_ENV_MAX_GLITCH_NUM and
NOVAS_FSDB_ENV_DUMP_SEQ_NUM
Use command line option +fsdb_parallel or environment variable FSDB_PARALLEL to improve the dumping performance on dual CPU machines.


仿真是IC设计不可或缺的重要步骤,仿真后一般需要记录下波形文件,用于做详细分析和研究。说一下几种波形文件WLF(Wave Log File)、VCD(Value Change Dump)文件,fsdb(Fast Signal DataBase)文件、shm、vpd:

 

对于WLF波形日志文件,只要我们使用过modelsim,应该都很熟。WLF(Wave Log File) 是Mentor Graphics 公司Modelsim支持的波形文件。但我们在波形窗口观察波形时,仿真结束时都会生成一个*.wlf的文件(默认是vsim.wlf)。我们下次就可以通过通过modelsim直接打开这个保存下来的波形。vsim -view vsim.wlf -do run.do 其中run.do中的内容为要查看的波形信号。要强调的是这个wlf文件只能是由modelsim来生成,也只能通过modelsim来显示。不是一个通用的文件文件格式。

 

 

 

VCD (Value Change Dump)是一个通用的格式。 VCD文件是IEEE1364标准(Verilog HDL语言标准)中定义的一种ASCII文件。它主要包含了头信息,变量的预定义和变量值的变化信息。正是因为它包含了信号的变化信息,就相当于记录了整个仿真的信息,我们可以用这个文件来再现仿真,也就能够显示波形。因为VCD是 Verilog HDL语言标准的一部分,因此所有的verilog的仿真器都要能够实现这个功能,也要允许用户在verilog代码中通过系统函数来dump VCD文件。我们可以通过Verilog HDL的系统函数$dumpfile 来生成波形,通过$dumpvars的参数来规定我们抽取仿真中某些特定模块和信号的数据。


fsdb(Fast Signal DataBase) 是Spring Soft (Novas)公司 Debussy / Verdi 支持的波形文件,一般较小,使用较为广泛,其余仿真工具如ncsim,modlesim等等可以通过加载Verdi 的PLI (一般位于安装目录下的share/pli 目录下) 而直接dump fsdb文件。fsdb文件是verdi使用一种专用的数据格式,类似于VCD,但是它是只提出了仿真过程中信号的有用信息,除去了VCD中信息冗余,就像对VCD数据进行了一次huffman编码。因此fsdb数据量小,而且会提高仿真速度。我们知道VCD文件使用verilog内置的系统函数来实现的,fsdb是通过verilog的PLI接口来实现的。$fsdbDumpfile,$fsdbDumpvars等


其余波形文件就是各家不同的仿真或调试工具支持的文件类型,互不通用,但基本都可以由VCD文件转换而来(其实就是VCD文件的压缩版,因为只取仿真调试需要的数据,所以文件大小要远小于原始VCD文件),有的还提供与VCD文件的互转换功能。

 

 

 

shm 是Cadence公司 NC verilog 和Simvision支持的波形文件,实际上 .shm是一个目录,其中包含了.dsn和.trn两个文件。

 

vpd 是Synopsys公司 VCS DVE支持的波形文件,可以用$vcdpluson产生。

 

通过使用Cadence NC Verilog 对同一testcase和相同dump波形条件的比较,产生shm文件的时间最短(废话,本来就是一个公司的),产生vcd文件的时间数倍于产生shm和fsdb的时间。在笔者测试的例子中,产生的fsdb文件为十几MB,shm文件为几十MB,而vcd文件则要几个GB的大小。

 



fsdbDumplimit - 限制FSDB 文件size  如何使用?

$fsdbDumpvars([<level>], <scope | signal>*)

fsdbDumpfile - 指定FSDB 文件名

$fsdbDumpfile(“<FSDB name>”)

fsdbDumpvars - Dump 指定的变量

fsdbDumpSingle - Dump 指定的信号

fsdbDumpvariable - Dump 指定的VHDL 变量

fsdbSwitchDumpFile - 将dumping 切换到另一个FSDB 文件

$fsdbSwitchDumpFile(“<new FSDB name>”)

fsdbAutoSwitchDumpfile - 限制文件大小并在数据量过大时自动创建新的FSDB 文件

$fsdbAutoSwitchDumpfile(<file size>, “<FSDB name>”,< number of file>)

fsdbDumpflush - Force to Dump Result to FSDB file

fsdbDumpMem - Dump 指定的memory 的内容

$fsdbDumpMem(<reg name>, [<start addr>, [<size>]])

$fsdbDumpon - 打开 FSDB dumping

$fsdbDumpoff - 关闭 FSDB dumping



Specify the option in an FSDB dumping command to enable dumping allsupported signals:

$fsdbDumpvars("+all");


The Novas object files for FSDB dumping provide the following FSDB dumpingcommands for Verilog:

$fsdbAutoSwitchDumpfile

 

$fsdbDumpfile

 

$fsdbDumpflush

 

$fsdbDumpon, $fsdbDumpoff 

 

$fsdbDumpvars

 

$fsdbDumpvarsByFile

 

$fsdbDumpvarsES

 

$fsdbDumpFinish

 

$fsdbDumpMDA

 

$fsdbDumpSVA

 

$fsdbLog

 

$fsdbReplay

 

$fsdbSuppress

 

$fsdbSwitchDumpfile



$fsdbDumpfile

Description

To specify the FSDB file name created by the Novas object files for FSDBdumping. If not specified, the default FSDB file name is "novas.fsdb" . This command is valid only before $fsdbDumpvars is executed and is ignored if specified after $fsdbDumpvars . 

To restrict the largest dump file size to the user-defined size limitation, pleasespecify the limit size in megabyte format. This function will affect the FSDB filethat is specified in "FSDB_Name" . The FSDB dumper uses the sliding windowscheme to keep the last signal values in the FSDB file. It drops the old values if file size exceeds the user-specified limitation.

For $fsdbDumpvars ,$fsdbDumpMDA,$fsdbDumpvarsES,$fsdbDumpSVA and

$fsdbDumpvarsByFile , user can use the option "+fsdbfile+filename.fsdb" tospecify the target FSDB file to dump. It is equal to using $fsdbDumpfile then $fsdbDumpvars.


Syntax

When specified in the design:

$fsdbDumpfile("FSDB_Name" | FSDB_Name_var [ ,Limit_Size |,Limit_Size_var ]);

When specified on the simulator command line:

Cadence:

call fsdbDumpfile "FSDB_Name"call fsdbDumpfile "FSDB_Name" Limit_Size

 ModelSim:

fsdbDumpfile "FSDB_Name"fsdbDumpfile "FSDB_Name" Limit_Size

 Synopsys:

$fsdbDumpfile("FSDB_Name");$fsdbDumpfile("FSDB_Name", Limit_Size);

Arguments

FSDB_Name

Specify the name of the FSDB file generated by the Novas object files forFSDB dumping.

FSDB_Name_var

Specify the FSDB file name in a variable

Limit_Size

Specify the maximum FSDB file size in megabyte.

Limit_Size_var

Specify the maximum FSDB file size in a variable.

NOTE:

Valid only if the command is specified inside the design.

NOTE:

The minimum file size of the FSDB file is 10M. If you set the size to lessthan 10M, it will be set to 10M instead.

TAG:

 

评分:0

我来说两句

显示全部

:loveliness: :handshake :victory: :funk: :time: :kiss: :call: :hug: :lol :'( :Q :L ;P :$ :P :o :@ :D :( :)

日历

« 2019-01-22  
  12345
6789101112
13141516171819
20212223242526
2728293031  

数据统计

  • 访问量: 98622
  • 日志数: 246
  • 建立时间: 2016-03-25
  • 更新时间: 2017-05-19

RSS订阅

Open Toolbar
博聚网