我的后仿记录

1.流程
1.1不带SDF的网表(STA前)
(1)将验证环境中DUT 的RTL 替换换成网表文件
(2)检查DUT顶层,如果多出测试使用的bisr,ijtag等input io,在testbench中将其驱动为0
(3)带寄存器或者memory后门访问的,可能需要更新后门路径
(4)增加相应编译宏区分RTL 仿真和GLS的standcell list
(5)增加编译选项(不带SDF)
+nospecify (会直接跳过std cell中定义时序信息的部分)
+notimingcheck
1.2做完STA的网表+SDF文件
(1)将验证环境中DUT的RTL替换为网表文件
(2)带寄存器或者memory后门访问的,可能需要更新后门路径
(3)在testbench中调用vcs 系统任务:$sdf_annotate,格式如下 (以下关于sdf_annotate的解释摘自vcs manual)
在这里插入图片描述

[1]“sdf_file”
Specifies the path to an SDF file.
[2]module instance
Specifies the scope where back-annotation starts. The default is the scope of the module instance that calls $sdf_annotate.
[3]“sdf_configfile”
Specifies the SDF configuration file

[4]“sdf_logfile”
Specifies an SDF log file to which VCS sends error messages and warnings. By default, VCS displays no more than ten warning and ten error messages about back-annotation and writes no more than that in the log file you specify with the -l option.However, if you specify the SDF log file with this argument, the SDF log file receives all messages about back-annotation. You can also use the +sdfverbose runtime option to enable the display of all back-annotation messages.
[5]“mtm_spec”

Specifies which delay values of min:typ:max triplets VCS back-annotates. Its possible values are “MINIMUM”, “TYPICAL”,“MAXIMUM”, or “TOOL_CONTROL” (default).
[6]“scale_factors”

Specifies the multiplier for the minimum, typical, and maximum components of delay triplets. It is a colon separated string of three positive, real numbers “1.0:1.0:1.0” by default.

[7]“scale_type”

Specifies the delay value from each triplet in the SDF file for use before scaling. Its possible values are “FROM_TYPICAL”,“FROM_MIMINUM”, “FROM_MAXIMUM”, and “FROM_MTM” (default).

PS:还可通过添加编译选项完成sdf文件的设置,详情可参考vcs manual

(4)增加相应编译宏
+define+NTC(for setuphold negative delay)
+define+RECREM(for recrem,for recovery )
(5)增加相应的编译选项
+neg_tchk (if negative delay)
-negdelay (if negative delay)
-sdfretain (if sdf retain)
+no_notifier (no notifier reg toggle when timing violation,慎用)
+no_tchk_msg (shield all timing violation info,慎用)
+init_reg +random
+optconfigfile+u_notiming.list(list包含跨时钟域多级同步器的第一级寄存器)

2.debug尝试记录

2.1.时钟降频(最终还是需要使用STA时钟频率跑过才行)
时钟降频只会对SS(setup sdf) debug有效

2.2.monitor 采样从时钟上升沿挪到下降沿
下降沿的数据肯定是稳定的

2.3.driver 在时钟下降沿驱动

2.4.仿真hang住,考虑是不是遭遇0延时loop,增加如下仿真选项
-cmp_opts “+vcs+loopreport +vcs+loopdetect”

2.5.尽量不要用探针对网表模块内部interface做驱动和采样,就算从RTL上看网表顶层的module和下一层module之间的interface都是直连,中间没有做任何逻辑,变成网表之后这两层之间也会加入很多invert和buffer,所以探针驱动采样和在顶层interface 驱动采样结果是会不一样的

2.6.如果module(比如memory module)中没有定义timing信息,在做SDF annotate的过程中,会出现一些使用该module的instance的Annotaion Fail信息,例如
Warning-[SDFCOM-TANE] TIMINGCHECK Annotation Not Enabled
module AAA,instance:top.my_dut.my_module.my_memory
SDF warning: Canot find matching TIMINGCHECK in the corresponding instance
==>事实证明是因为错用了前仿不带specify的memory model,导致Annotation Fail

2.7.仿真log中报timing violation的话,需要注意一下报错时间,如果是在DUT rst结束之前的violation,可以忽略

2.8.memory model hdl后门访问失败,原因是综合后memory model被celldefine 标记,需要单独打开cell debug才能访问
-debug_access +all
-debug_access -debug_region+cell
在这里插入图片描述

2.9​. 用ucli做仿真调试​
(1)在testbench中设置断点
在这里插入图片描述

(2)打开编译选项 vcs -debug
(3)跑到断点之后在命令行输入需要的指令
详情可参考ucli_ug.pdf

2.10. TWRCC & TRWCC Error
报TWRCC&TRWCC Error是因为所用的memory model中定义了parameter TWRCC,定义了数据从写入到读出的最小时间间隔,该参数默认为1,所以时钟频率大于等于1GHZ的时候可能会出现Error,需要(1)用TWRCC或者TRWCC宏重新定义该参数(2)降低时钟频率
(1) +define+TWRCC=0.5 && +define+TRWCC=0.5
在这里插入图片描述

3.编译加速
3.0 VCS编译

  1. VCS两步仿真:
    Compilation
    Simulation
    (1).当设计比较大的时候,每次都要全部重新编译一遍,比较浪费时间;
    (2)当设计中存在VHDL文件时,两步法就无法使用,因为VHDL文件需要单独处理。
  2. VCS三步仿真(我们的选择):
    Analysis:对文件语法进行检测,产生中间文件库
    Elabration:根据analysis生成的库文件产生simv
    Simulation

3.1 partition + multi-core parallel complie

  1. 自动分块:只需加入编译选项-partcomp
  2. 手动分块:
    (1)创造分块文件topcfg.v
    在这里插入图片描述

(2)编译选项 : -partcomp -top topcfg topcfg.v
3.如果需要多核共同编译:
% XXXX -partcomp -fastpartcomp=jN (N=cpu 核数)

4.示例,自动分块,用16个核,并查看各部分编译时间
% XXXX -cmp_opts “-partcomp -fastpartcomp=j16 -pcmakeprof”

3.2 elabration 加速
% hsopt=j

4.小知识
4.1 对于TSMC的memory model:
1)TS1N*** 代表single port mem,时序仿真不会存在2.10指出的Read&Write Contention问题
2)TS6N***代表two port mem,时序仿真可能会存在Read&Write Contention,需要调整parameter(TSMC_TWRCC,TSMC_TRWCC)或者调整时钟频率来解决

  • 5
    点赞
  • 41
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值