Skip to content

Commit

Permalink
Merge pull request verilog-to-routing#2388 from CAS-Atlantic/ABC-Update
Browse files Browse the repository at this point in the history
ABC Version Update
  • Loading branch information
vaughnbetz authored Nov 12, 2023
2 parents dfa58c1 + 48eda6c commit 2e17646
Show file tree
Hide file tree
Showing 599 changed files with 103,380 additions and 6,603 deletions.
7 changes: 6 additions & 1 deletion abc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.3.0...3.13) # ! This line is edited to get rid of a CMake deprecation error
cmake_minimum_required(VERSION 3.3.0...3.13) # ! This line is edited to get rid of a CMake deprecation error

include(CMakeParseArguments)
include(CheckCCompilerFlag)
Expand Down Expand Up @@ -47,9 +47,14 @@ if(ABC_USE_NAMESPACE)
set(ABC_USE_NAMESPACE_FLAGS "ABC_USE_NAMESPACE=${ABC_USE_NAMESPACE}")
endif()

if( APPLE )
set(make_env ${CMAKE_COMMAND} -E env SDKROOT=${CMAKE_OSX_SYSROOT})
endif()

# run make to extract compiler options, linker options and list of source files
execute_process(
COMMAND
${make_env}
make
${ABC_READLINE_FLAGS}
${ABC_USE_NAMESPACE_FLAGS}
Expand Down
26 changes: 16 additions & 10 deletions abc/Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@

CC := gcc
CXX := g++
AR := ar
LD := $(CXX)

MSG_PREFIX ?=
ABCSRC = .

$(info $(MSG_PREFIX)Using CC=$(CC))
$(info $(MSG_PREFIX)Using CXX=$(CXX))
$(info $(MSG_PREFIX)Using AR=$(AR))
$(info $(MSG_PREFIX)Using LD=$(LD))

PROG := abc
Expand All @@ -16,7 +18,7 @@ OS := $(shell uname -s)
MODULES := \
$(wildcard src/ext*) \
src/base/abc src/base/abci src/base/cmd src/base/io src/base/main src/base/exor \
src/base/ver src/base/wlc src/base/acb src/base/bac src/base/cba src/base/pla src/base/test \
src/base/ver src/base/wlc src/base/wln src/base/acb src/base/bac src/base/cba src/base/pla src/base/test \
src/map/mapper src/map/mio src/map/super src/map/if \
src/map/amap src/map/cov src/map/scl src/map/mpm \
src/misc/extra src/misc/mvc src/misc/st src/misc/util src/misc/nm \
Expand All @@ -25,7 +27,7 @@ MODULES := \
src/opt/cut src/opt/fxu src/opt/fxch src/opt/rwr src/opt/mfs src/opt/sim \
src/opt/ret src/opt/fret src/opt/res src/opt/lpk src/opt/nwk src/opt/rwt \
src/opt/cgt src/opt/csw src/opt/dar src/opt/dau src/opt/dsc src/opt/sfm src/opt/sbd \
src/sat/bsat src/sat/xsat src/sat/satoko src/sat/csat src/sat/msat src/sat/psat src/sat/cnf src/sat/bmc src/sat/glucose \
src/sat/bsat src/sat/xsat src/sat/satoko src/sat/csat src/sat/msat src/sat/psat src/sat/cnf src/sat/bmc src/sat/glucose src/sat/glucose2 \
src/bool/bdc src/bool/deco src/bool/dec src/bool/kit src/bool/lucky \
src/bool/rsb src/bool/rpo \
src/proof/pdr src/proof/abs src/proof/live src/proof/ssc src/proof/int \
Expand Down Expand Up @@ -59,9 +61,9 @@ ifneq ($(findstring arm,$(shell uname -m)),)
CFLAGS += -DABC_MEMALIGN=4
endif

# compile ABC using the C++ comipler and put everything in the namespace $(ABC_NAMESPACE)
# compile ABC using the C++ compiler and put everything in the namespace $(ABC_NAMESPACE)
ifdef ABC_USE_NAMESPACE
CFLAGS += -DABC_NAMESPACE=$(ABC_USE_NAMESPACE) -fpermissive
CFLAGS += -DABC_NAMESPACE=$(ABC_USE_NAMESPACE) -fpermissive -x c++
CC := $(CXX)
$(info $(MSG_PREFIX)Compiling in namespace $(ABC_NAMESPACE))
endif
Expand Down Expand Up @@ -119,11 +121,16 @@ GCC_MINOR=$(word 2,$(subst .,$(space),$(GCC_VERSION)))

$(info $(MSG_PREFIX)Found GCC_VERSION $(GCC_VERSION))
ifeq ($(findstring $(GCC_MAJOR),0 1 2 3),)
$(info $(MSG_PREFIX)Found GCC_MAJOR>=4)
ifeq ($(GCC_MAJOR),4)
$(info $(MSG_PREFIX)Found GCC_MAJOR==4)
ifeq ($(findstring $(GCC_MINOR),0 1 2 3 4 5),)
$(info $(MSG_PREFIX)Found GCC_MINOR>=6)
CFLAGS += -Wno-unused-but-set-variable
endif
else
$(info $(MSG_PREFIX)Found GCC_MAJOR>=5)
CFLAGS += -Wno-unused-but-set-variable
endif
endif

endif
Expand Down Expand Up @@ -179,15 +186,15 @@ DEP := $(OBJ:.o=.d)

%.d: %.c
@echo "$(MSG_PREFIX)\`\` Generating dependency:" $(LOCAL_PATH)/$<
$(VERBOSE)$(ABCSRC)/depends.sh $(CC) `dirname $*.c` $(OPTFLAGS) $(INCLUDES) $(CFLAGS) $< > $@
$(VERBOSE)$(ABCSRC)/depends.sh "$(CC)" `dirname $*.c` $(OPTFLAGS) $(INCLUDES) $(CFLAGS) $< > $@

%.d: %.cc
@echo "$(MSG_PREFIX)\`\` Generating dependency:" $(LOCAL_PATH)/$<
$(VERBOSE)$(ABCSRC)/depends.sh $(CXX) `dirname $*.cc` $(OPTFLAGS) $(INCLUDES) $(CXXFLAGS) $< > $@
$(VERBOSE)$(ABCSRC)/depends.sh "$(CXX)" `dirname $*.cc` $(OPTFLAGS) $(INCLUDES) $(CXXFLAGS) $< > $@

%.d: %.cpp
@echo "$(MSG_PREFIX)\`\` Generating dependency:" $(LOCAL_PATH)/$<
$(VERBOSE)$(ABCSRC)/depends.sh $(CXX) `dirname $*.cpp` $(OPTFLAGS) $(INCLUDES) $(CXXFLAGS) $< > $@
$(VERBOSE)$(ABCSRC)/depends.sh "$(CXX)" `dirname $*.cpp` $(OPTFLAGS) $(INCLUDES) $(CXXFLAGS) $< > $@

ifndef ABC_MAKE_NO_DEPS
-include $(DEP)
Expand All @@ -210,8 +217,7 @@ $(PROG): $(OBJ)

lib$(PROG).a: $(LIBOBJ)
@echo "$(MSG_PREFIX)\`\` Linking:" $(notdir $@)
$(VERBOSE)ar rv $@ $?
$(VERBOSE)ranlib $@
$(VERBOSE)$(AR) rsv $@ $?

lib$(PROG).so: $(LIBOBJ)
@echo "$(MSG_PREFIX)\`\` Linking:" $(notdir $@)
Expand Down
21 changes: 17 additions & 4 deletions abc/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,22 @@
[![Build Status](https://travis-ci.org/berkeley-abc/abc.svg?branch=master)](https://travis-ci.org/berkeley-abc/abc)
[![Build status](https://ci.appveyor.com/api/projects/status/7q8gopidgvyos00d?svg=true)](https://ci.appveyor.com/project/berkeley-abc/abc)
[![.github/workflows/build-posix.yml](https://github.com/berkeley-abc/abc/actions/workflows/build-posix.yml/badge.svg)](https://github.com/berkeley-abc/abc/actions/workflows/build-posix.yml)
[![.github/workflows/build-windows.yml](https://github.com/berkeley-abc/abc/actions/workflows/build-windows.yml/badge.svg)](https://github.com/berkeley-abc/abc/actions/workflows/build-windows.yml)
[![.github/workflows/build-posix-cmake.yml](https://github.com/berkeley-abc/abc/actions/workflows/build-posix-cmake.yml/badge.svg)](https://github.com/berkeley-abc/abc/actions/workflows/build-posix-cmake.yml)

# ABC: System for Sequential Logic Synthesis and Formal Verification

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

## ABC fork with new features

Here is a [fork](https://github.com/yongshiwo/abc.git) of ABC containing Agdmap, a novel technology mapper for LUT-based FPGAs. Agdmap is based on a technology mapping algorithm with adaptive gate decomposition [1]. It is a cut enumeration based mapping algorithm with bin packing for simultaneous wide gate decomposition, which is a patent pending technology.

The mapper is developed and maintained by Longfei Fan and Prof. Chang Wu at Fudan University in Shanghai, China. The experimental results presented in [1] indicate that Agdmap can substantially improve area (by 10% or more) when compared against the best LUT mapping solutions in ABC, such as command "if".

The source code is provided for research and evaluation only. For commercial usage, please contact Prof. Chang Wu at [email protected].

References:

[1] L. Fan and C. Wu, "FPGA technology mapping with adaptive gate decompostion", ACM/SIGDA FPGA International Symposium on FPGAs, 2023.

## Compiling:

Expand All @@ -18,7 +31,7 @@ APIs of ABC compiled as a static library.

To build the demo program

* Copy demo.cc and libabc.a to the working directory
* Copy demo.c and libabc.a to the working directory
* Run `gcc -Wall -g -c demo.c -o demo.o`
* Run `g++ -g -o demo demo.o libabc.a -lm -ldl -lreadline -lpthread`

Expand Down
2 changes: 2 additions & 0 deletions abc/abc.rc
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,9 @@ alias src_rw "st; rw -l; rwz -l; rwz -l"
alias src_rs "st; rs -K 6 -N 2 -l; rs -K 9 -N 2 -l; rs -K 12 -N 2 -l"
alias src_rws "st; rw -l; rs -K 6 -N 2 -l; rwz -l; rs -K 9 -N 2 -l; rwz -l; rs -K 12 -N 2 -l"
alias resyn2rs "b; rs -K 6; rw; rs -K 6 -N 2; rf; rs -K 8; b; rs -K 8 -N 2; rw; rs -K 10; rwz; rs -K 10 -N 2; b; rs -K 12; rfz; rs -K 12 -N 2; rwz; b"
alias r2rs "b; rs -K 6; rw; rs -K 6 -N 2; rf; rs -K 8; b; rs -K 8 -N 2; rw; rs -K 10; rwz; rs -K 10 -N 2; b; rs -K 12; rfz; rs -K 12 -N 2; rwz; b"
alias compress2rs "b -l; rs -K 6 -l; rw -l; rs -K 6 -N 2 -l; rf -l; rs -K 8 -l; b -l; rs -K 8 -N 2 -l; rw -l; rs -K 10 -l; rwz -l; rs -K 10 -N 2 -l; b -l; rs -K 12 -l; rfz -l; rs -K 12 -N 2 -l; rwz -l; b -l"
alias c2rs "b -l; rs -K 6 -l; rw -l; rs -K 6 -N 2 -l; rf -l; rs -K 8 -l; b -l; rs -K 8 -N 2 -l; rw -l; rs -K 10 -l; rwz -l; rs -K 10 -N 2 -l; b -l; rs -K 12 -l; rfz -l; rs -K 12 -N 2 -l; rwz -l; b -l"

# use this script to convert 1-valued and DC-valued flops for an AIG
alias fix_aig "logic; undc; strash; zero"
Expand Down
Loading

0 comments on commit 2e17646

Please sign in to comment.