關於后仿我知道得不多


 0 后仿的意義

對以下方面進行動態仿真確認

  1. 異步路徑
  2. 時序緊張的同步路徑
  3. 復位流程是否有時序問題
  4. 不定態擴散問題

1 后仿的方法流程

1.1  綜合團隊/后端團隊release綜合網表給DV進行仿真,這一步可以稱為zero delay GLS(gate level simulation), 也可以干脆稱為綜合網表仿真。注意,不帶延時反標的綜合網表仿真,需要加上 nospecify 和 notimingcheck 這兩個編譯選項。

1.2  后端團隊PR網表時序收斂得差不多的時候,用EDA工具提取出延時信息SDF,和PR網表一起release給DV,DV進行帶延時反標的后端網表仿真,簡稱后仿。

SDF仿真不能加上的編譯選項有:

nospecify: Supress module path delays and timing checks in specify blocks. So post simulation with SDF must remove this option.

notimingcheck: Supress timing checks in specify blocks.

no_notifier: Supress the togging of notifier registers that are optional auguments of systemveilog timing checks. The timing checks violation is no affected. 這個選項可以視具體情況而定,最好不要加上。

 

SDF仿真需要加上的編譯選項有:

+neg_tchk:  Enable negative timing checks. If you omit this option, VCS changes all negative limits to 0. Negative timing checks are either $setuphold timing check with negative setup or hold limits, or $recrem timing checks with negative recovery or removal tlimits.

-negdelay: Enable the use of negative values in IOPATH and INTERCONNECT entries in SDF files.

-sdfretain: Enable timing annotation as specified by a RETAIN retry on IOPATH delays.

 

1.3 SDF反標

SDF反標有兩種方法

1) 使用VCS編譯選項

-sdf min|typ|max:instance_name:file.sdf

2) 使用sdf_annotate()系統函數 -- 推薦

You can use the $sdf_annotate system task to back-annotate delay values from an SDF file to your Verilog design.
The syntax for the $sdf_annotate system task is as follows:
$sdf_annotate ("sdf_file"[, module_instance] [,"sdf_configfile"][,"sdf_logfile"][,"mtm_spec"] [,"scale_factors"][,"scale_type"]);

sdf_file: SDF文件

sdf_logfile: 指定SDF反標日志。默認情況下,VCS最多顯示10條SDF反標警告到vcs compile log中。但是如果在這里指定了單獨的反標日志,則所有的警告都會打到指定的日志中。

如果加了+sdfverbose編譯選項,則vcs compile log中也會顯示所有的反標警告。

"mtm_spec":
Specifies which delay values of min:typ:max triplets VCS MX back-annotates. Specify "MINIMUM", "TYPICAL", "MAXIMUM" or "TOOL_CONTROL" (default).

示例:

$sdf_annotate("xxx.sdf.gz",  tb.dut,   , annotate.log, "MAXIMUM");


 以下是一些反標警告的分析總結:

Warning-[DRTZ] Detect delay value roundoff to 0

  Delay from design or SDF file roundoff to 0 based in timescalue. Please check dumped diagnostic file (timescale.txt).

這個警告是由於cell的timescale沒有設置好,可以查看timescale.txt, 分析cell的timescale是什么。

 

Warning-[SDFCOM_UHICD]

SDF Warning in instance
logic_mix.FE_OCPUNCOC97857_l2_connector_ram_1_1_data_mem_d_69_ of
module HD45_SH_BFX16:
/home/dspshop/amid/prime_power/tb14/glv_db/
logic_mix.fe_rut.try8.sdf.gz:192, SDF Warning: INTERCONNECT ->
accOutput(uphierarchy), port1 (Z) DEVICE delay applied

This warning is typically issued when one SDF interconnect delay has
to be backannotated on a net going from a device output to an output
port of one hierarchical block.

I believe Z is an output port and is connected to another output port
which is causing this warning message.

Please find the snippet from the sdf specifiacation3.0:
*****************************
3-21:
The INTERCONNECT entry is for the specification of interconnect delays
(actual or estimated) that are modeled independently for each driver-
to driven path. Both start and end points for the delay path are
specified.
Syntax
( INTERCONNECT port_instance port_instance delval_list )
The first port_instance is an output or bidirectional port.
The second port_instance is an input or bidirectional port.
delval_list is the INTERCONNECT delay between the output and input
ports.

 當SDF的互聯延時是從一個cell的output port到up hierarchy的某個輸出port時就會報這個警告。因為SDF格式要求INTERCONNECT延時都是某個output/inout到某個input/inout的。

仿真器會將這種互聯延時加到cell的device延時上面,從波形上看標上去的延時是符合預期的,所以這種警告可以忽略。

 

Warning-[SDFCOM_NICD]

SDF Warning: Negative INTERCONNECT Dealy

This negative value cannot be handled with switch -negdelay. Please check SDF files.

這種情況是由於SDF中的負interconnect延時不符合VCS的要求,即VCS在該負延時前后找不到正的延時進行合並處理。VCS user guide中說明如下:

To consider a negative INTERCONNECT delay, one of the following should be true:
-Sum of INTERCONNECT and PORT delays should be greater than zero
-Sum of INTERCONNECT and IOPATH delays should be greater than zero
-Sum of INTERCONNECT and DEVICE delays should be greater than zero
Otherwise, the negative INTERCONNECT delay is ignored, and a warning message is generated for the same.

 

Warning-[SDFCOM_ANICD] Adjust Negative INTERCONNECT DELAY

SDF Warning: Adjusting device delay for negative INTERCONNECT DELAY

tb.dut.U1234.X to

tb.dut.U1235.A

該警告的意思是說,將負的互聯延時調整到前一個cell的IOPATH上了,提醒你注意一下!

比如,U1234.X->U1235.A的互聯延時是-3ps, 而U1234的IOPATH A->X的delay原本是30,現在考慮到負的互聯延時,就把U1234的IOPATH調整成30-3=27ps.

要知道EDA工具是很難模擬負延時的,因此只能將負的互聯延時合並到前一級cell的IOPATH進行處理。因此就必須要求互聯延時+前一級IOPATH延時>0.

 

Warning-[NTCDNC] Negative Timing Check Did Not Converge

Negative timing check delays did not converge, trying to solve by setting minimum constraint to zero.

當2個以上的timing check使用同一個reference event(比如 posedge ck),且這些timing check檢查的時間窗口沒有重合時,EDA工具沒辦法處理這種情況,即負延時檢查沒有收斂。

EDA工具會嘗試把最小的一個負值改成0,去嘗試解決這個問題。這樣做會比原始的檢查更為嚴格,所以是對仿真無害的。

 


 

1.4 DUT內部變量的初始化

網表內部難免有些寄存器是沒有復位端或者置位端的,而這些寄存器的Q端在系統復位完后還是處於X態,一旦時鍾跑起來,這些X態就有可能傳播出去了。

因此,在項目實踐中,可以讓后端提供一個 no reset reg list, 他們可以用腳本非常方便的提取出來。有了這樣一個list后,我們在后仿中可以對這些沒有復位端的寄存器進行初始化。

1) 用vcs config file進行初始化

+vcs+initreg+config+config_file
Specifies a configuration file for initializing Verilog variables, registers defined in sequential UDPs, and memories including multi-dimensional arrays (MDAs) in your design, at time zero. In the configuration file, you can define the parts of a design to apply the initialization and the initialization values of the variables.
The syntax of the configuration file entries are:


defaultvalue x|z|0|1|random|random seed_value
instance instance_hierarchical_name [x|z|0|1|random| random seed_value]
tree instance_hierarchical_name depth [x|z|0|1|random| random seed_value]
module module_name [x|z|0|1|random|random seed_value]
modtree module_name depth [x|z|0|1|random|
random seed_value]

在config file中可以這樣寫

instance tb.dut.reg_0 random

tree tb.dut.xxx_inst 0 random

注意!這種方式只能初始化UDP(User Defined Primitives)中的reg。

 You can use the +vcs+initreg+random option to initialize all bits of Verilog variables and registers defined in sequential UDPs and memories including multi-dimensional arrays (MDAs) in your design to random value 0 or 1, at time zero.

 

2) 用$deposit系統函數 - 推薦

$deposit(tb.dut.reg_0.Q, uramdom_range(0, 1) );

至於Memory, 可以將其所有單元的值初始化為隨機值,也可以不初始化,具體視情況而定。比如,芯片的軟件有時候會在網memory里寫入值之前先讀取memory的值,如果有這種情況,為了防止X態的傳播,就必須先將Memory單元初始化為隨機值。

 

1.5 X態問題的分析定位

 沒有遇到X態問題的后仿是不完整的。遇到X態不要慌,試着從以下幾個角度分析。

1) 是否所有的DUT input端口都給予了一個known的值。

2) 是否對沒有復位端的寄存器作了初始化。

3) DUT里有哪些Memory, 是否有必要進行初始化?

4) 如果是Timing violation引起的X態,則需要先分析Timing violation

5) 實在不行,就只能一級一級往前追了,找到X態源頭

 

1.6 Timing violaton analyze and waive

對於原本就是工作在異步路徑下的sync cell, 靜態時序分析時沒有對它們進行約束和分析,因此在動態仿真時也一定會出現Timing Violation.

可以讓后端給一個sync cell的list, DV將其整理成notiming config file.

在編譯選項中 +optconfigfile=noTiming.cfg

在noTiming.cfg中

instance {tb.dut.u_xxx} {noTiming};

另外,對於模塊級或者子系統級的后仿,需要讓后端給一個input delay, 即輸入的數據信號相對於時鍾信號的延時,然后DV根據這個input delay去驅動數據信號。

這個input delay可能會影響模塊第一級觸發器的時序!

 

1.7 Negative timing check

負的setup/hold time到底是什么意思呢?

 當ASIC Cell內部有時序器件,而Cell的輸入時鍾和輸入數據到這個時序器件是有延時的,而且當我們以ASIC Cell為邊boundary去進行timing檢查時,

就有可能出現負的setup/hold time. 具體見上圖。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM