zh1、fsdb波形存入txt文件中
指定某信号输出到txt文件中:
fsdbreport tb.fsdb -exp "/tb/u_breath/clk & /tb/u_breath/rst & /tb/u_breath/cnt_flag " -s "/tb/u_breath/pwm_cnt" -of h -o fsdb.txt
将clk==1&rst==1&cnt_flag==1时对应的pwm_cnt数据写到fsdb.txt文件中;
指定某段时间的信号输出到txt文件中:
fsdbreport tb.fsdb -s /tb/u_breath/pwm_cnt -bt 101055ps -et 200000ps -of h -o fsdb_bt_et.txt
fsdbreport tb.fsdb -s /tb/u_breath/pwm_cnt -bt 101055ps -et 200000ps -w 32 -o fsdb_bt_et.txt
列出某个模块下的信号:
fsdbreport tb.fsdb -s /tb* -level 0 -bt 101055ps -et 200000ps -of h -o fsdb_cn.txt
fsdbreport tb.fsdb -s /tb* -level 0 -bt 101055ps -et 200000ps -cn 0 -of h -o fsdb_cn.txt
-find_forces显示某模块下的force,release,deposit信号值:
fsdbreport tb.fsdb -s /tb* -level 0 -find_forces -of h -o fsdb_forces.txt
fsdbreport -help可以查看更多选项
-
-s:指定要报告的信号或范围
-
-exp:当表达式为 true(==1) 时的报告值
-
-w 32是指定数据位宽
-
-bt :begin time
-
-et:end time
-
-of:定义输出显示格式为二进制、八进制、十进制、无符号十进制或十六进制
-
-o:指定输出报告的文件名
-
-level:指定要在指定范围内转储的级别数。此选项必须与 -s 一起使用
-
-cn:定义报告的列数,包括时间列, 0 表示所有满足的信号以一列形式显示;
Examples:
-
Assign the begin time and end time for the report.
fsdbreport verilog.fsdb -s /system/addr -bt 1000ps -et 2000ps
-
Report a slice of a bus signal.
fsdbreport verilog.fsdb -s "/system/addr[7:4]"
-
Report signals in the signal list with different formats.
fsdbreport fsdb/vhdl_typecase.fsdb -nocase -s top/A_SIMPLE_REC.FIELD3
-a simple.field3 -w 15 TOP/A_COMPLEX_REC.F1.FIELD3 -a complex.f1.field3
-w 20 top/a_std_logic_vector -af sean2.alias -of a -o output.txt -bt 1000 -et 2000
-
Report a scope and its descendants. Multiple scopes may be specified.
fsdbreport rtl.dump.fsdb -bt 10 -et 100 -s "/system/i_cpu/*" -level 3 /system/i_pram/clock -cn 0
-
Report the results for the specified strobe point using -strobe.
fsdbreport verilog.fsdb -strobe "/system/clock==1" -s /system/data/system/addr
-
Report the results when the expression value changes to true.
fsdbreport verilog.fsdb -exp "/system/addr=='h30 & /system/clock==1" -s /system/data
-
Report the force, release or deposit information of the specified signals using -find_forces.
fsdbreport rtl.fsdb -find_forces -s "/system/i_cpu/*" -level 2 -o report.txt
-
Report the force of the specified signals using -find_forces and -exclude_scope.
fsdbreport rtl.fsdb -find_forces -s "/system/i_cpu/*" -exclude_scope "/system/i_cpu/s1/*" "/system/i_cpu/s2" -o report.txt
2、fsdb 波形截取
fsdbextract source.fsdb -bt 1000ns -et 2000ns -o output.fsdb
source.fsdb是原始波形文件,1000ns 和 2000ns是截取波形的开始时间点与结束时间点,otuput.fsdb是截取出来的波形文件名;
3、fsdb2vcd
有时候需要利用VCD波形,比如进行功耗分析时,因此需要fsdb转换成vcd;
-
fsdb2vcd -h 即可查看相关的命令帮助;
全部转换
fsdb2vcd tb.fsdb -o tb.vcd
指定模块和时间:
fsdb2vcd tb.fsdb -s /system/i_cpu -level 1 -bt 10 -et 1000 -o tb.vcd
Examples:
-
Translate all signals.
fsdb2vcd verilog.fsdb -o output.vcd
-
Translate signals within a specified scope and time range.
fsdb2vcd verilog.fsdb -s /system/i_cpu -level 1 -bt 10 -et 1000 -o output.vcd
-
Generate a summary for this FSDB without performing the translation.
fsdb2vcd verilog.fsdb -summary