Verilog中的specify block和timing check


在ASIC設計中,有兩種HDL construct來描述delay信息:

1)Distributed delays:通過specify event經過gates和nets的time,來描述delay;

   對於net和gate都有三種delay信息: 1)rise delay   2)fall delay    3)transition to high-impedance value

             只有一種delay時,所有change都使用這種delay,兩個delay值時,才分為rise/fall

   每一種delay信息又分為:min:typical:max三種。

   gate和net的model例子:

           

           

     但是trireg類型的變量一般建模cap的信號:第三個delay信息表示他storage的信號值不再保證的時間;

           

2)Module path delays:通過描述event從source(input/inout port)到destination(output/inout port)的time,來描述delay;

使用specify......endspecify來進行描述。

 

在specify block中一般有三種信息:

1)various paths across the module;

2)Assign delays to those paths;

3)Perform timing check;

 

path的declaration包括三類:

1)simple path declaration;

   

2)edge sensitive path declaration;   加 posedge/negedge

    表示FF的有效沿是posedge,從in到out是一個positive的polarity,rise delay是10, fall delay是8。

  

3)state dependent path declaration;  加if/ifnone

4)Edge-sensitive state-dependent paths

 

“ *>”表示 full conection,   “ =>”表示parallel conection

 

對於會改變polarity的 path,可以通過+/-來進行描述,否則按unknown polarity分析(rise edge可能引起fall edge/rise/edge/no transition)。

"+"表示positive polarity, rise 可能引起rise edge或no transition

"-"表示positive polarity, rise 可能引起fall edge或no transition

 

Specifying transiiton delay on module path

按rise---fall---to-z的三種來區分,每一種delay信息可以再細分min/typ/max

前三者用","區分,后三者用":"區分

 

在delay path中,有一些是到同一個output的,這是選擇最近有效的一路來計算,如果還是有多條

同時有效,選擇delay較小的那一條path。

當Y從0變為1時,如果A transition more recently,那么選擇6的delay,否則選擇5的delay;

如果A和B都有效,那么選擇5的delay; 

 

對於module path delay和distributed delay都存在的情況,選擇兩者之間大的那一個值。 

 

對於path的distination必須是的單一driver的,所以一些wire類型的信號,必須變為gate輸出的signal

 

TIming Check,在給定的timing limit內,保證critical event occur;

可以分為兩大類:

1)檢查stability time window----------$setup, $hold, $setuphold, $recovery, $removal, $recrem

2)檢查two event之間的time----------$skew, $width, $period, $nochange

注意這些timing check並不是task,specify內也不允許有task;

所有的這些timing check都有兩個基准時間點:reference event和data event;

                                      兩個時間評估點:timestamp event和timecheck event;

不報violation,必須保證data event在正確的time window下發生

 

$setup check: $setup(data_event, reference_event, time_check_limit,notifier)

保證timestamp的時間在time window之內,否則會報violation

當limit設置為0時,表示這個檢查永遠不會報violation

 

$hold check: $hold(reference_event, data_event, time_check_limit,notifier)

當limit設置為0時,表示這個檢查永遠不會報violation

 

$setuphold check: $setuphold(reference_event, data_event, setup_time_check_limit,hold_time_check_limit,notifier)

 

$skew(reference_event, data_event, time_check_limit, notifier)

 

$width(reference_event, time_check_limit, threshold)

reference必須是一個trigger的event,另一個edge作為data event,兩者時間間隔大於threshold(防止glitch),小於limit。

 

$setuphold的完整定義:支持negtive timing

notifier作為一個reg類型變量,在timing check invoke的地方聲明,

當檢測到timing violation時,notifier通過FF的行為,打印violation信息,並propagate X to the output。

在timing check過程中,data和reference clock的delay copysignal會被創建,

用戶可以顯式的定義,delayed_reference或者delayed_data。

 

dclk在setup為負值時,表示clk延時7個cycle,在dclk之前D不再變化,就不會出現violation。

dD在hold為正值時,表示D延時13個cycle,如果dD發生在CLK之后,則不會出現violation。

在多個$setuphold的函數中,選擇大的一個賦值。

 

在做后仿的過程中,默認選擇sdf中的delay值,之后選擇specify中的delay值。


免責聲明!

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



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