前一篇文章 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)
SDF反标仿真
SDF网表仿真是芯片signoff交付流程的重要一环,但由于编译和仿真时间比较长,且需要交付多个SDF corner,导致时间比较紧张,需要提高仿真效率减少错误。
SDF反标通过以下系统函数实现,具体使用方式参见VCS手册。
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_RESET
宏DWEM_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结果如下:
问题记录
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)。
SDF错误分析
SDF反标warning
可以在elab选项设置 +warn=no<Title>
过滤特定SDF warning:
Title | Message | Explaination | Need Manual Check One by One? |
---|---|---|---|
SDFCOM_MINF | Module Instance Not Found | Commonly seen in top sdf when dummy modules are used | No |
SDFCOM_ICBF | Instance Cannot Be Found | Commonly seen in flattened sdf for interconnect delay annotation, from partitionA to partitionB if either partition is dummied | No |
SDFCOM_CFIIS | Cannot Find Instance In Scope | Commonly seen in top sdf when dummy modules are used | No |
SDFCOM_SDOR | Scaled Delay value Out of Range | Reported 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_STCLOR | Scaled TC Limit Out of Range | Reported 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_RLTPD | RETAIN value Larger Than IOPATH Delay | Reported in sram instances for IOPATH annotations with TEST1==1, not valid for function mode | No |
SDFCOM_UHICD | Up-Hierarchy Interconnect Delay Ignored | INTERCONNECT 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 delay | No |
SDFCOM_CFTC | Cannot Find Timing Check | Reported if timingcheck in SDF doesn’t match with verilog model. May caused by SDF/Netlist mismatch | Yes |
SDFCOM_INF | IOPATH Not Found | Reported 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_IANE | IOPATH Annotation Not Enabled | Reported if IOPATH not found in verilog model | Yes |
SDFCOM_TANE | TIMINGCHECK Annotation Not Enabled | Reported if timingcheck not found in verilog model | Yes |
SDFCOM_IWSBA | INTERCONNECT Will Still Be Annotated | Interconnect 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_SWC | Simple Wire Connection | Similar 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 |
NTCDNC | Negative Timing Check Did Not Converge | Reported 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_NTCDTL | NTC Delay is larger than ModPath Delay | Reported 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 |
VNTB | Value is Negative or Too Large | Reported 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的异步路径,或静态配置信号的违例可以屏蔽:
- 可以通过VCS elab选项如
+optconfigfile+./notimingcheck.cfg
传入cfg文件,关闭timing检查:
instance {signal A} {noTiming}; //signal A为绝对路径
module {xxx} {noTiming;}
- 可以通过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