Digital System Design & Synthesis
Digital System Design & Synthesis
Synthesis Techniques
Synthesis
Verilog files aren’t hardware yet!
Need to “synthesize” them
Tool reads hardware descriptions
Figures out what hardware to make
Done automatically
Faster!
Easier!
Designers still have to understand hardware!
Avoid pre- vs. post-synthesis discrepancies
Describe EFFICIENT hardware
2
Useful Documentation
Fairly complete documentation is available for the
Synopsys tools using:
/afs/engr.wisc.edu/apps/eda/synopsys/syn_Y-2006.06-
SP1/sold
Why do we need
to compare
synthesized code
to initial code?
4
Design Compiler
User Guide, pg. 2-17
Design Vision is GUI
for Design Compiler:
use design_vision
Can also run Design
Compiler directly
using dc_shell
To compile using a
synthesis script use
dc_shell –tcl_mode –f
file_name
5
Synthesis Script Example [1]
# To run, place in the directory with all the Verilog files
# and type: dc_shell -tcl_mode -f script.tcl
#Sets clock constraint of 2ns with 50% duty cycle on signal "clock".
create_clock -name "clk" -period 2 -waveform {0 1} {clock}
set_dont_touch_network [ find clock clk ]
6
Synthesis Script Example [2]
#Check and compile the design
check_design > check_design.txt
uniquify
compile -map_effort medium
#Generate reports
report_resources > resource_report.txt
report_area > area_report.txt
report_timing > timing_report.txt
report_constraint -all_violators > violator_report.txt
report_register -level_sensitive > latch_report.txt
exit 7
Internal Synthesizer Flow
HDL Description Structural
Representation
Parsing and
Syntax & Semantic Architectural Technology
Error Checking Optimization Library
Translation Technology-Based
(Elaboration) Implementation
8
Initial Steps
Parsing for Syntax and Semantics Checking
Gives error messages and warnings to user
User may modify the HDL description in response
This is where you find out you can’t use certain Verilog
constructs
This is synthesizer-dependent
Example: Design Vision allows indexed part-select
(guess[i*2 : 2]), but the Xilinx Foundation tool does not
Certain things common to MOST synthesizers
9
Translation (Elaboration)
Builds a structural representation of the design
Like a netlist, but includes larger components
Not just gate-level, may include adders, etc.
Gives additional errors or warnings to the user
Issues in initial transformation to hardware.
Affects quality achieved by optimization steps
Structural representation depends on HDL quality
Poor HDL can prevent optimization
10
Optimization in Synthesis
None of these are guaranteed!
Most synthesizers will make at least some attempt
12
Optimization Phases
Architectural optimization
High-level optimizations that occur before the design
is mapped to the logic-level
Based on constraints and high-level coding style
After optimization circuit function is represented by a
generic, technology-independent netlist (GTECH)
13
Architectural Optimization
In Synopsis, types include:
Sharing common mathematical subexpressions
Sharing resources
Selecting DesignWare implementations
Reordering operators
Identifying arithmetic expressions for datapath
synthesis
14
Architectural Optimization
Examples:
Replace an adder used as a counter with incrementer
Replace adder and separate subtractor with
adder/subtractor if not used simultaneously
Performs selection of pre-designed components
(Synopsys DesignWare)
adders, multipliers, shifters, comparators, muxes, etc.
15
Logic/Gate-Level Optimization
Works on the generic netlist created by logic
synthesis
Produces a technology-specific netlist.
In Synopsis, it consists of four stages:
Mapping
Delay optimization
Design rule fixing
Area optimization
16
Logic/Gate-Level Optimization
Mapping
Generates a gate level implementation
Tries to meet timing and area goals
Delay optimization
Tries to fix delay violations from mapping phase.
Does not fix design rule violations or meet area constraints.
Design rule fixing
Tries to correct design rule violations
Inserting buffers or resizing existing cells
If necessary, violates optimization constraints
Area optimization
Tries to meet area constraints, which have lowest priority
17
Combinational Optimization
18
Gate-Level Optimization
19
Logic-Level Optimizations
Verilog Technology
Description Libraries
Optimized
Two-level Technology
Multi-level Logic
Logic Functions Implementation
Functions
20
Logic Optimizations
Area
Number of gates fewer == smaller
Size of gates (# inputs) fewer == smaller
Delay
Number of logic levels fewer == faster
Size of gates (# inputs) fewer == faster
21
Logic Optimizations
Decomposition
Extraction
Factoring
Substitution
Elimination
23
Decomposition Example
F = abc + abd + a’c’d’ + b’c’d’
~7 gates, ~3 levels
F = ab(c + d) + c’d’(a’ + b’)
F = ab(c + d) + (c + d)’(ab)’
X = ab 1 gate, 1 level
Y=c+d 1 gate, 1 level
F = XY + X’Y’ 3 gates, 3 levels
G(original) = 16
G(decomposed) = 10
24
Extraction
Find common sub-expressions in functions
Like decomposition, but across more than one
function
Reduce redundancy
Reduce area (number/size of gates)
May increase delay if more logic levels
introduced
25
Extraction Example
F = (a + b)cd + e 3 gates, 3 levels
G = (a + b) e’ 2 gates, 2 levels
H = cde 1 gate, 1 level
Before:
(3) 2-input ORs, (2) 3-input ANDs, (1) 2-input AND
G(orginal) = 7 + 4 + 3 = 14
After
(2) 2-input Ors, (4) 2-input ANDs
G(extracted) = 2 + 2 + 4 + 2 + 2 = 12
26
Factoring
Traditional two-level logic is sum-of-products
Sometimes better expressed by product-of-sums
Fewer literals => less area
May increase delay if logic equation not
completely factored (becomes multi-level)
27
Factoring Example
Definitely good:
F = ac + ad + bc + bd ~7+ gates, ~3 levels
F = (a + b)(c + d) 3 gates, 2 levels
Maybe good:
F = ac + ad + e 3 gates, 2 levels
F = a(c + d) + e 3 gates, 3 levels
28
Substitution
Similar to Extraction
When one function is subfunction of another
Reduce area
Fewer gates
Can increase delay if more logic levels
29
Substitution Example
G=a+b 1 gate, 1 level
F=a+b+c 1 gate, 1 level
Before:
(1) 2-input OR, (1) 3-input OR
After
(2) 2-input ORs (but increased levels)
30
Elimination (Flattening)
Opposite of previous optimizations
Goal is to reduce delay
Make signals travel though as few logic levels as
possible
But will likely increase area
Gate replication / redundant logic
31
Elimination Example
G=c+d 1 gate, 1 level
F = Ga + G' b 3 gates, 3 levels
Before:
(2) 2-input ORs, (2) 2-input ANDs
After:
(1) 2-input OR, (1) 3-input OR, (2) 2-input ANDs,
(1) 3-input AND (but fewer levels)
32