elastic circuits blending synchronous and asynchronous technologies jordi cortadella universitat...
TRANSCRIPT
Elastic Circuitsblending synchronous and asynchronous technologies
Jordi CortadellaUniversitat Politècnica de Catalunya, Barcelona
(joint work with M. Kishinevsky and M. Galceran-Oms)
Collège de FranceMay 21st, 2013
Elastic circuitsCollège de France 2013 2
Synchronous circuit
Elastic circuits
CombinationalLogic
Flip
Flo
ps
Flip
Flo
ps
PLL
Collège de France 2013 3
Asynchronous circuit
Elastic circuits
CombinationalLogic LL
delay
CC 4-phase
Collège de France 2013 4
Asynchronous circuit
C
ReqIn ReqOut
AckIn AckOut
C C C
• David Muller’s pipeline (late 50’s)• Sutherland’s Micropipelines (Turing award, 1989)
Elastic circuitsCollège de France 2013 5
Globally-asynchronousLocally-synchronous
GALS
SoC design with GALS• Most IPs are synchronous
• Different components may have different operating frequencies
• Some components have variable latencies (e.g., cache hit/miss latency)
• Multiple clock domains are essential
Elastic circuits
Bridge
CDC
DSP
P
Fast Bus
Slow Bus
Bridge
CDC
Mem
CLK2
CLK1
CLK3
Collège de France 2013 7
Multiple clock domains
Elastic circuits
CLK
Single clock(mesochronous)
f1/f0
f2/f0
f3/f0
CLK(f0)
Rational clockfrequencies
CLK
1C
LK2
CLK
3
CLK
0
Independent clocks
(controllable skew)
Collège de France 2013 8
Synchronous handshakes
Elastic circuits
CLK1 CLK2
Data
Sender ReceiverValid
Ack
• The arrival of data is unpredictable• Handshakes solve the problem
Collège de France 2013 9
The problem: metastability
Elastic circuits
D Q
CLKS
D Q
?
D
Q
CLKRCLKR
setup hold
Collège de France 2013 10
Metastability
Elastic circuits
Source: W. J. Dally, Lecture notes for EE108A, Lecture 13.Metastability and Synchronization Failure (or When Good Flip-Flops go Bad) 11/9/2005.
Collège de France 2013 11
Metastability
Elastic circuits
logic 0 logic 1
metastable
Collège de France 2013 12
Classical synchronous solution
Elastic circuits
D Q D Q D Q D Q
CLKT CLKR
Wffe
D
rtMTBF
2
Mean Time Between Failures fФ: frequency of the clock fD: frequency of the data tr: resolve time available W: metastability window : resolve time constant
# FFs MTBF
1 FF 15 min
2 FF 9 days
3 FF 23 years
Example
Collège de France 2013 13
Handshake with synchronizers
Elastic circuits
CLK1 CLK2
Data
Sender ReceiverValid
Ack
• Simple solution• Throughput can be highly degraded:
a long round trip for every transaction
Collège de France 2013 14
Asynchronous FIFOs
Elastic circuits
Circular buffer
Valid Valid
Ack Ack
Data Data
Clk In Clk Out
FIFO control
• Ack is issued as soon as data has been delivered
• No impact on throughput (1 token/cycle)
• Min latency determined by the internal synchronizers
• Some tricky structures for the FIFO pointers (e.g. Grey encoding)
Collège de France 2013 15
1 cycle 1 cycle3-4 cycles
SoC design with GALS
Elastic circuits
Bridge
CDC
DSP
P
Fast Bus
Slow Bus
Bridge
CDC
Mem
CLK2
CLK1
CLK3
• Bridges for Clock Domain Crossing usually contain asynchronous FIFOs
• Latency cost only when interfacing with synchronous domains
• No latency penalty between asynchronous domains
Collège de France 2013 16
Synchronous and Asynchronousmeeting each other
Asynchronia
Collège de France 2013 Elastic circuits
Meanwhile, a small village ofindomitable engineers was resisting the
synchronous occupation …
18
Bill Grundmann(Intel’s director of CAD research,Technical director for CAD technology for the Alpha Microprocessor):
“The specification of a complex system is usuallyasynchronous (functional units, messages, queues, …),
… however the clock appears when we move downto the implementation levels”
(in a technical discussion about system designwith M. Kishinevsky and J. Cortadella, 2004)
Elastic circuitsCollège de France 2013 19
Async and Sync meeting each other
Elastic circuits
Async
Sync
• Modular (time elasticity)• But hard to analyze and synthesize
• Easy to analyze and synthesize• Not modular (time rigid)
J. O’Leary and G. Brown, 1997Synchronous emulation of asynchronous circuits
A. Peeters and K. Van Berkel, 2001Synchronous handshake circuits Elastic Circuits
(Sync / Async)
L. Carloni et al., 1999A methodology for correct-by-construction latency-insensitive design
Cortadella et al., Desynchronization, 2003
Collège de France 2013 20
Different flavors of elasticity
Elastic circuits
+147 … 348201…
…Rigid
+a48…147…
201… 3Asynchronous
+e ……Synchronous Elastic
8 4 37 4 1
1 20…
time
Collège de France 2013 21
Why synchronous elasticity?• Time is discrete (cycle based), but
unpredictable (unknown number of cycles)
• Examples– Short/long integer addition (8 bits, 64 bits)– Floating-point units– Cache latency: fast hit(2), slow hit(3), miss(>20)– Bus arbitration– Latencies in Network-on-Chip– … and many others
Elastic circuitsCollège de France 2013 22
… even at design time
Elastic circuits
ReceiverSender
CLK
Can we add a register without modifying the functionality of the system?
Collège de France 2013 23
Many systems are already elastic
AMBA AXI bus protocol
Handshake signals
Elastic circuitsCollège de France 2013 24
Designing withsynchronous elasticity
Communication channel
Elastic circuits
receiversender
Data Data
Long wires: slow transmission
Collège de France 2013 26
Pipelined communication
Elastic circuits
sender receiver
DataData
How about if the sender does not always send valid data?
Collège de France 2013 27
Pipelined communication
Elastic circuits
sender receiver
DataData
Collège de France 2013 28
Pipelined communication
Elastic circuits
sender receiver
DataData
Collège de France 2013 29
Pipelined communication
Elastic circuits
sender receiver
DataData
Collège de France 2013 30
Pipelined communication
Elastic circuits
sender receiver
DataData
???
Collège de France 2013 31
The Valid bit
Elastic circuits
sender receiver
Data Data
Valid Valid
Collège de France 2013 32
The Valid bit
Elastic circuits
sender receiver
Data
Valid
Data
Valid
Collège de France 2013 33
The Valid bit
Elastic circuits
sender
Data
Valid
receiver
Data
Valid
Collège de France 2013 34
The Valid bit
Elastic circuits
sender
Data
Valid
receiver
Data
Valid
Collège de France 2013 35
The Valid bit
Elastic circuits
Data
Valid
sender receiver
Data
Valid
How about if the receiver is not always ready ?
Collège de France 2013 36
The Stop bit
Elastic circuits
00000
sender
Data
Valid
Stop
receiver
Data
Valid
Stop
Collège de France 2013 37
The Stop bit
Elastic circuits
11000
sender
Data
Valid
Stop
receiver
Data
Valid
Stop
Collège de France 2013 38
The Stop bit
Elastic circuits
11100
sender
Data
Valid
Stop
receiver
Data
Valid
Stop
Collège de France 2013 39
The Stop bit
Elastic circuits
11111
sender
Data
Valid
Stop
receiver
Data
Valid
Stop
Back-pressure
Collège de France 2013 40
The Stop bit
Elastic circuits
01111
sender
Data
Valid
Stop
receiver
Data
Valid
Stop
Collège de France 2013 41
The Stop bit
Elastic circuits
00000
sender
Data
Valid
Stop
receiver
Data
Valid
Stop
Collège de France 2013 42
The Stop bit
Elastic circuits
00000
sender
Data
Valid
Stop
receiver
Data
Valid
Stop
Collège de France 2013 43
The Stop bit
Elastic circuits
00000
sender
Data
Valid
Stop
receiver
Data
Valid
Stop
Collège de France 2013 44
The Stop bit
Elastic circuits
00000
sender
Data
Valid
Stop
receiver
Data
Valid
Stop
Collège de France 2013 45
The Stop bit
Elastic circuits
10000
sender
Data
Valid
Stop
receiver
Data
Valid
Stop
Long combinational path
Collège de France 2013 46
Relay stations (Carloni, 1999)
Elastic circuits
shell
pearl
sender
shell
pearl
receiver
main main main
aux aux aux
Collège de France 2013 47
Relay stations (Carloni, 1999)
Elastic circuits
main main main
aux aux aux
shell
pearl
receiver
shell
pearl
sender
Collège de France 2013 48
Relay stations (Carloni, 1999)
Elastic circuits
main main main
aux aux aux
shell
pearl
receiver
shell
pearl
sender
Collège de France 2013 49
Relay stations (Carloni, 1999)
Elastic circuits
main main main
aux aux aux
shell
pearl
receiver
shell
pearl
sender
Collège de France 2013 50
Relay stations (Carloni, 1999)
Elastic circuits
main main main
aux aux aux
shell
pearl
receiver
shell
pearl
sender
Collège de France 2013 51
Relay stations (Carloni, 1999)
Elastic circuits
main main main
aux aux aux
shell
pearl
sender
shell
pearl
receiver
Collège de France 2013 52
Relay stations (Carloni, 1999)
Elastic circuits
main main main
aux aux aux
shell
pearl
sender
shell
pearl
receiver
Collège de France 2013 53
Relay stations (Carloni, 1999)
Elastic circuits
main main main
aux aux aux
shell
pearl
sender
shell
pearl
receiver
Collège de France 2013 54
Relay stations (Carloni, 1999)
Elastic circuits
main main main
aux aux aux
shell
pearl
sender
shell
pearl
receiver
Collège de France 2013 55
Relay stations (Carloni, 1999)
Elastic circuits
main main main
aux aux aux
shell
pearl
receiver
shell
pearl
sender
• Handshakes with short wires• Double storage required
Collège de France 2013 56
Flip-flops vs. latches
Elastic circuits
sender receiver
1 cycle
FF FF
Collège de France 2013 57
Flip-flops vs. latches
Elastic circuits
sender receiver
1 cycle
H L H L
Collège de France 2013 58
Flip-flops vs. latches
Elastic circuits
sender receiver
1 cycle
H L H L
Collège de France 2013 59
Flip-flops vs. latches
Elastic circuits
sender receiver
1 cycle
H L H L
Collège de France 2013 60
Flip-flops vs. latches
Elastic circuits
sender receiver
1 cycle
H L H L
Collège de France 2013 61
Flip-flops vs. latches
Elastic circuits
sender receiver
1 cycle
H L H L
Collège de France 2013 62
Flip-flops vs. latches
Elastic circuits
sender receiver
1 cycle
H L H L
Collège de France 2013 63
Flip-flops vs. latches
Elastic circuits
sender receiver
1 cycle
H L H L
Flip-flops already have adouble storage capability, but …
Collège de France 2013 64
Flip-flops vs. latches
Elastic circuits
sender receiver
1 cycle
H L H L
Not allowed in conventionalFF-based design !
Collège de France 2013 65
Flip-flops vs. latches
Elastic circuits
sender receiver
1 cycle
H L LH
Let’s make the master/slave latches independent
Collège de France 2013 66
Flip-flops vs. latches
Elastic circuits
sender receiverH L H L
½ cycle ½ cycle
Let’s make the master/slave latches independent
Only half of the latches (H or L) can move tokens
Collège de France 2013 67
Synchronous elasticity
Elastic circuits
sender receiver
V V V V
S S S S
En En En En
Data
Valid
Stop
Data
Valid
Stop
Collège de France 2013 68
Synchronous elasticity
Elastic circuits
sender receiver
V V V V
S S S S
En En En En
Data
Valid
Stop
Data
Valid
Stop
1
0
Collège de France 2013 69
Synchronous elasticity
Elastic circuits
sender receiver
V V V V
S S S S
En En En En
Data
Valid
Stop
Data
Valid
Stop
1
0
Collège de France 2013 70
Synchronous elasticity
Elastic circuits
sender receiver
V V V V
S S S S
En En En En
Data
Valid
Stop
Data
Valid
Stop
1
0
Collège de France 2013 71
Synchronous elasticity
Elastic circuits
sender receiver
V V V V
S S S S
En En En En
Data
Valid
Stop
Data
Valid
Stop
1
0
Collège de France 2013 72
Synchronous elasticity
Elastic circuits
sender receiver
V V V V
S S S S
En En En En
Data
Valid
Stop
Data
Valid
Stop
1
0
Collège de France 2013 73
Synchronous elasticity
Elastic circuits
sender receiver
V V V V
S S S S
En En En En
Data
Valid
Stop
Data
Valid
Stop
0
0
Collège de France 2013 74
Synchronous elasticity
Elastic circuits
sender receiver
V V V V
S S S S
En En En En
Data
Valid
Stop
Data
Valid
Stop
0
0
Collège de France 2013 75
Synchronous elasticity
Elastic circuits
sender receiver
V V V V
S S S S
En En En En
Data
Valid
Stop
Data
Valid
Stop
0
0
Collège de France 2013 76
Synchronous elasticity
Elastic circuits
sender receiver
V V V V
S S S S
En En En En
Data
Valid
Stop
Data
Valid
Stop
0
0
Collège de France 2013 77
Synchronous elasticity
Elastic circuits
sender receiver
V V V V
S S S S
En En En En
Data
Valid
Stop
Data
Valid
Stop
0
0
Collège de France 2013 78
Synchronous elasticity
Elastic circuits
sender receiver
V V V V
S S S S
En En En En
Data
Valid
Stop
Data
Valid
Stop
1
1
Collège de France 2013 79
Synchronous elasticity
Elastic circuits
sender receiver
V V V V
S S S S
En En En En
Data
Valid
Stop
1
1
Data
Valid
Stop
Collège de France 2013 80
Synchronous elasticity
Elastic circuits
sender receiver
V V V V
S S S S
En En En En
Data
Valid
Stop
1
1
Data
Valid
Stop
Collège de France 2013 81
Synchronous elasticity
Elastic circuits
sender receiver
V V V V
S S S S
En En En En
Data
Valid
Stop
1
1
Data
Valid
Stop
Collège de France 2013 82
Synchronous elasticity
Elastic circuits
sender receiver
V V V V
S S S S
En En En En
Data
Valid
Stop
1
1
Data
Valid
Stop
Collège de France 2013 83
Synchronous elasticity
Elastic circuits
sender receiver
V V V V
S S S S
En En En En
Data
Valid
Stop
1
1
Data
Valid
Stop
Collège de France 2013 84
Synchronous elasticity
Elastic circuits
sender receiver
V V V V
S S S S
En En En En
Data
Valid
Stop
1
1
Data
Valid
Stop
Collège de France 2013 85
Synchronous elasticity
Elastic circuits
sender receiver
V V V V
S S S S
En En En En
Data
Valid
Stop
1
1
Data
Valid
Stop
Collège de France 2013 86
Synchronous elasticity
Elastic circuits
sender receiver
V V V V
S S S S
En En En En
Data
Valid
Stop
1
1
Data
Valid
Stop
Collège de France 2013 87
Synchronous elasticity
Elastic circuits
sender receiver
V V V V
S S S S
En En En En
Data
Valid
Stop
1
0
Data
Valid
Stop
Collège de France 2013 88
Synchronous elasticity
Elastic circuits
sender receiver
V V V V
S S S S
En En En En
1
0
Data
Valid
Stop
Data
Valid
Stop
Collège de France 2013 89
Synchronous elasticity
Elastic circuits
sender receiver
V V V V
S S S S
En En En En
1
0
Data
Valid
Stop
Data
Valid
Stop
Collège de France 2013 90
Synchronous elasticity
Elastic circuits
sender receiver
V V V V
S S S S
En En En En
1
0
Data
Valid
Stop
Data
Valid
Stop
Collège de France 2013 91
Synchronous elasticity
Elastic circuits
sender receiver
V V V V
S S S S
En En En En
1
0
Data
Valid
Stop
Data
Valid
Stop
Collège de France 2013 92
Synchronous elasticity
Elastic circuits
sender receiver
V V V V
S S S S
En En En En
Data
Valid
Stop
Data
Valid
Stop
1
0
Collège de France 2013 93
Synchronous elasticity
Elastic circuits
sender receiver
V V V V
S S S S
En En En En
Data
Valid
Stop
Data
Valid
Stop
1
0
Collège de France 2013 94
Synchronous elasticity
Elastic circuits
sender receiver
V V V V
S S S S
En En En En
Data
Valid
Stop
Data
Valid
Stop
1
0
Collège de France 2013 95
Basic VS block
Si
Eni
Vi
Si-1
Vi-1
VSSi
Eni
Vi
Si-1
Vi-1
Elastic circuitsCollège de France 2013 96
Elastic netlists
VS ForkJoin
Join / Fork
Enable signalto data latches
Elastic circuits
VSVS
VS
VS
VS
VS
VS
Collège de France 2013 97
Join
VS
+
V1
V2
S1
S2
V
S
VS
VS
VS
VS
Elastic circuitsCollège de France 2013 98
Lazy Fork
V1
V2
S1
S2
V
S
Elastic circuitsCollège de France 2013 99
Eager Fork
Elastic circuits
V1
V2
S1
S2
^
^
V
S
Collège de France 2013 100
Variable Latency Units
Elastic circuits
[0 - k] cycles
[0 - k] cycles
donego clear
V/S V/S
Collège de France 2013 101
Design automation
Transforming sync into elastic
Elastic circuitsCollège de France 2013 103
Transforming sync into elastic
Elastic circuitsCollège de France 2013 104
Transforming sync into elastic
Elastic circuits
Behavioralequivalenceis preserved
Collège de France 2013 105
Elastic Esterel
module ABRO: input A,B,R; output O; loop [ await A || await B ]; emit O each Rend module
Elastic circuitsCollège de France 2013
Marc Galceran Oms, Master thesis, 2007
106
Elastic Esterel
A
B
RO
Boot
PauseReg7
PauseReg11
Elastic circuitsCollège de France 2013 107
Elastic Esterel
A
B
RO
Elastic Control Layer
Valid_AStop_AValid_BStop_BValid_RStop_R
Valid_O
Stop_O
Boot
PauseReg7
PauseReg11
Elastic circuitsCollège de France 2013 108
Circuit vs. μarchitectural cycles
Elastic circuitsCollège de France 2013 109
Synchronous handshake circuits (Peeters, 2001)
Collège de France 2013 Elastic circuits
→
SEQ
xR
R
RWMUX
→
yR
R
RWMUX
*
DMX-
DMX-
DMX <>
DMX <
do
→→ @
áá ññ→
out
int = type [0..255]& gcd: main proc (in? chan <<int,int>> & out! chan int)begin x, y: var int| forever do in?<<x,y>>
; do x <> y then if x < y then y:=y-x else x:=x-y fi od
; out!x odend
Sources:
J. Kessels and A. Peeters.DESCALE: A Design Experiment for a SmartCard Application Consuming Low Energy,in Principles of Asynchronous Circuit Design, A Systems Perspective,Eds., J. Sparso and S. Furber, Kluwer Academic Publishers, 2001.
P.A.Beerel, R.O. Ozdag and M. Ferretti.A Designer’s Guide to Asynchronous VLSI,Cambridge University Press, 2010. 110
Generalization: bounded FIFOs
InOut
B1 B3
B2
Bounded Dataflow Networks
Elastic circuitsCollège de France 2013 111
Behavioral equivalence
Elastic circuits
D: a b c d e f g h i j k …
Synchronous:
Elastic:
D: a a b b b c d e e f g g h i i i j k … V: 1 0 1 0 0 1 1 1 0 1 1 0 1 1 0 0 1 1 …
Collège de France 2013 112
Early evaluation
Early evaluation
52
3
x 15
Elastic circuitsCollège de France 2013 114
Early evaluation
2
3
x 6
Elastic circuitsCollège de France 2013 115
Early evaluation
0
x 0
8
Elastic circuitsCollège de France 2013 116
PC+4
Branch targetaddress
Example: mux for next-PC calculation
Take branch
• Only wait for required inputs• Late arriving tokens are cancelled by anti-
tokens
No branch
Early evaluation
Collège de France 2013 Elastic circuits 117
How to implement anti-tokens ?
Valid+ Valid+
Valid–
Valid+
Stop+ Stop+
Valid–
Stop–Stop–
+
-Elastic circuitsCollège de France 2013 118
Dual elastic controllers
S+
V+
V-
S-
S+
V+
V-
S-
En En
Elastic circuitsCollège de France 2013 119
Fork/join
Dual fork/join Join with early evaluation
Elastic circuitsCollège de France 2013 120
Re-designing for average performance
F
Early evaluation
slow / fast
Fslow
Ffast
Elastic circuitsCollège de France 2013 121
H.264 CABAC decoder
Gotmanov, Kishinevsky and Galceran-OmsEvaluation of flexible latencies: designing synchronous elastic H.264 CABAC decoderProc. Problems in design of micro- and nano-electronic systemsMoscow, Oct. 2010 (in Russian)Collège de France 2013 Elastic circuits 122
Profiling
Collège de France 2013 Elastic circuits 123
H.264 CABAC decoder
Collège de France 2013 Elastic circuits 124
Area vs. Performance
0,90
1,00
1,10
1,20
1,30
1,40
1,50
1,60
1,70
0,50 0,70 0,90 1,10 1,30 1,50 1,70 1,90
Original Optimized
Area
Effective Cycle Time
Collège de France 2013 Elastic circuits 125
Conclusions
• Rigid systems preserve timing equivalence(data always valid at every cycle)
• Elastic systems waive timing equivalence to enablemore concurrency
(bubbles decrease throughput, but reduce cycle time)
• A new avenue of performance optimizations can emerge to build correct-by-construction pipelines
Θ Θ
Elastic circuitsCollège de France 2013 126
Unifying sync/async elasticity
• J. Carmona, J. Cortadella,M. Kishinevsky and A. Taubin,Elastic Circuits,IEEE Trans. On CAD, Oct. 2009.
Collège de France 2013 Elastic circuits 127
Collège de France 2013 Elastic circuits 128