VCS后仿调试记录(Post-PR with SDF)

前一篇文章 VCS后仿调试记录(Pre-PR)记录了一些在做Pre-PR网表仿真阶段遇到的一些问题和解决思路,这篇把坑填一下,总结下使用VCS工具做Post-PR网表仿真和带SDF(Standard Delay Format)反标仿真的一些问题记录。

Post-PR网表仿真

在拿到Post-PR但后端还未提供SDF文件的bringup阶段,可以先使用zero-delay或unit-delay模型做网表仿真。

仿真参数

Post-PR网表仿真的编译选项基本可以参照前文Pre-PR网表参数,这里介绍一些VCS编译选项:

-debug_access+r+f+fwn		//用于精简debug选项
-debug_region+cell			//用于dump stdcell
-debug_region+encrypt		//用于调试加密代码
+lint=TFIPC-L				//用于检查未连接的端口,加强网表检查
-hsopt=gates				//提供一些网表仿真性能优化,有时可解决一些VCS工具问题

主要问题记录

Q: 后仿能否被Formal和STA取代?
A: 因为STA只检查边沿timing,而形式验证只看register和combination的抽象功能。后仿在下面三种情况是必要的:异步逻辑设计部分、ATPG向量验证和初始化状态验证。另外,后仿产生的VCD文件还可以做功耗分析。(检查SDC错误、路径延时等)

Q: 后仿Testplan制定策略?
A: 优先覆盖Multi-Cycle/False Path/异步路径等。

Q: SRAM X态传递问题?
A: 需要做DFT复位(包括给bisr_reset下降沿,scan_reset tie 1等)。另外SRAM model默认值X态也有可能导致X态传递,一般mem model内都有提供初始化为全0/1/random的宏或task或plusargs方法,可以调用相关方法把所有SRAM init成非X值。

Q: 寄存器默认复位不生效问题?
A: cell仿真行为问题,如果启用了initreg,则默认值不为复位值可能导致仿真问题。解决方法是force造复位沿,或者关闭该模块initreg(在initreg config文件中不能设置“defaultvalue 0”,否则会全局initreg)。

Q: “a=x?1:1” 的X态传递问题?
A: 前仿xprop=vmerge/tmerge均无法复现,门仿行为更悲观,需要initreg random(+vcs+initreg+config+initreg.cfg)
xprop

SDF反标仿真

SDF网表仿真是芯片signoff交付流程的重要一环,但由于编译和仿真时间比较长,且需要交付多个SDF corner,导致时间比较紧张,需要提高仿真效率减少错误。
SDF反标通过以下系统函数实现,具体使用方式参见VCS手册。
sdf_annotate
Corner工艺角
SDF corner指在不同工艺(Process)、电压(Voltage)、温度(Temperature,统称PVT条件)下生成的SDF文件,用于时序仿真中反映晶体管参数变化对电路延迟的影响。根据SDF文件和mtm参数控制,一般覆盖TT/SS/FF(signoff必须覆盖SS/FF,对应MAXIMUM/MINIMUM):

  • TT (typical nmos and typical pmos),参考常压常温Typical场景
  • SS (slow nmos and slow pmos),参考低压低温Worst场景
  • FF (fast nmos and fast pmos),参考高压高温Best场景
  • SF (slow nmos and fast pmos)
  • FS (fast nmos and slow pmos)

仿真参数

SDF网表仿真需要用到的仿真参数如下:

//宏定义
+define+NTC				//在TSMC stdcell library中,选择含有delayed signal的分支。SDF存在负值检查时启用。
+define+RECREM			//在TSMC stdcell library中,选择含有$recrem timingcheck的分支。SDF存在RECREM反标时启用。

//Elab参数
+sdfverbose				//启用所有反标warning和error信息,否则默认显示10条,不影响$sdf_annotate()指定输出的log文件
-negdelay				//允许使用SDF IOPATH和INTERCONNECT负值,否则负延时为0,见后续QA
+neg_tchk				//允许负值timing检查,否则负值检查替换为0
-sdfretain=warning		//启用SDF RETAIN反标,并在retain > delay时报warning,否则忽略RETAIN信息(retain值指cell输入端变化后,输出端变化前维持原值的时间,delay value后稳定)

注意以下选项在SDF仿真都需要被移除

+notimingcheck 	//仿真时序检查被关闭
+nospecify 		//specify路径延时被忽略
+no_tchk_msg	//timing violation被关闭
+rad			//不可用于SDF仿真

注意SNPS不建议signoff仿真定义VIRAGE_FAST_VERILOG, VIRAGE_IGNORE_RESETDWEM_Verilog_User_Guide

Pulse Control参数
在网表仿真时,为发现毛刺可能导致的潜在Timing问题,需要启用以下elab选项:

+transport_path_delays	//启用VCS Transport Delay模型,以允许对cell能传播输入宽度小于iopath delay的脉冲,否则默认Inertial Delay会过滤该脉冲
+transport_int_delays	//可选,允许对interconnect能传播输入宽度小于interconnect delay的脉冲
+pulse_e/1				//将宽度窄于指定模块path delay百分比(1%)的脉冲替换为X,并报warning。+pulse_int_e/number类似。可用+no_pulse_msg以禁用消息
+pulse_r/1				//过滤宽度窄于指定模块path delay百分比(1%)的脉冲,不会报warning。+pulse_int_r/number类似

例如+transport_path_delays +pulse_e/80 +pulse_r/50,VCS结果如下:pulsectrl

问题记录

Q:SDF仿真相比zero-delay仿真检查作用?
A:SDC质量检查,异步路径检查(STA同步分析无法检查),delay检查;还可用于IR-drop和power评估。

Q:SDF annotate delay值可以为负值?(e.g. -0.002)
A:可以,cell delay计算是比较output 50%和 input 50%差值,driver驱动能力大/input transition小/output load小时完全可能发生。

Q:SDF仿真接口时序错误/接口timing violation?
A:需要对interface也模拟setup/hold time时沿,可以在clocking block中设置input/output skew。一般默认input skew为1step,output skew为0,SDF仿真时input/output delay可以设置为1/4 cycle或根据实际设计调整(output delay可能要考虑hold time + path delay)。
cbskew

SDF错误分析

SDF反标warning
可以在elab选项设置 +warn=no<Title> 过滤特定SDF warning:

TitleMessageExplainationNeed Manual Check One by One?
SDFCOM_MINFModule Instance Not FoundCommonly seen in top sdf when dummy modules are usedNo
SDFCOM_ICBFInstance Cannot Be FoundCommonly seen in flattened sdf for interconnect delay annotation, from partitionA to partitionB if either partition is dummiedNo
SDFCOM_CFIISCannot Find Instance In ScopeCommonly seen in top sdf when dummy modules are usedNo
SDFCOM_SDORScaled Delay value Out of RangeReported in sram instances for clk->q delay when rme && rm[2:0]=0x7, this is low power mode and under this mode, delay value (>4300ns) exceeds 2^32 when scaled to timeprecision 1fs.No
SDFCOM_STCLORScaled TC Limit Out of RangeReported in sram instances for period check when rme && rm[2:0]=0x7, this is lowpower mode and under this mode, clock period limit (>4300ns) exceeds 2^32 when scaled to timeprecision 1fs.No
SDFCOM_RLTPDRETAIN value Larger Than IOPATH DelayReported in sram instances for IOPATH annotations with TEST1==1, not valid for function modeNo
SDFCOM_UHICDUp-Hierarchy Interconnect Delay IgnoredINTERCONNECT Delay to up-hierarchy destination accOutput is ignored, and treated as device delay (for the device lower in the hierarchy). If your SDF file already has DEVICE delay specified, then this interconnect delay is added to the device delayNo
SDFCOM_CFTCCannot Find Timing CheckReported if timingcheck in SDF doesn’t match with verilog model. May caused by SDF/Netlist mismatchYes
SDFCOM_INFIOPATH Not FoundReported in sram instances, CLKx->CLKx path is neither exist nor valid in function mode, safe to waive. Reported if IOPATH not found in verilog model, May caused by SDF/Netlist mismatch.Yes
SDFCOM_IANEIOPATH Annotation Not EnabledReported if IOPATH not found in verilog modelYes
SDFCOM_TANETIMINGCHECK Annotation Not EnabledReported if timingcheck not found in verilog modelYes
SDFCOM_IWSBAINTERCONNECT Will Still Be AnnotatedInterconnect from A to B is not connected by simple wire (ex. has gates/buf on the path). Interconnect delay is still valid. Safe to waive.No
SDFCOM_SWCSimple Wire ConnectionSimilar to IWSBA, interconnect from A to B doesn’t exist or not connected by simple wire. Interconnect delay is still valid. Safe to waive.No
NTCDNCNegative Timing Check Did Not ConvergeReported in compile log after SDF annotation. Commonly seen in stdlib cells. If there are multiple conditional timing checks, then it will be difficult to arrive at a solution for the same delayed clock or data.No (but should be kept in case need to cross check when timing violation is reported)
SDFCOM_NTCDTLNTC Delay is larger than ModPath DelayReported in compile log after SDF annotation. Reported in sram instances for timingchecks when rme && rm[2:0]=0x5, this configuration is not used in GLS.No
VNTBValue is Negative or Too LargeReported in compile log after SDF annotation. Reported in sram timingchecks for RM6 or RM7, which has too large Tcq (7777ns, means not supported). Not used in GLS.No

时序违例
如设置dont-touch的异步路径,或静态配置信号的违例可以屏蔽:

  1. 可以通过VCS elab选项如+optconfigfile+./notimingcheck.cfg 传入cfg文件,关闭timing检查:
instance {signal A} {noTiming}; 	//signal A为绝对路径
module {xxx} {noTiming;}
  1. 可以通过UCLI接口输入命令或传入cfg文件,关闭timing检查:
    tcheck <instance | port> <tcheck_type> <-msg|-xgen> [-enable | -disable] [-r]
  • <instance | port> instance或instance_port路径
  • <tcheck_type> [all|HOLD|SETUP|SETUPHOLD|WIDTH|RECOVERY|REMOVAL|RECREM|PERIOD|SKEW]
  • <-msg | -xgen> 控制开关时序违例warning/notifier toggling
  • [-r] 递归修改指定实例
#disable timing checks for async
tcheck hdl_top.top.partition_a.async_cell_0.sync_d0_DONT_TOUCH all -msg -xgen -disable
#disable timing checks for entire module
tcheck hdl_top.top.i_pcie_ss.i_pcie.u_pcie_phy_top.pcie_pipe.phy0.pma all -msg -xgen -disable -r
在进行VCS仿真时,可以通过以下几个步骤调用SDF文件: 1. 首先,在Verilog文件中添加对SDF文件的引用。例如: `module my_module (input clk, input reset, output reg [7:0] data_out);` `// SDF file inclusion` `// "my_module.sdf" is the path to the SDF file` `// -sdf_cmd_file option is used to specify the SDF file` `// -sdf_verbose option is used to enable verbose mode` `// -sdf_annotate option is used to enable annotation mode` `// -sdfnoexpr option is used to disable expression evaluation` `// -sdfnoedge option is used to disable edge evaluation` `// -sdfnochk option is used to disable timing check` `// -sdfnowarn option is used to disable warning messages` `// -sdfnotime option is used to specify the time scale` `// -sdfmaxdelay option is used to specify the maximum cell delay` `// -sdfmindelay option is used to specify the minimum cell delay` `// -sdfnomaxdelay option is used to disable the maximum cell delay check` `// -sdfnominelay option is used to disable the minimum cell delay check` `// -sdfrep option is used to specify the SDF report file` `// -sdfreport option is used to enable SDF report generation` `// -sdferr option is used to specify the SDF error file` `// -sdfverbose option is used to enable SDF verbose mode` `// -sdfdebug option is used to enable SDF debug mode` `// -sdfpath option is used to specify the SDF library search path` `// -sdfnolib option is used to disable the SDF library search` `// -sdflib option is used to specify the SDF library file` `// -sdfflags option is used to specify additional SDF flags` `// -sdfnoopt option is used to disable SDF optimization` `// -sdfnowire option is used to disable wire delay evaluation` `// -sdfnooutput option is used to disable output delay evaluation` `// -sdfnoinput option is used to disable input delay evaluation` `// -sdfnosupply option is used to disable supply net delay evaluation` `// -sdfnocheck option is used to disable SDF consistency check` `// -sdfnousage option is used to disable usage delay evaluation` `// -sdfnoglobal option is used to disable global delay evaluation` `// -sdfnohierarchy option is used to disable hierarchy delay evaluation` `// -sdfinput option is used to specify the SDF input file` `// -sdfoutput option is used to specify the SDF output file` `// -sdfversion option is used to specify the SDF version` `// -sdftimeout option is used to specify the maximum SDF processing time` `// -sdfquiet option is used to disable SDF message output` `// -sdfignore option is used to ignore SDF errors` `// -sdfkeep option is used to keep the SDF temporary files` `// -sdflist option is used to list all SDF files` `// -sdfhelp option is used to display the SDF help message` `// -sdf option is used to specify all SDF options` `(* SDF_FILE="my_module.sdf",` `SDF_CMD_FILE="-sdf_cmd_file my_module.sdf",` `SDF_VERBOSE="-sdf_verbose",` `SDF_ANNOTATE="-sdf_annotate",` `SDF_NOEXPR="-sdfnoexpr",` `SDF_NOEDGE="-sdfnoedge",` `SDF_NOCHK="-sdfnochk",` `SDF_NOTIME="-sdfnotime 1ns",` `SDF_MAXDELAY="-sdfmaxdelay 10ns",` `SDF_MINDELAY="-sdfmindelay 1ns",` `SDF_NOMAXDELAY="-sdfnomaxdelay",` `SDF_NOMINDELAY="-sdfnominelay",` `SDF_REPORT="-sdfreport my_module.sdf.rpt",` `SDF_ERR="-sdferr my_module.sdf.err",` `SDF_VERBOSE2="-sdfverbose",` `SDF_DEBUG="-sdfdebug",` `SDF_PATH="-sdfpath /lib/sdf",` `SDF_NOLIB="-sdfnolib",` `SDF_LIB="-sdflib my_module.sdflib",` `SDF_FLAGS="-sdfflags "-q -m""` `SDF_NOOPT="-sdfnoopt",` `SDF_NOWIRE="-sdfnowire",` `SDF_NOOUTPUT="-sdfnooutput",` `SDF_NOINPUT="-sdfnoinput",` `SDF_NOSUPPLY="-sdfnosupply",` `SDF_NOCHECK="-sdfnocheck",` `SDF_NOUSAGE="-sdfnousage",` `SDF_NOGLOBAL="-sdfnoglobal",` `SDF_NOHIERARCHY="-sdfnohierarchy",` `SDF_INPUT="-sdfinput my_module.sdf",` `SDF_OUTPUT="-sdfoutput my_module.sdf.out",` `SDF_VERSION="-sdfversion 3.0",` `SDF_TIMEOUT="-sdftimeout 10s",` `SDF_QUIET="-sdfquiet",` `SDF_IGNORE="-sdfignore",` `SDF_KEEP="-sdfkeep",` `SDF_LIST="-sdflist",` `SDF_HELP="-sdfhelp",` `SDF="-sdf" *)` `always @(posedge clk or posedge reset)` `if (reset)` `data_out <= 0;` `else` `data_out <= data_out + 1;` 2. 然后,在进行仿真时,使用vcs命令行选项来指定SDF文件,例如: `vcs -sdf my_module.sdf -top my_module -debug -full64 -R` 其中: -sdf:指定SDF文件 -top:指定顶层模块 -debug:开启调试模式 -full64:使用64位编译器 -R:运行仿真 3. 最后,在仿真完成后,可以查看SDF报告文件以获取时序分析结果。例如: `report_timing -from <起始时钟域> -to <终止时钟域> -delay_type min -path_type full_clock_unate -nworst <最差路径数> -verbose -file <报告文件名>` 其中: -from:指定起始时钟域 -to:指定终止时钟域 -delay_type:指定延迟类型 -path_type:指定路径类型 -nworst:指定最差路径数 -verbose:开启详细模式 -file:指定报告文件名
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

小破同学

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值