Power | PTPX功耗分析实战, 附VCD/SAIF/FSDB的区别

PT如果进行功耗分析需要额外的PTPX的licence,可以通过以下变量打开:

set_app_var power_enable_analysis true (默认值为false)

用PTPX做平均功耗分析,分3种情况:

(1)假如有波形文件:最理想的情况是能提供后仿产生的VCD/SAIF文件,通过read_vcd/read_saif将真实的翻转率反标到Net上,然后通过report_switching_activity检查反标率,最后report_power报功耗值。

(2)人为设置翻转率:根据经验值,通过set_switching_activity/set_case_analysis来设置register,clock gate以及memory/blackbox的翻转率,这个经验是从以往项目的仿真得到的,然后通过以下类似下面的命令设置:

reset_switching_activity (重置之前设置的翻转率)

set_switching_activity [get_pins -of_object [all_registers]] -toggle_rate 0.5 -static_probability 0.5 -base_clock * (设置register的翻转率)

set_switching_activity -type black_boxes -toggle_rate 0.1 -static_probability 0.5 -base_clock * -hierarchy (设置blockboxs上的翻转率)

set_switching_activity -toggle_rate 0.5 -static_probability 0.5 -base_clock * [remove_from_collection [all_inputs] [get_port -filter "is_clock_used_as_clock == true"]] (设置Input上的翻转率)

set_switching_activity [get_pins -of_object [get_cells -hierarchical * -filter "ref_name =~ *ICG*"]] -toggle_rate 0.5 -static_probability 0.5 -base_clock * (设置clock gate上的翻转率)

set_case_analysis 1 [get_ports *reset*] (使reset信号不翻转,准静态信号)

set_switching_activity -toggle_rate 0 -static_probability 1 -base_clock * [get_port *reset*]

 

(3)使用默认翻转率:最不济的方式就是使用工具默认的翻转率了,通过下面3个变量可以设定。

 

set_app_var power_default_toggle_rate 0.5 (默认值为 0.1)

set_app_var power_default_static_probability 0.5 (默认值为0.5)

set_app_var power_default_toggle_rate_reference_clock fastest (默认值related)


在PT中report_switching_activity会报出所有Nets的switching activity来源的统计数据:

上图中每一列所表示的含义如下:

From Activity File :

The switching activity value is from a SAIF or VCD file, 在read_vcd或者read_saif时要注意通过-stripe_path选项指定合适的hierarchical层次,否则activity反标不上。

From SSA :

The switching activity value set by using the set_switching_activity command.

From SCA :

The switching activity set by using the set_case_analysis command.

From clock :

The switching activity set by using the create_clock command.

Default:

对于用户没有指定的翻转率的Net,PT会使用默认的翻转率

Propagated:

The switching activity  from propagation engine

Implied:

Switching activity from simple automatic propagation of activity through buffers and inverters

Not Annotated:

没有反标翻转率的Net,需要特别注意,一般要求在update_power或者report_power之后,这部分占比应该很低甚至为0,如果有大量没有翻转的Net,会影响report_power的准确率,可以通过以下命令打印出来分析:

    report_switching_activity -list_not_annotated    

get_switching_activity ...

另外,PTPX也支持time_based功耗分析,通过以下选项开启:

set_app_var power_analysis_mode time_based (默认值为averaged)

在该模式下,需要提供VCD(注:SAIF文件不行),工具会分析峰值功耗,生成功耗波形等。

VCD: Value/Variable Change Dump

  • It is an event-based format that contains every value change for the signals in the design and the time at which they occurred.

  • VCD is supported in both the averaged and time-based analysis modes,是国际标准格式

  • Gate-Level VCD和RTL-Level VCD都可以,但是使用RTL-Level VCD时,需要进行name mapping (set_rtl_to_gate_name)。

  • VCD文件示例:http://en.wikipedia.org/wiki/Value_change_dump

SAIF: Switching Activity Interface Format

    • It captures signal transitions and the time spent at each logic level. The SAIF file contains the toggle counts and static probabilities for the nets in the design.

    • SAIF is supported only in the averaged power analysis mode.

    • 有些工具,比如ICC/ICC2,只支持SAIF文件,需要将VCD转换成SAIF文件,在PT安装目录下有一个utility:

    vcd2saif -input vcd_file -output saif_file ...

FSDB: Fast Signal DataBbase

  • 类似于VCD的波形文件,去除了VCD中的冗余信息,数据量小很多,提高了仿真的速度,Synopsys的仿真工具支持较多。

 








猜你喜欢

转载自www.cnblogs.com/lelin/p/12548923.html