Lecture 16: Asynchronous State Machines - Stanford University

22 downloads 98 Views 529KB Size Report
Nov 18, 1998 ... Asynchronous State Machines, Pipelines, and. Iterative ... each even event on a causes an event on c a b c a. 1 b. 0. 00. 10 c. 00. 1 d. 01 ...
EE 273 Lecture 16, Asynchronous State Machines

11/18/98

EE273 Lecture 16 Asynchronous State Machines, Pipelines, and Iterative Circuits November 18, 1998

William J. Dally Computer Systems Laboratory Stanford University [email protected]

EE273, L16, Nov 18, 1998

Copyright (C) by William J. Dally, All Rights Reserved

1

Today’s Assignment • Term Project – checkpoint 2 due on Wednesday 11/25

• Reading – Sections 5.1, 5.2, and 5.5

EE273, L16, Nov 18, 1998

Copyright 1998 by W. J. Dally, all rights reserved.

Copyright (C) by William J. Dally, All Rights Reserved

2

1

EE 273 Lecture 16, Asynchronous State Machines

11/18/98

Some Comments about the Project

EE273, L16, Nov 18, 1998

Copyright (C) by William J. Dally, All Rights Reserved

3

Project 2/3

EE273, L16, Nov 18, 1998

Copyright 1998 by W. J. Dally, all rights reserved.

Copyright (C) by William J. Dally, All Rights Reserved

4

2

EE 273 Lecture 16, Asynchronous State Machines

11/18/98

Project 3/3

EE273, L16, Nov 18, 1998

Copyright (C) by William J. Dally, All Rights Reserved

5

A Quick Overview • Asynchronous State Machines

EE273, L16, Nov 18, 1998

Copyright 1998 by W. J. Dally, all rights reserved.

• Asynchronous Pipelines

Copyright (C) by William J. Dally, All Rights Reserved

6

3

EE 273 Lecture 16, Asynchronous State Machines

11/18/98

Asynchronous State Machines • General case of sequential digital circuits • Input transitions may cause change of

• We can represent ASMs by – their input/output waveforms – a state table • also called a flow table

– a state diagram

– output values – internal state

• In the general case, several inputs may change simultaneously – not fundamental mode – multiple changes may represent concurrency or choice

EE273, L16, Nov 18, 1998

7

Copyright (C) by William J. Dally, All Rights Reserved

Example, a Toggle Circuit • A toggle circuit – has one input, a, and two outputs, b and c. – a, b, and c are all RZ eventonly signals (no value) – each odd event on a causes an event on b – each even event on a causes an event on c

00 a

EE273, L16, Nov 18, 1998

Copyright 1998 by W. J. Dally, all rights reserved.

1

10 b

a b c

0

00 c

Copyright (C) by William J. Dally, All Rights Reserved

1

01 d

8

4

EE 273 Lecture 16, Asynchronous State Machines

11/18/98

State Table Representation 00 a

1

10 b

EE273, L16, Nov 18, 1998

0

00 c

1

01 d

State a b c d

Out 00 10 00 01

Next State 0 1 a b c b c d a d

9

Copyright (C) by William J. Dally, All Rights Reserved

Trajectory Maps a

EE273, L16, Nov 18, 1998

Copyright 1998 by W. J. Dally, all rights reserved.

b

Copyright (C) by William J. Dally, All Rights Reserved

c

– e.g., after a↑, b↑ in toggle circuit

x

• Insert state variables as needed to keep distinct states separate

c

– arrows indicate a trajectory through the state space – input transitions are horizontal – output and state variable changes are vertical

b

• A Karnaugh map showing the dynamic behavior of the circuit

10

5

EE 273 Lecture 16, Asynchronous State Machines

11/18/98

Trajectory Map for the Toggle Circuit a a

c

• Stable states are denoted with letters

b

• Each arrow denotes a state transition

d

• This is not the only possible sequence. Can you suggest another one?

b

x

b

c

c

EE273, L16, Nov 18, 1998

Copyright (C) by William J. Dally, All Rights Reserved

11

From Trajectory Map to K-Map • For the K-map for output or state variable z – if an arrow leads to a state with z=1, mark the state where the arrow starts to 1 – if an arrow leads to a state with z=0, mark the state where the arrow starts to 0

• Cover any hazards along the trajectory when selecting implicants to cover the logic function • No need to cover off-trajectory hazards

EE273, L16, Nov 18, 1998

Copyright 1998 by W. J. Dally, all rights reserved.

Copyright (C) by William J. Dally, All Rights Reserved

12

6

EE 273 Lecture 16, Asynchronous State Machines

11/18/98

Logic Design for the Toggle Circuit From Trajectory Map to K-Map a

a

a

a

b

b

b

b

a

c

c

c

c d

b

b

b

x c

c

c

c EE273, L16, Nov 18, 1998

x

x

b

x

b

c

13

Copyright (C) by William J. Dally, All Rights Reserved

Another Example, A FIFO Control Element • Arrows labeled with inputs – rin, aout

• States labeled with outputs – ain, rout

00 00 a

10

11 b

11

11 c

00

10

f 00

01

00 e

01

d 11 11

EE273, L16, Nov 18, 1998

Copyright 1998 by W. J. Dally, all rights reserved.

Copyright (C) by William J. Dally, All Rights Reserved

14

7

EE 273 Lecture 16, Asynchronous State Machines

11/18/98

Concurrency and Choice 00

• In states b and e both inputs can change

ain,rout 00 rin,aout 11

a

• Does it matter which changes first?

10

11

b

00

10

f 00

• If they both change at the same time, what does the circuit do?

11 c

01

00 e

01

d 11 11

• This is an example of concurrency • move in one step from b to e • also called a non-critical race EE273, L16, Nov 18, 1998

15

Copyright (C) by William J. Dally, All Rights Reserved

An Arbiter • In state a, both ain and bin can change

ain,bin

00 aout,bout

• Here it matters which one changes first • Here the simultaneity represents choice, not concurrency • In states b and c the simultaneous input changes represent concurrency • Where there is choice, we need synchronization (an arbiter)

EE273, L16, Nov 18, 1998

Copyright 1998 by W. J. Dally, all rights reserved.

00 a

10 01

10 b

11

01 c

11

10 d

01

01 e

10

00

Copyright (C) by William J. Dally, All Rights Reserved

16

8

EE 273 Lecture 16, Asynchronous State Machines

11/18/98

ALM

Align

ALM

Align

Align

A Simple Asynchronous Pipeline

ALM

• Align blocks separate async logic modules – wait for all inputs valid, then signal previous align block – when signal received from forward align block, set inputs invalid (if RZ) and allow next set of inputs to enter

EE273, L16, Nov 18, 1998

Copyright (C) by William J. Dally, All Rights Reserved

17

Asynchronous Pipelines • Very different from synchronous pipelines • Delay of pipe is sum of delays of stages – not rounded up to delay of longest stage

• The number of problems in the pipe is flexible (≤ the number of stages – Different branches of a pipe need not have the same number of stages – The first problem may exit before the second problem enters regardless of the number of stages

EE273, L16, Nov 18, 1998

Copyright 1998 by W. J. Dally, all rights reserved.

Copyright (C) by William J. Dally, All Rights Reserved

18

9

EE 273 Lecture 16, Asynchronous State Machines

11/18/98

A Simple Align Block • What does the state diagram of this circuit look like? • What is wrong with this simple approach? • How can we fix it?

din

D

dout

Q G

rin C

rout aout

ain

EE273, L16, Nov 18, 1998

19

Copyright (C) by William J. Dally, All Rights Reserved

Asynchronous Iterative Circuits • Can we feed the output of an asynchronous pipeline back to its input?

din

rin

EE273, L16, Nov 18, 1998

Copyright 1998 by W. J. Dally, all rights reserved.

ALM

Align

Align

• How does such a circuit behave?

ALM

Control

Copyright (C) by William J. Dally, All Rights Reserved

20

10

EE 273 Lecture 16, Asynchronous State Machines

11/18/98

Next Time • Power Distribution

EE273, L16, Nov 18, 1998

Copyright 1998 by W. J. Dally, all rights reserved.

Copyright (C) by William J. Dally, All Rights Reserved

21

11