readme 4.69 KB
Newer Older
Alan Mishchenko committed
1
ABC: System for Sequential Logic Synthesis and Formal Verification
Alan Mishchenko committed
2 3 4 5 6 7 8 9 10 11 12 13

ABC is always changing but the current snapshot is believed to be stable. 

Compiling:

To compile ABC as a binary, download and unzip the code, then type "make".

To compile ABC as a static library, comment out #define _LIB in file 
"src/base/main/main.c", then type "make libabc.a".

When ABC is used as a static library, two additional procedures, Abc_Start() 
and Abc_Stop(), are provided for starting and quitting the ABC framework in 
Alan Mishchenko committed
14
the calling application. A simple demo program (file src/demo.c) shows how to 
Alan Mishchenko committed
15 16 17
create a stand-alone program performing DAG-aware AIG rewriting, by calling 
APIs of ABC compiled as a static library.

Alan Mishchenko committed
18
To build the demo program
Alan Mishchenko committed
19
- Copy demo.cc and libabc.a to the working directory
Alan Mishchenko committed
20
- Run "gcc -Wall -g -c demo.c -o demo.o"
Alan Mishchenko committed
21 22
- Run "gcc -g -o demo demo.o libabc.a -lm -ldl -rdynamic -lreadline -ltermcap -lpthread"

Alan Mishchenko committed
23
To run the demo program, give it a file with the logic network in AIGER or BLIF. For example:
Alan Mishchenko committed
24

Alan Mishchenko committed
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
> [alanmi@mima] ~/abc> demo i10.aig
> i10          : i/o =  257/  224  lat =    0  and =   2396  lev = 37
> i10          : i/o =  257/  224  lat =    0  and =   1851  lev = 35
> Networks are equivalent.
> Reading =   0.00 sec   Rewriting =   0.18 sec   Verification =   0.41 sec

The same can be produced by running the binary in the command-line mode:

> [alanmi@mima] ~/abc> ./abc
> UC Berkeley, ABC 1.01 (compiled Oct  6 2012 19:05:18)
> abc 01> r i10.aig; b; ps; b; rw -l; rw -lz; b; rw -lz; b; ps; cec
> i10          : i/o =  257/  224  lat =    0  and =   2396  lev = 37
> i10          : i/o =  257/  224  lat =    0  and =   1851  lev = 35
> Networks are equivalent.

or in the batch mode:

> [alanmi@mima] ~/abc> ./abc -c "r i10.aig; b; ps; b; rw -l; rw -lz; b; rw -lz; b; ps; cec"
> ABC command line: "r i10.aig; b; ps; b; rw -l; rw -lz; b; rw -lz; b; ps; cec".
> i10          : i/o =  257/  224  lat =    0  and =   2396  lev = 37
> i10          : i/o =  257/  224  lat =    0  and =   1851  lev = 35
> Networks are equivalent.
Alan Mishchenko committed
47

Alan Mishchenko committed
48 49 50 51


Compiling as C or C++

Alan Mishchenko committed
52
The current version of ABC can be compiled with C compiler or C++ compiler.
Alan Mishchenko committed
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77

To compile as C code (default): make sure that CC=gcc and ABC_NAMESPACE is not defined.
To compile as C++ code without namespaces: make sure that CC=g++ and ABC_NAMESPACE is not defined.
To compile as C++ code with namespaces: make sure that CC=g++ and ABC_NAMESPACE is set to
the name of the requested namespace. For example, add to OPTFLAGS -DABC_NAMESPACE=xxx


Bug reporting:

Please try to reproduce all the reported bugs and unexpected features using the latest 
version of ABC available from https://bitbucket.org/alanmi/abc/

If the bug still persists, please provide the following information:    
1. ABC version (when it was downloaded from BitBucket)
2. Linux distribution and version (32-bit or 64-bit)
3. The exact command-line and error message when trying to run the tool
4. The output of the 'ldd' command run on the exeutable (e.g. 'ldd abc').
5. Versions of relevant tools or packages used.


Trouble shooting:

(1) If compilation does not start because of the cyclic dependency check, 
try touching all files as follows:    find ./ -type f -exec touch "{}" \;

Alan Mishchenko committed
78 79
(2) If compilation fails because readline is missing, install 'readline' library or
comment out line 26 "#define ABC_USE_READLINE" in file "src/base/main/mainUtils.c"
Alan Mishchenko committed
80

Alan Mishchenko committed
81
(4) If compilation fails because pthreads are missing, install 'pthread' library or
Alan Mishchenko committed
82 83
comment out line 29 "#define ABC_USE_PTHREADS" in file "src/base/cmd/cmdStarter.c" 
and in file "src/proof/abs/absPth.c"
Alan Mishchenko committed
84

Alan Mishchenko committed
85 86 87
(5) If compilation fails in file "src/base/main/libSupport.c", try the following:
- Remove "src/base/main/libSupport.c" from "src/base/main/module.make"
- Comment out calls to Libs_Init() and Libs_End() in "src/base/main/mainInit.c"
88

Alan Mishchenko committed
89 90
(6) On some systems, readline requires adding '-lcurses' to Makefile.

91 92 93

The following comment was added by Krish Sundaresan:

Alan Mishchenko committed
94 95 96 97 98 99 100 101 102 103
"I found that the code does compile correctly on Solaris if gcc is used (instead of 
g++ that I was using for some reason). Also readline which is not available by default 
on most Sol10 systems, needs to be installed. I downloaded the readline-5.2 package 
from sunfreeware.com and installed it locally. Also modified CFLAGS to add the local 
include files for readline and LIBS to add the local libreadline.a. Perhaps you can 
add these steps in the readme to help folks compiling this on Solaris."


Final remarks:

Alan Mishchenko committed
104
Unfortunately, there is no comprehensive regression test. Good luck!                                
Alan Mishchenko committed
105 106


Alan Mishchenko committed
107 108
This system is maintained by Alan Mishchenko <alanmi@eecs.berkeley.edu>. Consider also 
using ZZ framework developed by Niklas Een: https://bitbucket.org/niklaseen/abc-zz
Alan Mishchenko committed
109 110

This file was last modified on Oct 6, 2012