Lecture 10: Sequential Networks: Timing and Retiming CSE 140: - - PowerPoint PPT Presentation

lecture 10 sequential networks timing and retiming
SMART_READER_LITE
LIVE PREVIEW

Lecture 10: Sequential Networks: Timing and Retiming CSE 140: - - PowerPoint PPT Presentation

Lecture 10: Sequential Networks: Timing and Retiming CSE 140: Components and Design Techniques for Digital Systems Spring 2014 CK Cheng, Diba Mirza Dept. of Computer Science and Engineering University of California, San Diego 1 Timing


slide-1
SLIDE 1

Lecture 10: Sequential Networks: Timing and Retiming

CSE 140: Components and Design Techniques for Digital Systems Spring 2014

CK Cheng, Diba Mirza

  • Dept. of Computer Science and Engineering

University of California, San Diego

1

slide-2
SLIDE 2

Timing

  • Clock specifies a precise time for the next state
  • 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.

2

slide-3
SLIDE 3

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).

Sequential Networks

3

Combinational CLK1 CLK2 A B C D R1 R2

slide-4
SLIDE 4

Combinational CLK1 CLK2 A B C

tcq + tcomb + tsetup ≤ T thold < tcq + tcomb

4

slide-5
SLIDE 5

So far ….

Combinational CLK

slide-6
SLIDE 6

This lecture …

  • When does our (seemingly logically correct) design go wrong?
  • How can we design a circuit that works under real constraints?

Combinational CLK

slide-7
SLIDE 7

Timing Constraints of flip flops

D Q Q’

7

D

t1 time Q: What is the output of the flip flop at time t1?

  • A. One
  • B. Zero
  • C. Can’t say for sure

CLK

slide-8
SLIDE 8

Timing Constraints of flip flops

D Q Q’

8

t1 time What if the input transition happens late, close to the rising edge?

  • A. Output will still be one at t1
  • B. Output will be zero at t1
  • C. Can’t say for sure

D

slide-9
SLIDE 9

Input Timing Constraint: Set up time

D Q Q’

9

D

t1 time I. Setup time: tsetup This is the time before the clock edge that data must be stable (i.e. not change) CLK

slide-10
SLIDE 10

Input Timing Constraint: Hold time

D Q Q’

10

D

t1 time I. Is it okay for the input to the flip flop to change right after the rising edge? CLK

slide-11
SLIDE 11

Input Constraints: Set up and hold time

D Q Q’

11

CLK tsetup D thold ta

I. Setup time: tsetup Time before the clock edge that data must be stable (i.e. not change)

  • II. Hold time: thold

Time after the clock edge that data must be stable Aperture time: ta Time around clock edge that data must be stable (ta = tsetup + thold)

slide-12
SLIDE 12

Set up and hold time violations

D Q Q’

12

CLK tsetup D thold ta

I. Setup time violation This occurs if the input data signal does not remain unchanged for at least tsetup before the clock edge.

  • II. Hold time violation

This occurs if the input data signal does not remain unchanged for at least tsetup after the clock edge

slide-13
SLIDE 13

Output Timing Constraints

CLK tccq tpcq Q

13

D Q Q’

slide-14
SLIDE 14

Output Timing Constraints

I. Contamination delay: tccq Time after clock edge that Q might be unstable (i.e., start changing) II. Propagation delay: tpcq Time after clock edge that the output Q is guaranteed to be stable (i.e., to stop changing)

CLK tccq tpcq Q

14

D Q Q’

slide-15
SLIDE 15

PIQ: A hold time violation is likely to occur when

  • A. The input signal (into the flip flop) fails to change to a

desired value fast enough

  • B. The output signal (out of the flip flop) takes too long to

stabilize

  • C. The input signal (into the flip flop) does not remain stable

long enough after the clock edge

  • D. The output signal (out of the flip flop) changes too quickly

15

slide-16
SLIDE 16

PIQ: The timing of which of the following signals can cause a

setup-time violation?

  • A. The input signal T(t)
  • B. The output signal Q(t)
  • C. The clock signal, CLK
  • D. Some of the above
  • E. None of the above

16

T Q Q’ T(t) CLK Q(t)

slide-17
SLIDE 17

PIQ: For a given flip-flop implementation which of its timing

parameters can we modify when designing a sequential network (depicted below)

  • A. Set up and hold time
  • B. Propagation and

Contamination delays

  • C. All of the above
  • D. None of the above

17

Combinational

CLK

slide-18
SLIDE 18

Fact 1: Once a flip flop has been ‘built’ we are stuck with its timing characteristics: tsetup , thold, tccq, tpcq Now let’s look at the timing characteristics of the combinational part

18

Combinational

CLK

slide-19
SLIDE 19

Combinational Logic: Output timing constraints

19

X1 X2 X4

I. Why don’t we have input constraints? Combinational circuit

X3 Y1 Y2 Y4 Y3

slide-20
SLIDE 20

Combinational Logic: Output timing constraints

20

X1 X2 X4

Combinational circuit

X3 Y1 Y2 Y4 Y3

I. Contamination delay: tcd

Minimum time from when an input changes until any output starts to change

slide-21
SLIDE 21

Combinational Logic: Output timing constraints

21

X1 X2 X4

I. Contamination delay: tcd

Minimum time from when an input changes until any output starts to change

II. Propagation delay: tpd

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)

Combinational circuit

X3 Y1 Y2 Y4 Y3

slide-22
SLIDE 22

Combinational Logic: Output timing constraints

22

A B C D Y 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. AND- OR – NOR
  • B. AND-OR
  • C. NOR
  • D. OR-NOR
slide-23
SLIDE 23

Combinational Logic: Output timing constraints

23

A B C D Y 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. AND- OR – NOR
  • B. AND-OR
  • C. NOR
  • D. OR-NOR
slide-24
SLIDE 24

R1 Combinational CLK R2 CLK D1 Q1 D2

An alternate view of the sequential circuit

Combinational CLK

slide-25
SLIDE 25

The delay between registers has a minimum and maximum delay, dependent on the delays of the circuit elements (Dynamic Discipline)

C L CLK CLK R1 R2 Q1 D2 (a) CLK Q1 D2 (b) Tc

25

slide-26
SLIDE 26

C L CLK CLK R1 R2 Q1 D2 (a) CLK Q1 D2 (b) Tc

26

PI Q: Suppose input to R1 changed before t1, what is the maximum delay (from t1) after which D2 reaches a stable value?

  • A. Setup time of R1+

Propagation delay of CL + Propagation delay of R2

  • B. Hold time of R1+

Propagation delay of CL + setup time of R1

  • C. Propagation delay of R1+

Propagation delay of CL + Propagation delay of R2

  • D. Propagation delay of R1+

Propagation delay of CL E. Propagation delay of CL + Propagation delay of R2

t1

slide-27
SLIDE 27

C L CLK CLK R1 R2 Q1 D2 (a) CLK Q1 D2 (b) Tc

27

PI Q: Suppose input to R1 changed before t1, what is the minimum delay (from t1) after which D2 starts to change?

  • A. Setup time of R1+

propagation delay of CL + propagation of R2

  • B. Hold time of R1+

propagation time of CL +setup time of R1

  • C. Hold time of R1+

Contamination delay of CL + Propagation time of R2

  • D. Contamination delay of R1+

Contamination delay of CL E. Contamination delay of CL + Contamination delay of R2

slide-28
SLIDE 28

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 tsetup before the clock edge.

CLK Q1 D2 Tc tpcq tpd tsetup C L CLK CLK Q1 D2 R1 R2

28

Maximum delay, tmax = Setup Time Constraint:

slide-29
SLIDE 29

Setup Time Constraint

CLK Q1 D2 Tc tpcq tpd tsetup C L CLK CLK Q1 D2 R1 R2

29

Tc ≥ tpcq + tpd + tsetup tpd ≤ Tc – (tpcq + tsetup)

slide-30
SLIDE 30

Hold Time Constraint

  • The hold time constraint depends on the minimum delay from register R1

through the combinational logic.

  • The input to register R2 must be stable for at least thold after the clock edge.

30

Minimum delay, tmin = Hold Time Constraint:

CLK Q1 D2 tccq tcd thold C L CLK CLK Q1 D2 R1 R2

slide-31
SLIDE 31
slide-32
SLIDE 32
slide-33
SLIDE 33
slide-34
SLIDE 34

Hold Time Constraint

31

CLK Q1 D2 tccq tcd thold C L CLK CLK Q1 D2 R1 R2

thold < tccq + tcd tcd > thold - tccq

slide-35
SLIDE 35

Timing Analysis

CLK CLK A B C D X' Y' X Y

Timing Characteristics

tccq = 30 ps tpcq = 50 ps tsetup = 60 ps thold = 70 ps tpd = 35 ps tcd = 25 ps

tpd = tcd = Setup time constraint: Tc ≥ fc = 1/Tc = Hold time constraint: tccq + tcd > thold ?

32

slide-36
SLIDE 36

Timing Analysis

CLK CLK A B C D X' Y' X Y

Timing Characteristics

tccq = 30 ps tpcq = 50 ps tsetup = 60 ps thold = 70 ps tpd = 35 ps tcd = 25 ps

33

tpd = 3 x 35 ps = 105 ps tcd = 25 ps Setup time constraint: Tc ≥ (50 + 105 + 60) ps = 215 ps fc = 1/Tc = 4.65 GHz Hold time constraint: tccq + tcd > thold ? (30 + 25) ps > 70 ps ? No!

slide-37
SLIDE 37

Fixing Hold Time Violation

Timing Characteristics

tccq = 30 ps tpcq = 50 ps tsetup = 60 ps thold = 70 ps tpd = 35 ps tcd = 25 ps

tpd = tcd = Setup time constraint: Tc ≥ fc = Hold time constraint: tccq + tcd > thold ?

CLK CLK A B C D X' Y' X Y

Add buffers to the short paths:

34

slide-38
SLIDE 38

Fixing Hold Time Violation

Timing Characteristics

tccq = 30 ps tpcq = 50 ps tsetup = 60 ps thold = 70 ps tpd = 35 ps tcd = 25 ps

tpd = 3 x 35 ps = 105 ps tcd = 2 x 25 ps = 50 ps Setup time constraint: Tc ≥ (50 + 105 + 60) ps = 215 ps fc = 1/Tc = 4.65 GHz Hold time constraint: tccq + tcd > thold ? (30 + 50) ps > 70 ps ? Yes!

CLK CLK A B C D X' Y' X Y

Add buffers to the short paths:

35

slide-39
SLIDE 39

Clock Skew

  • The clock doesn’t arrive at all registers at the same time
  • Skew is the difference between two clock edges
  • Examine the worst case to guarantee that the dynamic discipline is not

violated for any register – many registers in a system!

t skew

CLK1 CLK2 C L CLK2 CLK1 R1 R2 Q1 D2 CLK delay CLK

36

slide-40
SLIDE 40

Setup Time Constraint with Clock Skew

  • In the worst case, the CLK2 is earlier than CLK1

Tc ≥ tpcq + tpd + tsetup + tskew tpd ≤ Tc – (tpcq + tsetup + tskew)

CLK1 Q1 D2 Tc tpcq tpd tsetuptskew C L CLK2 CLK1 R1 R2 Q1 D2 CLK2

37

slide-41
SLIDE 41

Timing Analysis with clock skew

CLK CLK A B C D X' Y' X Y

Timing Characteristics

tccq = 30 ps tpcq = 50 ps tsetup = 60 ps thold = 70 ps tpd = 35 ps tcd = 25 ps tskew = 50 ps

tpd = 3 x 35 ps = 105 ps tcd = 25 ps Setup time constraint: Tc ≥ 265 ps fc = 1/Tc =3.77 GHz Without skew we got fc =4.65 GHz

38

slide-42
SLIDE 42

Hold Time Constraint with Clock Skew

  • In the worst case, CLK2 is later than CLK1

tccq + tcd > thold + tskew tcd > thold + tskew – tccq

tccq tcd thold Q1 D2 tskew C L CLK2 CLK1 R1 R2 Q1 D2 CLK2 CLK1

39

slide-43
SLIDE 43

Hold Time Violation

Timing Characteristics

tccq = 30 ps tpcq = 50 ps tsetup = 60 ps thold = 70 ps tpd = 35 ps tcd = 25 ps tskew = 50 ps

tpd = 3 x 35 ps = 105 ps tcd = 2 x 25 ps = 50 ps Hold time constraint: tccq + tcd > thold + tskew? (30 + 50) ps > (70 ps +50) ps ?

CLK CLK A B C D X' Y' X Y

Add buffers to the short paths:

40

slide-44
SLIDE 44

Using Clock Skew advantageously (Retiming)

  • Suppose CLK2 is later than CLK1 by tskew(1,2)

tccq + tcd > thold + tskew(1,2) tskew(1,2)< tccq + tcd - thold

tccq tcd thold Q1 D2 tskew C L CLK2 CLK1 R1 R2 Q1 D2 CLK2 CLK1

41

Tc+ tskew(1,2) ≥ tpcq + tpd + tsetup

slide-45
SLIDE 45

Retiming

Timing Characteristics

tccq = 30 ps tpcq = 50 ps tsetup = 60 ps thold = 70 ps tpd = 35 ps tcd = 25 ps tskew = ?

tpd = 3 x 35 ps = 105 ps tcd = 2 x 25 ps = 50 ps

CLK CLK A B C D X' Y' X Y

Add buffers to the short paths:

42

tskew(1,2)< tccq + tcd - thold Tc+ tskew(1,2) ≥ tpcq + tpd + tsetup

(215ps) (10 ps)

slide-46
SLIDE 46

Timing and Retiming

  • Retiming: Adjust the clock skew so that

the clock period can be reduced.

43