Skip to content

Commit 7fc3557

Browse files
authored
Merge branch 'berkeley-abc:master' into master
2 parents cc02c28 + 324ceea commit 7fc3557

File tree

252 files changed

+23288
-1470
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

252 files changed

+23288
-1470
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/.gitcommit export-subst
12
* text=auto
23

34
*.c text

.gitcommit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
$Format:%H$

.github/workflows/build-posix-cmake.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
on: [push]
1+
name: Build Posix CMake
2+
3+
on:
4+
push:
5+
pull_request:
26

37
jobs:
48

.github/workflows/build-posix.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
on: [push]
1+
name: Build Posix
2+
3+
on:
4+
push:
5+
pull_request:
26

37
jobs:
48

.github/workflows/build-windows.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
on: [push]
1+
name: Build Windows
2+
3+
on:
4+
push:
5+
pull_request:
26

37
jobs:
48

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ ReleaseLib/
66
ReleaseExe/
77
ReleaseExt/
88

9+
_/
910
_TEST/
1011
lib/abc*
1112
lib/m114*
@@ -61,3 +62,4 @@ tags
6162

6263
/cmake
6364
/cscope
65+
abc.history

CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1-
cmake_minimum_required(VERSION 3.3.0)
1+
cmake_minimum_required(VERSION 3.5.0)
22

33
include(CMakeParseArguments)
44
include(CheckCCompilerFlag)
55
include(CheckCXXCompilerFlag)
66

7+
# Default c++ standard used unless otherwise specified in target_compile_features.
8+
set(CMAKE_CXX_STANDARD 17 CACHE STRING "the C++ standard to use for this project")
9+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
10+
711
function(addprefix var prefix)
812
foreach( s ${ARGN} )
913
list(APPEND tmp "-I${s}")

Makefile

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ AR := ar
55
LD := $(CXX)
66

77
MSG_PREFIX ?=
8-
ABCSRC = .
8+
ABCSRC ?= .
9+
VPATH = $(ABCSRC)
910

1011
$(info $(MSG_PREFIX)Using CC=$(CC))
1112
$(info $(MSG_PREFIX)Using CXX=$(CXX))
@@ -19,7 +20,7 @@ MODULES := \
1920
$(wildcard src/ext*) \
2021
src/base/abc src/base/abci src/base/cmd src/base/io src/base/main src/base/exor \
2122
src/base/ver src/base/wlc src/base/wln src/base/acb src/base/bac src/base/cba src/base/pla src/base/test \
22-
src/map/mapper src/map/mio src/map/super src/map/if \
23+
src/map/mapper src/map/mio src/map/super src/map/if src/map/if/acd \
2324
src/map/amap src/map/cov src/map/scl src/map/mpm \
2425
src/misc/extra src/misc/mvc src/misc/st src/misc/util src/misc/nm \
2526
src/misc/vec src/misc/hash src/misc/tim src/misc/bzlib src/misc/zlib \
@@ -41,7 +42,7 @@ default: $(PROG)
4142
ARCHFLAGS_EXE ?= ./arch_flags
4243

4344
$(ARCHFLAGS_EXE) : arch_flags.c
44-
$(CC) arch_flags.c -o $(ARCHFLAGS_EXE)
45+
$(CC) $< -o $(ARCHFLAGS_EXE)
4546

4647
INCLUDES += -I$(ABCSRC)/src
4748

@@ -137,11 +138,11 @@ endif
137138

138139
# LIBS := -ldl -lrt
139140
LIBS += -lm
140-
ifneq ($(OS), FreeBSD)
141+
ifneq ($(OS), $(filter $(OS), FreeBSD OpenBSD NetBSD))
141142
LIBS += -ldl
142143
endif
143144

144-
ifneq ($(findstring Darwin, $(shell uname)), Darwin)
145+
ifneq ($(OS), $(filter $(OS), FreeBSD OpenBSD NetBSD Darwin))
145146
LIBS += -lrt
146147
endif
147148

@@ -151,7 +152,7 @@ ifdef ABC_USE_LIBSTDCXX
151152
endif
152153

153154
$(info $(MSG_PREFIX)Using CFLAGS=$(CFLAGS))
154-
CXXFLAGS += $(CFLAGS)
155+
CXXFLAGS += $(CFLAGS) -std=c++17 -fno-exceptions
155156

156157
SRC :=
157158
GARBAGE := core core.* *.stackdump ./tags $(PROG) arch_flags
@@ -173,26 +174,32 @@ DEP := $(OBJ:.o=.d)
173174
# implicit rules
174175

175176
%.o: %.c
177+
@mkdir -p $(dir $@)
176178
@echo "$(MSG_PREFIX)\`\` Compiling:" $(LOCAL_PATH)/$<
177179
$(VERBOSE)$(CC) -c $(OPTFLAGS) $(INCLUDES) $(CFLAGS) $< -o $@
178180

179181
%.o: %.cc
182+
@mkdir -p $(dir $@)
180183
@echo "$(MSG_PREFIX)\`\` Compiling:" $(LOCAL_PATH)/$<
181184
$(VERBOSE)$(CXX) -c $(OPTFLAGS) $(INCLUDES) $(CXXFLAGS) $< -o $@
182185

183186
%.o: %.cpp
187+
@mkdir -p $(dir $@)
184188
@echo "$(MSG_PREFIX)\`\` Compiling:" $(LOCAL_PATH)/$<
185189
$(VERBOSE)$(CXX) -c $(OPTFLAGS) $(INCLUDES) $(CXXFLAGS) $< -o $@
186190

187191
%.d: %.c
192+
@mkdir -p $(dir $@)
188193
@echo "$(MSG_PREFIX)\`\` Generating dependency:" $(LOCAL_PATH)/$<
189194
$(VERBOSE)$(ABCSRC)/depends.sh "$(CC)" `dirname $*.c` $(OPTFLAGS) $(INCLUDES) $(CFLAGS) $< > $@
190195

191196
%.d: %.cc
197+
@mkdir -p $(dir $@)
192198
@echo "$(MSG_PREFIX)\`\` Generating dependency:" $(LOCAL_PATH)/$<
193199
$(VERBOSE)$(ABCSRC)/depends.sh "$(CXX)" `dirname $*.cc` $(OPTFLAGS) $(INCLUDES) $(CXXFLAGS) $< > $@
194200

195201
%.d: %.cpp
202+
@mkdir -p $(dir $@)
196203
@echo "$(MSG_PREFIX)\`\` Generating dependency:" $(LOCAL_PATH)/$<
197204
$(VERBOSE)$(ABCSRC)/depends.sh "$(CXX)" `dirname $*.cpp` $(OPTFLAGS) $(INCLUDES) $(CXXFLAGS) $< > $@
198205

@@ -206,7 +213,10 @@ depend: $(DEP)
206213

207214
clean:
208215
@echo "$(MSG_PREFIX)\`\` Cleaning up..."
209-
$(VERBOSE)rm -rvf $(PROG) lib$(PROG).a $(OBJ) $(GARBAGE) $(OBJ:.o=.d)
216+
$(VERBOSE)rm -rvf $(PROG) lib$(PROG).a
217+
$(VERBOSE)rm -rvf $(OBJ)
218+
$(VERBOSE)rm -rvf $(GARBAGE)
219+
$(VERBOSE)rm -rvf $(OBJ:.o=.d)
210220

211221
tags:
212222
etags `find . -type f -regex '.*\.\(c\|h\)'`

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,19 @@
44

55
# ABC: System for Sequential Logic Synthesis and Formal Verification
66

7-
ABC is always changing but the current snapshot is believed to be stable.
7+
ABC is always changing but the current snapshot is believed to be stable.
8+
9+
## ABC fork with new features
10+
11+
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.
12+
13+
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".
14+
15+
The source code is provided for research and evaluation only. For commercial usage, please contact Prof. Chang Wu at wuchang@fudan.edu.cn.
16+
17+
References:
18+
19+
[1] L. Fan and C. Wu, "FPGA technology mapping with adaptive gate decompostion", ACM/SIGDA FPGA International Symposium on FPGAs, 2023.
820

921
## Compiling:
1022

abc.rc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,8 @@ alias resyn2rs "b; rs -K 6; rw; rs -K 6 -N 2; rf; rs -K 8; b; rs -K 8 -N 2; r
135135
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"
136136
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"
137137
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"
138+
alias &resyn2rs "&put; resyn2rs; &get"
139+
alias &compress2rs "&put; compress2rs; &get"
138140

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

0 commit comments

Comments
 (0)