Skip to content

Commit 5c9448c

Browse files
authored
Merge pull request #7 from QuantamHD/update_abc2
Update To Latest ABC
2 parents ef5389d + c12ea9a commit 5c9448c

File tree

160 files changed

+11437
-871
lines changed

Some content is hidden

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

160 files changed

+11437
-871
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: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ on:
66

77
jobs:
88

9-
build-posix:
9+
build-posix-cmake:
1010
strategy:
1111
matrix:
12-
os: [macos-11, ubuntu-latest]
12+
os: [macos-latest, ubuntu-latest]
1313
use_namespace: [false, true]
1414

1515
runs-on: ${{ matrix.os }}
@@ -22,7 +22,7 @@ jobs:
2222
steps:
2323

2424
- name: Git Checkout
25-
uses: actions/checkout@v2
25+
uses: actions/checkout@v4
2626
with:
2727
submodules: recursive
2828

@@ -44,6 +44,10 @@ jobs:
4444
run: |
4545
cmake --build build
4646
47+
- name: Run Unit Tests
48+
run: |
49+
ctest --output-on-failure
50+
4751
- name: Test Executable
4852
run: |
4953
./build/abc -c "r i10.aig; b; ps; b; rw -l; rw -lz; b; rw -lz; b; ps; cec"
@@ -60,7 +64,7 @@ jobs:
6064
cp build/abc build/libabc.a staging/
6165
6266
- name: Upload pacakge artifact
63-
uses: actions/upload-artifact@v1
67+
uses: actions/upload-artifact@v4
6468
with:
65-
name: package
69+
name: package-cmake-${{ matrix.os }}-${{ matrix.use_namespace }}
6670
path: staging/

.github/workflows/build-posix.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
steps:
2323

2424
- name: Git Checkout
25-
uses: actions/checkout@v2
25+
uses: actions/checkout@v4
2626
with:
2727
submodules: recursive
2828

@@ -60,7 +60,7 @@ jobs:
6060
cp abc libabc.a staging/
6161
6262
- name: Upload pacakge artifact
63-
uses: actions/upload-artifact@v1
63+
uses: actions/upload-artifact@v4
6464
with:
65-
name: package
65+
name: package-posix-${{ matrix.os }}-${{ matrix.use_namespace }}
6666
path: staging/

.github/workflows/build-windows.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
steps:
1414

1515
- name: Git Checkout
16-
uses: actions/checkout@v2
16+
uses: actions/checkout@v4
1717
with:
1818
submodules: recursive
1919

@@ -46,7 +46,7 @@ jobs:
4646
copy UpgradeLog.htm staging/
4747
4848
- name: Upload pacakge artifact
49-
uses: actions/upload-artifact@v1
49+
uses: actions/upload-artifact@v4
5050
with:
51-
name: package
51+
name: package-windows
5252
path: staging/

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ lib/m114*
1313
lib/bip*
1414
docs/
1515
.vscode/
16+
.cache/
1617

1718
src/ext*
1819
src/xxx/

CMakeLists.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,3 +119,17 @@ add_library(libabc-pic EXCLUDE_FROM_ALL ${ABC_SRC})
119119
abc_properties(libabc-pic PUBLIC)
120120
set_property(TARGET libabc-pic PROPERTY POSITION_INDEPENDENT_CODE ON)
121121
set_property(TARGET libabc-pic PROPERTY OUTPUT_NAME abc-pic)
122+
123+
if(NOT DEFINED ABC_SKIP_TESTS)
124+
enable_testing()
125+
include(FetchContent)
126+
FetchContent_Declare(
127+
googletest
128+
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
129+
# Specify the commit you depend on and update it regularly.
130+
URL "https://github.com/google/googletest/archive/refs/tags/v1.14.0.zip"
131+
)
132+
FetchContent_MakeAvailable(googletest)
133+
include(GoogleTest)
134+
add_subdirectory(test)
135+
endif()

Makefile

Lines changed: 16 additions & 6 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))
@@ -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

@@ -138,11 +139,11 @@ endif
138139

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

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

@@ -152,7 +153,7 @@ ifdef ABC_USE_LIBSTDCXX
152153
endif
153154

154155
$(info $(MSG_PREFIX)Using CFLAGS=$(CFLAGS))
155-
CXXFLAGS += $(CFLAGS) -std=c++17
156+
CXXFLAGS += $(CFLAGS) -std=c++17 -fno-exceptions
156157

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

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

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

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

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

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

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

@@ -207,7 +214,10 @@ depend: $(DEP)
207214

208215
clean:
209216
@echo "$(MSG_PREFIX)\`\` Cleaning up..."
210-
$(VERBOSE)rm -rvf $(PROG) lib$(PROG).a $(OBJ) $(GARBAGE) $(OBJ:.o=.d)
217+
$(VERBOSE)rm -rvf $(PROG) lib$(PROG).a
218+
$(VERBOSE)rm -rvf $(OBJ)
219+
$(VERBOSE)rm -rvf $(GARBAGE)
220+
$(VERBOSE)rm -rvf $(OBJ:.o=.d)
211221

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

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"

abclib.dsp

Lines changed: 12 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)