Professional Documents
Culture Documents
018 Sequential Synthesis
018 Sequential Synthesis
Sequential Synthesis
4
Overview of Circuit Optimizations
Distance from Physical Implementation
Combinational Optimization
Retiming
Architectural Restructuring
System-Level Optimization
5
Sequential Optimization Techniques
• State assignment
– Lots of theory, practical only for small FSMs, that too targeting 2-level
control logic
• Sequential don’t cares
– Compute unreachable states, use them as external don’t cares for the
next-state logic
• State minimization
– Easy for completely specified FSMs (n ¢ log n algorithm)
– Incompletely specified FSMs
• Retiming
– balancing of path delays by moving registers within circuit topology
– interleaving with combinational optimization techniques
6
Integration in Design Flow
• Optimization Space
– significant more optimization freedom for improving performance,
power, and area
• Distance from Physical Implementation
– difficult to accurately model impact on final implementation
– difficult to mathematically characterize optimization space
• Verification Challenge
– departure from combinational comparison model would break
formal equivalence checking
– different simulation behavior causes acceptance problems
7
Retiming
r3
r2 4 5
r1 2 3
r4
4 5
2 r’1 3
r4
Skew =0
Dmax=6 Tcycle=8
Dmax=8 Dmax=0
Dmin=2 Dmin=3 Dmin=0
( Skew
T =7
cycle
)
= -1
r’1 r4
8
Retiming
+ • Only setup time constraint (0 clock skew)
• Simple integration with other logical (e.g. combinational) or
physical optimizations
• Easy combination with clock skew scheduling to obtain global
optimum
9
Retiming - Architectural Restructuring
r3
2 20
r2
{
2 ... ... 2
r2 r4
r1
r3
r2 2 10 10
{
2
r’4
{
...
r’1
... 2
r4
10
Retiming - Architectural Restructuring
+ • Smooth extension of regular retiming
• Potential to alleviate global performance bottlenecks by adding
sequential redundancy and pipelining
11
Example
Design example:
- 360 I/O
- 2240 flip-flops
- 41665 timing edges
Distribution:
20% 30 edges
40% 63 edges
60% 130 edges
80% 249 edges
100% 425 edges
12
Verification
• Timing verification unchanged
• Sequential optimizations change the next-state and output functions
– traditional combinational equivalence checking not applicable
– simulation runs not recognizable by designer - acceptance problems
• Generic solution:
– preserve retime function (mapping function) from synthesis for:
• reducing sequential EC problem back to combinational case
– no false positives possible!!!!
• modifying simulation model to reproduce original simulation output
13
Optimizing Circuits by Retiming
Inputs
Outputs
Various Goals:
– Reduce clock cycle time
– Reduce area
• Reduce number of latches
14
Retiming
Problem
– Pure combinational optimization can be suboptimal since relations
across register boundaries are disregarded
Solutions
– Retiming: Move register(s) so that
• clock cycle decreases, or number of registers decreases and
• input-output behavior is preserved
– RnR: Combine retiming with combinational optimization techniques
• Move latches out of the way temporarily
• optimize larger blocks of combinational
15
Circuit Representation
16
Circuit Representation
Example: Correlator (from Leiserson and Saxe) (simplified)
+ 7
0
Host 0
0 0
2 3 3
0
(x, y) = 1 if x=y Retiming Graph (Directed)
0 otherwise a b
Circuit Operation delay
17
Preliminaries
e0 e1 ek 1
For a path p : v0 v1 vk 1 vk
k
d ( p) d (vi ) (includes endpoints)
i 0
k 1
w( p) w(ei )
i 0
7 Path with
Clock cycle 0
c max {d ( p)}
0
0 0 w(p)=0
p: w( p ) 0
2 3 3
0
For correlator c = 13
18
Basic Operation
Retime by -1
Retime by 1
7 7
0 0
0 1
0 0 1
0 v
u v u
2 1 3 3
3 3 0
0
20
Retiming for Minimum Clock Cycle
Problem Statement: (minimum cycle time)
Given G (V, E, d, w), find a legal retiming r so that
c max {d ( p)}
p: wr ( p ) 0
is minimized
W (u, v) min{w( p) : u
p
v}
p
• Delay matrix
D(u, v) max{d ( p) : u
p
v, w( p) w(u, v)}
p
21
Retiming for minimum clock cycle
W = register path weight matrix
7 (minimum # latches
0
0 on all paths between
v0 0 0 u and v)
2 D = path delay matrix
3 3
0 (maximum delay on
V1 V2
all paths between
W D u and v)
V0 V1 V2 V3 V0 V1 V2 V3
V0 0222 0 3 6 13 V0
V1 0000 13 3 6 13 V1
V2 0200 10 13 3 10 V2
V3 0220 7 10 13 7 V3
Assume that we are asked to check if a retiming exists for a clock cycle
Legal retiming: wr(e) 0 for all e. Hence
wr(e) = w(e) = r(v) - r(u) 0 or
r (u) - r (v) w (e)
For all paths p: u v such that d(p) , we require wr(p) 1
– Thus k 1
1 wr ( p ) wr (ei )
i 0
k 1
[ w(ei ) r (vi 1 ) r (vi )]
i 0
w( p ) r (vk ) r (v0 )
w( p ) r (v) r (u )
Take the least w(p) (tightest constraint) r(u)-r(v) W(u,v)-1
Note: this is independent of the path from u to v, so we just need to apply
it to u, v such that D(u,v) 23
Solving the constraints
• All constraints in difference-of-2-variable form
• Related to shortest path problem
W D
Correlator: = 7 V0 V1 V2 V3 V0 V1 V2 V3
V0 0222 0 3 6 13 V0
V1 0000 13 3 6 13 V1
D>7: V2
V2 0200 10 13 3 10
Legal: r(u)-r(v)w(e) r(u)-r(v)W(u,v)-1 7 10 13 7 V3
V3 0220
r (v0 ) r (v1 ) 2 r (v0 ) r (v3 ) 1
r (v1 ) r (v2 ) 0 r (v1 ) r (v0 ) 1
r (v1 ) r (v3 ) 0 r (v1 ) r (v3 ) 1 0
7
Constraint graph
D>7:
Legal: r(u)-r(v)w(e) r(u)-r(v)W(u,v)-1
r (v0 ) r (v1 ) 2 -1
r (v0 ) r (v3 ) 1 0
r (v1 ) r (v2 ) 0 r(0) 2 -1
r (v1 ) r (v0 ) 1 0 r(1)
r (v1 ) r (v3 ) 0
r (v1 ) r (v3 ) 1 0 0 0 1 1
r (v2 ) r (v3 ) 0
r (v2 ) r (v0 ) 1
r (v3 ) r (v0 ) 0 0 -1 1 0,-1
r (v2 ) r (v1 ) 1 1
r (v2 ) r (v3 ) 1 0
r(2) r(3)
r (v3 ) r (v1 ) 1 0,-1
0
-1
r (v3 ) r (v2 ) 1 1
7
0
0
W D
V0 V1 V2 V3 V0 V1 V2 V3
v0 0 0
V0 0222 0 3 6 13 V0
2 3 3 V1
0 V1 0000 13 3 6 13
v1 V2 V2 0200 10 13 3 10 V2
V3 7 10 13 7 V3
0220
Retimed correlator:
+ +
Retime
Host Host
Clock cycle
= 3+3+7=13 Clock cycle = 7
26
a b a b
Retiming: 2 more algorithms
1. Relaxation based:
– Repeatedly find critical path;
– retime vertex at end of path by +1 (O(VElogV))
+1
v
Critical path
u
27
Retiming for Minimum Area
( w(e) r (v) r (u ))
e:u v
w(e) (r (v) r (u ))
eE e:u v
N (r (v) r (u ))
u v
N aV r (v )
vV
where av is a constant. 28
Minimum Registers - Formulation
a r (v )
Minimize:
v
vV
29
Problems with Retiming
• Computation of equivalent initial states
– do not exist necessarily
1
?
0 ?
• Timing models
– too far away from actual implementation
30