建立时间和保持时间(setup time 和 hold time)
建立時(shí)間和保持時(shí)間貫穿了整個(gè)時(shí)序分析過程。只要涉及到同步時(shí)序電路,那么必然有上升沿、下降沿采樣,那么無法避免setup-time 和 hold-time這兩個(gè)概念。本文內(nèi)容相對獨(dú)立于該系列其他文章,是同步時(shí)序電路的基礎(chǔ)。
針對xilinx手冊中一些概念的更新和術(shù)語的規(guī)范化,以及存在的一些問題,參考文檔為UG906,已進(jìn)行了一系列修改。--2019/5/5
系列目錄
時(shí)序收斂:基本概念
建立時(shí)間和保持時(shí)間(setup time 和 hold time)
OFFSET約束(OFFSET IN 和OFFSET OUT)
Clock Skew , Clock uncertainly 和 Period
特殊約束From To
OFFSET IN 使用舉例
Achieving Timing Closure
1. 什么是setup-time 和 hold-time
同步時(shí)序電路設(shè)計(jì)中,只在時(shí)鐘的上升沿或下降沿進(jìn)行采樣。為了正確得到采樣結(jié)果,需要確保采樣時(shí)刻數(shù)據(jù)有效,因此工具會對綜合結(jié)果進(jìn)行靜態(tài)時(shí)序分析,以判斷時(shí)鐘和數(shù)據(jù)之間的相對關(guān)系是否滿足要求。以寄存器-寄存器之間的路徑為例子
圖1
圖2
發(fā)射時(shí)間(launch edge):源時(shí)鐘發(fā)射數(shù)據(jù)的時(shí)刻
采樣時(shí)間(capture edge):目的時(shí)鐘采樣數(shù)據(jù)的時(shí)刻(顯然采樣時(shí)刻要晚于發(fā)射時(shí)刻)
而Setup time和Hold time,按照維基百科的解釋為
Setup time is the minimum amount of time the data signal should be held steady before the clock event so that the data is reliably sampled by the clock. This applies to synchronous input signals to the flip-flop.
Hold time is the minimum amount of time the data signal should be held steady after the clock event so that the data are reliably sampled. This applies to synchronous input signals to the flip-flop.
無論是Setup time 或者Hold time,都是指時(shí)間上的相對關(guān)系;在具體分析過程中,時(shí)鐘有發(fā)射時(shí)鐘和采樣時(shí)鐘,而各個(gè)路徑上的數(shù)據(jù)也有不同的延時(shí),因此僅提及Setup time/Hold time往往有指代不清的問題。因此,Xilinx在UG902中明確了
setup relationship:時(shí)序分析工具給出的launch edge和capture edge之間setup關(guān)系
setup requirement:launch edge和capture edge之間最嚴(yán)格的setup約束(分析得到所有的setup relationship中的最小值)
hold relationship:時(shí)序分析工具給出的launch edge和capture edge之間hold關(guān)系
hold requirement:launch edge和capture edge之間最嚴(yán)格的hold約束(分析得到所有的hold relationship中的最大值)
如圖2所示,在同一理想時(shí)鐘下,假設(shè)時(shí)鐘周期為5ns;lanch time記為0ns,則capture time為5ns,此時(shí)setup relationship為5ns,hold relationship為0ns。
2. 建立在Setup和Hold上時(shí)序分析
建立在上一節(jié)基礎(chǔ)上,可以對數(shù)據(jù)的具體采樣時(shí)刻進(jìn)行分析,以判斷是否在數(shù)據(jù)有效時(shí)刻完成了采樣。如果說采樣時(shí)刻比數(shù)據(jù)到達(dá)時(shí)刻晚,則滿足了setup的要求。
如圖1所示,由于源時(shí)鐘可能有路徑延時(shí),因此Q端的輸出會比launch time晚source clock path delay,同時(shí)由于在數(shù)據(jù)路徑上有延時(shí),因此到達(dá)下一寄存器Q端還需花費(fèi)datapath delay時(shí)間,因此
Data Arrival Time(Setup) = launch edge time + source clock path delay + datapath delay
類似可計(jì)算實(shí)際的采樣時(shí)刻
Data Required Time(Setup) = Caputure edge time + destinationclock path delay – clock uncertainty – Synchronous Element Setup time
其中Synchronous Element Setup time是寄存器的特性,Clock Uncertainty類似下圖所示,由于時(shí)鐘的不確定性,需要考慮最壞情況。
Xilinx計(jì)算Slack來判斷是否滿足是需要求。Slack的中文意思是“松弛的”,可以簡單的理解為設(shè)計(jì)余量。即如果slack是正數(shù),那么設(shè)計(jì)滿足要求,否則不滿足要求。對于setup time的slack,有
Slack = Data Required Time(Setup) - Data Arrival Time(Setup)
如圖2所示的理想情況下,Required Time(setup)為5ns,只要datapth delay不大于5ns,那么Slack就能滿足要求。
當(dāng)然,在一個(gè)設(shè)計(jì)中會存在多條路徑,所有的Slack均需要滿足要求。
類似的,也可以給出Hold的分析結(jié)果;與setup不同,要求數(shù)據(jù)完成采樣之后下一個(gè)數(shù)據(jù)才能到達(dá)。
Data Arrival Time(hold) = launch edge time + source clock path delay + datapath delay
Data Required Time(Setup) = Caputure edge time + destinationclock path delay + clock uncertainty + Synchronous Element Hold time
Slack = Data Arrival Time(Hold) - Data Requried Time(Hold)
如圖2所示的理想情況下,Required Time(Hold)為0ns,只要datapth delay大于0,那么Slack就能滿足要求。
總結(jié)
以上是生活随笔為你收集整理的建立时间和保持时间(setup time 和 hold time)的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 百香果怎么吃(如何吃百香果减肥)
- 下一篇: Perst嵌入式数据库介绍