Upload
namanga043424
View
213
Download
0
Embed Size (px)
Citation preview
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
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.
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.
7/30/2019 008-architectural.pdf
http://slidepdf.com/reader/full/008-architecturalpdf 4/45
Synthesis and optimizationSynthesis and optimization
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);
}
7/30/2019 008-architectural.pdf
http://slidepdf.com/reader/full/008-architecturalpdf 6/45
Example of structuresExample of structures
7/30/2019 008-architectural.pdf
http://slidepdf.com/reader/full/008-architecturalpdf 7/45
Example
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
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.
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
7/30/2019 008-architectural.pdf
http://slidepdf.com/reader/full/008-architecturalpdf 11/45
Hardware and software compilation.Hardware and software compilation.
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
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
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.
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
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
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
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
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
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
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
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
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
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
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
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
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
7/30/2019 008-architectural.pdf
http://slidepdf.com/reader/full/008-architecturalpdf 28/45
Design evaluation spaceDesign evaluation space
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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.