CSE 140: Components and Design Techniques for Digital Systems Lecture 10: Sequential Networks: Timing and Retiming CK Cheng Dept. of Computer Science and Engineering University of California, San Diego 1
Timing • Motivation • Gate Delay • Flip-Flop Timing Window • Two Timing Constraints: shortest and longest timing paths • Examples 2
Timing: Motivation • Clock specifies a precise time for the next state – In general, we allocate one clock period for signal propagation between registers. Goldilocks timing. • Too late: Fail to reach for the setup of the next state. • Too early: Race to disturb the holding of the next state. • Analysis: Verify the timing of the system. • Goal: A robust design. 3
The Story of Goldilocks and the Three Bears Once upon a time, there was a little girl named Goldilocks. She went for a walk in the forest. Pretty soon, she came upon a house. She knocked and, when no one answered, she walked right in. At the table in the kitchen, there were three bowls of porridge. Goldilocks was hungry. She tasted the porridge from the first bowl. "This porridge is too hot!" she exclaimed. So, she tasted the porridge from the second bowl. "This porridge is too cold," she said. So, she tasted the last bowl of porridge. "Ahhh, this porridge is just right," she said happily and she ate it all up. DLTK's Crafts for Kids 4
Motivation: So far …. Combinational CLK Logic-level analysis
Motivation: This lecture … Combinational CLK • When does our (seemingly logically correct) design go wrong? • How can we design a circuit that works under real constraints? • Popular interview question.
Motivation: Sequential Networks R1 R2 D B C A Combinational CLK1 CLK2 A typical sequential network has combinational circuit between registers (R1 to R2). The registers are synchronized by clocks (CLK1 to CLK2). Timing is set between clocks (CLK1 and CLK2). The beauty of the synchronized design is that we need only to take care of the timing of the regions separated by the registers. 7
iClicker x(t) y(t) C1 C2 CLK S(t) For a synchronized digital Moore machine, we need to take care of the timing of the following region(s). A. Between every pair of registers. B. Between i. input and register, and ii. register and output. C. Both A and B. D. None of the above. 8
Gate Delay: Combinational Logic Timing I. Min delay of a gate, also called Contamination delay: t cd Minimum time from when an input changes until the output starts to change II. Max delay of a gate, also called Propagation delay: t pd Maximum time from when an input changes until the output is guaranteed to reach its final value (i.e., stop changing) 9
Combinational Logic: Output timing constraints A B Y C D PI Q: Which path in the above circuit determines the contamination delay of the circuit (assuming the delay of all the gates is the same)? A. Green path B. Red path C. Both D. Neither 10
Combinational Logic: Output timing constraints A B Y C D PI Q: Which path in the above circuit determines the propagation delay of the circuit (assuming the delay of all the gates is the same)? A. Green path B. Red path C. Both D. Neither 11
Combinational Logic: Output timing constraints X 1 Y 1 Combinational X 2 Y 2 circuit X 3 Y 3 X 4 Y 4 I. Contamination delay: t cd Minimum time from when an input changes until any output starts to change II. Propagation delay: t pd Maximum time from when an input changes until the output or outputs of a combinational circuit are guaranteed to reach their final value (i.e., stop changing) 12
Flip-Flop Timing Window Timing: Setup Time and Hold Time Constraints CLK Q D Q’ CLK CLK N1 D D Q D Q Q L1 Q L2 Q Q Once a flip flop has been ‘built’ we are stuck with its timing characteristics: t setup , t hold timing relation between D and CLK t ccq , t pcq timing relation between CLK and Q No direct timing relation between input D and output Q 13
FF Input Constraints: Set up and hold time CLK Q D Q’ D t setup t hold I. Setup time: t setup t a Time before the clock edge that data must be stable (i.e. not change) II. Hold time: t hold Time after the clock edge that data must be stable Aperture time: t a Time around clock edge that data must be stable ( t a = t setup + t hold ) 14
FF Set up and hold time violations CLK Q D Q’ D t setup t hold I. Setup time violation t a This occurs if the input signal D does not settle (set up) to the stable value at least t setup before the clock edge. II. Hold time violation This occurs if the input signal D does not remain unchanged (hold) for at least t hold after the clock edge. 15
FF Output Timing Constraints CLK Q D Q’ Q t ccq t pcq • Propagation delay: t pcq = time after clock edge that the output Q is guaranteed to be stable (i.e., to stop changing) • Contamination delay: t ccq = time after clock edge that Q might be unstable (i.e., start changing) 16
FF Output Timing Constraints CLK Q D Q’ Q t ccq t pcq I. Contamination delay: t ccq Time after clock edge that Q might be unstable (i.e., start changing) II. Propagation delay: t pcq Time after clock edge that the output Q is guaranteed to be stable (i.e., to stop changing) 17
Two Timing Constraints B C A Combinational CLK1 CLK2 t cq + t comb + t setup ≤ T t hold < t cq + t comb 18
Two Timing Constraints B C A Combinational CLK1 CLK2 Setup time constraint Longest delay from CLK1 to CLK2 t cq + t comb + t setup ≤ T max(t cq + t comb + t setup )≤ T Hold time constraint Shortest delay from CLK1 to CLK2 t hold < t cq + t comb t hold < min ( t cq + t comb ) 19
PIQ: The timing of which of the following signals can cause a setup-time violation? Q(t) D(t) Q D Q’ A. Signal D arrives too early B. Signal D arrives too late C. Clock CLK arrives too late CLK D. Output Q(t) responds too early None of the above E. 20
PIQ: A hold time violation is likely to occur when Q(t) D(t) Q D A. Signal D changes too early Q’ B. Signal D changes too late C. Clock CLK arrives too early CLK D. None of the above 21
PIQ: A hold time violation is likely to occur when Q(t) D(t) Q D A. Signal D changes too late Q’ B. Clock CLK arrives too early C. Clock CLK arrives too late CLK D. None of the above 22
An alternate view of the sequential circuit Combinational CLK Q1 D2 D1 R1 R2 Combinational CLK CLK
What should happen within a clock cycle for correct functionality? D2 D1 Q1 R1 R2 Combinational CLK CLK
The delay between registers has a minimum and maximum delay, dependent on the delays of the circuit elements CLK CLK Q1 D2 C L R1 R2 (a) T c CLK Q1 D2 (b) 25
The delay between registers has a minimum and maximum delay, dependent on the delays of the circuit elements CLK CLK CLK CLK Q1 D2 Q1 D2 C C L L R1 R2 R1 R2 (a) (a) T c T c CLK CLK Q1 Q1 D2 D2 (b) (b) 26
PI Q: Suppose CLK rises at t 1 , what is the maximum delay (from t 1 ) after which D2 reaches a stable value? A. Setup time of R1+ Propagation delay of CL + CLK CLK Propagation delay of R2 Q1 D2 C L B. Hold time of R1+ Propagation delay of CL + setup time of R1 R2 (a) R1 T c C. Propagation delay of R1+ CLK Propagation delay of CL + Propagation delay of R2 Q1 D. Propagation delay of R1+ Propagation delay of CL D2 E. Propagation delay of CL + (b) Propagation delay of R2 27
Setup Time Constraint • The setup time constraint depends on the maximum delay from register R1 through the combinational logic. • The input to register R2 must be stable at least t setup before the clock edge. CLK CLK Maximum delay, t max Q1 D2 C L = R1 R2 T c Setup Time Constraint: CLK Q1 D2 t pcq t pd t setup 28
Setup Time Constraint T c ≥ t pcq + t pd + t setup CLK CLK PI Q: As a designer, which of the Q1 D2 C L following parameters would you modify to meet the set up time R1 R2 T c constraint? CLK A. The clock period, T c Q1 B. The prop. delay of R1, t pcq D2 C. The prop. delay of CL, t pd t pcq t pd t setup D. The setup time of R2, t setup E. All of the above 29
Setup Time Constraint T c ≥ t pcq + t pd + t setup t pd ≤ T c – ( t pcq + t setup ) CLK CLK PI Q: As a designer, which of the Q1 D2 C following parameters would you L modify to meet the set up time R1 R2 constraint? T c CLK A. The clock period, T c Q1 B. The prop. delay of R1, t pcq C. The prop. delay of CL, t pd D2 D. The setup time of R2, t setup t pcq t pd t setup E. All of the above 30
PI Q: Suppose CLK rises at t 1 , what is the minimum delay (from t 1 ) after which D2 starts to change? A. Setup time of R1+ CLK CLK propagation delay of CL + propagation of R2 Q1 D2 C L B. Hold time of R1+ R1 R2 propagation time of CL (a) +setup time of R1 T c C. Hold time of R1+ CLK Contamination delay of CL + Propagation time of R2 Q1 D. Contamination delay of R1+ D2 Contamination delay of CL (b) E. Contamination delay of CL + Contamination delay of R2 31
Recommend
More recommend