为了正常的体验网站,请在浏览器设置里面开启Javascript功能!

关于建立时间(setup time)保持时间(hold time)以及时序的一些问题集合

2013-05-08 31页 doc 542KB 245阅读

用户头像

is_663873

暂无简介

举报
关于建立时间(setup time)保持时间(hold time)以及时序的一些问题集合建立时间和保持时间 giltch1.jpg 图1 建立时间(setup time)是指在触发器的时钟信号上升沿到来以前,数据稳定不变的时间,如果建立时间不够,数据将不能在这个时钟上升沿被打入触发器;保持时间(hold time)是指在触发器的时钟信号上升沿到来以后,数据稳定不变的时间, 如果保持时间不够,数据同样不能被打入触发器。 如图1 。 数据稳定传输必须满足建立和保持时间的要求,当然在一些情况下,建立时间和保持时间的值可以为零。 QUOTE: DC,建立时间不满足,只能重新综合设计,并以违例路径为目标进行优...
关于建立时间(setup time)保持时间(hold time)以及时序的一些问题集合
建立时间和保持时间 giltch1.jpg 图1 建立时间(setup time)是指在触发器的时钟信号上升沿到来以前,数据稳定不变的时间,如果建立时间不够,数据将不能在这个时钟上升沿被打入触发器;保持时间(hold time)是指在触发器的时钟信号上升沿到来以后,数据稳定不变的时间, 如果保持时间不够,数据同样不能被打入触发器。 如图1 。 数据稳定传输必须满足建立和保持时间的要求,当然在一些情况下,建立时间和保持时间的值可以为零。 QUOTE: DC,建立时间不满足,只能重新综合设计,并以违例路径为目标进行优化,以及对涉及到违例的组合逻辑以及子模块加紧约束。 保持时间不满足,可在布图前或者布图后再修改这些违例,通常布图后再修改。因为布图前综合,时序分析采用统计线载模型,在布局前修正保持时间违例可能会导致布图后建立时间违例。 QUOTE: 1、setup time的意义:为什么Data需要在Clock到达之前到达?       其实在实际的问题中,setup time并不一定是大于零的,因为Clock到达时刻并不等同于latch的传输门A关闭的时刻(更何况这种关闭并不是绝对的和瞬间完成的),这之间有一个未知的延迟时间。      为使问题简化,假设Clock的到达时刻为传输门A关闭、传输们B打开的时刻。如果Data没有在这之前足够早的时刻到达,那么很有可能内部的feedback线路上的电压还没有达到足够使得inv1翻转的地步(因为inv0有延时,Data有slope,传输门B打开后原来的Q值将通过inv2迫使feedback保持原来的值)。如果这种竞争的情况发生,Q的旧值将有可能获胜,使Q不能够寄存住正确的Data值;当然如果feedback上的电压已经达到了足够大的程度也有可能在竞争中取胜,使得Q能够正确输出。       如果inv0、inv1和inv2的延时较大(Data的变化影响feedback和Q的时间越长),那么为了保证正确性就需要更大的setup time。所以在实际测量setup time的时候,需要选取工艺中最慢的corner进行仿真测量。 2、、hold time的意义:为什么Data在Clock到达之后仍然要保持一段时间?       和setuptime的情况不一样,因为Clock到达时刻并不等同于latch的传输门A完全关闭的时刻。所以如果Data没有在Clock到达之后保持足够长的时间,那么很有可能在传输门A完全关闭之前Data就已经变化了,并且引起了feedback的变化。如果这种变化足够大、时间足够长的话,很有可能将feedback从原本正确的低电压拉到较高电压的电压。甚至如果这种错误足够剧烈,导致了inv1和inv2组成的keeper发生了翻转,从而彻底改变了Q的正确值,就会导致输出不正确。当然,如果这种错误电压不是足够大到能够改变keeper的值,就不会影响到Q的正确输出。       如果inv0、inv1和inv2的延时较小(Data的变化影响feedback和Q的时间越短),那么为了保证正确性,就需要更大的hold time。所以在实际测量hold time的时候,需要选取工艺中最快的corner进行仿真测量。 QUOTE: 时钟周期为T,触发器D1的时钟沿到来到触发器Q变化的时间Tco(CLK--Q)最大为T1max,最小为T1min,逻辑组合电路的延迟时间最大为T2max,最小为T2min,问触发器D2的建立时间和保持时间。 最终:T3setup0。         所以要求的最小时钟周期即为T=Tcq+Tpd+Tsetup-Tcd 时钟周期为T,触发器D1的时钟沿到来到触发器Q变化的时间Tco(CLK--Q)最大为T1max,最小为T1min,逻辑组合电路的延迟时间最大为T2max,最小为T2min,问触发器D2的建立时间和保持时间。          该题最终答案:T3setup< FONT>      maxbird:D2的保持时间就是时钟沿到来之后,D2的数据输入端要保持数据不变的时间,这个时间是由D1和D2之间的组合逻辑时延决定的。例如:假设D1和D2之间的组合逻辑时延为2ns,时钟周期为10ns,这意味着在时钟沿来到后,D1输出的新数据要过2ns才会到达D2的数据输入端,那么在这2ns内,D2的数据输入端保持的还是上一次的旧数据,其值不会立即更新,假设D2的最小保持时间为3ns,这意味时钟沿到来后,D2的数据输入端的值在3ns内不能有变化,回到问题的关键,由于D1在时钟沿到来后的输出结果,经过2ns的组合逻辑延时便到达了D2的输入端,而D2要求在时钟沿到来后的3ns内其输入端的值不能改变,这样D2的保持时间就得不到满足,所以D2的保持时间必须小于等于2ns。至于说T2min为0时的情况,其实T2min是永远不能为0的,即使是一根导线其时延也是不可能为0的,这就是为什么移位寄存器的两个触发器之间连的只是一根导线,导线后端触发器的保持时间却还是可以满足的原因,其实移位寄存器中触发器的保持时间可以看成是小于等于其间导线的时延。       建立时间:触发器在时钟沿来到前,其数据输入端的数据必须保持不变的时间;保持时间:触发器在时钟沿来到后,其数据输入端的数据必须保持不变的时间。如下图:   因为触发器内部数据的形成是需要一定的时间的,如果不满足建立和保持时间,触发器将进入亚稳态,进入亚稳态后触发器的输出将不稳定,在0和1之间变化,这时需要经过一个恢复时间,其输出才能稳定,但稳定后的值并不一定是你的输入值。这就是为什么要用两级触发器来同步异步输入信号。这样做可以防止由于异步输入信号对于本级时钟可能不满足建立保持时间而使本级触发器产生的亚稳态传播到后面逻辑中,导致亚稳态的传播。两级触发器可防止亚稳态传播的原理:假设第一级触发器的输入不满足其建立保持时间,它在第一个脉冲沿到来后输出的数据就为亚稳态,那么在下一个脉冲沿到来之前,其输出的亚稳态数据在一段恢复时间后必须稳定下来,而且稳定的数据必须满足第二级触发器的建立时间,如果都满足了,在下一个脉冲沿到来时,第二级触发器将不会出现亚稳态,因为其输入端的数据满足其建立保持时间。同步器有效的条件:第一级触发器进入亚稳态后的恢复时间 + 第二级触发器的建立时间 < = 时钟周期。     maxbird在该部分详细说明了建立时间和保持时间的概念,以及如果不满足二者可能导致的亚稳态的传播。注意这里说的建立时间和保持时间都是针对时钟而言的,在进行时序约束时所指的就是这种,而很多网友以前学习的建立时间保持时间的概念是针对信号而言的,所指的对象不同,分析出来的结论完全相反,一定注意不要混淆。      不考虑CLOCK SKEW情况下。D2的建立时间要求:Tco1+T1(logic delay)+Tsetup2 + - 如果你正确设置了convert_clk 和out_clk的时序分析参数,在时序分析中应该看到满足时序要求的结果:Clock Setup :'convert_clk'、Clock Hold :'convert_clk'。 你说的负值未必就不好,对于th、tsu来说,负值是好的。如果你在时序设置中指定了期望值的话,用期望值减去实际值,得到的是你的余量(slack)。只有slack是正值,才是好的结果。 如果你现在还没有分配引脚,并且不准备把设计用于实际系统的话,你可以暂时不关心th、tsu。但是一定要设置和分析你的时钟信号。 负的setup 和 hold time 还是比较好理解的。 讨论一下setup time violation 的形成---因为信号比clock 后到达DFF,或者说到达的时间太晚了,这个时候这个DFF就没有办法采样到这个信号,于是就出现了setup slak。 那么,假设你对这一个DFF做优化,你会怎么做?---打包这个DFF,假设为DFFA。在DFFA中把clock加delay,再连接到原DFF。这样你的信号就可以走的慢一点,慢到比clock还慢都没有问题---而这个时候setup time就被你给优化到负的值了。同样的可以解释负的hold time。 下面这个来自:http://blog.ednchina.com/tanghtctc/195716/message.aspx 时钟是整个电路最重要、最特殊的信号,系统内大部分器件的动作都是在时钟的跳变沿上进行, 这就要求时钟信号时延差要非常小,否则就可能造成时序逻辑状态出错;因而明确FPGA设计中决定系统时钟的因素,尽量较小时钟的延时对保证设计的稳定性有非常重要的意义。 建立时间与保持时间     建立时间(Tsu:set uptime)是指在时钟沿到来之前数据从不稳定到稳定所需的时间,如果建立的时间不满足要求那么数据将不能在这个时钟上升沿被稳定的打入触发器;保持时间(Th:holdtime)是指数据稳定后保持的时间,如果保持时间不满足要求那么数据同样也不能被稳定的打入触发器。建立与保持时间的简单示意图如下图1所示。 图1 保持时间与建立时间的示意图     在FPGA设计的同一个模块中常常是包含组合逻辑与时序逻辑,为了保证在这些逻辑的接口处数据能稳定的被处理,那么对建立时间与保持时间建立清晰的概念非常重要。下面在认识了建立时间与保持时间的概念上思考如下的问题。 图2 同步设计中的一个基本模型    图2为统一采用一个时钟的同步设计中一个基本的模型。图中Tco是触发器的数据输出的延时;Tdelay是组合逻辑的延时;Tsetup是触发器的建立时间;Tpd为时钟的延时。如果第一个触发器D1建立时间最大为T1max,最小为T1min,组合逻辑的延时最大为T2max,最小为T2min。问第二个触发器D2立时间T3与保持时间T4应该满足什么条件,或者是知道了T3与T4那么能容许的最大时钟周期是多少。这个问题是在设计中必须考虑的问题,只有弄清了这个问题才能保证所设计的组合逻辑的延时是否满足了要求。     下面通过时序图来分析:设第一个触发器的输入为D1,输出为Q1,第二个触发器的输入为D2,输出为Q2;    时钟统一在上升沿进行采样,为了便于分析我们讨论两种情况即第一:假设时钟的延时Tpd为零,其实这种情况在FPGA设计中是常常满足的,由于在FPGA设计中一般是采用统一的系统时钟,也就是利用从全局时钟管脚输入的时钟,这样在内部时钟的延时完全可以忽略不计。这种情况下不必考虑保持时间,因为每个数据都是保持一个时钟节拍同时又有线路的延时,也就是都是基于CLOCK的延迟远小于数据的延迟基础上,所以保持时间都能满足要求,重点是要关心建立时间,此时如果D2的建立时间满足要求那么时序图应该如图3所示。 从图中可以看出如果: T-Tco-Tdelay>T3 即: Tdelay< T-Tco-T3 那么就满足了建立时间的要求,其中T为时钟的周期,这种情况下第二个触发器就能在第二个时钟的升沿就能稳定的采到D2,时序图如图3所示。 图3 符合要求的时序图     如果组合逻辑的延时过大使得T-Tco-Tdelay=T3 这也就是要求的D2的建立时间。     从上面的时序图中也可以看出,D2的建立时间与保持时间与D1的建立与保持时间是没有关系的,而只和D2前面的组合逻辑和D1的数据传输延时有关,这也是一个很重要的结论。说明了延时没有叠加效应。     第二种情况如果时钟存在延时,这种情况下就要考虑保持时间了,同时也需要考虑建立时间。时钟出现较大的延时多是采用了异步时钟的设计方法,这种方法较难保证数据的同步性,所以实际的设计中很少采用。此时如果建立时间与保持时间都满足要求那么输出的时序如图5所示。 图5 时钟存在延时但满足时序     从图5中可以容易的看出对建立时间放宽了Tpd,所以D2的建立时间需满足要求: Tpd+T-Tco-T2max>=T3     由于建立时间与保持时间的和是稳定的一个时钟周期,如果时钟有延时,同时数据的延时也较小那么建立时间必然是增大的,保持时间就会随之减小,如果减小到不满足D2的保持时间要求时就不能采集到正确的数据,如图6所示。     这时即T-(Tpd+T-Tco-T2min)=T4 即Tco+T2min-Tpd>=T4     从上式也可以看出如果Tpd=0也就是时钟的延时为0那么同样是要求Tco+T2min>T4,但是在实际的应用中由于T2的延时也就是线路的延时远远大于触发器的保持时间即T4所以不必要关系保持时间。 图6 时钟存在延时且保持时间不满足要求     综上所述,如果不考虑时钟的延时那么只需关心建立时间,如果考虑时钟的延时那么更需关心保持时间。下面将要分析在FPGA设计中如何提高同步系统中的工作时钟。 如何提高同步系统中的工作时钟     从上面的分析可以看出同步系统时对D2建立时间T3的要求为: T-Tco-T2max>=T3    所以很容易推出T>=T3+Tco+T2max,其中T3为D2的建立时间Tset,T2为组合逻辑的延时。在一个设计中T3和Tco都是由器件决定的固定值,可控的也只有T2也就时输入端组合逻辑的延时,所以通过尽量来减小T2就可以提高系统的工作时钟。为了达到减小T2在设计中可以用下面不同的几种方法综合来实现。 通过改变走线的方式来减小延时    以altera的器件为例,我们在quartus里面的timing closure floorplan可以看到有很多条条块块,我们可以将条条块块按行和按列分,每一个条块代表1个LAB,每个LAB里有8个或者是10个LE。它们的走线时延的关系如下:同一个LAB中(最快) < 同列或者同行 < 不同行且不同列。我们通过给综合器加适当的约束(约束要适量,一般以加5%裕量较为合适,比如电路工作在100Mhz,则加约束加到105Mhz就可以了,过大的约束效果反而不好,且极大增加综合时间)可以将相关的逻辑在布线时尽量布的靠近一点,从而减少走线的时延。 通过拆分组合逻辑的方法来减小延时    由于一般同步电路都不止一级锁存(如图8),而要使电路稳定工作,时钟周期必须满足最大延时要求,缩短最长延时路径,才可提高电路的工作频率。如图7所示:我们可以将较大的组合逻辑分解为较小的几块,中间插入触发器,这样可以提高电路的工作频率。这也是所谓“流水线”(pipelining)技术的基本原理。     对于图8的上半部分,它时钟频率受制于第二个较大的组合逻辑的延时,通过适当的方法平均分配组合逻辑,可以避免在两个触发器之间出现过大的延时,消除速度瓶颈。 图7 分割组合逻辑 图8 转移组合逻辑 那么在设计中如何拆分组合逻辑呢,更好的方法要在实践中不断的积累,但是一些良好的设计思想和方法也需要掌握。我们知道,目前大部分FPGA都基于4输入LUT的,如果一个输出对应的判断条件大于四输入的话就要由多个LUT级联才能完成,这样就引入一级组合逻辑时延,我们要减少组合逻辑,无非就是要输入条件尽可能的少,这样就可以级联的LUT更少,从而减少了组合逻辑引起的时延。 QUOTE: Setup time is the minimum time prior totrigerring edge of the clock pulse upto which the data should be kept stable atthe flip-flop input so that data could be properly sensed at the input.Holdtime is the minimum time after the clock edge upto which the data should bekept stable in order to trigger the flip flop at right voltage level. Setuptime is required in order to find the maximum clock frequency of a circuit. QUOTE: Setup time :It is theminimum time before the clock edge the input should be stable.This is due tothe input capacitance present at the input.It takes some time to charge to theparticular logic level at the input. Hold time:It is theminimum time the input should be present stable after the clock edge.This isthe time taken for the various switching elements to transit from saturation tocut off and vice versa. So basically set up andhold time is the window during which the input should be stable.Any changes inthe input during the window period may lead to voltage levels which is notrecognised by the subsequent stages and the circuit may go to metastable stage. QUOTE: suppose ur flip-flop is positive edge triggered. timefor which data should be stable prior to positive edge clock is called setuptime constraint . Time for which datashould be stable after the positive edge of clock is called as hold timeconstraint. if any of theseconstraints are violated then flip-flop will enter in meta stable state, inwhich we cannot determine the output of flip-flop. there are two equation: 1. Tcq + Tcomb> Tskew+ Thold 2. Tcq + Tcomb 0) hold time you might face a problem. More info, VHDL and VERILOG code as well as simulation utilities can  be found at http://bknpk.no-ip.biz/ A2:1) What causes HOLD VIOLATIONS in DESIGN. Simply, data should be hold for some time (hold time) after the edge of the clock. So, if the data changes with the hold time might cause violation. In general, holdtime will be fixed during backend work (during PNR) while buildingclock tree. If u r a frontend designer, concentrate on fixing setup time violations rather than hold violations. 2) How it effects DESIGN. If a chip is done with some setup violations it can work by reducing the frequency. If achip is done with hold violations, JUST DUMP the chip. This is how it effects at the end of the day. Hold vilations needs to be fixed. 3) What changes need to be done to make DESIGN work. PNR tools will route and place the cells in such a way that no timing violations will occur. If  still u face hold violations, u can manully work on it to fix. Manually place the cells to avoid hold violations, or in the worst case, u can keep some buffers in the datapath to avoid hold violations (but be sure setup timing is not effected.) >you said "If a chip is done with hold violations, JUST DUMP the chip. " >why can't reducing the frequency to settle the hold violation as setup violation ? >could you explain it clearer ? Equation for Setup Time Tclk > Tclktoq + Tlogic + Tsetup + Tskew + Tjitter Equation for Hold Time Tclktoq + Tlogic - Tskew > Thold Note that Hold Time equation is independent of clk frequency(i.e Time period Tclk) key things to note from above equations a) once the silicon comes back , if u have setup time problem , u can increase the clock period (Tclk) to fix it , whereas if u have hold time problem , its a more serious problem and u will need a new metal fix tapeout . ( But u can still test the current chip using Low supply voltage, or High temperature or SS corner part that decrease hold time violation)> Hi koggestone, > It is nice information. Could you please give us more information on > " u will need a new metal fix tapeout . ( But u can still test the current chip using > Low supply voltage, or High temperature or SS corner part that decrease hold time >violation)" what i meant was , when u have hold time violation , u dont need to throw away chip and wait for 3 months for fixed chip to come back. in the meanwhile , by playing with voltage and temperature , u can do other functional tests on the chip . since normally hold time simulation are done at " FF corner , high voltage, low temperature " which is the pessimistic case for hold time , by decreasing voltage , using high temperature, and a SS corner chip , we may be lucky enough to find a part that works , to do other functional tests to catch any other bugs before next tapeout. 下面这个比较详细: Sunil Budumuru: Pls. make a note that HOLD violations are dangerous than SETUP. To keep it simple way, SETUP timing depends on the frequency of operation. But HOLD time is not. Let us see the equations here. T = Frequency of operation (can be variable) Tcq = Flop clock to Flop output delay (fixed/constant) Tcomb = Delay od the combinational logic between the Flops (can be variable) Tsetup = Setup time of a Flop (fixed/constant) Thold = Hold time of a Flop (fixed/constant) Tskew = Delay between clock edges of two adjacent flops (delay offered by clock path) (can be variable) For SETUP, T >= Tcq + Tcomb + Tsetup - Tskew If you have setup time means u r violating the above rule. i.e some how the equation becomes T < Tcq + Tcomb + Tsetup - Tskew Now let us consider two cases. Case1: During the Design development phase itself. Now, you have three variables (T, Tcomb, Tskew.) to avoid the setup violation. T : Reduce the frequency such that u saticify T >= Tcq + Tcomb + Tsetup - Tskew. But do u think it is the correct solution. Obviously, NO. This is because we have other options to avoid setup violations right. Tcomb : If you reduce the combinational delay (between the Flops of violated path) such a way that T < Tcq + Tcomb + Tsetup - Tskew will become T >= Tcq + Tcomb + Tsetup - Tskew. So, the SETUP violation is avoided. How do u reduce the combinational delay??? Try different logic structure without effecting the functionality. or try to reduce the more fanout nets within the logic. Or upsize or downsize the cells. If it worked out thats fine. Tskew: If u increase the skew, u can change T < Tcq + Tcomb + Tsetup - Tskew to T >= Tcq + Tcomb + Tsetup - Tskew. How to increase the Tskew? Just keep buffers in the clock path. But be sure doesnt effect the HOLD timing. Case2: After the CHIP is manufatured and is in your hand. In this case, one cannot access the Tcomb and Tskew. Only the variable that can handle is T. So, Just reduce the frequency (T) such that the violated equation, T < Tcq + Tcomb + Tsetup - Tskew becomes violation free equation T >= Tcq + Tcomb + Tsetup - Tskew. So, if u have setup violations on a manufatured chip, u can make it work by reducing the frequency. For HOLD, Thold + Tskew <= Tcq + Tcomb If you have setup time means u r violating the above rule. i.e some how the equation becomes Thold + Tskew > Tcq + Tcomb and ur aim is to make Thold + Tskew <= Tcq + Tcomb Now let us consider two cases. Case1: During the Design development phase itself. You have two variables in hand (Tcomb, Tskew) to avoid HOLD violations. Tcomb: Increase the Tcomb by adding buffers in the data path. Thus u can change the situation from Thold + Tskew > Tcq + Tcomb to Thold + Tskew <= Tcq + Tcomb. But this might effect the SETUP time as you are increasing the delay of combinational path. So this may not be the perfect solution always. Tskew : Reduce the clock skew so that you will land on Thold + Tskew <= Tcq + Tcomb. To reduce the clock skew, the best solution is to take the help of your PNR engineer. Case2: After the CHIP is manufatured and is in your hand. Do you see any variables that will fix the hold violations after manufaturing?????!!!!!! NO right. So, its time to DUMP the chip as we dont deliver malfunctioning chips to the customers. So becareful with the HOLD violations. Note: One can get those equations if u put the those scenarios on a paper and develop the timing diagrams. Hope I've explained it properly. ust make sure that once you have added hold time, setup time and propagation delay, the clock period has not been exceeded.   t_clock < t_setup + t_hold + t_prop_delay Another way of looking at it is that the time left for your logicoperation between the two registers equals to the clock period minusthe setup and hold time. I copied an example about how to calculate setup and hold time from a book(in the attachment). giggs11,I think the formula u gave us is wrong, according to the waveform in the example, I get this: T_setup =(T_clock + △T)-T_combin_logic,T_hold=_combin_logic-△T In above interview quiz ,△T=0. So,the equation is: T_setup =(T_clock + △T)- T_combin_logic<=T_clock-T_setup =10ns-0.2ns=9.8ns This gives a max clock frequency of 1/9.8ns. sh.jpg 这个附件就是上面这个图: HYPERLINK "http://www.socvista.com/bbs/attachment.php?aid=1322" \t "_blank" setuphold.pdf (200
/
本文档为【关于建立时间(setup time)保持时间(hold time)以及时序的一些问题集合】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。 本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。 网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。
热门搜索

历史搜索

    清空历史搜索