Beruflich Dokumente
Kultur Dokumente
SYNTHESIS
c Giovanni De Micheli
Stanford University
Outline
c GDM
Motivation.
Compiling language models
into abstract models.
Behavioral-level optimization
Synthesis
c GDM
Logic-level synthesis:
{ Logic abstraction level.
{ Determine microscopic structure.
{ Example: logic gate interconnection.
c GDM
HDL
compilation
ABSTRACT MODELS
BEHAVIORAL VIEW
architectural
synthesis &
optimization
compilation
HDL
ARCHITECTURAL LEVEL
LANGUAGE MODELS
logic
synthesis &
optimization
translation
HDL
LOGIC LEVEL
STRUCTURAL VIEW
Example
c GDM
dieq f
read (x; y; u; dx; a);
repeat f
= x + dx;
ul = u
(3 x u dx) (3 y dx);
yl = y + u dx;
c = x < a;
x = xl; u = ul; y = yl;
xl
until ( c ) ;
write (y);
Example of structures
STEERING
&
MEMORY
ALU
ALU
ALU
c GDM
CONTROL
UNIT
STEERING
&
MEMORY
CONTROL
UNIT
Example
c GDM
Area
15
(2,2)
13
(2,1)
12
10
(1,2)
8
7
(1,1)
Latency
Architectural-level synthesis
motivation
c GDM
Architectural-level synthesis
c GDM
Software compilation:
{ Compile program into intermediate form.
{ Optimize intermediate form.
{ Generate target code for an architecture.
Hardware compilation:
{ Compile HDL model into sequencing
graph.
frontend
lex
intermediate form
parse
optimization
backend
codegen
(a)
frontend
lex
intermediate form
parse
behavioral
optimization
(b)
backend
asynthesis
lsynthesis
lbinding
Compilation
c GDM
Front-end:
{ Lexical and syntax analysis.
{ Parse-tree generation.
{ Macro-expansion.
{ Expansion of meta-variables.
Semantic analysis:
{ Data-
ow and control-
ow analysis.
{ Type checking.
{ Resolve arithmetic and relational operators.
c GDM
assignment
=
identifier
a
expression
+
identifier
p
expression
*
identifier
identifier
Behavioral-level optimization
c GDM
Semantic-preserving transformations
aiming at simplifying the model.
Applied to parse-trees
Taxonomy:
{ Data-
ow based transformations.
{ Control-
ow based transformations.
c GDM
Tree-height reduction.
Constant and variable propagation.
Common subexpression elimination.
Dead-code elimination.
Operator-strength reduction.
Code motion.
Tree-height reduction
c GDM
Techniques:
{ Balance the expression tree.
{ Exploit commutativity, associativity
and distributivity.
(a)
b
(b)
= + + ) =( + )+
x
(a)
(b)
= ( + ) ) = + ;
x
Examples of propagation
c GDM
Constant propagation:
{ = 0;
a
{ = 0;
a
= a + 1;
= 1;
= 2 b;
= 2;
Variable propagation:
{ = ;
a
{ = ;
a
= a + 1;
= x + 1;
= 2 a;
= 2 x;
Sub-expression elimination
c GDM
Logic expressions:
{ Performed by logic optimization.
{ Kernel-based methods.
Arithmetic expressions:
{ Search isomorphic patterns in the parse
trees.
{ Example:
= + ;
a
= + ;
a
= a + 1;
= x + y;
= a + 1;
= a;
Dead-code elimination:
{ = ;
a
= x + 1;
= 2 x;
Operator-strength reduction:
{ = 2;
a
= 3 x;
{ = ;
a
= x << 1;
= x + t;
Code motion:
{ for ( = 1; )f g
i
{ = ;
t
for ( = 1; )f g
i
Model expansion.
Conditional expansion.
Loop expansion.
Block-level transformations.
Model expansion
c GDM
Example:
{ = + ;
x
f oo p; q
= a b;
)ft = q
{ By expanding
{ = + ;
x
f oo
= f oo(x; y);
( ); g
return t
= a b;
=y
Conditional expansion
c GDM
ab
bd
a b
a bd
ab
d a
Loop expansion
c GDM
Expanded to:
{ = 0;
x
= x +1;
= x +2;
= x +3
c GDM
Design space:
{ Set of all feasible implementations.
Implementation parameters:
{ Area.
{ Performance:
Cycle-time.
Latency.
c GDM
Area
me
i
t
le
Area
c
Cy
Area
Area
Max
me
i
t
le
c
Cy
Latency
Latency
Latency
Latency
Max
Hardware modeling
Circuit behavior:
{ Sequencing graphs.
Building blocks:
{ Resources.
Constraints:
{ Timing and resource usage.
c GDM
Resources
c GDM
Functional resources:
{ Perform operations on data.
{ Example: arithmetic and logic blocks.
Memory resources:
{ Store data.
{ Example: memory and registers.
Interface resources:
{ Example: busses and ports.
Functional resources
c GDM
Standard resources:
{ Existing macro-cells.
{ Well characterized (area/delay).
{ Example: adders, multipliers, ...
Application-specic resources:
{ Circuits for specic tasks.
{ Yet to be synthesized.
{ Example: instruction decoder.
c GDM
Resource-dominated circuits.
{ Area and performance depend on few,
well-characterized blocks.
Implementation constraints
c GDM
Timing constraints:
{ Cycle-time.
{ Latency of a set of operations.
{ Time spacing between operation pairs.
Resource constraints:
{ Resource usage (or allocation).
{ Partial binding.
Scheduling:
{ Associate a start-time with each operation.
{ Determine latency and parallelism
of the implementation.
Example
c GDM
0
NOP
TIME 1
TIME 2
TIME 3
TIME 4
*
3
11
n
NOP
10
<
c GDM
Binding:
{ Associate a resource with each operation
with the same type.
Sharing:
{ Bind a resource to more than one operation.
{ Operations must not execute concurrently.
Example
c GDM
0
NOP
(1,1)
TIME 1
(1,2)
(1,3)
TIME 4
10
11
(2,1)
TIME 3
(2,2)
TIME 2
(1,4)
NOP
<
c GDM
Partial binding:
{ Partial mapping, given as design constraint.
Compatible binding:
{ Binding satisfying the constraints
of the partial binding.
Example
c GDM
0
NOP
TIME 1
TIME 2
TIME 3
TIME 4
*
3
NOP
11
<
9
10
Estimation
c GDM
Resource-dominated circuits.
{ Area = sum of the area of the resources
bound to the operations.
Determined by binding.
Area/latency trade-o,
{ for some values of the cycle-time.
Cycle-time/latency trade-o,
{ for some binding (area).
Area/cycle-time trade-o,
{ for some schedules (latency).
Area/latency trade-o
c GDM
(2,2)
Area
(2,1)
20
(3,2)
18
17
(3,1)
(1,2)
(1,1)
15
13
tim
(2,1)
Cy
cl
12
10
40
8
7
Latency
30
Area-latency trade-o
c GDM
Rationale:
{ Cycle-time dictated by system constraints.
Resource-dominated circuits:
{ Area is determined by resource usage.
Approaches:
{ Schedule for minimum latency
under resource constraints
Summary
c GDM
Behavioral optimization:
{ Create abstract models from HDL models.
{ Optimize models without considering
implementation parameters.