abc_2019 synthesis digital circuit .ppt

CheerChess 39 views 29 slides Aug 11, 2024
Slide 1
Slide 1 of 29
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29

About This Presentation

ABC synthesis


Slide Content

ABC: An Industrial-Strength ABC: An Industrial-Strength
Logic Synthesis and Logic Synthesis and
Verification ToolVerification Tool
Alan MishchenkoAlan Mishchenko
University of California, BerkeleyUniversity of California, Berkeley

22
OutlineOutline

Basic levelBasic level

Boolean calculator and visualizerBoolean calculator and visualizer

Standard commands and scriptsStandard commands and scripts

Advanced levelAdvanced level

Key packages and data-structuresKey packages and data-structures

Ways to improve runtime and memory usage Ways to improve runtime and memory usage

Future research directionsFuture research directions

33
OutlineOutline

Basic levelBasic level

Boolean calculator and visualizerBoolean calculator and visualizer

Standard commands and scriptsStandard commands and scripts

Advanced levelAdvanced level

Key packages and data-structuresKey packages and data-structures

Ways to improve runtime and memory usageWays to improve runtime and memory usage

Future research directionsFuture research directions

44
Boolean CalculatorBoolean Calculator

Read/generate small functions/networksRead/generate small functions/networks

Automatically extracted or manually specifiedAutomatically extracted or manually specified

Compute basic functional propertiesCompute basic functional properties

Symmetries, decomposability, unateness, etcSymmetries, decomposability, unateness, etc
Transform them in various waysTransform them in various ways

Minimize SOP, reorder BDD, extract kernels, etcMinimize SOP, reorder BDD, extract kernels, etc

VisualizationVisualization

Use text output, dot / GSView, etcUse text output, dot / GSView, etc

55
Standard Commands/ScriptsStandard Commands/Scripts

Technology independent synthesisTechnology independent synthesis

Logic synthesis for PLAsLogic synthesis for PLAs

Technology mapping for standard cellsTechnology mapping for standard cells

Technology mapping for LUTsTechnology mapping for LUTs

Sequential synthesisSequential synthesis

VerificationVerification

66
Technology Independent SynthesisTechnology Independent Synthesis

AIG rewriting for areaAIG rewriting for area

Scripts Scripts drwsat, compress2rsdrwsat, compress2rs

AIG rewriting for delayAIG rewriting for delay

Scripts Scripts dc2, resyn2dc2, resyn2
Scripts Scripts &syn2, &synch2&syn2, &synch2

High-effort delay optimizationHigh-effort delay optimization

Perform SOP balancing (Perform SOP balancing (st; if –g –K 6st; if –g –K 6))
Follow up with area-recovery (Follow up with area-recovery (resyn2resyn2) and technology ) and technology
mapping (mapping (map, amap, ifmap, amap, if))

Iterate, if neededIterate, if needed

77
Logic Synthesis for PLAsLogic Synthesis for PLAs

Enter PLA (.type fd) into ABC using Enter PLA (.type fd) into ABC using readread

Perform logic sharing extraction using Perform logic sharing extraction using fxfx

If If fxfx is complaining that individual covers are not prime and is complaining that individual covers are not prime and
irredundant, try irredundant, try bdd; sop; fxbdd; sop; fx

After After fxfx, , convert shared logic into AIG and continue AIG-convert shared logic into AIG and continue AIG-
based synthesis and mapping if neededbased synthesis and mapping if needed

Consider using high-effort synthesis with don’t-caresConsider using high-effort synthesis with don’t-cares

First map into 6-LUTs (First map into 6-LUTs (if –K 6; psif –K 6; ps), optimize (), optimize (mfs2mfs2), synthesize ), synthesize
with choices (with choices (st; dchst; dch) and map into 6-LUTs () and map into 6-LUTs (if –K 6; psif –K 6; ps))

Iterate until no improvement, then remap into target technologyIterate until no improvement, then remap into target technology

To find description of PLA format, google for “Espresso To find description of PLA format, google for “Espresso
PLA format”, for example:PLA format”, for example:

http://www.ecs.umass.edu/ece/labs/vlsicad/ece667/links/http://www.ecs.umass.edu/ece/labs/vlsicad/ece667/links/
espresso.5.htmlespresso.5.html

88
Technology Mapping for SCsTechnology Mapping for SCs

Read library usingRead library using
read_genlibread_genlib (for libraries in GENLIB format) (for libraries in GENLIB format)
read_libertyread_liberty (for libraries in Liberty format)(for libraries in Liberty format)

For standard-cellsFor standard-cells

mapmap: Boolean matching, delay-oriented, cells up to 5 inputs: Boolean matching, delay-oriented, cells up to 5 inputs
amapamap: structural mapping, area-oriented, cells up to 15 inputs: structural mapping, area-oriented, cells up to 15 inputs

If Liberty library is used, run If Liberty library is used, run topotopo followed by followed by
stimestime (accurate timing analysis) (accurate timing analysis)

bufferbuffer (buffering) (buffering)
upsize; dnsizeupsize; dnsize (gate sizing)(gate sizing)

Structural choices are an important way of improving Structural choices are an important way of improving
mapping (both area and delay)mapping (both area and delay)

Run Run st; dchst; dch before calling before calling mapmap or or amapamap

99
Technology Mapping for LUTsTechnology Mapping for LUTs

It is suggested to use mapper It is suggested to use mapper if –K <num>if –K <num>

For area-oriented mapping, try For area-oriented mapping, try if -aif -a

For delay-oriented mapping, try delay-oriented AIG-For delay-oriented mapping, try delay-oriented AIG-
based synthesis with structural choicesbased synthesis with structural choices

Structural choices are an important way of Structural choices are an important way of
improving mapping (both area and delay)improving mapping (both area and delay)

Run Run st; dchst; dch before calling before calling ifif

1010
Sequential SynthesisSequential Synthesis

Uses reachable state information to further Uses reachable state information to further
improve the quality of resultsimprove the quality of results

Reachable states are often approximatedReachable states are often approximated

Types of AIG-based sequential synthesisTypes of AIG-based sequential synthesis

Retiming (Retiming (retimeretime, , dretimedretime, etc), etc)

Detecting and merging sequential equivalences Detecting and merging sequential equivalences
((lcorr, scorr, &scorrlcorr, scorr, &scorr, etc), etc)
Negative experiencesNegative experiences

Sequential redundancy removal is often hardSequential redundancy removal is often hard
Using sequential don’t-cares in combinational Using sequential don’t-cares in combinational
synthesis typically gives a very small improvementsynthesis typically gives a very small improvement

1111
VerificationVerification

Combinational verificationCombinational verification

r <file1>; cec <file2>r <file1>; cec <file2> (small/medium circuits) (small/medium circuits)

&r <file1.aig>; &cec <file2.aig>&r <file1.aig>; &cec <file2.aig> (large circuits) (large circuits)

Sequential verificationSequential verification
r <file1>; dsec <file2>r <file1>; dsec <file2>

Running Running ceccec or or dsecdsec any time in a synthesis flow any time in a synthesis flow
compares the current network against its speccompares the current network against its spec

The spec is the circuit obtained from the original fileThe spec is the circuit obtained from the original file

Verification and synthesis are closely related and Verification and synthesis are closely related and
should be co-developedshould be co-developed

1212
OutlineOutline

Basic levelBasic level

Boolean calculator and visualizerBoolean calculator and visualizer

Standard commands and scriptsStandard commands and scripts

Advanced levelAdvanced level

KeyKey packages and data-structurespackages and data-structures

Ways to improve runtime and memory usageWays to improve runtime and memory usage

Future research directionsFuture research directions

1313
Key PackagesKey Packages

AIG packageAIG package

Technology-independent synthesisTechnology-independent synthesis

Technology mappersTechnology mappers

SAT solverSAT solver

Combinational equivalence checkingCombinational equivalence checking

Sequential synthesisSequential synthesis

Sequential verification engine IC3/PDRSequential verification engine IC3/PDR

1414
Key PackagesKey Packages

AIG packageAIG package

Technology-independent synthesisTechnology-independent synthesis

Technology mappersTechnology mappers

SAT solverSAT solver

Combinational equivalence checkingCombinational equivalence checking

Sequential synthesisSequential synthesis

Sequential verification engine IC3/PDRSequential verification engine IC3/PDR

1515
And-Inverter Graph (AIG)And-Inverter Graph (AIG)
cdcd
abab
0000010111111010
00000000 1100
01010000 1111
11110011 1100
10100000 1100
F(a,b,c,d) = ab + d(a!c+bc)
F(a,b,c,d) = a!c(b+d) + bc(a+d)
cdcd
abab
0000010111111010
00000000 1100
01010000 1111
11110011 1100
10100000 1100
6 nodes
4 levels
7 nodes
3 levels
bcac
abd
acbdbcad
AIG is a Boolean network composed of two-input ANDs and invertersAIG is a Boolean network composed of two-input ANDs and inverters

1616
Components of Efficient AIG PackageComponents of Efficient AIG Package

Structural hashingStructural hashing

Leads to a compact representationLeads to a compact representation

Is applied during AIG constructionIs applied during AIG construction

Propagates constantsPropagates constants

Makes each node structurally uniqueMakes each node structurally unique

Complemented edgesComplemented edges

Represents inverters as attributes on the edgesRepresents inverters as attributes on the edges

Leads to fast, uniform manipulationLeads to fast, uniform manipulation

Does not use memory for invertersDoes not use memory for inverters

Increases logic sharing using DeMorgan’s rule Increases logic sharing using DeMorgan’s rule

Memory allocationMemory allocation

Uses fixed amount of memory for each nodeUses fixed amount of memory for each node

Can be done by a custom memory managerCan be done by a custom memory manager

Even dynamic fanout can be implemented this wayEven dynamic fanout can be implemented this way

Allocates memory for nodes in a topological orderAllocates memory for nodes in a topological order

Optimized for traversal using this topological orderOptimized for traversal using this topological order

Small static memory footprint for many applicationsSmall static memory footprint for many applications

Computes fanout information on demandComputes fanout information on demand
ab
c d
ab
c d
Without hashingWithout hashing
With hashingWith hashing

1717
““Minimalistic” AIG PackageMinimalistic” AIG Package

Designed to minimize memory requirements Designed to minimize memory requirements

Baseline: 8 bytes/node for AIGs (works up to 2 billion nodes)Baseline: 8 bytes/node for AIGs (works up to 2 billion nodes)

Structural hashing: +8 bytes/nodeStructural hashing: +8 bytes/node

Logic level information: +4 bytes/nodeLogic level information: +4 bytes/node

Simulation information: +8 bytes/node for 64 patternsSimulation information: +8 bytes/node for 64 patterns

Each node attribute is stored in a separate arrayEach node attribute is stored in a separate array

No “Aig_Node” structNo “Aig_Node” struct

Attributes are allocated and deallocated on demandAttributes are allocated and deallocated on demand

Helps improve locality of computationHelps improve locality of computation

Very useful to large AIG (100M nodes and more)Very useful to large AIG (100M nodes and more)

Maintaining minimum memory footprint for basic tasks, while Maintaining minimum memory footprint for basic tasks, while
allowing the AIG package to have several optional built-in featuresallowing the AIG package to have several optional built-in features

Structural hashingStructural hashing

Bit-parallel simulationBit-parallel simulation

Circuit-based SAT solvingCircuit-based SAT solving

1818
Key PackagesKey Packages

AIG packageAIG package

Technology-independent synthesisTechnology-independent synthesis

Technology mappersTechnology mappers

SAT solverSAT solver

Combinational equivalence checkingCombinational equivalence checking

Sequential synthesisSequential synthesis

Sequential verification engine IC3/PDRSequential verification engine IC3/PDR

1919
SAT SolverSAT Solver

Modern SAT solvers are practicalModern SAT solvers are practical

A modern solver is a treasure-trove of tricks for A modern solver is a treasure-trove of tricks for
efficient implementation efficient implementation

To mentions just a fewTo mentions just a few

Representing clauses as arrays of integersRepresenting clauses as arrays of integers

Using signatures to check clause containmentUsing signatures to check clause containment

Using two-literal watching schemeUsing two-literal watching scheme

etcetc

2020
What is Missing in a SAT Solver? What is Missing in a SAT Solver?
(from the point of view of logic synthesis)(from the point of view of logic synthesis)

Modern SAT solvers are geared to solving hard problems from SAT Modern SAT solvers are geared to solving hard problems from SAT
competitions or hard verification instances (1 problem ~ 15 min)competitions or hard verification instances (1 problem ~ 15 min)

This motivates elaborate data-structures and high memory usageThis motivates elaborate data-structures and high memory usage

64 bytes/variable; 16 bytes/clause; 4 bytes/literal64 bytes/variable; 16 bytes/clause; 4 bytes/literal

In logic synthesis, runtime of many applications is dominated by SATIn logic synthesis, runtime of many applications is dominated by SAT

SAT sweeping, sequential synthesis, computing structural choices, etcSAT sweeping, sequential synthesis, computing structural choices, etc

The SAT problems solved in these applications areThe SAT problems solved in these applications are

Incremental (+/- 10 AIG nodes, compared to a previous problem)Incremental (+/- 10 AIG nodes, compared to a previous problem)

Relatively easy (less than 10 conflicts)Relatively easy (less than 10 conflicts)

Numerous (100K-1M problems in one run)Numerous (100K-1M problems in one run)

For these appliactions, a new circuit-based SAT solver can be For these appliactions, a new circuit-based SAT solver can be
developed (abc/src/aig/gia/giaCSat.c)developed (abc/src/aig/gia/giaCSat.c)

2121
Experimental ResultsExperimental Results
abc 01> &r corrsrm06.aig; &sat -v -C 100
CO = 98192 AND = 544369 Conf = 100 MinVar = 2000 MinCalls = 200
Unsat calls 32294 ( 32.89 %) Ave conf = 4.6 Time = 2.12 sec ( 15.35 %)
Sat calls 65540 ( 66.75 %) Ave conf = 0.6 Time = 9.38 sec ( 67.82 %)
Undef calls 358 ( 0.36 %) Ave conf = 101.6 Time = 0.98 sec ( 7.08 %)
Total time = 13.83 sec
abc 01> &r corrsrm06.aig; &sat -vc -C 100
CO = 98192 AND = 544369 Conf = 100 JustMax = 100
Unsat calls 31952 ( 32.54 %) Ave conf = 3.3 Time = 0.12 sec ( 14.51 %)
Sat calls 65501 ( 66.71 %) Ave conf = 0.3 Time = 0.42 sec ( 52.77 %)
Undef calls 739 ( 0.75 %) Ave conf = 102.3 Time = 0.20 sec ( 24.48 %)
Total time = 0.80 sec

Well-tuned version based on MiniSATWell-tuned version based on MiniSAT
Version based on circuit-based solverVersion based on circuit-based solver

2222
Why MiniSAT Is Slower?Why MiniSAT Is Slower?

Requires multiple intermediate stepsRequires multiple intermediate steps

Window Window  AIG AIG  CNF CNF  Solving Solving
Instead ofInstead of Window Window  Solving Solving

Generates counter examples in the form ofGenerates counter examples in the form of

Complete assignment of primary inputsComplete assignment of primary inputs
Instead of Instead of Partial assignment of primary inputs Partial assignment of primary inputs
Uses too much memoryUses too much memory
Solver + CNF = 140 bytes / AIG nodeSolver + CNF = 140 bytes / AIG node

Instead ofInstead of 8-16 bytes / AIG node 8-16 bytes / AIG node

Decision heuristicsDecision heuristics
Is not aware of the circuit structureIs not aware of the circuit structure
Instead ofInstead of Using circuit information Using circuit information

2323
General Guidelines for Improving General Guidelines for Improving
Speed and Memory Usage Speed and Memory Usage

Minimize memory usageMinimize memory usage

Use integers instead of pointersUse integers instead of pointers

Recycle memory whenever possibleRecycle memory whenever possible
especially if memory is split into chunks of the same sizeespecially if memory is split into chunks of the same size

Use book-keeping to avoid useless computationUse book-keeping to avoid useless computation

Windowing, local fanout, event-driven simulation Windowing, local fanout, event-driven simulation

If application is important, design custom If application is important, design custom
specialized data-structuresspecialized data-structures

Typically the overhead to covert to the custom data-Typically the overhead to covert to the custom data-
structure is negligible, compared to the runtime saved structure is negligible, compared to the runtime saved
by using itby using it

2424
OutlineOutline

Basic levelBasic level

Boolean calculator and visualizerBoolean calculator and visualizer

Standard commands and scriptsStandard commands and scripts

Advanced levelAdvanced level

Key packages and data-structuresKey packages and data-structures

Ways to improve runtime and memory usageWays to improve runtime and memory usage

Future research directionsFuture research directions

2525
Research DirectionsResearch Directions

OngoingOngoing

Deep integration of simulation and SATDeep integration of simulation and SAT

Word-level optimizations (e.g. memory abstraction)Word-level optimizations (e.g. memory abstraction)

Logic synthesis for machine learningLogic synthesis for machine learning
As opposed to machine learning for logic synthesis!As opposed to machine learning for logic synthesis!

Near futureNear future

Delay-oriented word-level to AIG transformationDelay-oriented word-level to AIG transformation

Fast (SAT-based) placement (and routing)Fast (SAT-based) placement (and routing)
Hopefully, some dayHopefully, some day

Improved Verilog interfaceImproved Verilog interface

2626
ConclusionsConclusions

If you have patience and time to figure it out, If you have patience and time to figure it out,
ABC can be very usefulABC can be very useful

Do not hesitate to contact me if you have any Do not hesitate to contact me if you have any
questions or ideas questions or ideas

Consider contributing something that could be Consider contributing something that could be
helpful for others, for examplehelpful for others, for example

the code used in your paperthe code used in your paper

your course projectyour course project

2727
Contributors to ABCContributors to ABC

Fabio Somenzi (U Colorado, Boulder) - Fabio Somenzi (U Colorado, Boulder) - BDD package CUDDBDD package CUDD

Niklas Sorensson, Niklas Een (Chalmers U, Sweden) - Niklas Sorensson, Niklas Een (Chalmers U, Sweden) - MiniSAT v. 1.4 (2005)MiniSAT v. 1.4 (2005)

Gilles Audemard, Laurent Simon (U Artois, U Paris Sud, France) Gilles Audemard, Laurent Simon (U Artois, U Paris Sud, France) -- Glucose 3.0Glucose 3.0

Hadi Katebi, Igor Markov (U Michigan) - Hadi Katebi, Igor Markov (U Michigan) - Boolean matching for CECBoolean matching for CEC

Jake Nasikovsky - Jake Nasikovsky - Fast truth table manipulationFast truth table manipulation

Wenlong Yang (Fudan U, China) - Wenlong Yang (Fudan U, China) - Lazy man’s synthesisLazy man’s synthesis

Zyad Hassan (U Colorado, Boulder) - Zyad Hassan (U Colorado, Boulder) - Improved generalization in IC3/PDRImproved generalization in IC3/PDR

Augusto Neutzling, Jody Matos, Andre Reis (UFRGS, Brazil) - Augusto Neutzling, Jody Matos, Andre Reis (UFRGS, Brazil) - Technology Technology
mapping into threshold functionsmapping into threshold functions

Mayler Martins. Vinicius Callegaro, Andre Reis (UFRGS, Brazil) – Mayler Martins. Vinicius Callegaro, Andre Reis (UFRGS, Brazil) – Boolean Boolean
decomposition using read-polarity-once (RPO) functiondecomposition using read-polarity-once (RPO) function

Mathias Soeken, EPFL - Mathias Soeken, EPFL - Exact logic synthesisExact logic synthesis

Ana Petkovska, EPFL – Ana Petkovska, EPFL – Hierarchical NPN matchingHierarchical NPN matching

Bruno Schmitt (UFRGS / EPFL) - Bruno Schmitt (UFRGS / EPFL) - Fast-extract with cube hashingFast-extract with cube hashing

Xuegong Zhou, Lingli Wang (Fudan U, China) - Xuegong Zhou, Lingli Wang (Fudan U, China) - NPN classificationNPN classification

Yukio Miyasaka, Masahiro Fujita (U Tokyo, Japan) - Yukio Miyasaka, Masahiro Fujita (U Tokyo, Japan) - Custom BDD package for Custom BDD package for
multiplier verificationmultiplier verification

Siang-Yun Lee, Roland Jiang (NTU, Taiwan) - Siang-Yun Lee, Roland Jiang (NTU, Taiwan) - Dumping libraries of minimum Dumping libraries of minimum
circuits for functions up to five input variablescircuits for functions up to five input variables

2828
ABC Resources ABC Resources

Source code Source code

https://github.com/berkeley-abc/abchttps://github.com/berkeley-abc/abc

““Getting started with ABC”, a tutorial by Ana PetkovskaGetting started with ABC”, a tutorial by Ana Petkovska

https://www.dropbox.com/s/qrl9svlf0ylxy8p/ https://www.dropbox.com/s/qrl9svlf0ylxy8p/
ABC_GettingStarted.pdfABC_GettingStarted.pdf
An overview paper: An overview paper: R. Brayton and A. Mishchenko, "ABC: R. Brayton and A. Mishchenko, "ABC:
An academic industrial-strength verification tool", Proc. An academic industrial-strength verification tool", Proc.
CAV'10.CAV'10.

hhttp://www.eecs.berkeley.edu/~alanmi/publications/ttp://www.eecs.berkeley.edu/~alanmi/publications/
2010/cav10_abc.pdf2010/cav10_abc.pdf

Windows binaryWindows binary

http://www.eecs.berkeley.edu/~alanmi/abc/abc.exehttp://www.eecs.berkeley.edu/~alanmi/abc/abc.exe

http://www.eecs.berkeley.edu/~alanmi/abc/abc.rchttp://www.eecs.berkeley.edu/~alanmi/abc/abc.rc

2929
AbstractAbstract

The talk presents ABC on three levels. The talk presents ABC on three levels.

On the basic level, ABC is discussed in general, On the basic level, ABC is discussed in general,
what it has to offer for different users, and what what it has to offer for different users, and what
are the most important computations and are the most important computations and
commands. commands.

On the advanced level, there is an overview of On the advanced level, there is an overview of
different ABC packages and the lessons learned different ABC packages and the lessons learned
while developing them, as well as an in-depth while developing them, as well as an in-depth
look into the important data-structures and coding look into the important data-structures and coding
patterns that make ABC fast and efficient. patterns that make ABC fast and efficient.

Finally, there is an overview of future research Finally, there is an overview of future research
efforts and an invitation for contributions. efforts and an invitation for contributions.
Tags