Logic Synthesis
Logic Synthesis
Outline
Logic Synthesis Problem Logic Specification Two-Level Logic Optimization
Goal
Understand logic synthesis problem Understand logic optimization problem
Goals
maximize speed minimize power minimize chip/board area
Constraints
target technology CAD tool CPU time
abc + abc + d
bc + d
b c
b c d
Logic Specification
Two-level logic equations
sum of products PLA format ESPRESSO format
x = ab + bc + abc y = abc + ab z = ab
literal operand
x = (a(b+c)d + ef(i+j))(k + l)
Logic Specification
Logic equations are flattened to two levels
AND-OR, NAND-NAND, NOR-NOR common starting point for most tools eliminates any input bias causes exponential explosion in equation size in worst case does not occur in practice
2. logic synthesis
map equations to generic gates AND, OR, NOT
3. gate-level optimization
local transformations for speed, area, power e.g. AND-NOT => NAND need estimate of technology costs
4. technology mapping
map from gates to component library FPGAs, standard cells, TTL, etc.
F = AB + BC + AD
Examples
C 0 0 1 A 0 1 1 0 1 1 0 0 B 1 A 1 1 1 0 0 0 1 0 1
C 0 0 B 1
1 D
1 D
F = AC + BD F is not a cover
Examples
C 0 0 1 A 0 1 1 0 1 1 0 0 B 1 A 1 1 1 0 0 0 1 0 1
C 0 0 B 1
1 D
1 D
B
1 A 0 0 1 1
Local Minima
C C
1
1 1 A 0
1
0 0 0 D
1
0 0 0
1
1 B 1 A 0
1
1 1 0
1
0 0 0 D
1
0 0 0
1
1 B 1 0
C 1 1 1 A 0 0 D 0 0 1 0 0 1 0 0 1 1 1 1 1 0 0 0 D 1 0 0 0
C 1 1
B
1 A 0 0 1 1
Local Minima
C C
1
1 1 A 0
1
0 0 0 D
1
0 0 0
1
1 B 1 A 0
1
1 1 0
1
0 0 0 D
1
0 0 0
1
1 B 1 0
F = AB + BD
Result is minimal
Usually many minima
Solution
cube: a DC: b
ab ab
ab space: <a:b> ab
ab
ab
ab
ab
ON
a + b DC OFF
Complications
solve simultaneously for each expression (output) minimize total number of unique cubes consider ON vs. OFF vs. DONT CARE set ESPRESSO input .i 3 .o 3 .p 4 10x101 x01100 110110 11x010 .e ESPRESSO output .i 3 .o 3 .p 4 -01 100 11- 010 1-0 100 10- 001 .e
x = ab + bc + abc y = abc + ab z = ab
x = bc + ac y = ab z = ab
Algorithm
start with cubes covering the ON-set this is just sum-of-products form iteratively expand, shrink, add, remove cubes remove redundant (covered) cubes result is irredundant cover x = ab + ab + ab ab ab ab ab ab ab x = a + b ab ab
ESPRESSO Algorithm
Forig = ON-set; /* vertices with expression TRUE */ R = OFF-set; /* vertices with expression FALSE */ D = DC-set; /* vertices with expression DC */ F = expand(Forig, R); /* expand cubes against OFF-set */ F = irredundant(F, D); /* remove redundant cubes */ do { do { F = reduce(F, D); /* shrink cubes against ON-set */ F = expand(F, R); F = irredundant(F, D); } until cost is stable; /* perturb solution */ G = reduce_gasp(F, D); /* add cubes that can be reduced */ G = expand_gasp(G, R); /* expand cubes that cover another */ F = irredundant(F+G, D); } until time is up; ok = verify(F, Forig, D); /* check that result is correct */
Cube Operations
Expand
expand essential cubes in F in decreasing size to a prime cube prime cube - fully expanded against OFF-set essential cube - contains essential vertex essential vertex - minterm no other cube covers remove any covered cubes
01
Expand 00
11
10
01
00
11
10
ON DC OFF
Cube Operations
Irredundant
find minimal cover with each cube containing an essential vertex find relatively essential cubes E removing them violates cover - keep them redundant cubes R = F - E can be individually removed totally redundant Rt - covered by E+D remove Rt partially redundant Rp - R - Rt new F = E + minimal set of Rp
E Irredundant 01 Rp 00 Rp 11 Rt 10 01 11
ON DC
00
10
OFF
Cube Operations
Reduce
shrink cubes in descending order of size while maintaining cover smaller cubes can expand in more directions smaller cubes more likely to be covered by other cubes during expansion
01 Reduce 00
11 10
01 00
11 10
ON DC OFF
Cube Operations
Reduce Gasp
for each cube add a subcube not covered by other cubes
Expand Gasp
expand subcubes and add them if they cover another cube later use Irredundant to discard redundant cubes this is a last gasp heuristic for exploration no ordering by cube size
01
11 10
01 00
11 10 ON DC OFF
Reduce Gasp
00
01
11 10
01 00
11 10
Expand Gasp
00
Example
x = ab + ab + ab ab ab ab ab Expand ab ab ab ab Irredundant ab ab ab ab Expand ab ab Irredundant Reduce ab ab x = a + b ab ab
ab
ab Cost Stable
ab
ab
ab
ab
Examples
Rp E
Initial Cover
Reduce
Conclusions
Experimental Results
ESPRESSO algorithm gets minimum or close to minimum cover where cover is known up to 10 000 input literals, 100 inputs, 100 outputs tested CPU time < 12 min on high-speed workstation
Application
PLA minimization use as subroutine in multi-level logic minimization minimize pieces of larger circuit