HLSM & Time Constraints on Sequential Circuits Prof. Usagi - - PowerPoint PPT Presentation

hlsm time constraints on sequential circuits
SMART_READER_LITE
LIVE PREVIEW

HLSM & Time Constraints on Sequential Circuits Prof. Usagi - - PowerPoint PPT Presentation

HLSM & Time Constraints on Sequential Circuits Prof. Usagi RTL(Register Transfer Level) Design 2 RTL Design Process Step 1: Capture a high-level state machine Describe the systems desired behavior as a high-level state machine.


slide-1
SLIDE 1

HLSM & Time Constraints on Sequential Circuits

  • Prof. Usagi
slide-2
SLIDE 2

RTL(Register Transfer Level) Design

2

slide-3
SLIDE 3
  • Step 1: Capture a high-level state machine
  • Describe the system’s desired behavior as a high-level state machine.

The state machine consists of states and transitions. The state machine is high level because the transition conditions and the state actions are more than just Boolean operations on single-bit input and outputs

  • Recommendations:
  • Always list all inputs, outputs and local registers on top of your HLSM diagram
  • Clearly specify the size in bits of each of them
  • On states: update the value of registers, update of outputs
  • On transitions: express conditions in terms of the HLSM inputs or state of the

internal values and arithmetic operations between them.

3

RTL Design Process

slide-4
SLIDE 4
  • Step 2: Convert it to a circuit
  • Create a datapath
  • Create a datapath to carry out the data operations of the high level state machine
  • Elements of your datapaths can be registers, adders, comparators, multipliers, dividers, etc.
  • Connect the datapath to a controller
  • Connect the datapath to a controller block.
  • Connect the external control inputs and outputs to the controller block.
  • Clearly label all control signals that are exchanged between the datapath and the controller
  • Derive the controller’s FSM
  • Convert the high-level state machine to a finite state machine (FSM) for the controller, by

replacing data operations with setting and reading of control signals to and from the datapath

  • Final Step Implement the FSM as a state register and logic

4

RTL Design Process

slide-5
SLIDE 5
  • Capture the behavior with HLSM
  • Convertit to a circuit
  • High-level architecture (datapath and control path)
  • Datapath capable of HLSM's data operations
  • Design controller to control the datapath

5

RTL Design Summary

slide-6
SLIDE 6
  • Register: tot
  • Comparator: to compare tot

and s

  • Adder: to update tot = tot + a
  • Connect datapath elements
  • I/O interface

6

Create Datapath for Soda Dispenser

Init Wait Add Disp.

c tot:=tot+a tot:=0 d:=‘0’ c’*(tot<s) c’*(tot<s)’ d:=‘1’ tot ld clr 8-bit < 8-bit adder a tot < s s

slide-7
SLIDE 7
  • According to the current design, under which of the following conditions does the

register output ‘tot’ change at the rising clock edge?

  • A. Whenever the value of the coin inserted (‘a’) changes
  • B. Whenever the cost of the soda (‘s’) changes
  • C. When the signal tot_ld becomes high
  • D. When the signal tot_clr becomes high
  • E. Both C. & D.

7

Signals in Soda Dispenser

Init Wait Add Disp.

tot:=tot+a tot:=0 d:=‘0’ c’*(tot<s) c’*(tot<s)’ d:=‘1’ tot ld clr 8-bit < 8-bit adder tot < s s a

Poll close in

c

slide-8
SLIDE 8
  • According to the current design, under which of the following conditions does the

register output ‘tot’ change at the rising clock edge?

  • A. Whenever the value of the coin inserted (‘a’) changes
  • B. Whenever the cost of the soda (‘s’) changes
  • C. When the signal tot_ld becomes high
  • D. When the signal tot_clr becomes high
  • E. Both C. & D.

8

Signals in Soda Dispenser

Init Wait Add Disp.

tot:=tot+a tot:=0 d:=‘0’ c’*(tot<s) c’*(tot<s)’ d:=‘1’ tot ld clr 8-bit < 8-bit adder tot < s s a c

slide-9
SLIDE 9
  • Controller’s inputs
  • External input c (coin

detected)

  • Input from datapath

comparator’s output, which we named tot<s

  • Controller’s outputs
  • External output d

(dispense soda)

  • Outputs to datapathto

load and clear the tot register

9

Connect Datapath to a Controller

tot ld clr 8-bit < 8-bit adder tot < s s a Controller c d

slide-10
SLIDE 10
  • FSM has the same states and arcs

as HLSM

  • Replace all references to the data

elements in the HLSM with appropriate control signals & values

10

Derive the Controller’s FSM

tot ld clr 8-bit < 8-bit adder tot < s s a Controller c d

Init Wait Add Disp.

c’*(tot<s) c’*(tot<s)’ d=0 c clr=1 ld=1

slide-11
SLIDE 11
  • Implement the FSM as a state

register and logic

11

Final Step: Implement the controller FSM

Init Wait Add Disp.

c’*(tot<s) c’*(tot<s)’ d=0 c clr=1 ld=1 c d ld clr tot < s

slide-12
SLIDE 12

Control path of a microprocessor

12

slide-13
SLIDE 13
  • We have learned all datapath components for an ALU!
  • Register
  • Shifter
  • Adders
  • Multiplier
  • Processor has only one clock generator
  • Each datapath component has a different latency

13

Let’s put all things together!

slide-14
SLIDE 14
  • If we are designing a processor that supports shift, add, mul operations with

the following datapath components, what’s the expected processor clock rate?

  • Register — 0.1 ns
  • Shifter — 0.2 ns
  • 32-bit CLA — 1.6 ns
  • 32-bit hierarchical multiplier — 16 ns
  • A. ~ 10 GHz
  • B. ~ 5 GHz
  • C. ~ 500 MHz
  • D. ~ 50 MHz
  • E. ~ 5 MHz

14

The clock rate of the processor

Poll close in

slide-15
SLIDE 15
  • If we are designing a processor that supports shift, add, mul operations with

the following datapath components, what’s the expected processor clock rate?

  • Register — 0.1 ns
  • Shifter — 0.2 ns
  • 32-bit CLA — 1.6 ns
  • 32-bit hierarchical multiplier — 16 ns
  • A. ~ 10 GHz
  • B. ~ 5 GHz
  • C. ~ 500 MHz
  • D. ~ 50 MHz
  • E. ~ 5 MHz

15

The clock rate of the processor

— The slowest component bottlenecks the processor performance

slide-16
SLIDE 16
  • We have learned all datapath components for an ALU!
  • Register
  • Shifter
  • Adders
  • Multiplier
  • Processor has only one clock generator
  • Each datapath component has a different latency
  • We have make some of the above “serial”

16

Let’s put all things together!

slide-17
SLIDE 17
  • If we are designing a processor that supports shift, add, mul operations with

the following datapath components, what’s the expected processor clock rate?

  • Register — 0.1 ns
  • Shifter — 0.2 ns
  • Serial 4-bit CLA — 0.3 ns
  • Serial 32-bit shift-and-add multiplier — 0.9 ns
  • A. ~ 10 GHz
  • B. ~ 5 GHz
  • C. ~ 1 GHz
  • D. ~ 500 MHz
  • E. ~ 50 MHz

17

The clock rate of the processor (2)

Poll close in

slide-18
SLIDE 18
  • If we are designing a processor that supports shift, add, mul operations with

the following datapath components, what’s the expected processor clock rate?

  • Register — 0.1 ns
  • Shifter — 0.2 ns
  • Serial 4-bit CLA — 0.3 ns
  • Serial 32-bit shift-and-add multiplier — 0.9 ns
  • A. ~ 10 GHz
  • B. ~ 5 GHz
  • C. ~ 1 GHz
  • D. ~ 500 MHz
  • E. ~ 50 MHz

18

The clock rate of the processor (2)

slide-19
SLIDE 19
  • If we are designing a processor that supports shift, add, mul operations with

the following datapath components, what’s the expected processor clock rate?

  • Register — 0.1 ns
  • Shifter — 0.2 ns
  • Serial 8-bit CLA — 0.4 ns
  • Serial 32-bit shift-and-add multiplier — 0.9 ns
  • A. ~ 10 GHz
  • B. ~ 5 GHz
  • C. ~ 1 GHz
  • D. ~ 500 MHz
  • E. ~ 50 MHz

19

The clock rate of the processor

Poll close in

slide-20
SLIDE 20
  • If we are designing a processor that supports shift, add, mul operations with

the following datapath components, what’s the expected processor clock rate?

  • Register — 0.1 ns
  • Shifter — 0.2 ns
  • Serial 8-bit CLA — 0.4 ns
  • Serial 32-bit shift-and-add multiplier — 0.9 ns
  • A. ~ 10 GHz
  • B. ~ 5 GHz
  • C. ~ 1 GHz
  • D. ~ 500 MHz
  • E. ~ 50 MHz

20

The clock rate of the processor

slide-21
SLIDE 21
  • If we are designing a processor that supports shift, add, mul operations with

the following datapath components and the clock rate is set to 1GHz, what’s the expected number of cycles we need for a 32-bit add operation?

  • Register — 0.1 ns
  • Shifter — 0.2 ns
  • Serial 8-bit CLA — 0.4 ns
  • Serial 32-bit shift-and-add multiplier — 0.9 ns
  • A. 1
  • B. 2
  • C. 4
  • D. 8
  • E. 16

21

How many cycles for an add?

Poll close in

slide-22
SLIDE 22
  • If we are designing a processor that supports shift, add, mul operations with

the following datapath components and the clock rate is set to 1GHz, what’s the expected number of cycles we need for a 32-bit add operation?

  • Register — 0.1 ns
  • Shifter — 0.2 ns
  • Serial 8-bit CLA — 0.4 ns
  • Serial 32-bit shift-and-add multiplier — 0.9 ns
  • A. 1
  • B. 2
  • C. 4
  • D. 8
  • E. 16

22

How many cycles for an add?

slide-23
SLIDE 23

The HLSM for the processor’s control

23

Register File

Shifter 8-bit Serial Adder 32-bit Serial Multiplier Control Unit

MUX

a b

  • peration

are we done? Datapath Control Path

slide-24
SLIDE 24

The HLSM for the processor’s control

24

Control Unit

  • peration

mux are we done? Control Path

cycles mux shift 1 add 4 1 mul 32 2

slide-25
SLIDE 25

The HLSM for the processor’s control

25

Control Unit

  • peration

are we done? Control Path

cycles mux shift 1 add 4 1 mul 32 2

Init Add

Begin

Mul

Begin add mux := “0” done := ‘0’

Shift

shift mux := “0” done := ‘1’ shift

Add

In-progress remain == 0 remain > 0 remain := “2” done :=‘0’ , mux := “1”

Add

Done remain > 0 remain := remain - 1 done :=‘1’ add mul remain := “30” done :=‘0’ , mux := “1”

Mul

In-progress remain > 0 remain := remain - 1

Mul

Done remain > 0 remain == 0 mux := “2” , done :=‘1’ mul shift add shift mul mul add

slide-26
SLIDE 26

Master-Slave D Flip-flop

Recap: D flip-flop

26

D-latch

D Q Clk

D-latch

D Q Clk Input Clk Output Clk Input Output

slide-27
SLIDE 27

Timing Constraints on Sequential Logic

27

slide-28
SLIDE 28
  • A seemingly logically correct design can go wrong – signals

don’t travel in zero time

  • We next look at timing constraints for combinational and

sequential logic.

28

Timing Constraints in Sequential Circuit Designs

C1 C2

y(t) S(t) Clk x(t)

C1 C2

y(t) S(t) Clk x(t) Mealy Machine Moore Machine

slide-29
SLIDE 29
  • Min delay of a gate, also called contamination delay: tcd
  • Minimum time from when an input changes until the output starts to

change

  • Max delay of a gate, also called propagation delay: tpd
  • Maximum time from when an input changes until the output is

guaranteed to reach its final value (i.e., stop changing)

29

Combinational Logic Timing

slide-30
SLIDE 30
  • Which path in the above circuit determines the contamination

delay of the circuit (assuming the delay of all the gates is the same)?

  • A. Blue path
  • B. Red path
  • C. Both
  • D. Neither

30

Combinational Logic: Output Timing Constraints

Poll close in

slide-31
SLIDE 31
  • Which path in the above circuit determines the contamination

delay of the circuit (assuming the delay of all the gates is the same)?

  • A. Blue path
  • B. Red path
  • C. Both
  • D. Neither

31

Combinational Logic: Output Timing Constraints

slide-32
SLIDE 32
  • Which path in the above circuit determines the propagation

delay of the circuit (assuming the delay of all the gates is the same)?

  • A. Blue path
  • B. Red path
  • C. Both
  • D. Neither

32

Combinational Logic: Output Timing Constraints

Poll close in

slide-33
SLIDE 33
  • Which path in the above circuit determines the propagation

delay of the circuit (assuming the delay of all the gates is the same)?

  • A. Blue path
  • B. Red path
  • C. Both
  • D. Neither

33

Combinational Logic: Output Timing Constraints

slide-34
SLIDE 34
  • Setup time: tsetup
  • Time before the clock edge that data must be stable (i.e. not change)
  • 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)

34

Setup and hold times

thold tsetup ta

slide-35
SLIDE 35
  • Min delay of FF, also called contamination delay or min CLK to Q delay: tccq
  • Time after clock edge that Q might be unstable (i.e., starts changing)
  • Max delay of FF, also called propagation delay or maximum CLK to Q delay: tpcq
  • Time after clock edge that the output Q is guaranteed to be stable (i.e. stops

changing)

35

Output Timing Constraints

D Flip- flop D Q CLK

tpcq tccq

CLK Q

slide-36
SLIDE 36
  • iEval — Capture your screenshot, submit through iLearn and you will receive a full credit

assignment

  • Lab 6 is up — due on 6/2
  • Watch the video and read the instruction BEFORE your session
  • There are links on both course webpage and iLearn lab section
  • Submit through iLearn > Labs
  • Office Hours
  • All office hours share the same meeting instance — if you have registered once, you cannot do it again.
  • Zoom does not resend registration confirmation and does not allow us to “re-approve” if you have

registered

  • The only way is to dig out the e-mail from Zoom
  • Final exam will be held during the campus scheduled period to avoid conflicts
  • 6/11 11:30am — 2:59:59pm
  • About the same format as midterm, but longer
  • Will have a final review on 6/6 to help you prepare

36

Announcement

slide-37
SLIDE 37

つづく

Electrical Computer Engineering Science

120A