45
7/30/2019 008-architectural.pdf http://slidepdf.com/reader/full/008-architecturalpdf 1/45 Chapter 4 ARCHITECTURAL-LEVEL ARCHITECTURAL-LEVEL SYNTHESIS SYNTHESIS Giovanni De Giovanni De M icheli M icheli Stanford University Stanford University Please read the entire chapter 4

008-architectural.pdf

Embed Size (px)

Citation preview

Page 1: 008-architectural.pdf

7/30/2019 008-architectural.pdf

http://slidepdf.com/reader/full/008-architecturalpdf 1/45

Chapter 4

ARCHITECTURAL-LEVELARCHITECTURAL-LEVEL

SYNTHESISSYNTHESIS

Giovanni DeGiovanni De

MicheliMicheli

Stanford UniversityStanford University

Please read the

entire chapter 4

Page 2: 008-architectural.pdf

7/30/2019 008-architectural.pdf

http://slidepdf.com/reader/full/008-architecturalpdf 2/45

Outline

•Motivation.

•Compilinglanguage models intoabstract models.

• Behavioral-level optimizationandprogram-level transformations.

• Architectural synthesis: an overview.

Page 3: 008-architectural.pdf

7/30/2019 008-architectural.pdf

http://slidepdf.com/reader/full/008-architecturalpdf 3/45

SynthesisSynthesis

• Transformbehavioral intostructural view.

• Architectural-level synthesis:– Architectural abstraction level.

– Determinemacroscopicstructure.– Example: major building blocks.

• Logic-level synthesis:– Logic abstraction level.

– Determinemicroscopicstructure.

– Example: logic gate interconnection.

Page 4: 008-architectural.pdf

7/30/2019 008-architectural.pdf

http://slidepdf.com/reader/full/008-architecturalpdf 4/45

Synthesis and optimizationSynthesis and optimization

Page 5: 008-architectural.pdf

7/30/2019 008-architectural.pdf

http://slidepdf.com/reader/full/008-architecturalpdf 5/45

ExampleExamplediffeq {

read (x, y, u, dx, a);

repeat{

xl = x + dx;

ul = u - (3 * x * u * dx) - (3 * y * dx);

yl = y + u * dx;c = x < a;

x = xl; u = ul; y = yl;

  }until ( c ) ;

write (y);

}

Page 6: 008-architectural.pdf

7/30/2019 008-architectural.pdf

http://slidepdf.com/reader/full/008-architecturalpdf 6/45

Example of structuresExample of structures

Page 7: 008-architectural.pdf

7/30/2019 008-architectural.pdf

http://slidepdf.com/reader/full/008-architecturalpdf 7/45

Example

Page 8: 008-architectural.pdf

7/30/2019 008-architectural.pdf

http://slidepdf.com/reader/full/008-architecturalpdf 8/45

Architectural-level synthesis motivationArchitectural-level synthesis motivation

• Raise input abstraction level.

– Reduce specification of details.

– Extend designer base.

– Self-documenting design specifications.

– Ease modifications and extensions.

• Reduce design time.

• Explore and optimize macroscopicstructure:

– Series/parallel execution of operations.

hi l l l h i

Page 9: 008-architectural.pdf

7/30/2019 008-architectural.pdf

http://slidepdf.com/reader/full/008-architecturalpdf 9/45

Architectural-level synthesisArchitectural-level synthesis

• Translate HDL models into sequencinggraphs.

• Behavioral-level optimization:

– Optimize abstract models independently from the

implementation parameters.

• Architectural synthesis and optimization:

– Create macroscopic structure:• data-path and control-unit.

– Consider area and delay information of theimplementation.

Page 10: 008-architectural.pdf

7/30/2019 008-architectural.pdf

http://slidepdf.com/reader/full/008-architecturalpdf 10/45

Compilation and behavioralCompilation and behavioral

optimizationoptimization

• Software compilation:

– Compile program into intermediate form.

– Optimize intermediate form.– Generate target code for an architecture.

• Hardware compilation:– Compile HDL model into sequencing graph.

– Optimize sequencing graph.

– Generate gate-level interconnection for a cell library.

H d d f il i

Page 11: 008-architectural.pdf

7/30/2019 008-architectural.pdf

http://slidepdf.com/reader/full/008-architecturalpdf 11/45

Hardware and software compilation.Hardware and software compilation.

Page 12: 008-architectural.pdf

7/30/2019 008-architectural.pdf

http://slidepdf.com/reader/full/008-architecturalpdf 12/45

CompilationCompilation• Front-end:

– Lexical and syntax analysis.

– Parse-tree generation.

– Macro-expansion.– Expansion of meta-variables.

• Semantic analysis:– Data-flow and control-flow analysis.

– Type checking.

– Resolve arithmetic and relational operators.

P t l

Page 13: 008-architectural.pdf

7/30/2019 008-architectural.pdf

http://slidepdf.com/reader/full/008-architecturalpdf 13/45

Parse tree example

a = p +q r

h i l l l i i i

Page 14: 008-architectural.pdf

7/30/2019 008-architectural.pdf

http://slidepdf.com/reader/full/008-architecturalpdf 14/45

Behavioral-level optimizationBehavioral-level optimization

• Semantic-preserving transformationsaiming at simplifying the model.

• Applied to parse-trees or during theirgeneration.

• Taxonomy:

– Data-flowbased transformations.

– Control-flowbased transformations.

Page 15: 008-architectural.pdf

7/30/2019 008-architectural.pdf

http://slidepdf.com/reader/full/008-architecturalpdf 15/45

Data-flow based transformations

• Tree-height reduction.• Constant and variable propagation.

• Common sub-expression elimination.

• Dead-code elimination.

• Operator-strength reduction.

• Code motion.

T h i ht d tiTree height reduction

Page 16: 008-architectural.pdf

7/30/2019 008-architectural.pdf

http://slidepdf.com/reader/full/008-architecturalpdf 16/45

 Tree-height reduction Tree-height reduction

• Applied to arithmetic expressions.

• Goal:– Split into two-operand expressions to exploit

hardware parallelism at best.

• Techniques:

– Balance the expression tree.

– Exploit commutativitycommutativity,, associativityassociativityandand

distributivitdistributivityy..

Exampleoftree-heightreduction

Page 17: 008-architectural.pdf

7/30/2019 008-architectural.pdf

http://slidepdf.com/reader/full/008-architecturalpdf 17/45

Example of tree-height reductionusingcommutativity andassociativity

x = a +b c +d ) x = (a +d) +b c

Example of tree height reductionExample of tree-height reduction

Page 18: 008-architectural.pdf

7/30/2019 008-architectural.pdf

http://slidepdf.com/reader/full/008-architecturalpdf 18/45

Example of tree-height reductionExample of tree-height reduction

usingusingdistributivitydistributivity

x = a (b c d +e) ) x = a b c d +a e;

l f iE l f ti

Page 19: 008-architectural.pdf

7/30/2019 008-architectural.pdf

http://slidepdf.com/reader/full/008-architecturalpdf 19/45

Examples of propagationExamples of propagation

• First Transformation type: Constant

propagation:– a = 0, b = a +1, c = 2 * b,

– a = 0, b = 1, c = 2,

• Second Transformation type: Variable

propagation:– a = x, b = a +1, c = 2 * a,

– a = x, b = x +1, c = 2 * x,

S b i li i tiS b i li i ti

Page 20: 008-architectural.pdf

7/30/2019 008-architectural.pdf

http://slidepdf.com/reader/full/008-architecturalpdf 20/45

Sub-expression eliminationSub-expression elimination

• Logic expressions:

– Performed by logic optimization.– Kernel-based methods.

• Arithmetic expressions:– Search isomorphic patterns in the parse trees.

– Example:• a = x +y, b = a +1, c = x +y,

• a = x +y, b = a +1, c = a.

Examples of other transformationsExamples of other transformations

Page 21: 008-architectural.pdf

7/30/2019 008-architectural.pdf

http://slidepdf.com/reader/full/008-architecturalpdf 21/45

Examples of other transformationsExamples of other transformations

• Dead-code elimination:

– a = x; b = x +1; c = 2 * x;– a = x; can be removed if not referenced.

• Operator-strength reduction:– a = x 2 ; b = 3 * x;

– a = x * x; t = x << 1; b = x + t;

• Code motion:

– for (i = 1; i ≤ a * b) { }

– t = a * b; for (i = 1; i ≤ t) { }

Control flow based transformationsControl flow based transformations

Page 22: 008-architectural.pdf

7/30/2019 008-architectural.pdf

http://slidepdf.com/reader/full/008-architecturalpdf 22/45

Control- flow based transformationsControl- flow based transformations

• Model expansion.

• Conditional expansion.• Loop expansion.

• Block-level transformations.

Model expansionModel expansion

Page 23: 008-architectural.pdf

7/30/2019 008-architectural.pdf

http://slidepdf.com/reader/full/008-architecturalpdf 23/45

Model expansionModel expansion

• Expand subroutine flatten hierarchy.

• Useful to expand scope of other optimization

techniques.• Problematic when routine is called more than

once.• Example:Example:

– x = a +b; y = a * b; z = foo(x; y);

– foo(p; q) {t = q - p; return(t); }

– By expanding foo:

– x = a +b; y = a * b; z = y - x

Conditional expansionConditional expansion

Page 24: 008-architectural.pdf

7/30/2019 008-architectural.pdf

http://slidepdf.com/reader/full/008-architecturalpdf 24/45

Conditional expansionConditional expansion

• Transform conditional into parallel executionwith test at the end.

• Useful when test depends on late signals.• May preclude hardware sharing.

• Always useful for logic expressions.• Example:

– y = ab; if if (a) {x = b + d; }elseelse{x = bd;}– can be expanded to: x = a(b +d) +a’a’ bd

– and simplified as: y = ab; x = y +d(a +b)

Loop expansionLoop expansion

Page 25: 008-architectural.pdf

7/30/2019 008-architectural.pdf

http://slidepdf.com/reader/full/008-architecturalpdf 25/45

Loop expansionLoop expansion

• Applicable to loops with data-independent exitconditions.

• Useful to expand scope of other optimizationtechniques.

• Problematic when loop has many iterations.

• Example:– x = 0;

for (i = 1; i ≤ 3; i ++) {x = x +1; }

– Expanded to:

x = 0; x = x +1; x = x +2; x = x +3

Architectural synthesis and optimizationArchitectural synthesis and optimization

Page 26: 008-architectural.pdf

7/30/2019 008-architectural.pdf

http://slidepdf.com/reader/full/008-architecturalpdf 26/45

Architectural synthesis and optimizationArchitectural synthesis and optimization

• Synthesize macroscopic structure in terms of building-blocks.

• Explore area/performance trade-o:– maximum performanceimplementations subject to

area constraints.

– minimum areaimplementations subject toperformance constraints.

• Determine an optimal implementation.• Create logic model for data-path and control.

Design spaceand objectivesDesign spaceand objectives

Page 27: 008-architectural.pdf

7/30/2019 008-architectural.pdf

http://slidepdf.com/reader/full/008-architecturalpdf 27/45

Design space and objectivesDesign space and objectives

• Design space:– Set of all feasible implementations.

• Implementation parameters:– Area.

– Performance:

• Cycle-time.

• Latency.• Throughput (for pipelined implementations).

– Power consumption

DesignevaluationspaceDesignevaluationspace

Page 28: 008-architectural.pdf

7/30/2019 008-architectural.pdf

http://slidepdf.com/reader/full/008-architecturalpdf 28/45

Design evaluation spaceDesign evaluation space

Page 29: 008-architectural.pdf

7/30/2019 008-architectural.pdf

http://slidepdf.com/reader/full/008-architecturalpdf 29/45

Hardware modelingHardware modeling

• Circuit behavior:– Sequencing graphs.

• Building blocks:

– Resources.

• Constraints:

– Timing and resource usage.

RResources

Page 30: 008-architectural.pdf

7/30/2019 008-architectural.pdf

http://slidepdf.com/reader/full/008-architecturalpdf 30/45

ResourcesResources

• 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.

F ti lF ti l

Page 31: 008-architectural.pdf

7/30/2019 008-architectural.pdf

http://slidepdf.com/reader/full/008-architecturalpdf 31/45

• Standard resources:

– Existing macro-cells.– Well characterized (area/delay).

– Example: adders, multipliers, ...• Application-specific resources:

– Circuits for specific tasks.– Yet to be synthesized.

– Example: instruction decoder.

Functional resourcesFunctional resources

Resourcesand circuit familiesResourcesand circuit families

Page 32: 008-architectural.pdf

7/30/2019 008-architectural.pdf

http://slidepdf.com/reader/full/008-architecturalpdf 32/45

Resources and circuit familiesResources and circuit families

• Resource-dominated circuits.

– Area and performance depend on few, well-characterized blocks.

– Example: DSP circuits.

• Non resource-dominated circuits.

– Area and performance are strongly influencedby sparse logic, control and wiring.

– Example: some ASIC circuits.

Implementation constraintsImplementation constraints

Page 33: 008-architectural.pdf

7/30/2019 008-architectural.pdf

http://slidepdf.com/reader/full/008-architecturalpdf 33/45

Implementation constraintsImplementation constraints

•  Timing constraints:– Cycle-time.

– Latency of a set of operations.– Time spacing between operation pairs.

• Resource constraints:

– Resource usage (or allocation).

– Partial binding.

Synthesis in the temporaldomainSynthesis in the temporaldomain

Page 34: 008-architectural.pdf

7/30/2019 008-architectural.pdf

http://slidepdf.com/reader/full/008-architecturalpdf 34/45

Synthesis in the temporal domainSynthesis in the temporal domain

• Scheduling:– Associate a start-time with each operation.

– Determine latency and parallelism of theimplementation.

• Scheduled sequencing graph:

– Sequencing graph with start-time annotation.

Exampleof Synthesis in the temporal domainSynthesis in the temporal domain

Page 35: 008-architectural.pdf

7/30/2019 008-architectural.pdf

http://slidepdf.com/reader/full/008-architecturalpdf 35/45

Example of Synthesis in the temporal domainSynthesis in the temporal domain

ASAP

Synthesis in the spatial domainSynthesis in the spatial domain

Page 36: 008-architectural.pdf

7/30/2019 008-architectural.pdf

http://slidepdf.com/reader/full/008-architecturalpdf 36/45

Synthesis in the spatial domainSynthesis in the spatial domain

• Binding:

– Associate a resource with each operation with the

same type.– Determine area of the implementation.

• Sharing:– Bind a resource to more than one operation.

– Operations must not execute concurrently.

• Bound sequencing graph:

– Sequencing graph with resource annotation.

Example of Synthesis in the spatial domainExample of Synthesis in the spatial domain

Page 37: 008-architectural.pdf

7/30/2019 008-architectural.pdf

http://slidepdf.com/reader/full/008-architecturalpdf 37/45

Example of Synthesis in the spatial domaina pe o Sy ess e spa a do a

• Firstmultiplier

• Second

multiplier • Thirdmultiplier • Fourthmultiplier

• First ALU

• SecondALU

• Solution

• FourMultipliers

• Two ALUs

• Four Cycles

BindingspecificationBindingspecification

Page 38: 008-architectural.pdf

7/30/2019 008-architectural.pdf

http://slidepdf.com/reader/full/008-architecturalpdf 38/45

Binding specificationBinding specification

• Mapping from the vertex set to the set of resource instances, for each given type.

• Partial binding:

– Partial mapping, given as design constraint.

• Compatible binding:

– Binding satisfying the constraints of the partial

binding.

Example of Binding specificationExample of Binding specification

Page 39: 008-architectural.pdf

7/30/2019 008-architectural.pdf

http://slidepdf.com/reader/full/008-architecturalpdf 39/45

Example of Binding specificationa pe o d g spec ca o

• Binding tothe samemultiplier

EstimationEstimation

Page 40: 008-architectural.pdf

7/30/2019 008-architectural.pdf

http://slidepdf.com/reader/full/008-architecturalpdf 40/45

• Resource-dominated circuits.

– Area = sum of the area of the resources bound to theoperations.

• Determined by binding.– Latency = start time of the sink operation (minus start

time of the source operation).

• Determined by scheduling

• Non resource-dominated circuits.

– Area also affected by:• registers, steering logic, wiring and control.

– Cycle-time also affected by:

•steering logic, wiring and (possibly) control.

Approaches to architecturalApproaches to architectural

Page 41: 008-architectural.pdf

7/30/2019 008-architectural.pdf

http://slidepdf.com/reader/full/008-architecturalpdf 41/45

pppp

optimizationoptimization

• Multiple-criteriaoptimization problem:– area, latency, cycle-time.

• DeterminePareto optimal points:– Implementations such that no other has all

parameters with inferior values.

• Draw trade-off curves:

– discontinuous and highly nonlinear.

Approaches to architecturalApproaches to architectural

Page 42: 008-architectural.pdf

7/30/2019 008-architectural.pdf

http://slidepdf.com/reader/full/008-architecturalpdf 42/45

pppp

optimizationoptimization

• Area/latency trade-off,

– for some values of the cycle-time.

• Cycle-time/latency trade-off,

– for some binding (area).

• Area/cycle-time trade-off ,

– for some schedules (latency).

Area/latency trade-off for various cycle timesArea/latency trade-off for various cycle times

Page 43: 008-architectural.pdf

7/30/2019 008-architectural.pdf

http://slidepdf.com/reader/full/008-architecturalpdf 43/45

• Area/Latencyfor cycletime=30

• Area/Latency

for cycletime=40

ParetoPareto pointspoints

in threein three

dimensionsdimensions

Area-latency trade-offArea-latency trade-off

Page 44: 008-architectural.pdf

7/30/2019 008-architectural.pdf

http://slidepdf.com/reader/full/008-architecturalpdf 44/45

Area latency trade off Area latency trade off 

• Rationale:

– Cycle-time dictated by system constraints.

• Resource-dominated circuits:

– Area is determined by resource usage.

• Approaches:

– Schedule for minimum latencyunder resource

constraints– Schedule for minimum resourceusage under

latency constraints

• for varying constraints.

SummarySummary

Page 45: 008-architectural.pdf

7/30/2019 008-architectural.pdf

http://slidepdf.com/reader/full/008-architecturalpdf 45/45

SummarySummary

• Behavioral optimization:

– Create abstract models from HDL models.

– Optimize models without considering

implementation parameters.

• Architectural synthesis and optimization.

– Consider resource parameters.

– Multiple-criteria optimization problem:

• area, latency, cycle-time.