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 theset_switching_activitycommand.
From SCA :
The switching activity set by using theset_case_analysiscommand.
From clock :
The switching activity set by using the create_clock command.
Default:
對于用戶沒有指定的翻轉率的Net,PT會使用默認的翻轉率
Propagated:
Theswitching activity frompropagation engine
Implied:
Switching activity from simple automatic propagation of activitythrough 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的仿真工具支持較多。
總結
以上是生活随笔為你收集整理的Power | PTPX功耗分析实战, 附VCD/SAIF/FSDB的区别的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 魔兽世界挂机脚本
- 下一篇: apache ignite系列(四):持