reference
What is Setup and hold time in an FPGA?
Propagation delay in an FPGA or ASIC?
另外ug906的第五章介紹了時序分析的基礎。最一開始介紹的就是timing path的概念,進而引出了時序分析的兩個關鍵分析點setup slack analysis和hold slack analysis。
作為基礎,本文的reference當中提到了setup time和hold time的概念:
setup time: Setup time is the amount of time required for the input to a Flip-Flop to be stable before a clock edge.
hold time: Hold time is the minimum amount of time required for the input to a Flip-Flop to be stable after a clock edge.
這里\(t_{su}\)就是setup time,\(t_h\)就是那個hold time。setup time和hold time對於一個觸發器來說是固定的參數。也就是說要完成一次正常的數據鎖存,數據必須要在setup time和hold time的時候保持穩定。
在實際的電路當中一個觸發器的運行周期必須滿足:
這里只有\(t_p\)(傳輸延時)是可變的,與具體的電路結構設計有關。傳輸的延時越短,FPGA可運行的時鍾速率就越高。
再來看xilinx當中的Setup/Recovery Relationship的概念。Xilinx說:
The setup check is performed only on the most pessimistic setup relationship between two clocks.
-ug906(v2016.4)P153
因為(dst的setup time)setup time是固定的,所以只要能保證在收發脈沖上升沿時間差值最短的時候保證沒有問題,那么實際運行應該就不會出現問題。所以檢查的是required_time - arrival_time。
即
Data Required Time(hold) =
capture edge time
+destination clock path delay
-clock uncertainty
-setup time
Data Arrival Time(hold) =
launch edge time
+source clock path delay
+datapath delay
Slack(hold) =
Data Required Time-Data Arrival Time
在接收端dst的hold time也是固定的,如果在hold時間還沒結束的時候下個數據就被推過來了。在當前傳輸的數據就有可能被覆蓋掉。所以hold check檢查的是arrival_time - required_time。
Data Required Time(hold) =
capture edge time
+destination clock path delay
-clock uncertainty
+hold time
Data Arrival Time(hold) =
launch edge time
+source clock path delay
+datapath delay
Slack(hold) =
Data Arrival Time-Data Required Time
本來hold分許也叫作Min delay analysis,可以這樣理解如果把setup Slack的計算公式當做是一種標准型,那么我們就希望Min delay這個值負的越多越好。當然這里實際是反過來了,取了個相反數,那就是越大越好。
陳小碩的那兩個個cnblog的文章講述的非常清晰,但是感覺理解起來有點過於復雜了,我覺得簡化來說,setup slack就是指在數據setup time之前多久數據必須到達才行。hold slack就是在數據hold time之后數據必須保持多久,才能讓下一個數據過來(hold是在說下一個launch edge了)。