在了解setup time和hold time之前,我们应该了解D锁存器D latch
和 D触发器DFF
。D锁存器和DFF是由传输门transmission gate
和反相器inverters
组成。
PMOS is on when gate input is 0. NMOS is on when gate input is 1.
When control is high (1) from the truth table we can see both transistors are ON at the same time and whatever is applied to the input we got at the output.
When control is low (0) from the truth table we can see both transistors are OFF at the same time and whatever is applied to the input is not reached to the output so we got high impedance (Z) at the output.
The latch is a level-sensitive(电平敏感) device and it is transparent when the clock is high if it is a positive level-sensitive latch and when the clock is low it is called negative level-sensitive latch.
In latch the output (Q) is dependent only on the level of the clock (Clk). In this latch D is control the output (Q).
It is also consist of two transmission gate and two inverters. It is working in an exactly opposite manner of the positive level-sensitive D latch.
A D flip flop is an edge-triggered边沿触发
device which means the output (Q) follows the input (D) only at the active edge (for positive rising edge) of the clock (for the positive edge-triggered) and retain the same value until the next rising edge i.e. output does not change between two rising edges, it should be changed only at the rising edge.
输出Q仅在时钟的上升沿(对于上升沿触发)跟随输入D ,并保持相同的值,直到下一个上升沿,即输出不会在两个上升沿之间改变,它应该只在上升边沿改变。
It is a combination of negative level-sensitive latch
and positive level-sensitive latch
that giving an edge-sensitive
device. Data is change only at the active edge of the clock.(data只在有效的时钟边沿改变)
when Clk= Low (0) T1, T4 is ON and T2, T3 is OFF.
New data (D) is continuously entering through T1 and getting stored till the edge of T2 (path is D-1-2-3-4 and at node 4 it stops)
it cannot pass through T2 and T3 transmission gate because they are off. This operation for the master latch.
For slave latch it keeps retaining the previously stored value of output (Q) (path is 5-6-7-8-5).(保持的是以前存储的输出值)
When Clk= HIGH (1) T2, T3 are ON and T1, T4 are OFF.
Now master latch did not allow new data to enter into the device because T1 is OFF and the previously stored data at point 4 is going through the path 4-1-2-5-6-Q and this same data is reflected at the output and this does not change until the next rising edge and this same data is also going to the transmission gate T4 (path is 4-1-2-5-6-7-8 and stops because transmission gate T4 is OFF).
Again if Clk is low the master latching circuit is enabled and there is no change in the output.
Any changes in input is reflected at node 4
which is reflected at the output at the next positive edge of the clock.
输入的任何变化都会反映在“节点 4”上,并会在时钟的下一个上升沿反映在输出上。
So we can say that if D changes, the changes would reflect only at node 4 when the clock is low and it will appear at the output only when the Clk is high.
如果 D发生变化,则D的变化只会在时钟为低电平时反映在节点 4 上,只有在 Clk 为高电平时D的变化才会出现在输出端。
The minimum time for which the data (D) should be stable at the input before the active edge of clock arrival.
The data is launched from FF1 and captured at the FF2 at the next clock edge. The launched data should be present at the D pin of capture flop at least setup time before the next active edge of the clock arrives.
launched data应至少在时钟的下一个有效沿到达之前的建立时间前出现在捕获触发器capture flop
的 引脚上。
So total time to propagate the data(传播数据的总时间) from launch to capture flop = one time period (T) –Tsu
This is the required time
for the data travel from launch to capture flop.
And how much time it does take data to arrive at the D pin of capture flop is =Tcq (clock
to Q delay of FF1
) + Tcomb (combinational delay). This is called arrival time
.
So condition for setup timing to not violate
PR阶段对于setup是否需要fix的判断方法是slack是否小于100ps(-100ps以内都可以)
WNSworst negative slack
控制在100ps以内就可以往下继续跑其他flow,这里是指PR阶段即ICC2或Innovus中。PR实现过程是一个实现的过程,而非timing signoff或时序验收阶段。PR这个过程可以理解成工地里面的施工队,而PT是第三方验收单位。工程合不合格需要看PT第三方验收结果。但是为了达到某个特定要求的验收标准,施工队PR就得按照稍微高点的标准来施工,这样验收的时候才能更容易通过(严于律己)。
setup time
如果在时钟的下一个有效边沿到达之前,data (D) is not stable for the setup time,会发生什么
If there is a positive skew it means we are giving more time to data to arrive at D pin of capture FF
. so positive skew is good for setup but bad for hold
Tskew is positive or negative depending on the capture clock it comes fast or slow than the launch clock.
The minimum time for which the data (D) should be stable at the input after the active edge of clock has arrived
.
Why do we check to hold at the same edge itself?
Because this same edge is going to both the flip flops if at this edge The capturing flop FF2 is capturing the current data (n) at this same edge itself the launch flop FF1 is launching the next data (n+1)
so the whole check is to make sure that this new data (n+1) which is being launched at the same edge from the launch flop FF1 should not come so fast that it corrupts the current data (n) which is being captured at the capture flop at the same edge.
The arrival time of this (n+1)th data should at least be greater(更长) than the Thold time of capture flop FF2
.
Basically this current data (n) should be held for enough time for it to be captured reliably, that enough time is called hold time
.
Hold slack = Arrival time – Require time
If arrival time is less that means data coming is very fast (or early) so hold violation occurs
It means the next data (n+1) will be launched early from the launch flop FF1 and till now the capture clock is not reached to the capture flop FF2 so the data (n) also did not have to capture yet,
but this nth(第n个数据) data has to be stable at the capture clock for Tskew+ Thold
time otherwise data n will be corrupted.
So we can say positive skew is bad for hold.(hold slack = arriveal time - require time变大了
)
it means the data (n) is being captured at captured flop FF2 early but by the time (n+1) data will not be getting launched from the launched flop FF1,
so the data (n) got enough time to be held at the input for it to be captured reliability but till now the launch flop did not launch (n+1) data. So negative skew is good for hold.