fsdb 实用技巧

本文详细介绍了如何使用fsdbreport和fsdbextract工具处理FSDB波形文件,包括选择特定信号、指定时间范围、格式转换等操作,并展示了将FSDB转换为VCD格式的步骤,对于信号分析和调试具有实用价值。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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:

  1. Assign the begin time and end time for the report.

fsdbreport verilog.fsdb -s /system/addr -bt 1000ps -et 2000ps 
  1. Report a slice of a bus signal.

fsdbreport verilog.fsdb -s "/system/addr[7:4]"
  1. 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
  1. 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
  1. Report the results for the specified strobe point using -strobe.

fsdbreport verilog.fsdb -strobe "/system/clock==1" -s /system/data/system/addr
  1. Report the results when the expression value changes to true.

fsdbreport verilog.fsdb -exp "/system/addr=='h30 & /system/clock==1" -s /system/data 
  1. 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
  1. 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:

  1. Translate all signals.

fsdb2vcd verilog.fsdb -o output.vcd
  1. 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
  1. Generate a summary for this FSDB without performing the translation.

fsdb2vcd verilog.fsdb -summary
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值