iqdaliu的个人空间 https://blog.eetop.cn/1791707 [收藏] [复制] [分享] [RSS]

空间首页 动态 记录 日志 相册 主题 分享 留言板 个人资料

日志

芯片功耗那些事(三)

热度 1已有 1216 次阅读| 2022-5-19 12:49 |个人分类:Power 功耗分析|系统分类:芯片设计| 功耗分析

大壮在前面两期梳理了芯片的功耗组成, 好学的小伙伴就问:这些功耗如何计算喃?我怎么得知我的芯片功耗是多大喃?

我们聊聊这个话题,功耗的计算在芯片设计的流程中,不同阶段基于design 的不同数据如何计算功耗的。

先讨论PTPX 为何从这个入手?这个环节是后端工程师常常遇到的。以后我们再进一步延展认知。

如图:

PTPX 的常用流程

clip_image002.gif


1)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 average and time-based analysis modes

>Either Gate-level VCD or RTL VCD are fine for the PTPX flow, and it need mapping when use RTL based  VCD, and command is (set_rtl_to_gate_name) then check annotation ratio;

 

>VCD (Value Change Dump)是一个通用的格式。 VCD文件是IEEE1364标准(Verilog HDL语言标准)中定义的一种ASCII文件。它主要包含了头信息,变量的预定义和变量值的变化信息。正是因为它包含了信号的变化信息,就相当于记录了整个仿真的信息,我们可以用这个文件来再现仿真,也就能够显示波形。因为VCD是 Verilog HDL语言标准的一部分,因此所有的verilog的仿真器都要能够实现这个功能,也要允许用户在verilog代码中通过系统函数来dump VCD文件。我们可以通过Verilog HDL的系统函数$dumpfile 来生成波形,通过$dumpvars的参数来规定我们抽取仿真中某些特定模块和信号的数据。

 

 

2)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

>It is supported only the average power analysis mode

>ICCII/FC only support SAIF, then you can convert VCD into SAIF format, by this utility under PT installation directory: vcd2saif -input  vcd_file  -output saif_file

 

 

3FSDB: Fast signal Data Base

>It is similar with VCD, removing some unnecessary information from VCD for PTPX, the this FSDB size is far smaller than VCD and benefit runtime of simulation

fsdb(Fast Signal DataBase) 是 Debussy / Verdi 支持的波形文件,文件size一般较小,使用较为广泛,其余仿真工具如ncsim,modlesim等等可以通过加载Verdi 的PLI (一般位于安装目录下的share/pli 目录下) 而直接dump fsdb文件。fsdb文件是verdi使用一种专用的数据格式,类似于VCD,但是它是只提出了仿真过程中信号的有用信息,除去了VCD中信息冗余,就像对VCD数据进行了一次huffman编码。因此fsdb数据量小,而且会提高仿真速度。我们知道VCD文件使用verilog内置的系统函数来实现的,fsdb是通过verilog的PLI接口来实现的。$fsdbDumpfile,$fsdbDumpvars等

 

对文件和流程有个大概了解之后,开起PTPX之旅。

##################################################### 

# Set the Power Analysis Mode: Averarged or time_based

##################################################### 

set power_enable_analysis TRUE 

set power_analysis_mode time_based  # or Averarged

##################################################### 

# Read design with gate level netlist and link  

##################################################### 

set search_path "/prj/library/path/.

set link_library " * std_typ.db memory_type.db

read_verilog my_design.vg

current_design my_design

link

##################################################### 

#Set transition time by reading sdc and readin parasitics by spef format

##################################################### 

read_sdc ./my_design.sdc 

read_parasitics ./my_design_power_corner.spef.gz 

##################################################### 

check_timing 

update_timing 

report_timing 

##################################################### 

# read switching activity file by wave format recommended

##################################################### 

read_vcd ../my_design.vcd.dump.gz -strip_path tb/macinst 

##################################################### 

# analyze power 

##################################################### 

check_power 

set_power_analysis_options -waveform_format out -waveform_output vcd 

update_power 

report_power -nosplit > ./rpt/power_time_based.rpt

report_power -hierarchy -level 6 -power_greater_than 0.001 -nosplit > ./rpt/power_hier_time_based.rpt

quit       

#------------------------------------------Done-----------------------------------------------------------

 

 

这个流程是假定有 波形VCD 作为输入,这样就可以将真实的翻转率反标到Design 的各个Net上,report_switching_activity可以来查看annotate的比例,其值越高得到的power越准确。

 

关于flow 的输入文件:

-logic library,包含timing和power信息,支持NLPM和CCS类型的library。

-Gate_level netlist,支持verilog,VHDL,systemverilog格式。

-Design constraints,计算primary input的transition time和define clock。

-Activity,VCD/SAIF,default,user_defined。

-net parasitic,SPEF文件,包含net RC参数。

 

 

有兴趣的小伙伴,可以测试比较 两种 modesAvderged or time_based) 得到的power 值的差别。

更多内容,请关注:

qrcode_for_gh_e9bef7231710_258.jpg

1

点赞

刚表态过的朋友 (1 人)

评论 (0 个评论)

facelist

您需要登录后才可以评论 登录 | 注册

  • 关注TA
  • 加好友
  • 联系TA
  • 0

    周排名
  • 0

    月排名
  • 0

    总排名
  • 1

    关注
  • 25

    粉丝
  • 2

    好友
  • 18

    获赞
  • 16

    评论
  • 123

    访问数
关闭

站长推荐 上一条 /1 下一条

小黑屋| 关于我们| 联系我们| 在线咨询| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2024-4-27 04:04 , Processed in 0.020567 second(s), 8 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
返回顶部