How berkeley-abc/abc works
Project Type and Purpose
• ABC is a monolithic, performance‐oriented C/C++ system for sequential logic synthesis and formal verification.
• It exposes both a command‐line interface (“abc” binary) and a static/shared library API (Abc_Start(), Abc_Stop()).
• It ingests hardware description formats (AIGER, BLIF, Verilog, SMT, etc.), applies synthesis/optimization/verification passes, and emits reports or transformed netlists.
Top-Level Components
a. Front-End Interfaces
• Command-Line Client (src/base/main, starter.c)
• Demo Application (src/demo.c)
• Static Library API (Abc_Start(), Abc_Stop())
b. Core Engine
• Main Dispatcher (main.c, cmd.c)
• Data Structures & Managers (AIG, BDD, PLA, Verilog representations in src/aig, src/bdd, src/base/pla, src/base/ver)
c. Algorithm Modules
• Logic Rewriting & Optimization (src/aig/*, src/opt/*)
• Technology Mapping (src/map/*)
• Verification & Proof (src/proof/*, src/sat/*)
• Timing, Placement & Routing Helpers (src/phys/*)
d. I/O & Utilities
• File Readers/Writers (src/base/io, ioRead*/ioWrite*)
• Parsing & Formats (BLIF, AIGER, SMT, Verilog modules)
• Miscellaneous Libraries (src/misc/*: zlib, bzip2, hash tables, vectors, parse utilities)
e. External Dependencies
• pthreads (lib/pthread*), readline, math (-lm), dynamic loader (-ldl)
Relationships & Data Flow
• User issues a command or calls the API → Front-End
• Front-End invokes Core Dispatcher → loads input via I/O module → builds in-memory network (AIG/BDD)
• Core Dispatcher schedules passes in Algorithm Modules
• Each pass reads/modifies the in-memory model, possibly invoking SAT/BMC in src/sat or proof engines in src/proof
• Results fed back to Core Dispatcher → written out by I/O module or reported to user
Architectural Patterns & Principles
• Plugin-like module.make system: each module registers its commands and callbacks at init time
• Separation of concerns: I/O layer, core data structures, algorithmic modules, external solver interfaces
• Incremental extension: new passes can be dropped into src/opt or src/map and hooked via module.make