fsdbDump用法

本文介绍如何使用fsdbDump系列函数。

所有的fsdbDump系列函数的详细说明可见 verdi/doc/linking_dumping.pdf 文档。

命令行参数

可以通过命令行参数的方式来控制dump的选项。

例如在仿真时指定dump波形的文件。

1
simv +fsdb+high.fsdb
Specify on simulator Command line Specify Using Environment Variable Specify With FSDB Dumping Command
+fsdb+all[=on\ off] NOVAS_FSDB_ALL +all
+fsdb+autoflush None None
+fsdb+dump_limit=size FSDB_DUMP_LIMIT None
+fsdb+filename NOVAS_FSDB_FILE +fsdbfile+filename
+fsdb+mda[=on\ off] NOVAS_FSDB_MDA +mda
…….

commands used with verilog

$fsdbDumpfile

syntax

1
$fsdbDumpfile("name" | name_var [, limit_size | ,limit_size_var]);

可以指定文件名和最大的文件大小,可以通过变量的方式指定。

1
$fsdbDumpfile("novas.fsdb",32); // 32 megabytes

$fsdbDumpFinish

syntax

1
$fsdbDumpFinish;

$fsdbDumpflush

syntax

1
$fsdbDumpflush;

$fsdbDumpon $fsdbDumpoff

syntax

1
2
$fsdbDumpon(["option"| option_Var])
$fsdbDumpoff(["option"| option_Var])

option

1
+fsdbfile+filename

example

1
2
3
$fsdbDumpon("+fsdbfile+novas.fsdb");
#100
$fsdbDumpoff("+fsdbfile+novas.fsdb");

$fsdbDumpvars

syntax

1
2
3
4
5
$fsdbDumpvars(
[depth, | "level=",depth_var,]
[instance, | "instance=", instance_var]
[, "option"| ,"option, option_var"]
);

depth

depth description
0 all signals in all scopes
1 all signals in current scope
n all signals in the current scope and all scopes n-1 levels below

option

option description
+all dumps all signals including memory, MDA, packed array, structure, union, power-related, and packed structure
+mda dumps all memory and MDA signals in all scopes specified
+IO_Only only IO port signals are dumped
+Reg_Only only reg type signals are dumped
+parameter dumps parameters
+functions enable dumping of functions in the design
+fsdbfile+filename specifes the FSDB file name
……

examples

1
2
3
4
$fsdbDumpvars("+all");
$fsdbDumpvars(0, system);
$fsdbDumpvars(0, system, "+fsdbfile+novas.fsdb");
$fsdbDumpvars(1, top.dut.u1);

$fsdbDumpvarsByFile

syntax

1
$fsdbDumpvarsByFile("textFileName" | textfile_var [, "option"|,option_var]);

file format

1
2
3
# [pragma]
# comment
[option_in_file] [depth] instance name

examples

1
2
+all 1 system
+mda +struct 3 system.i_cpu

$fsdbAutoSwitchDumpfile

syntax

1
2
3
4
5
6
7
$fsdbAutoSwitchDumpfile(
file_size | file_size_var,
"fsdb_name" | fsdb_name_Var,
number_of_files | number_of_files_var
[, "log_filename" | log_filename_Var]
[, "+fsdb+no_overwrite"]
);

examples

1
$fsdbAutoSwitchDumpfile(10, "test.fsdb", 20); // 10M, 20 files max

$fsdbSuppress

specify the scopes that are not dumped by the $fsdbDumpvars commands.

must be specified before $fsdbDumpvars; otherwise, $fsdbSuppress does not work.

syntax

1
2
3
4
5
6
7
$fsdbSuppress(
"suppress_file" | "file=",file_var
| [instance], | "instance="[,instance_var]
| "module_file=", "filename"
| "module_base=", [, module_name]
| "signal_prefix="
);

examples

1
2
$fsdbSupress(dump_top, system.i_pram);
$fsdbDumpvars(0, dump_top);

fsdbDumpDMA

syntax

1
2
3
4
5
$fsdbDumpDMA(
[depth, | "level=",depth_var,]
[instance | "instance=",instance_var]
[, "option"|"option=",option_var]
)

examples

1
reg [7:0] screen [79:0][0:24]
command result
$fsdbDumpDMA(screen) dump all cells of MDA screen
$fsdbDumpDMA(screen, 10) dump screen [10: 10] [0:24][7:0]
$fsdbDumpDMA(screen, 10, 1) dump screen [10: 10] [0:24][7:0]
$fsdbDumpDMA(screen, 10, 1, 12) dump screen [10: 10] [12:12][7:0]
$fsdbDumpDMA(screen, 10, 1, 12, 2) dump screen [10: 10] [12:13][7:0]
1
$fsdbDumpDMA(1, system.i_pram);

$fsdbDumpSVA

syntax

1
2
3
4
5
$fsdbDumpSVA(
[depth, | "level=",depth_var,]
[instance | "instance=",instance_var]
[, "option"|"option=",option_var]
)

examples

1
2
$fsdbDumpSVA();
$fsdbDumpSAA(0, system);