mirror of https://github.com/YosysHQ/abc.git
Version abc60220
This commit is contained in:
parent
77d7377442
commit
8eef7f8326
2
Makefile
2
Makefile
|
|
@ -9,7 +9,7 @@ PROG := abc
|
|||
MODULES := src/base/abc src/base/abci src/base/seq src/base/cmd src/base/io src/base/main \
|
||||
src/bdd/cudd src/bdd/dsd src/bdd/epd src/bdd/mtr src/bdd/parse src/bdd/reo \
|
||||
src/map/fpga src/map/pga src/map/mapper src/map/mio src/map/super \
|
||||
src/misc/extra src/misc/mvc src/misc/st src/misc/util src/misc/vec \
|
||||
src/misc/extra src/misc/mvc src/misc/st src/misc/util src/misc/espresso src/misc/vec \
|
||||
src/opt/cut src/opt/dec src/opt/fxu src/opt/rwr src/opt/sim \
|
||||
src/sat/asat src/sat/csat src/sat/msat src/sat/fraig
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,81 @@
|
|||
|
||||
CC := gcc
|
||||
CXX := g++
|
||||
LD := g++
|
||||
CP := cp
|
||||
|
||||
PROG := abc
|
||||
|
||||
#MODULES := src/base/abc src/base/abci src/base/seq src/base/cmd src/base/io src/base/main \
|
||||
# src/bdd/cudd src/bdd/dsd src/bdd/epd src/bdd/mtr src/bdd/parse src/bdd/reo \
|
||||
# src/map/fpga src/map/pga src/map/mapper src/map/mio src/map/super \
|
||||
# src/misc/extra src/misc/mvc src/misc/st src/misc/util src/misc/vec \
|
||||
# src/opt/cut src/opt/dec src/opt/fxu src/opt/rwr src/opt/sim \
|
||||
# src/sat/asat src/sat/csat src/sat/msat src/sat/fraig
|
||||
|
||||
MODULES := src/base/abc src/base/abci src/base/seq src/base/cmd src/base/io src/base/main \
|
||||
src/bdd/dsd src/bdd/parse src/bdd/reo \
|
||||
src/map/fpga src/map/pga src/map/mapper src/map/mio src/map/super \
|
||||
src/misc/extra src/misc/mvc src/misc/st src/misc/util src/misc/espresso src/misc/vec \
|
||||
src/opt/cut src/opt/dec src/opt/fxu src/opt/rwr src/opt/sim \
|
||||
src/sat/asat src/sat/csat src/sat/msat src/sat/fraig
|
||||
|
||||
default: lib$(PROG).a
|
||||
|
||||
OPTFLAGS := -DNDEBUG -O3
|
||||
#OPTFLAGS := -g
|
||||
|
||||
# for linux
|
||||
CFLAGS += -Wall -Wno-unused-function $(OPTFLAGS) $(patsubst %, -I%, $(MODULES))
|
||||
|
||||
# for solaris
|
||||
#CFLAGS += -Wall $(OPTFLAGS) $(patsubst %, -I%, $(MODULES))
|
||||
|
||||
CFLAGS += -I../cudd-2.3.1/cudd -I../cudd-2.3.1/dddmp -I../cudd-2.3.1/epd -I../cudd-2.3.1/mtr -I../cudd-2.3.1/st -I../cudd-2.3.1/util
|
||||
CXXFLAGS += $(CFLAGS)
|
||||
|
||||
LIBS := -ldl -rdynamic
|
||||
SRC :=
|
||||
GARBAGE := core core.* *.stackdump ./tags $(PROG)
|
||||
|
||||
.PHONY: tags clean docs
|
||||
|
||||
include $(patsubst %, %/module.make, $(MODULES))
|
||||
|
||||
OBJ := \
|
||||
$(patsubst %.cc, %.o, $(filter %.cc, $(SRC))) \
|
||||
$(patsubst %.c, %.o, $(filter %.c, $(SRC))) \
|
||||
$(patsubst %.y, %.o, $(filter %.y, $(SRC)))
|
||||
|
||||
DEP := $(OBJ:.o=.d)
|
||||
|
||||
# implicit rules
|
||||
|
||||
%.d: %.c
|
||||
./depends.sh $(CC) `dirname $*.c` $(CFLAGS) $*.c > $@
|
||||
|
||||
%.d: %.cc
|
||||
./depends.sh $(CXX) `dirname $*.cc` $(CXXFLAGS) $(CFLAGS) $*.cc > $@
|
||||
|
||||
-include $(DEP)
|
||||
|
||||
# Actual targets
|
||||
|
||||
depend: $(DEP)
|
||||
|
||||
clean:
|
||||
rm -rf $(PROG) $(OBJ) $(GARBAGE) $(OBJ:.o=.d)
|
||||
|
||||
tags:
|
||||
ctags -R .
|
||||
|
||||
$(PROG): $(OBJ)
|
||||
$(LD) -o $@ $^ $(LIBS)
|
||||
|
||||
lib$(PROG).a: $(OBJ)
|
||||
ar rv $@ $?
|
||||
ranlib $@
|
||||
|
||||
docs:
|
||||
doxygen doxygen.conf
|
||||
|
||||
276
abc.dsp
276
abc.dsp
|
|
@ -42,7 +42,7 @@ RSC=rc.exe
|
|||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /W3 /GX /O2 /I "src\base\abc" /I "src\base\abci" /I "src\base\abcs" /I "src\base\seq" /I "src\base\cmd" /I "src\base\io" /I "src\base\main" /I "src\bdd\cudd" /I "src\bdd\epd" /I "src\bdd\mtr" /I "src\bdd\parse" /I "src\bdd\dsd" /I "src\bdd\reo" /I "src\sop\ft" /I "src\sat\aig" /I "src\sat\asat" /I "src\sat\msat" /I "src\sat\fraig" /I "src\opt\cut" /I "src\opt\dec" /I "src\opt\fxu" /I "src\opt\sim" /I "src\opt\rwr" /I "src\map\fpga" /I "src\map\pga" /I "src\map\mapper" /I "src\map\mio" /I "src\map\super" /I "src\misc\extra" /I "src\misc\st" /I "src\misc\mvc" /I "src\misc\util" /I "src\misc\npn" /I "src\misc\vec" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "__STDC__" /D "HAVE_ASSERT_H" /FR /YX /FD /c
|
||||
# ADD CPP /nologo /W3 /GX /O2 /I "src\base\abc" /I "src\base\abci" /I "src\base\abcs" /I "src\base\seq" /I "src\base\cmd" /I "src\base\io" /I "src\base\main" /I "src\bdd\cudd" /I "src\bdd\epd" /I "src\bdd\mtr" /I "src\bdd\parse" /I "src\bdd\dsd" /I "src\bdd\reo" /I "src\sop\ft" /I "src\sat\aig" /I "src\sat\asat" /I "src\sat\msat" /I "src\sat\fraig" /I "src\opt\cut" /I "src\opt\dec" /I "src\opt\fxu" /I "src\opt\sim" /I "src\opt\rwr" /I "src\map\fpga" /I "src\map\pga" /I "src\map\mapper" /I "src\map\mio" /I "src\map\super" /I "src\misc\extra" /I "src\misc\st" /I "src\misc\mvc" /I "src\misc\util" /I "src\misc\npn" /I "src\misc\vec" /I "src\misc\espresso" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "__STDC__" /FR /YX /FD /c
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
|
|
@ -66,7 +66,7 @@ LINK32=link.exe
|
|||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "src\base\abc" /I "src\base\abci" /I "src\base\abcs" /I "src\base\seq" /I "src\base\cmd" /I "src\base\io" /I "src\base\main" /I "src\bdd\cudd" /I "src\bdd\epd" /I "src\bdd\mtr" /I "src\bdd\parse" /I "src\bdd\dsd" /I "src\bdd\reo" /I "src\sop\ft" /I "src\sat\aig" /I "src\sat\asat" /I "src\sat\msat" /I "src\sat\fraig" /I "src\opt\cut" /I "src\opt\dec" /I "src\opt\fxu" /I "src\opt\sim" /I "src\opt\rwr" /I "src\map\fpga" /I "src\map\pga" /I "src\map\mapper" /I "src\map\mio" /I "src\map\super" /I "src\misc\extra" /I "src\misc\st" /I "src\misc\mvc" /I "src\misc\util" /I "src\misc\npn" /I "src\misc\vec" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "__STDC__" /D "HAVE_ASSERT_H" /FR /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "src\base\abc" /I "src\base\abci" /I "src\base\abcs" /I "src\base\seq" /I "src\base\cmd" /I "src\base\io" /I "src\base\main" /I "src\bdd\cudd" /I "src\bdd\epd" /I "src\bdd\mtr" /I "src\bdd\parse" /I "src\bdd\dsd" /I "src\bdd\reo" /I "src\sop\ft" /I "src\sat\aig" /I "src\sat\asat" /I "src\sat\msat" /I "src\sat\fraig" /I "src\opt\cut" /I "src\opt\dec" /I "src\opt\fxu" /I "src\opt\sim" /I "src\opt\rwr" /I "src\map\fpga" /I "src\map\pga" /I "src\map\mapper" /I "src\map\mio" /I "src\map\super" /I "src\misc\extra" /I "src\misc\st" /I "src\misc\mvc" /I "src\misc\util" /I "src\misc\npn" /I "src\misc\vec" /I "src\misc\espresso" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "__STDC__" /FR /YX /FD /GZ /c
|
||||
# SUBTRACT CPP /X
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
|
|
@ -182,7 +182,11 @@ SOURCE=.\src\base\abci\abcBalance.c
|
|||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\base\abci\abcCollapse.c
|
||||
SOURCE=.\src\base\abci\abcClpBdd.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\base\abci\abcClpSop.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
|
|
@ -194,6 +198,10 @@ SOURCE=.\src\base\abci\abcDsd.c
|
|||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\base\abci\abcEspresso.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\base\abci\abcFpga.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
|
@ -214,6 +222,10 @@ SOURCE=.\src\base\abci\abcMiter.c
|
|||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\base\abci\abcNewAig.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\base\abci\abcNtbdd.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
|
@ -226,6 +238,10 @@ SOURCE=.\src\base\abci\abcPrint.c
|
|||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\base\abci\abcProve.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\base\abci\abcReconv.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
|
@ -238,6 +254,10 @@ SOURCE=.\src\base\abci\abcRenode.c
|
|||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\base\abci\abcRestruct.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\base\abci\abcRewrite.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
|
@ -906,6 +926,14 @@ SOURCE=.\src\sat\asat\added.c
|
|||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\sat\asat\asatmem.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\sat\asat\asatmem.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\sat\asat\solver.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
|
@ -1134,6 +1162,10 @@ SOURCE=.\src\sat\aig\fraigTrav.c
|
|||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\sat\aig\rwrMffc.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\sat\aig\rwrTruth.c
|
||||
# End Source File
|
||||
# End Group
|
||||
|
|
@ -1704,6 +1736,10 @@ SOURCE=.\src\misc\extra\extraUtilProgress.c
|
|||
|
||||
SOURCE=.\src\misc\extra\extraUtilReader.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\extra\extraUtilUtil.c
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "st"
|
||||
|
||||
|
|
@ -1725,54 +1761,6 @@ SOURCE=.\src\misc\st\stmm.c
|
|||
SOURCE=.\src\misc\st\stmm.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "util"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\util\cpu_stats.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\util\cpu_time.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\util\datalimit.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\util\getopt.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\util\leaks.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\util\pathsearch.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\util\safe_mem.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\util\stdlib_hack.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\util\strsav.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\util\texpand.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\util\util.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "mvc"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
|
|
@ -1869,9 +1857,193 @@ SOURCE=.\src\misc\vec\vecStr.h
|
|||
SOURCE=.\src\misc\vec\vecVec.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "npn"
|
||||
# Begin Group "espresso"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\cofactor.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\cols.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\compl.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\contain.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\cubehack.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\cubestr.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\cvrin.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\cvrm.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\cvrmisc.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\cvrout.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\dominate.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\equiv.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\espresso.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\espresso.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\essen.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\exact.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\expand.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\gasp.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\gimpel.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\globals.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\hack.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\indep.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\irred.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\map.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\matrix.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\mincov.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\mincov.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\mincov_int.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\opo.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\pair.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\part.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\primes.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\reduce.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\rows.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\set.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\setc.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\sharp.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\sminterf.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\solution.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\sparse.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\sparse.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\sparse_int.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\unate.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\verify.c
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "util"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\util\util_hack.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# End Group
|
||||
# End Group
|
||||
|
|
|
|||
|
|
@ -0,0 +1,84 @@
|
|||
# global parameters
|
||||
#set check # checks intermediate networks
|
||||
#set checkfio # prints warnings when fanins/fanouts are duplicated
|
||||
set checkread # checks new networks after reading from file
|
||||
set backup # saves backup networks retrived by "undo" and "recall"
|
||||
set savesteps 1 # sets the maximum number of backup networks to save
|
||||
|
||||
# program names for internal calls
|
||||
set dotwin dot.exe
|
||||
set dotunix dot
|
||||
set gsviewwin gsview32.exe
|
||||
set gsviewunix gv
|
||||
set siswin sis.exe
|
||||
set sisunix sis
|
||||
set mvsiswin mvsis.exe
|
||||
set mvsisunix mvsis
|
||||
|
||||
# standard aliases
|
||||
alias b balance
|
||||
alias cl cleanup
|
||||
alias clp collapse
|
||||
alias esd ext_seq_dcs
|
||||
alias f fraig
|
||||
alias fs fraig_sweep
|
||||
alias fsto fraig_store
|
||||
alias fres fraig_restore
|
||||
alias ft fraig_trust
|
||||
alias mu renode -m
|
||||
alias pex print_exdc -d
|
||||
alias pf print_factor
|
||||
alias pfan print_fanio
|
||||
alias pl print_level
|
||||
alias pio print_io
|
||||
alias pk print_kmap
|
||||
alias ps print_stats
|
||||
alias psu print_supp
|
||||
alias psy print_symm
|
||||
alias pun print_unate
|
||||
alias q quit
|
||||
alias r read
|
||||
alias ren renode
|
||||
alias rl read_blif
|
||||
alias rb read_bench
|
||||
alias ret retime
|
||||
alias rp read_pla
|
||||
alias rv read_verilog
|
||||
alias rsup read_super mcnc5_old.super
|
||||
alias rlib read_library
|
||||
alias rw rewrite
|
||||
alias rwz rewrite -z
|
||||
alias rf refactor
|
||||
alias rfz refactor -z
|
||||
alias rs restructure
|
||||
alias rsz restructure -z
|
||||
alias sa set autoexec ps
|
||||
alias so source -x
|
||||
alias st strash
|
||||
alias sw sweep
|
||||
alias ssw ssweep
|
||||
alias scl scleanup
|
||||
alias u undo
|
||||
alias wb write_blif
|
||||
alias wl write_blif
|
||||
alias wp write_pla
|
||||
alias wv write_verilog
|
||||
|
||||
# standard scripts
|
||||
alias opt "b; ren; b"
|
||||
alias share "b; ren; fx; b"
|
||||
alias sharem "b; ren -m; fx; b"
|
||||
alias sharedsd "b; ren; dsd -g; sw; fx; b"
|
||||
alias resyn "b; rw; rwz; b; rwz; b"
|
||||
alias resyn2 "b; rw; rf; b; rw; rwz; b; rfz; rwz; b"
|
||||
alias resyn3 "b; rs; rs -K 6; b; rsz; rsz -K 6; b; rsz -K 5; b"
|
||||
alias compress "b; rw -l; rwz -l; b; rwz -l; b"
|
||||
alias compress2 "b; rw -l; rf -l; b; rw -l; rwz -l; b; rfz -l; rwz -l; b"
|
||||
alias choice "fraig_store; resyn; fraig_store; resyn2; fraig_store; fraig_restore"
|
||||
alias choice2 "fraig_store; balance; fraig_store; resyn; fraig_store; resyn2; fraig_store; resyn2; fraig_store; fraig_restore"
|
||||
alias rwsat "st; rw -l; rf -l; b -l; rw -l; rf -l"
|
||||
alias t "r c/4/csat_101_opt.blif; st; ps; test"
|
||||
alias t2 "r c/5/csat_026.bench; st; ps; test"
|
||||
alias r1 "r c/4/csat_101_opt.blif; st; ps"
|
||||
|
||||
|
||||
232
abclib.dsp
232
abclib.dsp
|
|
@ -41,7 +41,7 @@ RSC=rc.exe
|
|||
# PROP Intermediate_Dir "abclib\ReleaseLib"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
|
||||
# ADD CPP /nologo /W3 /GX /O2 /I "src\base\abc" /I "src\base\abci" /I "src\base\abcs" /I "src\base\seq" /I "src\base\cmd" /I "src\base\io" /I "src\base\main" /I "src\bdd\cudd" /I "src\bdd\epd" /I "src\bdd\mtr" /I "src\bdd\parse" /I "src\bdd\dsd" /I "src\bdd\reo" /I "src\sop\ft" /I "src\sat\asat" /I "src\sat\msat" /I "src\sat\fraig" /I "src\opt\cut" /I "src\opt\dec" /I "src\opt\fxu" /I "src\opt\sim" /I "src\opt\rwr" /I "src\map\fpga" /I "src\map\pga" /I "src\map\mapper" /I "src\map\mapp" /I "src\map\mio" /I "src\map\super" /I "src\misc\extra" /I "src\misc\st" /I "src\misc\mvc" /I "src\misc\util" /I "src\misc\npn" /I "src\misc\vec" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D "__STDC__" /D "HAVE_ASSERT_H" /FR /YX /FD /c
|
||||
# ADD CPP /nologo /W3 /GX /O2 /I "src\base\abc" /I "src\base\abci" /I "src\base\abcs" /I "src\base\seq" /I "src\base\cmd" /I "src\base\io" /I "src\base\main" /I "src\bdd\cudd" /I "src\bdd\epd" /I "src\bdd\mtr" /I "src\bdd\parse" /I "src\bdd\dsd" /I "src\bdd\reo" /I "src\sop\ft" /I "src\sat\aig" /I "src\sat\asat" /I "src\sat\msat" /I "src\sat\fraig" /I "src\opt\cut" /I "src\opt\dec" /I "src\opt\fxu" /I "src\opt\sim" /I "src\opt\rwr" /I "src\map\fpga" /I "src\map\pga" /I "src\map\mapper" /I "src\map\mio" /I "src\map\super" /I "src\misc\extra" /I "src\misc\st" /I "src\misc\mvc" /I "src\misc\util" /I "src\misc\npn" /I "src\misc\vec" /I "src\misc\espresso" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D "__STDC__" /D "HAVE_ASSERT_H" /FR /YX /FD /c
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
|
|
@ -64,7 +64,7 @@ LIB32=link.exe -lib
|
|||
# PROP Intermediate_Dir "abclib\DebugLib"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "src\base\abc" /I "src\base\abci" /I "src\base\abcs" /I "src\base\seq" /I "src\base\cmd" /I "src\base\io" /I "src\base\main" /I "src\bdd\cudd" /I "src\bdd\epd" /I "src\bdd\mtr" /I "src\bdd\parse" /I "src\bdd\dsd" /I "src\bdd\reo" /I "src\sop\ft" /I "src\sat\asat" /I "src\sat\msat" /I "src\sat\fraig" /I "src\opt\cut" /I "src\opt\dec" /I "src\opt\fxu" /I "src\opt\sim" /I "src\opt\rwr" /I "src\map\fpga" /I "src\map\pga" /I "src\map\mapper" /I "src\map\mapp" /I "src\map\mio" /I "src\map\super" /I "src\misc\extra" /I "src\misc\st" /I "src\misc\mvc" /I "src\misc\util" /I "src\misc\npn" /I "src\misc\vec" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "__STDC__" /D "HAVE_ASSERT_H" /FR /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "src\base\abc" /I "src\base\abci" /I "src\base\abcs" /I "src\base\seq" /I "src\base\cmd" /I "src\base\io" /I "src\base\main" /I "src\bdd\cudd" /I "src\bdd\epd" /I "src\bdd\mtr" /I "src\bdd\parse" /I "src\bdd\dsd" /I "src\bdd\reo" /I "src\sop\ft" /I "src\sat\aig" /I "src\sat\asat" /I "src\sat\msat" /I "src\sat\fraig" /I "src\opt\cut" /I "src\opt\dec" /I "src\opt\fxu" /I "src\opt\sim" /I "src\opt\rwr" /I "src\map\fpga" /I "src\map\pga" /I "src\map\mapper" /I "src\map\mio" /I "src\map\super" /I "src\misc\extra" /I "src\misc\st" /I "src\misc\mvc" /I "src\misc\util" /I "src\misc\npn" /I "src\misc\vec" /I "src\misc\espresso" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "__STDC__" /D "HAVE_ASSERT_H" /FR /YX /FD /GZ /c
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
|
|
@ -171,6 +171,10 @@ SOURCE=.\src\base\abci\abcAttach.c
|
|||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\base\abci\abcAuto.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\base\abci\abcBalance.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
|
@ -187,6 +191,10 @@ SOURCE=.\src\base\abci\abcDsd.c
|
|||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\base\abci\abcEspresso.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\base\abci\abcFpga.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
|
@ -207,6 +215,10 @@ SOURCE=.\src\base\abci\abcMiter.c
|
|||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\base\abci\abcNewAig.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\base\abci\abcNtbdd.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
|
@ -219,6 +231,10 @@ SOURCE=.\src\base\abci\abcPrint.c
|
|||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\base\abci\abcProve.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\base\abci\abcReconv.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
|
@ -255,6 +271,10 @@ SOURCE=.\src\base\abci\abcTiming.c
|
|||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\base\abci\abcUnate.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\base\abci\abcUnreach.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
|
@ -895,6 +915,14 @@ SOURCE=.\src\sat\asat\added.c
|
|||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\sat\asat\asatmem.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\sat\asat\asatmem.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\sat\asat\solver.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
|
@ -1519,6 +1547,10 @@ SOURCE=.\src\misc\extra\extra.h
|
|||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\extra\extraBddAuto.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\extra\extraBddKmap.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
|
@ -1531,6 +1563,10 @@ SOURCE=.\src\misc\extra\extraBddSymm.c
|
|||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\extra\extraBddUnate.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\extra\extraUtilBitMatrix.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
|
@ -1557,6 +1593,10 @@ SOURCE=.\src\misc\extra\extraUtilProgress.c
|
|||
|
||||
SOURCE=.\src\misc\extra\extraUtilReader.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\extra\extraUtilUtil.c
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "st"
|
||||
|
||||
|
|
@ -1607,6 +1647,10 @@ SOURCE=.\src\misc\util\pathsearch.c
|
|||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\util\prtime.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\util\safe_mem.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
|
@ -1726,6 +1770,190 @@ SOURCE=.\src\misc\vec\vecStr.h
|
|||
SOURCE=.\src\misc\vec\vecVec.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "espresso"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\cofactor.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\cols.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\compl.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\contain.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\cubehack.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\cubestr.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\cvrin.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\cvrm.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\cvrmisc.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\cvrout.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\dominate.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\equiv.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\espresso.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\espresso.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\essen.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\exact.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\expand.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\gasp.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\gimpel.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\globals.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\hack.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\indep.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\irred.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\map.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\matrix.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\mincov.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\mincov.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\mincov_int.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\opo.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\pair.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\part.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\primes.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\reduce.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\rows.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\set.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\setc.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\sharp.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\sminterf.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\solution.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\sparse.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\sparse.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\sparse_int.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\unate.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\util_old.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\espresso\verify.c
|
||||
# End Source File
|
||||
# End Group
|
||||
# End Group
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
|
|
|||
|
|
@ -0,0 +1,10 @@
|
|||
Often the code comes directly from a Windows computer.
|
||||
The following steps may be needed to compile it on UNIX:
|
||||
|
||||
>> dos2unix Makefile Makefile
|
||||
>> dos2unix depends.sh depends.sh
|
||||
>> chmod 755 depends.sh
|
||||
>> make
|
||||
|
||||
If compiling as a static library, it is necessary to uncomment
|
||||
#define _LIB in "src/abc/main/main.c"
|
||||
|
|
@ -8,5 +8,5 @@ r examples/s444.blif; b; esd -v; dsd; cec; ps
|
|||
r examples/i10.blif; fpga; cec; ps; u; map; cec; ps
|
||||
r examples/i10.blif; choice; fpga; cec; ps; u; map; cec; ps
|
||||
r examples/s6669.blif; fpga; ps; sec; u; sfpga; ps; sec; u; fpga; ret; ps; sec
|
||||
r examples/s5378.blif; map -s; ps; sec; u; smap; ps; sec; u; map; ret; ps; sec
|
||||
#r examples/s5378.blif; map -s; ps; sec; u; smap; ps; sec; u; map; ret; ps; sec
|
||||
time
|
||||
|
|
|
|||
|
|
@ -410,6 +410,8 @@ extern bool Abc_AigCheck( Abc_Aig_t * pMan );
|
|||
extern int Abc_AigGetLevelNum( Abc_Ntk_t * pNtk );
|
||||
extern Abc_Obj_t * Abc_AigAnd( Abc_Aig_t * pMan, Abc_Obj_t * p0, Abc_Obj_t * p1 );
|
||||
extern Abc_Obj_t * Abc_AigAndLookup( Abc_Aig_t * pMan, Abc_Obj_t * p0, Abc_Obj_t * p1 );
|
||||
extern Abc_Obj_t * Abc_AigXorLookup( Abc_Aig_t * pMan, Abc_Obj_t * p0, Abc_Obj_t * p1, int * pType );
|
||||
extern Abc_Obj_t * Abc_AigMuxLookup( Abc_Aig_t * pMan, Abc_Obj_t * pC, Abc_Obj_t * pT, Abc_Obj_t * pE, int * pType );
|
||||
extern Abc_Obj_t * Abc_AigOr( Abc_Aig_t * pMan, Abc_Obj_t * p0, Abc_Obj_t * p1 );
|
||||
extern Abc_Obj_t * Abc_AigXor( Abc_Aig_t * pMan, Abc_Obj_t * p0, Abc_Obj_t * p1 );
|
||||
extern Abc_Obj_t * Abc_AigMiter( Abc_Aig_t * pMan, Vec_Ptr_t * vPairs );
|
||||
|
|
@ -425,7 +427,7 @@ extern void Abc_AigSetNodePhases( Abc_Ntk_t * pNtk );
|
|||
/*=== abcAttach.c ==========================================================*/
|
||||
extern int Abc_NtkAttach( Abc_Ntk_t * pNtk );
|
||||
/*=== abcBalance.c ==========================================================*/
|
||||
extern Abc_Ntk_t * Abc_NtkBalance( Abc_Ntk_t * pNtk, bool fDuplicate, bool fSelective );
|
||||
extern Abc_Ntk_t * Abc_NtkBalance( Abc_Ntk_t * pNtk, bool fDuplicate, bool fSelective, bool fUpdateLevel );
|
||||
/*=== abcCheck.c ==========================================================*/
|
||||
extern bool Abc_NtkCheck( Abc_Ntk_t * pNtk );
|
||||
extern bool Abc_NtkCheckRead( Abc_Ntk_t * pNtk );
|
||||
|
|
@ -435,7 +437,7 @@ extern bool Abc_NtkCompareSignals( Abc_Ntk_t * pNtk1, Abc_Ntk_t *
|
|||
/*=== abcCollapse.c ==========================================================*/
|
||||
extern Abc_Ntk_t * Abc_NtkCollapse( Abc_Ntk_t * pNtk, int fVerbose );
|
||||
/*=== abcCut.c ==========================================================*/
|
||||
extern void * Abc_NodeGetCutsRecursive( void * p, Abc_Obj_t * pObj );
|
||||
extern void * Abc_NodeGetCutsRecursive( void * p, Abc_Obj_t * pObj, int fMulti );
|
||||
extern void * Abc_NodeGetCuts( void * p, Abc_Obj_t * pObj, int fMulti );
|
||||
extern void Abc_NodeGetCutsSeq( void * p, Abc_Obj_t * pObj, int fFirst );
|
||||
extern void * Abc_NodeReadCuts( void * p, Abc_Obj_t * pObj );
|
||||
|
|
@ -559,8 +561,9 @@ extern void Abc_NtkFinalizeLatches( Abc_Ntk_t * pNtk );
|
|||
extern Abc_Ntk_t * Abc_NtkStartRead( char * pName );
|
||||
extern void Abc_NtkFinalizeRead( Abc_Ntk_t * pNtk );
|
||||
extern Abc_Ntk_t * Abc_NtkDup( Abc_Ntk_t * pNtk );
|
||||
extern Abc_Ntk_t * Abc_NtkCreateOutput( Abc_Ntk_t * pNtk, Abc_Obj_t * pNode, int fUseAllCis );
|
||||
extern Abc_Ntk_t * Abc_NtkCreateCone( Abc_Ntk_t * pNtk, Vec_Ptr_t * vRoots, Vec_Int_t * vValues );
|
||||
extern Abc_Ntk_t * Abc_NtkCreateCone( Abc_Ntk_t * pNtk, Abc_Obj_t * pNode, char * pNodeName, int fUseAllCis );
|
||||
extern Abc_Ntk_t * Abc_NtkCreateMffc( Abc_Ntk_t * pNtk, Abc_Obj_t * pNode, char * pNodeName );
|
||||
extern Abc_Ntk_t * Abc_NtkCreateTarget( Abc_Ntk_t * pNtk, Vec_Ptr_t * vRoots, Vec_Int_t * vValues );
|
||||
extern Abc_Ntk_t * Abc_NtkCreateFromNode( Abc_Ntk_t * pNtk, Abc_Obj_t * pNode );
|
||||
extern Abc_Ntk_t * Abc_NtkCreateWithNode( char * pSop );
|
||||
extern void Abc_NtkDelete( Abc_Ntk_t * pNtk );
|
||||
|
|
@ -575,6 +578,8 @@ extern void Abc_NtkPrintFactor( FILE * pFile, Abc_Ntk_t * pNtk, in
|
|||
extern void Abc_NodePrintFactor( FILE * pFile, Abc_Obj_t * pNode, int fUseRealNames );
|
||||
extern void Abc_NtkPrintLevel( FILE * pFile, Abc_Ntk_t * pNtk, int fProfile, int fListNodes );
|
||||
extern void Abc_NodePrintLevel( FILE * pFile, Abc_Obj_t * pNode );
|
||||
/*=== abcProve.c ==========================================================*/
|
||||
extern int Abc_NtkMiterProve( Abc_Ntk_t ** ppNtk, int nConfLimit, int nImpLimit, int fUseRewrite, int fUseFraig, int fVerbose );
|
||||
/*=== abcReconv.c ==========================================================*/
|
||||
extern Abc_ManCut_t * Abc_NtkManCutStart( int nNodeSizeMax, int nConeSizeMax, int nNodeFanStop, int nConeFanStop );
|
||||
extern void Abc_NtkManCutStop( Abc_ManCut_t * p );
|
||||
|
|
@ -590,13 +595,14 @@ extern int Abc_NodeMffcSize( Abc_Obj_t * pNode );
|
|||
extern int Abc_NodeMffcSizeSupp( Abc_Obj_t * pNode );
|
||||
extern int Abc_NodeMffcSizeStop( Abc_Obj_t * pNode );
|
||||
extern int Abc_NodeMffcLabel( Abc_Obj_t * pNode );
|
||||
extern int Abc_NodeMffcLabelFast( Abc_Obj_t * pNode, Vec_Ptr_t * vNodes );
|
||||
extern Vec_Ptr_t * Abc_NodeMffcCollect( Abc_Obj_t * pNode );
|
||||
extern void Abc_NodeMffsConeSupp( Abc_Obj_t * pNode, Vec_Ptr_t * vCone, Vec_Ptr_t * vSupp );
|
||||
extern int Abc_NodeDeref_rec( Abc_Obj_t * pNode );
|
||||
extern int Abc_NodeRef_rec( Abc_Obj_t * pNode );
|
||||
/*=== abcRenode.c ==========================================================*/
|
||||
extern Abc_Ntk_t * Abc_NtkRenode( Abc_Ntk_t * pNtk, int nThresh, int nFaninMax, int fCnf, int fMulti, int fSimple );
|
||||
extern DdNode * Abc_NtkRenodeDeriveBdd( DdManager * dd, Abc_Obj_t * pNodeOld, Vec_Ptr_t * vFaninsOld );
|
||||
/*=== abcSat.c ==========================================================*/
|
||||
extern int Abc_NtkMiterSat( Abc_Ntk_t * pNtk, int nSeconds, int fVerbose );
|
||||
extern int Abc_NtkMiterSat( Abc_Ntk_t * pNtk, int nConfLimit, int nImpLimit, int fVerbose );
|
||||
extern solver * Abc_NtkMiterSatCreate( Abc_Ntk_t * pNtk );
|
||||
/*=== abcSop.c ==========================================================*/
|
||||
extern char * Abc_SopRegister( Extra_MmFlex_t * pMan, char * pName );
|
||||
|
|
@ -681,6 +687,7 @@ extern int Abc_NtkLogicMakeSimpleCos( Abc_Ntk_t * pNtk, bool fDup
|
|||
extern void Abc_VecObjPushUniqueOrderByLevel( Vec_Ptr_t * p, Abc_Obj_t * pNode );
|
||||
extern bool Abc_NodeIsExorType( Abc_Obj_t * pNode );
|
||||
extern bool Abc_NodeIsMuxType( Abc_Obj_t * pNode );
|
||||
extern bool Abc_NodeIsMuxControlType( Abc_Obj_t * pNode );
|
||||
extern Abc_Obj_t * Abc_NodeRecognizeMux( Abc_Obj_t * pNode, Abc_Obj_t ** ppNodeT, Abc_Obj_t ** ppNodeE );
|
||||
extern int Abc_NtkPrepareTwoNtks( FILE * pErr, Abc_Ntk_t * pNtk, char ** argv, int argc, Abc_Ntk_t ** ppNtk1, Abc_Ntk_t ** ppNtk2, int * pfDelete1, int * pfDelete2 );
|
||||
extern void Abc_NodeCollectFanins( Abc_Obj_t * pNode, Vec_Ptr_t * vNodes );
|
||||
|
|
|
|||
|
|
@ -54,7 +54,6 @@ struct Abc_Aig_t_
|
|||
int nBins; // the size of the table
|
||||
int nEntries; // the total number of entries in the table
|
||||
Vec_Ptr_t * vNodes; // the temporary array of nodes
|
||||
Vec_Ptr_t * vStackDelete; // the nodes to be deleted
|
||||
Vec_Ptr_t * vStackReplaceOld; // the nodes to be replaced
|
||||
Vec_Ptr_t * vStackReplaceNew; // the nodes to be used for replacement
|
||||
Vec_Vec_t * vLevels; // the nodes to be updated
|
||||
|
|
@ -83,8 +82,7 @@ static Abc_Obj_t * Abc_AigAndCreateFrom( Abc_Aig_t * pMan, Abc_Obj_t * p0, Abc_O
|
|||
static void Abc_AigAndDelete( Abc_Aig_t * pMan, Abc_Obj_t * pThis );
|
||||
static void Abc_AigResize( Abc_Aig_t * pMan );
|
||||
// incremental AIG procedures
|
||||
static void Abc_AigReplace_int( Abc_Aig_t * pMan, int fUpdateLevel );
|
||||
static void Abc_AigDelete_int( Abc_Aig_t * pMan );
|
||||
static void Abc_AigReplace_int( Abc_Aig_t * pMan, Abc_Obj_t * pOld, Abc_Obj_t * pNew, int fUpdateLevel );
|
||||
static void Abc_AigUpdateLevel_int( Abc_Aig_t * pMan );
|
||||
static void Abc_AigUpdateLevelR_int( Abc_Aig_t * pMan );
|
||||
static void Abc_AigRemoveFromLevelStructure( Vec_Vec_t * vStruct, Abc_Obj_t * pNode );
|
||||
|
|
@ -116,7 +114,6 @@ Abc_Aig_t * Abc_AigAlloc( Abc_Ntk_t * pNtkAig )
|
|||
pMan->pBins = ALLOC( Abc_Obj_t *, pMan->nBins );
|
||||
memset( pMan->pBins, 0, sizeof(Abc_Obj_t *) * pMan->nBins );
|
||||
pMan->vNodes = Vec_PtrAlloc( 100 );
|
||||
pMan->vStackDelete = Vec_PtrAlloc( 100 );
|
||||
pMan->vStackReplaceOld = Vec_PtrAlloc( 100 );
|
||||
pMan->vStackReplaceNew = Vec_PtrAlloc( 100 );
|
||||
pMan->vLevels = Vec_VecAlloc( 100 );
|
||||
|
|
@ -139,13 +136,11 @@ Abc_Aig_t * Abc_AigAlloc( Abc_Ntk_t * pNtkAig )
|
|||
***********************************************************************/
|
||||
void Abc_AigFree( Abc_Aig_t * pMan )
|
||||
{
|
||||
assert( Vec_PtrSize( pMan->vStackDelete ) == 0 );
|
||||
assert( Vec_PtrSize( pMan->vStackReplaceOld ) == 0 );
|
||||
assert( Vec_PtrSize( pMan->vStackReplaceNew ) == 0 );
|
||||
// free the table
|
||||
Vec_VecFree( pMan->vLevels );
|
||||
Vec_VecFree( pMan->vLevelsR );
|
||||
Vec_PtrFree( pMan->vStackDelete );
|
||||
Vec_PtrFree( pMan->vStackReplaceOld );
|
||||
Vec_PtrFree( pMan->vStackReplaceNew );
|
||||
Vec_PtrFree( pMan->vNodes );
|
||||
|
|
@ -166,18 +161,21 @@ void Abc_AigFree( Abc_Aig_t * pMan )
|
|||
***********************************************************************/
|
||||
int Abc_AigCleanup( Abc_Aig_t * pMan )
|
||||
{
|
||||
Vec_Ptr_t * vDangles;
|
||||
Abc_Obj_t * pAnd;
|
||||
int i, Counter;
|
||||
int i, nNodesOld;
|
||||
nNodesOld = pMan->nEntries;
|
||||
// collect the AND nodes that do not fanout
|
||||
assert( Vec_PtrSize( pMan->vStackDelete ) == 0 );
|
||||
vDangles = Vec_PtrAlloc( 100 );
|
||||
for ( i = 0; i < pMan->nBins; i++ )
|
||||
Abc_AigBinForEachEntry( pMan->pBins[i], pAnd )
|
||||
if ( Abc_ObjFanoutNum(pAnd) == 0 )
|
||||
Vec_PtrPush( pMan->vStackDelete, pAnd );
|
||||
Vec_PtrPush( vDangles, pAnd );
|
||||
// process the dangling nodes and their MFFCs
|
||||
for ( Counter = 0; Vec_PtrSize(pMan->vStackDelete) > 0; Counter++ )
|
||||
Abc_AigDelete_int( pMan );
|
||||
return Counter;
|
||||
Vec_PtrForEachEntry( vDangles, pAnd, i )
|
||||
Abc_AigDeleteNode( pMan, pAnd );
|
||||
Vec_PtrFree( vDangles );
|
||||
return nNodesOld - pMan->nEntries;
|
||||
}
|
||||
|
||||
/**Function*************************************************************
|
||||
|
|
@ -381,6 +379,74 @@ Abc_Obj_t * Abc_AigAndLookup( Abc_Aig_t * pMan, Abc_Obj_t * p0, Abc_Obj_t * p1 )
|
|||
return NULL;
|
||||
}
|
||||
|
||||
/**Function*************************************************************
|
||||
|
||||
Synopsis [Returns the gate implementing EXOR of the two arguments if it exists.]
|
||||
|
||||
Description [The argument nodes can be complemented.]
|
||||
|
||||
SideEffects []
|
||||
|
||||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
Abc_Obj_t * Abc_AigXorLookup( Abc_Aig_t * pMan, Abc_Obj_t * p0, Abc_Obj_t * p1, int * pType )
|
||||
{
|
||||
Abc_Obj_t * pNode1, * pNode2, * pNode;
|
||||
// set the flag to zero
|
||||
if ( pType ) *pType = 0;
|
||||
// check the case of XOR(a,b) = OR(ab, a'b')'
|
||||
if ( (pNode1 = Abc_AigAndLookup(pMan, Abc_ObjNot(p0), Abc_ObjNot(p1))) &&
|
||||
(pNode2 = Abc_AigAndLookup(pMan, p0, p1)) )
|
||||
{
|
||||
pNode = Abc_AigAndLookup( pMan, Abc_ObjNot(pNode1), Abc_ObjNot(pNode2) );
|
||||
if ( pNode && pType ) *pType = 1;
|
||||
return pNode;
|
||||
}
|
||||
// check the case of XOR(a,b) = OR(a'b, ab')
|
||||
if ( (pNode1 = Abc_AigAndLookup(pMan, p0, Abc_ObjNot(p1))) &&
|
||||
(pNode2 = Abc_AigAndLookup(pMan, Abc_ObjNot(p0), p1)) )
|
||||
{
|
||||
pNode = Abc_AigAndLookup( pMan, Abc_ObjNot(pNode1), Abc_ObjNot(pNode2) );
|
||||
return pNode? Abc_ObjNot(pNode) : NULL;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**Function*************************************************************
|
||||
|
||||
Synopsis [Returns the gate implementing EXOR of the two arguments if it exists.]
|
||||
|
||||
Description [The argument nodes can be complemented.]
|
||||
|
||||
SideEffects []
|
||||
|
||||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
Abc_Obj_t * Abc_AigMuxLookup( Abc_Aig_t * pMan, Abc_Obj_t * pC, Abc_Obj_t * pT, Abc_Obj_t * pE, int * pType )
|
||||
{
|
||||
Abc_Obj_t * pNode1, * pNode2, * pNode;
|
||||
// set the flag to zero
|
||||
if ( pType ) *pType = 0;
|
||||
// check the case of MUX(c,t,e) = OR(ct', c'e')'
|
||||
if ( (pNode1 = Abc_AigAndLookup(pMan, pC, Abc_ObjNot(pT))) &&
|
||||
(pNode2 = Abc_AigAndLookup(pMan, Abc_ObjNot(pC), Abc_ObjNot(pE))) )
|
||||
{
|
||||
pNode = Abc_AigAndLookup( pMan, Abc_ObjNot(pNode1), Abc_ObjNot(pNode2) );
|
||||
if ( pNode && pType ) *pType = 1;
|
||||
return pNode;
|
||||
}
|
||||
// check the case of MUX(c,t,e) = OR(ct, c'e)
|
||||
if ( (pNode1 = Abc_AigAndLookup(pMan, pC, pT)) &&
|
||||
(pNode2 = Abc_AigAndLookup(pMan, Abc_ObjNot(pC), pE)) )
|
||||
{
|
||||
pNode = Abc_AigAndLookup( pMan, Abc_ObjNot(pNode1), Abc_ObjNot(pNode2) );
|
||||
return pNode? Abc_ObjNot(pNode) : NULL;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**Function*************************************************************
|
||||
|
||||
Synopsis [Deletes an AIG node from the hash table.]
|
||||
|
|
@ -662,11 +728,16 @@ void Abc_AigReplace( Abc_Aig_t * pMan, Abc_Obj_t * pOld, Abc_Obj_t * pNew, bool
|
|||
{
|
||||
assert( Vec_PtrSize(pMan->vStackReplaceOld) == 0 );
|
||||
assert( Vec_PtrSize(pMan->vStackReplaceNew) == 0 );
|
||||
assert( Vec_PtrSize(pMan->vStackDelete) == 0 );
|
||||
Vec_PtrPush( pMan->vStackReplaceOld, pOld );
|
||||
Vec_PtrPush( pMan->vStackReplaceNew, pNew );
|
||||
assert( !Abc_ObjIsComplement(pOld) );
|
||||
// process the replacements
|
||||
while ( Vec_PtrSize(pMan->vStackReplaceOld) )
|
||||
Abc_AigReplace_int( pMan, fUpdateLevel );
|
||||
{
|
||||
pOld = Vec_PtrPop( pMan->vStackReplaceOld );
|
||||
pNew = Vec_PtrPop( pMan->vStackReplaceNew );
|
||||
Abc_AigReplace_int( pMan, pOld, pNew, fUpdateLevel );
|
||||
}
|
||||
if ( fUpdateLevel )
|
||||
{
|
||||
Abc_AigUpdateLevel_int( pMan );
|
||||
|
|
@ -685,14 +756,10 @@ void Abc_AigReplace( Abc_Aig_t * pMan, Abc_Obj_t * pOld, Abc_Obj_t * pNew, bool
|
|||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
void Abc_AigReplace_int( Abc_Aig_t * pMan, int fUpdateLevel )
|
||||
void Abc_AigReplace_int( Abc_Aig_t * pMan, Abc_Obj_t * pOld, Abc_Obj_t * pNew, int fUpdateLevel )
|
||||
{
|
||||
Abc_Obj_t * pOld, * pNew, * pFanin1, * pFanin2, * pFanout, * pFanoutNew, * pFanoutFanout;
|
||||
int k, v, iFanin;
|
||||
// get the pair of nodes to replace
|
||||
assert( Vec_PtrSize(pMan->vStackReplaceOld) > 0 );
|
||||
pOld = Vec_PtrPop( pMan->vStackReplaceOld );
|
||||
pNew = Vec_PtrPop( pMan->vStackReplaceNew );
|
||||
Abc_Obj_t * pFanin1, * pFanin2, * pFanout, * pFanoutNew, * pFanoutFanout;
|
||||
int k, v, iFanin;
|
||||
// make sure the old node is regular and has fanouts
|
||||
// (the new node can be complemented and can have fanouts)
|
||||
assert( !Abc_ObjIsComplement(pOld) );
|
||||
|
|
@ -775,88 +842,58 @@ void Abc_AigReplace_int( Abc_Aig_t * pMan, int fUpdateLevel )
|
|||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
void Abc_AigDeleteNode( Abc_Aig_t * pMan, Abc_Obj_t * pOld )
|
||||
void Abc_AigDeleteNode( Abc_Aig_t * pMan, Abc_Obj_t * pNode )
|
||||
{
|
||||
assert( Vec_PtrSize(pMan->vStackDelete) == 0 );
|
||||
Vec_PtrPush( pMan->vStackDelete, pOld );
|
||||
while ( Vec_PtrSize(pMan->vStackDelete) )
|
||||
Abc_AigDelete_int( pMan );
|
||||
}
|
||||
|
||||
/**Function*************************************************************
|
||||
|
||||
Synopsis [Performs internal deletion step.]
|
||||
|
||||
Description []
|
||||
|
||||
SideEffects []
|
||||
|
||||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
void Abc_AigDelete_int( Abc_Aig_t * pMan )
|
||||
{
|
||||
Vec_Ptr_t * vNodes;
|
||||
Abc_Obj_t * pRoot, * pObj;
|
||||
int k;
|
||||
// get the node to delete
|
||||
assert( Vec_PtrSize(pMan->vStackDelete) > 0 );
|
||||
pRoot = Vec_PtrPop( pMan->vStackDelete );
|
||||
Abc_Obj_t * pNode0, * pNode1, * pTemp;
|
||||
int i, k;
|
||||
|
||||
// make sure the node is regular and dangling
|
||||
assert( !Abc_ObjIsComplement(pRoot) );
|
||||
assert( Abc_ObjIsNode(pRoot) );
|
||||
assert( Abc_ObjFaninNum(pRoot) == 2 );
|
||||
assert( Abc_ObjFanoutNum(pRoot) == 0 );
|
||||
assert( !Abc_ObjIsComplement(pNode) );
|
||||
assert( Abc_ObjIsNode(pNode) );
|
||||
assert( Abc_ObjFaninNum(pNode) == 2 );
|
||||
assert( Abc_ObjFanoutNum(pNode) == 0 );
|
||||
|
||||
// collect the MFFC
|
||||
vNodes = Abc_NodeMffcCollect( pRoot );
|
||||
|
||||
// if reverse levels are specified, schedule fanins of MFFC for updating
|
||||
// currently, we do not do it because we do not know the correct level of the fanins
|
||||
// also, it is unlikely that this will make a difference since we are
|
||||
// processing the network forward while at this point fanins are left behind...
|
||||
/*
|
||||
if ( pObj->pNtk->vLevelsR )
|
||||
Vec_PtrForEachEntry( vNodes, pObj, k )
|
||||
// when deleting an old node that is scheduled for replacement, remove it from the replacement queue
|
||||
Vec_PtrForEachEntry( pMan->vStackReplaceOld, pTemp, i )
|
||||
if ( pNode == pTemp )
|
||||
{
|
||||
Abc_Obj_t * pFanin;
|
||||
if ( Abc_ObjIsCi(pObj) )
|
||||
continue;
|
||||
pFanin = Abc_ObjFanin0(pObj);
|
||||
if ( pFanin->fMarkB == 0 )
|
||||
// remove the entry from the replacement array
|
||||
for ( k = i; k < pMan->vStackReplaceOld->nSize - 1; k++ )
|
||||
{
|
||||
pFanin->fMarkB = 1;
|
||||
Vec_VecPush( pMan->vLevelsR, Abc_NodeReadReverseLevel(pFanin), pFanin );
|
||||
}
|
||||
pFanin = Abc_ObjFanin1(pObj);
|
||||
if ( pFanin->fMarkB == 0 )
|
||||
{
|
||||
pFanin->fMarkB = 1;
|
||||
Vec_VecPush( pMan->vLevelsR, Abc_NodeReadReverseLevel(pFanin), pFanin );
|
||||
pMan->vStackReplaceOld->pArray[k] = pMan->vStackReplaceOld->pArray[k+1];
|
||||
pMan->vStackReplaceNew->pArray[k] = pMan->vStackReplaceNew->pArray[k+1];
|
||||
}
|
||||
pMan->vStackReplaceOld->nSize--;
|
||||
pMan->vStackReplaceNew->nSize--;
|
||||
}
|
||||
*/
|
||||
|
||||
// delete the nodes in MFFC
|
||||
Vec_PtrForEachEntry( vNodes, pObj, k )
|
||||
{
|
||||
if ( Abc_ObjIsCi(pObj) )
|
||||
continue;
|
||||
assert( Abc_ObjFanoutNum(pObj) == 0 );
|
||||
// remove the node from the table
|
||||
Abc_AigAndDelete( pMan, pObj );
|
||||
// if the node is in the level structure, remove it
|
||||
if ( pObj->fMarkA )
|
||||
Abc_AigRemoveFromLevelStructure( pMan->vLevels, pObj );
|
||||
if ( pObj->fMarkB )
|
||||
Abc_AigRemoveFromLevelStructureR( pMan->vLevelsR, pObj );
|
||||
// remove the node from the network
|
||||
Abc_NtkDeleteObj( pObj );
|
||||
}
|
||||
Vec_PtrFree( vNodes );
|
||||
// when deleting a new node that should replace another node, do not delete
|
||||
Vec_PtrForEachEntry( pMan->vStackReplaceNew, pTemp, i )
|
||||
if ( pNode == Abc_ObjRegular(pTemp) )
|
||||
return;
|
||||
|
||||
// remember the node's fanins
|
||||
pNode0 = Abc_ObjFanin0( pNode );
|
||||
pNode1 = Abc_ObjFanin1( pNode );
|
||||
|
||||
// remove the node from the table
|
||||
Abc_AigAndDelete( pMan, pNode );
|
||||
// if the node is in the level structure, remove it
|
||||
if ( pNode->fMarkA )
|
||||
Abc_AigRemoveFromLevelStructure( pMan->vLevels, pNode );
|
||||
if ( pNode->fMarkB )
|
||||
Abc_AigRemoveFromLevelStructureR( pMan->vLevelsR, pNode );
|
||||
// remove the node from the network
|
||||
Abc_NtkDeleteObj( pNode );
|
||||
|
||||
// call recursively for the fanins
|
||||
if ( Abc_ObjIsNode(pNode0) && pNode0->vFanouts.nSize == 0 )
|
||||
Abc_AigDeleteNode( pMan, pNode0 );
|
||||
if ( Abc_ObjIsNode(pNode1) && pNode1->vFanouts.nSize == 0 )
|
||||
Abc_AigDeleteNode( pMan, pNode1 );
|
||||
}
|
||||
|
||||
|
||||
/**Function*************************************************************
|
||||
|
||||
Synopsis [Updates the level of the node after it has changed.]
|
||||
|
|
|
|||
|
|
@ -306,7 +306,7 @@ Vec_Ptr_t * Abc_NodeGetFaninNames( Abc_Obj_t * pNode )
|
|||
int i;
|
||||
vNodes = Vec_PtrAlloc( 100 );
|
||||
Abc_ObjForEachFanin( pNode, pFanin, i )
|
||||
Vec_PtrPush( vNodes, util_strsav(Abc_ObjName(pFanin)) );
|
||||
Vec_PtrPush( vNodes, Extra_UtilStrsav(Abc_ObjName(pFanin)) );
|
||||
return vNodes;
|
||||
}
|
||||
|
||||
|
|
@ -341,7 +341,7 @@ Vec_Ptr_t * Abc_NodeGetFakeNames( int nNames )
|
|||
Buffer[1] = '0' + i/26;
|
||||
Buffer[2] = 0;
|
||||
}
|
||||
Vec_PtrPush( vNames, util_strsav(Buffer) );
|
||||
Vec_PtrPush( vNames, Extra_UtilStrsav(Buffer) );
|
||||
}
|
||||
return vNames;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -117,8 +117,8 @@ Abc_Ntk_t * Abc_NtkStartFrom( Abc_Ntk_t * pNtk, Abc_NtkType_t Type, Abc_NtkFunc_
|
|||
// start the network
|
||||
pNtkNew = Abc_NtkAlloc( Type, Func );
|
||||
// duplicate the name and the spec
|
||||
pNtkNew->pName = util_strsav(pNtk->pName);
|
||||
pNtkNew->pSpec = util_strsav(pNtk->pSpec);
|
||||
pNtkNew->pName = Extra_UtilStrsav(pNtk->pName);
|
||||
pNtkNew->pSpec = Extra_UtilStrsav(pNtk->pSpec);
|
||||
// clean the node copy fields
|
||||
Abc_NtkForEachNode( pNtk, pObj, i )
|
||||
pObj->pCopy = NULL;
|
||||
|
|
@ -235,8 +235,8 @@ Abc_Ntk_t * Abc_NtkStartRead( char * pName )
|
|||
// allocate the empty network
|
||||
pNtkNew = Abc_NtkAlloc( ABC_NTK_NETLIST, ABC_FUNC_SOP );
|
||||
// set the specs
|
||||
pNtkNew->pName = util_strsav( Extra_FileNameGeneric(pName) );
|
||||
pNtkNew->pSpec = util_strsav( pName );
|
||||
pNtkNew->pName = Extra_FileNameGeneric(pName);
|
||||
pNtkNew->pSpec = Extra_UtilStrsav(pName);
|
||||
return pNtkNew;
|
||||
}
|
||||
|
||||
|
|
@ -359,7 +359,7 @@ Abc_Ntk_t * Abc_NtkDup( Abc_Ntk_t * pNtk )
|
|||
|
||||
/**Function*************************************************************
|
||||
|
||||
Synopsis [Creates the network composed of one output.]
|
||||
Synopsis [Creates the network composed of one logic cone.]
|
||||
|
||||
Description []
|
||||
|
||||
|
|
@ -368,22 +368,22 @@ Abc_Ntk_t * Abc_NtkDup( Abc_Ntk_t * pNtk )
|
|||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
Abc_Ntk_t * Abc_NtkCreateOutput( Abc_Ntk_t * pNtk, Abc_Obj_t * pNode, int fUseAllCis )
|
||||
Abc_Ntk_t * Abc_NtkCreateCone( Abc_Ntk_t * pNtk, Abc_Obj_t * pNode, char * pNodeName, int fUseAllCis )
|
||||
{
|
||||
Vec_Ptr_t * vNodes;
|
||||
Abc_Ntk_t * pNtkNew;
|
||||
Abc_Obj_t * pObj, * pFanin;
|
||||
Vec_Ptr_t * vNodes;
|
||||
Abc_Obj_t * pObj, * pFanin, * pNodeCoNew;
|
||||
char Buffer[1000];
|
||||
int i, k;
|
||||
|
||||
assert( Abc_NtkIsLogic(pNtk) || Abc_NtkIsStrash(pNtk) );
|
||||
assert( Abc_ObjIsCo(pNode) );
|
||||
assert( Abc_ObjIsNode(pNode) );
|
||||
|
||||
// start the network
|
||||
pNtkNew = Abc_NtkAlloc( pNtk->ntkType, pNtk->ntkFunc );
|
||||
// set the name
|
||||
sprintf( Buffer, "%s_%s", pNtk->pName, Abc_ObjName(pNode) );
|
||||
pNtkNew->pName = util_strsav(Buffer);
|
||||
sprintf( Buffer, "%s_%s", pNtk->pName, pNodeName );
|
||||
pNtkNew->pName = Extra_UtilStrsav(Buffer);
|
||||
|
||||
// establish connection between the constant nodes
|
||||
Abc_NtkConst1(pNtk)->pCopy = Abc_NtkConst1(pNtkNew);
|
||||
|
|
@ -399,7 +399,9 @@ Abc_Ntk_t * Abc_NtkCreateOutput( Abc_Ntk_t * pNtk, Abc_Obj_t * pNode, int fUseAl
|
|||
Abc_NtkLogicStoreName( pObj->pCopy, Abc_ObjName(pObj) );
|
||||
}
|
||||
}
|
||||
|
||||
// add the PO corresponding to this output
|
||||
pNodeCoNew = Abc_NtkCreatePo( pNtkNew );
|
||||
Abc_NtkLogicStoreName( pNodeCoNew, pNodeName );
|
||||
// copy the nodes
|
||||
Vec_PtrForEachEntry( vNodes, pObj, i )
|
||||
{
|
||||
|
|
@ -415,15 +417,83 @@ Abc_Ntk_t * Abc_NtkCreateOutput( Abc_Ntk_t * pNtk, Abc_Obj_t * pNode, int fUseAl
|
|||
Abc_ObjAddFanin( pObj->pCopy, pFanin->pCopy );
|
||||
}
|
||||
}
|
||||
// connect the internal nodes to the new CO
|
||||
Abc_ObjAddFanin( pNodeCoNew, pNode->pCopy );
|
||||
Vec_PtrFree( vNodes );
|
||||
|
||||
// add the PO corresponding to this output
|
||||
pNode->pCopy = Abc_NtkCreatePo( pNtkNew );
|
||||
Abc_ObjAddFanin( pNode->pCopy, Abc_ObjFanin0(pNode)->pCopy );
|
||||
Abc_NtkLogicStoreName( pNode->pCopy, Abc_ObjName(pNode) );
|
||||
if ( !Abc_NtkCheck( pNtkNew ) )
|
||||
fprintf( stdout, "Abc_NtkCreateCone(): Network check has failed.\n" );
|
||||
return pNtkNew;
|
||||
}
|
||||
|
||||
/**Function*************************************************************
|
||||
|
||||
Synopsis [Creates the network composed of MFFC of one node.]
|
||||
|
||||
Description []
|
||||
|
||||
SideEffects []
|
||||
|
||||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
Abc_Ntk_t * Abc_NtkCreateMffc( Abc_Ntk_t * pNtk, Abc_Obj_t * pNode, char * pNodeName )
|
||||
{
|
||||
Abc_Ntk_t * pNtkNew;
|
||||
Abc_Obj_t * pObj, * pFanin, * pNodeCoNew;
|
||||
Vec_Ptr_t * vCone, * vSupp;
|
||||
char Buffer[1000];
|
||||
int i, k;
|
||||
|
||||
assert( Abc_NtkIsLogic(pNtk) || Abc_NtkIsStrash(pNtk) );
|
||||
assert( Abc_ObjIsNode(pNode) );
|
||||
|
||||
// start the network
|
||||
pNtkNew = Abc_NtkAlloc( pNtk->ntkType, pNtk->ntkFunc );
|
||||
// set the name
|
||||
sprintf( Buffer, "%s_%s", pNtk->pName, pNodeName );
|
||||
pNtkNew->pName = Extra_UtilStrsav(Buffer);
|
||||
|
||||
// establish connection between the constant nodes
|
||||
Abc_NtkConst1(pNtk)->pCopy = Abc_NtkConst1(pNtkNew);
|
||||
|
||||
// collect the nodes in MFFC
|
||||
vCone = Vec_PtrAlloc( 100 );
|
||||
vSupp = Vec_PtrAlloc( 100 );
|
||||
Abc_NodeDeref_rec( pNode );
|
||||
Abc_NodeMffsConeSupp( pNode, vCone, vSupp );
|
||||
Abc_NodeRef_rec( pNode );
|
||||
// create the PIs
|
||||
Vec_PtrForEachEntry( vSupp, pObj, i )
|
||||
{
|
||||
pObj->pCopy = Abc_NtkCreatePi(pNtkNew);
|
||||
Abc_NtkLogicStoreName( pObj->pCopy, Abc_ObjName(pObj) );
|
||||
}
|
||||
// create the PO
|
||||
pNodeCoNew = Abc_NtkCreatePo( pNtkNew );
|
||||
Abc_NtkLogicStoreName( pNodeCoNew, pNodeName );
|
||||
// copy the nodes
|
||||
Vec_PtrForEachEntry( vCone, pObj, i )
|
||||
{
|
||||
// if it is an AIG, add to the hash table
|
||||
if ( Abc_NtkIsStrash(pNtk) )
|
||||
{
|
||||
pObj->pCopy = Abc_AigAnd( pNtkNew->pManFunc, Abc_ObjChild0Copy(pObj), Abc_ObjChild1Copy(pObj) );
|
||||
}
|
||||
else
|
||||
{
|
||||
Abc_NtkDupObj( pNtkNew, pObj );
|
||||
Abc_ObjForEachFanin( pObj, pFanin, k )
|
||||
Abc_ObjAddFanin( pObj->pCopy, pFanin->pCopy );
|
||||
}
|
||||
}
|
||||
// connect the topmost node
|
||||
Abc_ObjAddFanin( pNodeCoNew, pNode->pCopy );
|
||||
Vec_PtrFree( vCone );
|
||||
Vec_PtrFree( vSupp );
|
||||
|
||||
if ( !Abc_NtkCheck( pNtkNew ) )
|
||||
fprintf( stdout, "Abc_NtkCreateOutput(): Network check has failed.\n" );
|
||||
fprintf( stdout, "Abc_NtkCreateMffc(): Network check has failed.\n" );
|
||||
return pNtkNew;
|
||||
}
|
||||
|
||||
|
|
@ -438,7 +508,7 @@ Abc_Ntk_t * Abc_NtkCreateOutput( Abc_Ntk_t * pNtk, Abc_Obj_t * pNode, int fUseAl
|
|||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
Abc_Ntk_t * Abc_NtkCreateCone( Abc_Ntk_t * pNtk, Vec_Ptr_t * vRoots, Vec_Int_t * vValues )
|
||||
Abc_Ntk_t * Abc_NtkCreateTarget( Abc_Ntk_t * pNtk, Vec_Ptr_t * vRoots, Vec_Int_t * vValues )
|
||||
{
|
||||
Vec_Ptr_t * vNodes;
|
||||
Abc_Ntk_t * pNtkNew;
|
||||
|
|
@ -450,7 +520,7 @@ Abc_Ntk_t * Abc_NtkCreateCone( Abc_Ntk_t * pNtk, Vec_Ptr_t * vRoots, Vec_Int_t *
|
|||
// start the network
|
||||
Abc_NtkCleanCopy( pNtk );
|
||||
pNtkNew = Abc_NtkAlloc( ABC_NTK_STRASH, ABC_FUNC_AIG );
|
||||
pNtkNew->pName = util_strsav(pNtk->pName);
|
||||
pNtkNew->pName = Extra_UtilStrsav(pNtk->pName);
|
||||
|
||||
// collect the nodes in the TFI of the output
|
||||
vNodes = Abc_NtkDfsNodes( pNtk, (Abc_Obj_t **)vRoots->pArray, vRoots->nSize );
|
||||
|
|
@ -483,7 +553,7 @@ Abc_Ntk_t * Abc_NtkCreateCone( Abc_Ntk_t * pNtk, Vec_Ptr_t * vRoots, Vec_Int_t *
|
|||
Abc_ObjAddFanin( pNodePo, pFinal );
|
||||
Abc_NtkLogicStoreName( pNodePo, "miter" );
|
||||
if ( !Abc_NtkCheck( pNtkNew ) )
|
||||
fprintf( stdout, "Abc_NtkCreateCone(): Network check has failed.\n" );
|
||||
fprintf( stdout, "Abc_NtkCreateTarget(): Network check has failed.\n" );
|
||||
return pNtkNew;
|
||||
}
|
||||
|
||||
|
|
@ -505,7 +575,7 @@ Abc_Ntk_t * Abc_NtkCreateFromNode( Abc_Ntk_t * pNtk, Abc_Obj_t * pNode )
|
|||
int i;
|
||||
// start the network
|
||||
pNtkNew = Abc_NtkAlloc( pNtk->ntkType, pNtk->ntkFunc );
|
||||
pNtkNew->pName = util_strsav(Abc_ObjName(pNode));
|
||||
pNtkNew->pName = Extra_UtilStrsav(Abc_ObjName(pNode));
|
||||
// add the PIs corresponding to the fanins of the node
|
||||
Abc_ObjForEachFanin( pNode, pFanin, i )
|
||||
{
|
||||
|
|
@ -544,7 +614,7 @@ Abc_Ntk_t * Abc_NtkCreateWithNode( char * pSop )
|
|||
int i, nVars;
|
||||
// start the network
|
||||
pNtkNew = Abc_NtkAlloc( ABC_NTK_LOGIC, ABC_FUNC_SOP );
|
||||
pNtkNew->pName = util_strsav("ex");
|
||||
pNtkNew->pName = Extra_UtilStrsav("ex");
|
||||
// create PIs
|
||||
Vec_PtrPush( pNtkNew->vObjs, NULL );
|
||||
nVars = Abc_SopGetVarNum( pSop );
|
||||
|
|
|
|||
|
|
@ -24,10 +24,8 @@
|
|||
/// DECLARATIONS ///
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static int Abc_NodeRefDeref( Abc_Obj_t * pNode, bool fReference, bool fLabel, Vec_Ptr_t * vNodes );
|
||||
static int Abc_NodeMffcCountSupp( Vec_Ptr_t * vNodes );
|
||||
static int Abc_NodeRefDeref( Abc_Obj_t * pNode, bool fReference, bool fLabel );
|
||||
static int Abc_NodeRefDerefStop( Abc_Obj_t * pNode, bool fReference );
|
||||
static int Abc_NodeDeref( Abc_Obj_t * pNode, Vec_Ptr_t * vNodes );
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
/// FUNCTION DEFINITIONS ///
|
||||
|
|
@ -52,43 +50,13 @@ int Abc_NodeMffcSize( Abc_Obj_t * pNode )
|
|||
assert( Abc_ObjIsNode( pNode ) );
|
||||
if ( Abc_ObjFaninNum(pNode) == 0 )
|
||||
return 0;
|
||||
nConeSize1 = Abc_NodeRefDeref( pNode, 0, 0, NULL ); // dereference
|
||||
nConeSize2 = Abc_NodeRefDeref( pNode, 1, 0, NULL ); // reference
|
||||
nConeSize1 = Abc_NodeRefDeref( pNode, 0, 0 ); // dereference
|
||||
nConeSize2 = Abc_NodeRefDeref( pNode, 1, 0 ); // reference
|
||||
assert( nConeSize1 == nConeSize2 );
|
||||
assert( nConeSize1 > 0 );
|
||||
return nConeSize1;
|
||||
}
|
||||
|
||||
/**Function*************************************************************
|
||||
|
||||
Synopsis [Returns the MFFC size.]
|
||||
|
||||
Description []
|
||||
|
||||
SideEffects []
|
||||
|
||||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
int Abc_NodeMffcSizeSupp( Abc_Obj_t * pNode )
|
||||
{
|
||||
Vec_Ptr_t * vNodes;
|
||||
int nSuppSize, nConeSize1, nConeSize2;
|
||||
assert( Abc_NtkIsStrash(pNode->pNtk) );
|
||||
assert( !Abc_ObjIsComplement( pNode ) );
|
||||
assert( Abc_ObjIsNode( pNode ) );
|
||||
if ( Abc_ObjFaninNum(pNode) == 0 )
|
||||
return 0;
|
||||
vNodes = Vec_PtrAlloc( 10 );
|
||||
nConeSize1 = Abc_NodeRefDeref( pNode, 0, 0, vNodes ); // dereference
|
||||
nSuppSize = Abc_NodeMffcCountSupp(vNodes);
|
||||
nConeSize2 = Abc_NodeRefDeref( pNode, 1, 0, NULL ); // reference
|
||||
assert( nConeSize1 == nConeSize2 );
|
||||
assert( nConeSize1 > 0 );
|
||||
Vec_PtrFree(vNodes);
|
||||
return nSuppSize;
|
||||
}
|
||||
|
||||
/**Function*************************************************************
|
||||
|
||||
Synopsis [Returns the MFFC size while stopping at the complemented edges.]
|
||||
|
|
@ -129,80 +97,18 @@ int Abc_NodeMffcSizeStop( Abc_Obj_t * pNode )
|
|||
int Abc_NodeMffcLabel( Abc_Obj_t * pNode )
|
||||
{
|
||||
int nConeSize1, nConeSize2;
|
||||
assert( Abc_NtkIsStrash(pNode->pNtk) );
|
||||
assert( !Abc_ObjIsComplement( pNode ) );
|
||||
assert( Abc_ObjIsNode( pNode ) );
|
||||
if ( Abc_ObjFaninNum(pNode) == 0 )
|
||||
return 0;
|
||||
nConeSize1 = Abc_NodeRefDeref( pNode, 0, 1, NULL ); // dereference
|
||||
nConeSize2 = Abc_NodeRefDeref( pNode, 1, 0, NULL ); // reference
|
||||
nConeSize1 = Abc_NodeRefDeref( pNode, 0, 1 ); // dereference
|
||||
nConeSize2 = Abc_NodeRefDeref( pNode, 1, 0 ); // reference
|
||||
assert( nConeSize1 == nConeSize2 );
|
||||
assert( nConeSize1 > 0 );
|
||||
return nConeSize1;
|
||||
}
|
||||
|
||||
/**Function*************************************************************
|
||||
|
||||
Synopsis [Returns the MFFC size.]
|
||||
|
||||
Description [Profiling shows that this procedure runs the same as
|
||||
the above one, not faster.]
|
||||
|
||||
SideEffects []
|
||||
|
||||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
int Abc_NodeMffcLabelFast( Abc_Obj_t * pNode, Vec_Ptr_t * vNodes )
|
||||
{
|
||||
Abc_Obj_t * pTemp;
|
||||
int nConeSize, i;
|
||||
|
||||
assert( !Abc_ObjIsComplement( pNode ) );
|
||||
assert( Abc_ObjIsNode( pNode ) );
|
||||
if ( Abc_ObjFaninNum(pNode) == 0 )
|
||||
return 0;
|
||||
|
||||
Vec_PtrClear( vNodes );
|
||||
nConeSize = Abc_NodeDeref( pNode, vNodes );
|
||||
// label the nodes with the current ID and ref their children
|
||||
Vec_PtrForEachEntry( vNodes, pTemp, i )
|
||||
{
|
||||
Abc_NodeSetTravIdCurrent( pTemp );
|
||||
if ( Abc_ObjIsCi(pTemp) )
|
||||
continue;
|
||||
Abc_ObjFanin0(pTemp)->vFanouts.nSize++;
|
||||
Abc_ObjFanin1(pTemp)->vFanouts.nSize++;
|
||||
}
|
||||
return nConeSize;
|
||||
}
|
||||
|
||||
/**Function*************************************************************
|
||||
|
||||
Synopsis [Collects the nodes in MFFC in the topological order.]
|
||||
|
||||
Description []
|
||||
|
||||
SideEffects []
|
||||
|
||||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
Vec_Ptr_t * Abc_NodeMffcCollect( Abc_Obj_t * pNode )
|
||||
{
|
||||
Vec_Ptr_t * vNodes;
|
||||
int nConeSize1, nConeSize2;
|
||||
assert( !Abc_ObjIsComplement( pNode ) );
|
||||
assert( Abc_ObjIsNode( pNode ) );
|
||||
vNodes = Vec_PtrAlloc( 8 );
|
||||
if ( Abc_ObjFaninNum(pNode) == 0 )
|
||||
return vNodes;
|
||||
nConeSize1 = Abc_NodeRefDeref( pNode, 0, 0, vNodes ); // dereference
|
||||
nConeSize2 = Abc_NodeRefDeref( pNode, 1, 0, NULL ); // reference
|
||||
assert( nConeSize1 == nConeSize2 );
|
||||
assert( nConeSize1 > 0 );
|
||||
return vNodes;
|
||||
}
|
||||
|
||||
/**Function*************************************************************
|
||||
|
||||
Synopsis [References/references the node and returns MFFC size.]
|
||||
|
|
@ -214,16 +120,13 @@ Vec_Ptr_t * Abc_NodeMffcCollect( Abc_Obj_t * pNode )
|
|||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
int Abc_NodeRefDeref( Abc_Obj_t * pNode, bool fReference, bool fLabel, Vec_Ptr_t * vNodes )
|
||||
int Abc_NodeRefDeref( Abc_Obj_t * pNode, bool fReference, bool fLabel )
|
||||
{
|
||||
Abc_Obj_t * pNode0, * pNode1;
|
||||
int Counter;
|
||||
// label visited nodes
|
||||
if ( fLabel )
|
||||
Abc_NodeSetTravIdCurrent( pNode );
|
||||
// collect visited nodes
|
||||
if ( vNodes )
|
||||
Vec_PtrPush( vNodes, pNode );
|
||||
// skip the CI
|
||||
if ( Abc_ObjIsCi(pNode) )
|
||||
return 0;
|
||||
|
|
@ -234,109 +137,22 @@ int Abc_NodeRefDeref( Abc_Obj_t * pNode, bool fReference, bool fLabel, Vec_Ptr_t
|
|||
if ( fReference )
|
||||
{
|
||||
if ( pNode0->vFanouts.nSize++ == 0 )
|
||||
Counter += Abc_NodeRefDeref( pNode0, fReference, fLabel, vNodes );
|
||||
Counter += Abc_NodeRefDeref( pNode0, fReference, fLabel );
|
||||
if ( pNode1->vFanouts.nSize++ == 0 )
|
||||
Counter += Abc_NodeRefDeref( pNode1, fReference, fLabel, vNodes );
|
||||
Counter += Abc_NodeRefDeref( pNode1, fReference, fLabel );
|
||||
}
|
||||
else
|
||||
{
|
||||
assert( pNode0->vFanouts.nSize > 0 );
|
||||
assert( pNode1->vFanouts.nSize > 0 );
|
||||
if ( --pNode0->vFanouts.nSize == 0 )
|
||||
Counter += Abc_NodeRefDeref( pNode0, fReference, fLabel, vNodes );
|
||||
Counter += Abc_NodeRefDeref( pNode0, fReference, fLabel );
|
||||
if ( --pNode1->vFanouts.nSize == 0 )
|
||||
Counter += Abc_NodeRefDeref( pNode1, fReference, fLabel, vNodes );
|
||||
Counter += Abc_NodeRefDeref( pNode1, fReference, fLabel );
|
||||
}
|
||||
return Counter;
|
||||
}
|
||||
|
||||
/**Function*************************************************************
|
||||
|
||||
Synopsis [References/references the node and returns MFFC supp size.]
|
||||
|
||||
Description []
|
||||
|
||||
SideEffects []
|
||||
|
||||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
int Abc_NodeMffcCountSupp( Vec_Ptr_t * vNodes )
|
||||
{
|
||||
Abc_Obj_t * pNode, * pNode0, * pNode1;
|
||||
int i, Counter = 0;
|
||||
Vec_PtrForEachEntry( vNodes, pNode, i )
|
||||
{
|
||||
if ( Abc_ObjIsCi(pNode) )
|
||||
{
|
||||
if ( pNode->fMarkB == 0 )
|
||||
{
|
||||
pNode->fMarkB = 1;
|
||||
Counter++;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
pNode0 = Abc_ObjFanin0(pNode);
|
||||
if ( pNode0->vFanouts.nSize > 0 && pNode0->fMarkB == 0 )
|
||||
{
|
||||
pNode0->fMarkB = 1;
|
||||
Counter++;
|
||||
}
|
||||
pNode1 = Abc_ObjFanin1(pNode);
|
||||
if ( pNode1->vFanouts.nSize > 0 && pNode1->fMarkB == 0 )
|
||||
{
|
||||
pNode1->fMarkB = 1;
|
||||
Counter++;
|
||||
}
|
||||
}
|
||||
Vec_PtrForEachEntry( vNodes, pNode, i )
|
||||
{
|
||||
if ( Abc_ObjIsCi(pNode) )
|
||||
{
|
||||
pNode->fMarkB = 0;
|
||||
continue;
|
||||
}
|
||||
pNode0 = Abc_ObjFanin0(pNode);
|
||||
pNode0->fMarkB = 0;
|
||||
pNode1 = Abc_ObjFanin1(pNode);
|
||||
pNode1->fMarkB = 0;
|
||||
}
|
||||
return Counter;
|
||||
|
||||
}
|
||||
|
||||
/**Function*************************************************************
|
||||
|
||||
Synopsis [References/references the node and returns MFFC size.]
|
||||
|
||||
Description []
|
||||
|
||||
SideEffects []
|
||||
|
||||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
int Abc_NodeDeref( Abc_Obj_t * pNode, Vec_Ptr_t * vNodes )
|
||||
{
|
||||
Abc_Obj_t * pNode0, * pNode1;
|
||||
int Counter;
|
||||
// collect visited nodes
|
||||
Vec_PtrPush( vNodes, pNode );
|
||||
// skip the CI
|
||||
if ( Abc_ObjIsCi(pNode) )
|
||||
return 0;
|
||||
// process the internal node
|
||||
pNode0 = Abc_ObjFanin0(pNode);
|
||||
pNode1 = Abc_ObjFanin1(pNode);
|
||||
assert( pNode0->vFanouts.nSize > 0 );
|
||||
assert( pNode1->vFanouts.nSize > 0 );
|
||||
Counter = 1;
|
||||
if ( --pNode0->vFanouts.nSize == 0 )
|
||||
Counter += Abc_NodeDeref( pNode0, vNodes );
|
||||
if ( --pNode1->vFanouts.nSize == 0 )
|
||||
Counter += Abc_NodeDeref( pNode1, vNodes );
|
||||
return Counter;
|
||||
}
|
||||
|
||||
/**Function*************************************************************
|
||||
|
||||
|
|
@ -379,6 +195,138 @@ int Abc_NodeRefDerefStop( Abc_Obj_t * pNode, bool fReference )
|
|||
return Counter;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**Function*************************************************************
|
||||
|
||||
Synopsis [Dereferences the node's MFFC.]
|
||||
|
||||
Description []
|
||||
|
||||
SideEffects []
|
||||
|
||||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
int Abc_NodeDeref_rec( Abc_Obj_t * pNode )
|
||||
{
|
||||
Abc_Obj_t * pFanin;
|
||||
int i, Counter = 1;
|
||||
if ( Abc_ObjIsCi(pNode) )
|
||||
return 0;
|
||||
Abc_ObjForEachFanin( pNode, pFanin, i )
|
||||
{
|
||||
assert( pFanin->vFanouts.nSize > 0 );
|
||||
if ( --pFanin->vFanouts.nSize == 0 )
|
||||
Counter += Abc_NodeDeref_rec( pFanin );
|
||||
}
|
||||
return Counter;
|
||||
}
|
||||
|
||||
/**Function*************************************************************
|
||||
|
||||
Synopsis [References the node's MFFC.]
|
||||
|
||||
Description []
|
||||
|
||||
SideEffects []
|
||||
|
||||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
int Abc_NodeRef_rec( Abc_Obj_t * pNode )
|
||||
{
|
||||
Abc_Obj_t * pFanin;
|
||||
int i, Counter = 1;
|
||||
if ( Abc_ObjIsCi(pNode) )
|
||||
return 0;
|
||||
Abc_ObjForEachFanin( pNode, pFanin, i )
|
||||
{
|
||||
if ( pFanin->vFanouts.nSize++ == 0 )
|
||||
Counter += Abc_NodeRef_rec( pFanin );
|
||||
}
|
||||
return Counter;
|
||||
}
|
||||
|
||||
/**Function*************************************************************
|
||||
|
||||
Synopsis [Collects the internal and boundary nodes in the derefed MFFC.]
|
||||
|
||||
Description []
|
||||
|
||||
SideEffects []
|
||||
|
||||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
void Abc_NodeMffsConeSupp_rec( Abc_Obj_t * pNode, Vec_Ptr_t * vCone, Vec_Ptr_t * vSupp, int fTopmost )
|
||||
{
|
||||
Abc_Obj_t * pFanin;
|
||||
int i;
|
||||
// skip visited nodes
|
||||
if ( Abc_NodeIsTravIdCurrent(pNode) )
|
||||
return;
|
||||
Abc_NodeSetTravIdCurrent(pNode);
|
||||
// add to the new support nodes
|
||||
if ( !fTopmost && (Abc_ObjIsCi(pNode) || pNode->vFanouts.nSize > 0) )
|
||||
{
|
||||
Vec_PtrPush( vSupp, pNode );
|
||||
return;
|
||||
}
|
||||
// recur on the children
|
||||
Abc_ObjForEachFanin( pNode, pFanin, i )
|
||||
Abc_NodeMffsConeSupp_rec( pFanin, vCone, vSupp, 0 );
|
||||
// collect the internal node
|
||||
Vec_PtrPush( vCone, pNode );
|
||||
}
|
||||
|
||||
/**Function*************************************************************
|
||||
|
||||
Synopsis [Collects the support of the derefed MFFC.]
|
||||
|
||||
Description []
|
||||
|
||||
SideEffects []
|
||||
|
||||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
void Abc_NodeMffsConeSupp( Abc_Obj_t * pNode, Vec_Ptr_t * vCone, Vec_Ptr_t * vSupp )
|
||||
{
|
||||
assert( Abc_ObjIsNode(pNode) );
|
||||
assert( !Abc_ObjIsComplement(pNode) );
|
||||
Vec_PtrClear( vCone );
|
||||
Vec_PtrClear( vSupp );
|
||||
Abc_NtkIncrementTravId( pNode->pNtk );
|
||||
Abc_NodeMffsConeSupp_rec( pNode, vCone, vSupp, 1 );
|
||||
}
|
||||
|
||||
/**Function*************************************************************
|
||||
|
||||
Synopsis [Collects the support of the derefed MFFC.]
|
||||
|
||||
Description []
|
||||
|
||||
SideEffects []
|
||||
|
||||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
void Abc_NodeMffsConeSuppPrint( Abc_Obj_t * pNode )
|
||||
{
|
||||
Vec_Ptr_t * vCone, * vSupp;
|
||||
vCone = Vec_PtrAlloc( 100 );
|
||||
vSupp = Vec_PtrAlloc( 100 );
|
||||
Abc_NodeDeref_rec( pNode );
|
||||
Abc_NodeMffsConeSupp( pNode, vCone, vSupp );
|
||||
Abc_NodeRef_rec( pNode );
|
||||
printf( "Cone = %6d. Supp = %6d. \n", Vec_PtrSize(vCone), Vec_PtrSize(vSupp) );
|
||||
Vec_PtrFree( vCone );
|
||||
Vec_PtrFree( vSupp );
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
/// END OF FILE ///
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
|||
|
|
@ -28,8 +28,6 @@
|
|||
/// DECLARATIONS ///
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static int Abc_NodeRefDeref( Abc_Obj_t * pNode, bool fFanouts, bool fReference );
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
/// FUNCTION DEFINITIONS ///
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -603,6 +601,35 @@ bool Abc_NodeIsMuxType( Abc_Obj_t * pNode )
|
|||
(Abc_ObjFaninId1(pNode0) == Abc_ObjFaninId1(pNode1) && (Abc_ObjFaninC1(pNode0) ^ Abc_ObjFaninC1(pNode1)));
|
||||
}
|
||||
|
||||
/**Function*************************************************************
|
||||
|
||||
Synopsis [Returns 1 if the node is the control type of the MUX.]
|
||||
|
||||
Description []
|
||||
|
||||
SideEffects []
|
||||
|
||||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
bool Abc_NodeIsMuxControlType( Abc_Obj_t * pNode )
|
||||
{
|
||||
Abc_Obj_t * pNode0, * pNode1;
|
||||
// check that the node is regular
|
||||
assert( !Abc_ObjIsComplement(pNode) );
|
||||
// skip the node that do not have two fanouts
|
||||
if ( Abc_ObjFanoutNum(pNode) != 2 )
|
||||
return 0;
|
||||
// get the fanouts
|
||||
pNode0 = Abc_ObjFanout( pNode, 0 );
|
||||
pNode1 = Abc_ObjFanout( pNode, 1 );
|
||||
// if they have more than one fanout, we are not interested
|
||||
if ( Abc_ObjFanoutNum(pNode0) != 1 || Abc_ObjFanoutNum(pNode1) != 1 )
|
||||
return 0;
|
||||
// if the fanouts have the same fanout, this is MUX or EXOR (or a redundant gate (CA)(CB))
|
||||
return Abc_ObjFanout0(pNode0) == Abc_ObjFanout0(pNode1);
|
||||
}
|
||||
|
||||
/**Function*************************************************************
|
||||
|
||||
Synopsis [Recognizes what nodes are control and data inputs of a MUX.]
|
||||
|
|
|
|||
1045
src/base/abci/abc.c
1045
src/base/abci/abc.c
File diff suppressed because it is too large
Load Diff
|
|
@ -24,8 +24,8 @@
|
|||
/// DECLARATIONS ///
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static void Abc_NtkBalancePerform( Abc_Ntk_t * pNtk, Abc_Ntk_t * pNtkAig, bool fDuplicate, bool fSelective );
|
||||
static Abc_Obj_t * Abc_NodeBalance_rec( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pNode, Vec_Vec_t * vStorage, int Level, bool fDuplicate, bool fSelective );
|
||||
static void Abc_NtkBalancePerform( Abc_Ntk_t * pNtk, Abc_Ntk_t * pNtkAig, bool fDuplicate, bool fSelective, bool fUpdateLevel );
|
||||
static Abc_Obj_t * Abc_NodeBalance_rec( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pNode, Vec_Vec_t * vStorage, int Level, bool fDuplicate, bool fSelective, bool fUpdateLevel );
|
||||
static Vec_Ptr_t * Abc_NodeBalanceCone( Abc_Obj_t * pNode, Vec_Vec_t * vSuper, int Level, int fDuplicate, bool fSelective );
|
||||
static int Abc_NodeBalanceCone_rec( Abc_Obj_t * pNode, Vec_Ptr_t * vSuper, bool fFirst, bool fDuplicate, bool fSelective );
|
||||
static void Abc_NtkMarkCriticalNodes( Abc_Ntk_t * pNtk );
|
||||
|
|
@ -45,7 +45,7 @@ static void Abc_NtkMarkCriticalNodes( Abc_Ntk_t * pNtk );
|
|||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
Abc_Ntk_t * Abc_NtkBalance( Abc_Ntk_t * pNtk, bool fDuplicate, bool fSelective )
|
||||
Abc_Ntk_t * Abc_NtkBalance( Abc_Ntk_t * pNtk, bool fDuplicate, bool fSelective, bool fUpdateLevel )
|
||||
{
|
||||
Abc_Ntk_t * pNtkAig;
|
||||
assert( Abc_NtkIsStrash(pNtk) );
|
||||
|
|
@ -57,7 +57,7 @@ Abc_Ntk_t * Abc_NtkBalance( Abc_Ntk_t * pNtk, bool fDuplicate, bool fSelective )
|
|||
}
|
||||
// perform balancing
|
||||
pNtkAig = Abc_NtkStartFrom( pNtk, ABC_NTK_STRASH, ABC_FUNC_AIG );
|
||||
Abc_NtkBalancePerform( pNtk, pNtkAig, fDuplicate, fSelective );
|
||||
Abc_NtkBalancePerform( pNtk, pNtkAig, fDuplicate, fSelective, fUpdateLevel );
|
||||
Abc_NtkFinalize( pNtk, pNtkAig );
|
||||
// undo the required times
|
||||
if ( fSelective )
|
||||
|
|
@ -88,7 +88,7 @@ Abc_Ntk_t * Abc_NtkBalance( Abc_Ntk_t * pNtk, bool fDuplicate, bool fSelective )
|
|||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
void Abc_NtkBalancePerform( Abc_Ntk_t * pNtk, Abc_Ntk_t * pNtkAig, bool fDuplicate, bool fSelective )
|
||||
void Abc_NtkBalancePerform( Abc_Ntk_t * pNtk, Abc_Ntk_t * pNtkAig, bool fDuplicate, bool fSelective, bool fUpdateLevel )
|
||||
{
|
||||
int fCheck = 1;
|
||||
ProgressBar * pProgress;
|
||||
|
|
@ -107,7 +107,7 @@ void Abc_NtkBalancePerform( Abc_Ntk_t * pNtk, Abc_Ntk_t * pNtkAig, bool fDuplica
|
|||
Extra_ProgressBarUpdate( pProgress, i, NULL );
|
||||
// strash the driver node
|
||||
pDriver = Abc_ObjFanin0(pNode);
|
||||
Abc_NodeBalance_rec( pNtkAig, pDriver, vStorage, 0, fDuplicate, fSelective );
|
||||
Abc_NodeBalance_rec( pNtkAig, pDriver, vStorage, 0, fDuplicate, fSelective, fUpdateLevel );
|
||||
}
|
||||
Extra_ProgressBarStop( pProgress );
|
||||
Vec_VecFree( vStorage );
|
||||
|
|
@ -115,38 +115,93 @@ void Abc_NtkBalancePerform( Abc_Ntk_t * pNtk, Abc_Ntk_t * pNtkAig, bool fDuplica
|
|||
|
||||
/**Function*************************************************************
|
||||
|
||||
Synopsis [Randomizes the node positions.]
|
||||
Synopsis [Finds the left bound on the next candidate to be paired.]
|
||||
|
||||
Description []
|
||||
Description [The nodes in the array are in the decreasing order of levels.
|
||||
The last node in the array has the smallest level. By default it would be paired
|
||||
with the next node on the left. However, it may be possible to pair it with some
|
||||
other node on the left, in such a way that the new node is shared. This procedure
|
||||
finds the index of the left-most node, which can be paired with the last node.]
|
||||
|
||||
SideEffects []
|
||||
|
||||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
void Abc_NodeBalanceRandomize( Vec_Ptr_t * vSuper )
|
||||
int Abc_NodeBalanceFindLeft( Vec_Ptr_t * vSuper )
|
||||
{
|
||||
Abc_Obj_t * pNode1, * pNode2;
|
||||
int i, Signature;
|
||||
Abc_Obj_t * pNodeRight, * pNodeLeft;
|
||||
int Current;
|
||||
// if two or less nodes, pair with the first
|
||||
if ( Vec_PtrSize(vSuper) < 3 )
|
||||
return;
|
||||
pNode1 = Vec_PtrEntry( vSuper, Vec_PtrSize(vSuper)-2 );
|
||||
pNode2 = Vec_PtrEntry( vSuper, Vec_PtrSize(vSuper)-3 );
|
||||
if ( Abc_ObjRegular(pNode1)->Level != Abc_ObjRegular(pNode2)->Level )
|
||||
return;
|
||||
// some reordering will be performed
|
||||
Signature = rand();
|
||||
for ( i = Vec_PtrSize(vSuper)-2; i > 0; i-- )
|
||||
return 0;
|
||||
// set the pointer to the one before the last
|
||||
Current = Vec_PtrSize(vSuper) - 2;
|
||||
pNodeRight = Vec_PtrEntry( vSuper, Current );
|
||||
// go through the nodes to the left of this one
|
||||
for ( Current--; Current >= 0; Current-- )
|
||||
{
|
||||
pNode1 = Vec_PtrEntry( vSuper, i );
|
||||
pNode2 = Vec_PtrEntry( vSuper, i-1 );
|
||||
if ( Abc_ObjRegular(pNode1)->Level != Abc_ObjRegular(pNode2)->Level )
|
||||
return;
|
||||
if ( Signature & (1 << (i % 10)) )
|
||||
continue;
|
||||
Vec_PtrWriteEntry( vSuper, i, pNode2 );
|
||||
Vec_PtrWriteEntry( vSuper, i-1, pNode1 );
|
||||
// get the next node on the left
|
||||
pNodeLeft = Vec_PtrEntry( vSuper, Current );
|
||||
// if the level of this node is different, quit the loop
|
||||
if ( Abc_ObjRegular(pNodeLeft)->Level != Abc_ObjRegular(pNodeRight)->Level )
|
||||
break;
|
||||
}
|
||||
Current++;
|
||||
// get the node, for which the equality holds
|
||||
pNodeLeft = Vec_PtrEntry( vSuper, Current );
|
||||
assert( Abc_ObjRegular(pNodeLeft)->Level == Abc_ObjRegular(pNodeRight)->Level );
|
||||
return Current;
|
||||
}
|
||||
|
||||
/**Function*************************************************************
|
||||
|
||||
Synopsis [Moves closer to the end the node that is best for sharing.]
|
||||
|
||||
Description [If there is no node with sharing, randomly chooses one of
|
||||
the legal nodes.]
|
||||
|
||||
SideEffects []
|
||||
|
||||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
void Abc_NodeBalancePermute( Abc_Ntk_t * pNtkNew, Vec_Ptr_t * vSuper, int LeftBound )
|
||||
{
|
||||
Abc_Obj_t * pNode1, * pNode2, * pNode3;
|
||||
int RightBound, i;
|
||||
// get the right bound
|
||||
RightBound = Vec_PtrSize(vSuper) - 2;
|
||||
assert( LeftBound <= RightBound );
|
||||
if ( LeftBound == RightBound )
|
||||
return;
|
||||
// get the two last nodes
|
||||
pNode1 = Vec_PtrEntry( vSuper, RightBound + 1 );
|
||||
pNode2 = Vec_PtrEntry( vSuper, RightBound );
|
||||
// find the first node that can be shared
|
||||
for ( i = RightBound; i >= LeftBound; i-- )
|
||||
{
|
||||
pNode3 = Vec_PtrEntry( vSuper, i );
|
||||
if ( Abc_AigAndLookup( pNtkNew->pManFunc, pNode1, pNode3 ) )
|
||||
{
|
||||
if ( pNode3 == pNode2 )
|
||||
return;
|
||||
Vec_PtrWriteEntry( vSuper, i, pNode2 );
|
||||
Vec_PtrWriteEntry( vSuper, RightBound, pNode3 );
|
||||
return;
|
||||
}
|
||||
}
|
||||
/*
|
||||
// we did not find the node to share, randomize choice
|
||||
{
|
||||
int Choice = rand() % (RightBound - LeftBound + 1);
|
||||
pNode3 = Vec_PtrEntry( vSuper, LeftBound + Choice );
|
||||
if ( pNode3 == pNode2 )
|
||||
return;
|
||||
Vec_PtrWriteEntry( vSuper, LeftBound + Choice, pNode2 );
|
||||
Vec_PtrWriteEntry( vSuper, RightBound, pNode3 );
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
/**Function*************************************************************
|
||||
|
|
@ -160,12 +215,12 @@ void Abc_NodeBalanceRandomize( Vec_Ptr_t * vSuper )
|
|||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
Abc_Obj_t * Abc_NodeBalance_rec( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pNodeOld, Vec_Vec_t * vStorage, int Level, bool fDuplicate, bool fSelective )
|
||||
Abc_Obj_t * Abc_NodeBalance_rec( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pNodeOld, Vec_Vec_t * vStorage, int Level, bool fDuplicate, bool fSelective, bool fUpdateLevel )
|
||||
{
|
||||
Abc_Aig_t * pMan = pNtkNew->pManFunc;
|
||||
Abc_Obj_t * pNodeNew, * pNode1, * pNode2;
|
||||
Vec_Ptr_t * vSuper;
|
||||
int i;
|
||||
int i, LeftBound;
|
||||
assert( !Abc_ObjIsComplement(pNodeOld) );
|
||||
// return if the result if known
|
||||
if ( pNodeOld->pCopy )
|
||||
|
|
@ -181,7 +236,7 @@ Abc_Obj_t * Abc_NodeBalance_rec( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pNodeOld, Vec_
|
|||
// for each old node, derive the new well-balanced node
|
||||
for ( i = 0; i < vSuper->nSize; i++ )
|
||||
{
|
||||
pNodeNew = Abc_NodeBalance_rec( pNtkNew, Abc_ObjRegular(vSuper->pArray[i]), vStorage, Level + 1, fDuplicate, fSelective );
|
||||
pNodeNew = Abc_NodeBalance_rec( pNtkNew, Abc_ObjRegular(vSuper->pArray[i]), vStorage, Level + 1, fDuplicate, fSelective, fUpdateLevel );
|
||||
vSuper->pArray[i] = Abc_ObjNotCond( pNodeNew, Abc_ObjIsComplement(vSuper->pArray[i]) );
|
||||
}
|
||||
if ( vSuper->nSize < 2 )
|
||||
|
|
@ -192,8 +247,10 @@ Abc_Obj_t * Abc_NodeBalance_rec( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pNodeOld, Vec_
|
|||
assert( vSuper->nSize > 1 );
|
||||
while ( vSuper->nSize > 1 )
|
||||
{
|
||||
// randomize the node positions
|
||||
// Abc_NodeBalanceRandomize( vSuper );
|
||||
// find the left bound on the node to be paired
|
||||
LeftBound = (!fUpdateLevel)? 0 : Abc_NodeBalanceFindLeft( vSuper );
|
||||
// find the node that can be shared (if no such node, randomize choice)
|
||||
Abc_NodeBalancePermute( pNtkNew, vSuper, LeftBound );
|
||||
// pull out the last two nodes
|
||||
pNode1 = Vec_PtrPop(vSuper);
|
||||
pNode2 = Vec_PtrPop(vSuper);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,53 @@
|
|||
/**CFile****************************************************************
|
||||
|
||||
FileName [abcCollapse.c]
|
||||
|
||||
SystemName [ABC: Logic synthesis and verification system.]
|
||||
|
||||
PackageName [Network and node package.]
|
||||
|
||||
Synopsis [Collapsing the network into two-levels.]
|
||||
|
||||
Author [Alan Mishchenko]
|
||||
|
||||
Affiliation [UC Berkeley]
|
||||
|
||||
Date [Ver. 1.0. Started - June 20, 2005.]
|
||||
|
||||
Revision [$Id: abcCollapse.c,v 1.00 2005/06/20 00:00:00 alanmi Exp $]
|
||||
|
||||
***********************************************************************/
|
||||
|
||||
#include "abc.h"
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
/// DECLARATIONS ///
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
/// FUNCTION DEFINITIONS ///
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/**Function*************************************************************
|
||||
|
||||
Synopsis [Collapses the network.]
|
||||
|
||||
Description []
|
||||
|
||||
SideEffects []
|
||||
|
||||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
Abc_Ntk_t * Abc_NtkCollapseSop( Abc_Ntk_t * pNtk, int fVerbose )
|
||||
{
|
||||
Abc_Ntk_t * pNtkNew;
|
||||
pNtkNew = NULL;
|
||||
return pNtkNew;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
/// END OF FILE ///
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
|
@ -57,10 +57,41 @@ Cut_Man_t * Abc_NtkCuts( Abc_Ntk_t * pNtk, Cut_Params_t * pParams )
|
|||
extern void Abc_NtkBalanceDetach( Abc_Ntk_t * pNtk );
|
||||
|
||||
assert( Abc_NtkIsStrash(pNtk) );
|
||||
|
||||
/*
|
||||
if ( pParams->fMulti )
|
||||
Abc_NtkBalanceAttach(pNtk);
|
||||
{
|
||||
Abc_Obj_t * pNode, * pNodeA, * pNodeB, * pNodeC;
|
||||
int nFactors;
|
||||
// lebel the nodes, which will be the roots of factor-cuts
|
||||
// mark the multiple-fanout nodes
|
||||
Abc_AigForEachAnd( pNtk, pNode, i )
|
||||
if ( pNode->vFanouts.nSize > 1 )
|
||||
pNode->fMarkB = 1;
|
||||
// unmark the control inputs of MUXes and inputs of EXOR gates
|
||||
Abc_AigForEachAnd( pNtk, pNode, i )
|
||||
{
|
||||
if ( !Abc_NodeIsMuxType(pNode) )
|
||||
continue;
|
||||
|
||||
pNodeC = Abc_NodeRecognizeMux( pNode, &pNodeA, &pNodeB );
|
||||
// if real children are used, skip
|
||||
if ( Abc_ObjFanin0(pNode)->vFanouts.nSize > 1 || Abc_ObjFanin1(pNode)->vFanouts.nSize > 1 )
|
||||
continue;
|
||||
|
||||
if ( pNodeC->vFanouts.nSize == 2 )
|
||||
pNodeC->fMarkB = 0;
|
||||
if ( Abc_ObjRegular(pNodeA) == Abc_ObjRegular(pNodeB) && Abc_ObjRegular(pNodeA)->vFanouts.nSize == 2 )
|
||||
Abc_ObjRegular(pNodeA)->fMarkB = 0;
|
||||
}
|
||||
// mark the PO drivers
|
||||
// Abc_NtkForEachCo( pNtk, pNode, i )
|
||||
// Abc_ObjFanin0(pNode)->fMarkB = 1;
|
||||
nFactors = 0;
|
||||
Abc_AigForEachAnd( pNtk, pNode, i )
|
||||
nFactors += pNode->fMarkB;
|
||||
printf( "Total nodes = %6d. Total factors = %6d.\n", Abc_NtkNodeNum(pNtk), nFactors );
|
||||
}
|
||||
*/
|
||||
// start the manager
|
||||
pParams->nIdsMax = Abc_NtkObjNumMax( pNtk );
|
||||
p = Cut_ManStart( pParams );
|
||||
|
|
@ -104,8 +135,13 @@ Cut_Man_t * Abc_NtkCuts( Abc_Ntk_t * pNtk, Cut_Params_t * pParams )
|
|||
}
|
||||
Vec_PtrFree( vNodes );
|
||||
Vec_IntFree( vChoices );
|
||||
/*
|
||||
if ( pParams->fMulti )
|
||||
Abc_NtkBalanceDetach(pNtk);
|
||||
{
|
||||
Abc_NtkForEachObj( pNtk, pNode, i )
|
||||
pNode->fMarkB = 0;
|
||||
}
|
||||
*/
|
||||
PRT( "Total", clock() - clk );
|
||||
//Abc_NtkPrintCuts_( p, pNtk, 0 );
|
||||
// Cut_ManPrintStatsToFile( p, pNtk->pSpec, clock() - clk );
|
||||
|
|
@ -282,14 +318,14 @@ printf( "Converged after %d iterations.\n", nIters );
|
|||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
void * Abc_NodeGetCutsRecursive( void * p, Abc_Obj_t * pObj )
|
||||
void * Abc_NodeGetCutsRecursive( void * p, Abc_Obj_t * pObj, int fMulti )
|
||||
{
|
||||
void * pList;
|
||||
if ( pList = Abc_NodeReadCuts( p, pObj ) )
|
||||
return pList;
|
||||
Abc_NodeGetCutsRecursive( p, Abc_ObjFanin0(pObj) );
|
||||
Abc_NodeGetCutsRecursive( p, Abc_ObjFanin1(pObj) );
|
||||
return Abc_NodeGetCuts( p, pObj, 0 );
|
||||
Abc_NodeGetCutsRecursive( p, Abc_ObjFanin0(pObj), fMulti );
|
||||
Abc_NodeGetCutsRecursive( p, Abc_ObjFanin1(pObj), fMulti );
|
||||
return Abc_NodeGetCuts( p, pObj, fMulti );
|
||||
}
|
||||
|
||||
/**Function*************************************************************
|
||||
|
|
@ -305,7 +341,8 @@ void * Abc_NodeGetCutsRecursive( void * p, Abc_Obj_t * pObj )
|
|||
***********************************************************************/
|
||||
void * Abc_NodeGetCuts( void * p, Abc_Obj_t * pObj, int fMulti )
|
||||
{
|
||||
int fTriv = (!fMulti) || (pObj->pCopy != NULL);
|
||||
// int fTriv = (!fMulti) || pObj->fMarkB;
|
||||
int fTriv = (!fMulti) || (pObj->vFanouts.nSize > 1 && !Abc_NodeIsMuxControlType(pObj));
|
||||
assert( Abc_NtkIsStrash(pObj->pNtk) );
|
||||
assert( Abc_ObjFaninNum(pObj) == 2 );
|
||||
return Cut_NodeComputeCuts( p, pObj->Id, Abc_ObjFaninId0(pObj), Abc_ObjFaninId1(pObj),
|
||||
|
|
|
|||
|
|
@ -446,7 +446,7 @@ void Abc_NodeDecompDsdAndMux( Abc_Obj_t * pNode, Vec_Ptr_t * vNodes, Dsd_Manager
|
|||
|
||||
/**Function*************************************************************
|
||||
|
||||
Synopsis [Performs decomposition of one node.]
|
||||
Synopsis [Checks if the node should be decomposed by DSD.]
|
||||
|
||||
Description []
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,244 @@
|
|||
/**CFile****************************************************************
|
||||
|
||||
FileName [abcEspresso.c]
|
||||
|
||||
SystemName [ABC: Logic synthesis and verification system.]
|
||||
|
||||
PackageName [Network and node package.]
|
||||
|
||||
Synopsis [Procedures to minimize SOPs using Espresso.]
|
||||
|
||||
Author [Alan Mishchenko]
|
||||
|
||||
Affiliation [UC Berkeley]
|
||||
|
||||
Date [Ver. 1.0. Started - June 20, 2005.]
|
||||
|
||||
Revision [$Id: abcEspresso.c,v 1.00 2005/06/20 00:00:00 alanmi Exp $]
|
||||
|
||||
***********************************************************************/
|
||||
|
||||
#include "abc.h"
|
||||
#include "espresso.h"
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
/// DECLARATIONS ///
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static void Abc_NodeEspresso( Abc_Obj_t * pNode );
|
||||
static pset_family Abc_SopToEspresso( char * pSop );
|
||||
static char * Abc_SopFromEspresso( Extra_MmFlex_t * pMan, pset_family Cover );
|
||||
static pset_family Abc_EspressoMinimize( pset_family pOnset, pset_family pDcset );
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
/// FUNCTION DEFINITIONS ///
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/**Function*************************************************************
|
||||
|
||||
Synopsis [Minimizes SOP representations using Espresso.]
|
||||
|
||||
Description []
|
||||
|
||||
SideEffects []
|
||||
|
||||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
void Abc_NtkEspresso( Abc_Ntk_t * pNtk, int fVerbose )
|
||||
{
|
||||
Abc_Obj_t * pNode;
|
||||
int i;
|
||||
assert( Abc_NtkIsLogic(pNtk) );
|
||||
// convert the network to have SOPs
|
||||
if ( Abc_NtkHasMapping(pNtk) )
|
||||
Abc_NtkUnmap(pNtk);
|
||||
else if ( Abc_NtkHasBdd(pNtk) )
|
||||
Abc_NtkBddToSop(pNtk);
|
||||
// minimize SOPs of all nodes
|
||||
Abc_NtkForEachNode( pNtk, pNode, i )
|
||||
if ( i ) Abc_NodeEspresso( pNode );
|
||||
}
|
||||
|
||||
/**Function*************************************************************
|
||||
|
||||
Synopsis [Minimizes SOP representation of one node.]
|
||||
|
||||
Description []
|
||||
|
||||
SideEffects []
|
||||
|
||||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
void Abc_NodeEspresso( Abc_Obj_t * pNode )
|
||||
{
|
||||
extern void define_cube_size( int n );
|
||||
pset_family Cover;
|
||||
int fCompl;
|
||||
|
||||
assert( Abc_ObjIsNode(pNode) );
|
||||
// define the cube for this node
|
||||
define_cube_size( Abc_ObjFaninNum(pNode) );
|
||||
// create the Espresso cover
|
||||
fCompl = Abc_SopIsComplement( pNode->pData );
|
||||
Cover = Abc_SopToEspresso( pNode->pData );
|
||||
// perform minimization
|
||||
Cover = Abc_EspressoMinimize( Cover, NULL ); // deletes also cover
|
||||
// convert back onto the node's SOP representation
|
||||
pNode->pData = Abc_SopFromEspresso( pNode->pNtk->pManFunc, Cover );
|
||||
if ( fCompl ) Abc_SopComplement( pNode->pData );
|
||||
sf_free(Cover);
|
||||
}
|
||||
|
||||
/**Function*************************************************************
|
||||
|
||||
Synopsis [Converts SOP in ABC into SOP representation in Espresso.]
|
||||
|
||||
Description []
|
||||
|
||||
SideEffects []
|
||||
|
||||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
pset_family Abc_SopToEspresso( char * pSop )
|
||||
{
|
||||
char * pCube;
|
||||
pset_family Cover;
|
||||
pset set;
|
||||
int nCubes, nVars, Value, v;
|
||||
|
||||
if ( pSop == NULL )
|
||||
return NULL;
|
||||
|
||||
nVars = Abc_SopGetVarNum(pSop);
|
||||
nCubes = Abc_SopGetCubeNum(pSop);
|
||||
assert( cube.size == 2 * nVars );
|
||||
|
||||
if ( Abc_SopIsConst0(pSop) )
|
||||
{
|
||||
Cover = sf_new(0, cube.size);
|
||||
return Cover;
|
||||
}
|
||||
if ( Abc_SopIsConst1(pSop) )
|
||||
{
|
||||
Cover = sf_new(1, cube.size);
|
||||
set = GETSET(Cover, Cover->count++);
|
||||
set_copy( set, cube.fullset );
|
||||
return Cover;
|
||||
}
|
||||
|
||||
// create the cover
|
||||
Cover = sf_new(nCubes, cube.size);
|
||||
// fill in the cubes
|
||||
Abc_SopForEachCube( pSop, nVars, pCube )
|
||||
{
|
||||
set = GETSET(Cover, Cover->count++);
|
||||
set_copy( set, cube.fullset );
|
||||
Abc_CubeForEachVar( pCube, Value, v )
|
||||
{
|
||||
if ( Value == '0' )
|
||||
set_remove(set, 2*v+1);
|
||||
else if ( Value == '1' )
|
||||
set_remove(set, 2*v);
|
||||
}
|
||||
}
|
||||
return Cover;
|
||||
}
|
||||
|
||||
/**Function*************************************************************
|
||||
|
||||
Synopsis [Converts SOP representation in Espresso into SOP in ABC.]
|
||||
|
||||
Description []
|
||||
|
||||
SideEffects []
|
||||
|
||||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
char * Abc_SopFromEspresso( Extra_MmFlex_t * pMan, pset_family Cover )
|
||||
{
|
||||
pset set;
|
||||
char * pSop, * pCube;
|
||||
int Lit, nVars, nCubes, i, k;
|
||||
|
||||
nVars = Cover->sf_size/2;
|
||||
nCubes = Cover->count;
|
||||
|
||||
pSop = Abc_SopStart( pMan, nCubes, nVars );
|
||||
|
||||
// go through the cubes
|
||||
i = 0;
|
||||
Abc_SopForEachCube( pSop, nVars, pCube )
|
||||
{
|
||||
set = GETSET(Cover, i++);
|
||||
for ( k = 0; k < nVars; k++ )
|
||||
{
|
||||
Lit = GETINPUT(set, k);
|
||||
if ( Lit == ZERO )
|
||||
pCube[k] = '0';
|
||||
else if ( Lit == ONE )
|
||||
pCube[k] = '1';
|
||||
}
|
||||
}
|
||||
return pSop;
|
||||
}
|
||||
|
||||
|
||||
/**Function*************************************************************
|
||||
|
||||
Synopsis [Minimizes the cover using Espresso.]
|
||||
|
||||
Description []
|
||||
|
||||
SideEffects []
|
||||
|
||||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
pset_family Abc_EspressoMinimize( pset_family pOnset, pset_family pDcset )
|
||||
{
|
||||
pset_family pOffset;
|
||||
int fNewDcset, i;
|
||||
int fSimple = 0;
|
||||
int fSparse = 0;
|
||||
|
||||
if ( fSimple )
|
||||
{
|
||||
for ( i = 0; i < cube.num_vars; i++ )
|
||||
pOnset = d1merge( pOnset, i );
|
||||
pOnset = sf_contain( pOnset );
|
||||
return pOnset;
|
||||
}
|
||||
|
||||
// create the dcset
|
||||
fNewDcset = (pDcset == NULL);
|
||||
if ( pDcset == NULL )
|
||||
pDcset = sf_new( 1, cube.size );
|
||||
pDcset->wsize = pOnset->wsize;
|
||||
pDcset->sf_size = pOnset->sf_size;
|
||||
|
||||
// derive the offset
|
||||
if ( pDcset->sf_size == 0 || pDcset->count == 0 )
|
||||
pOffset = complement(cube1list(pOnset));
|
||||
else
|
||||
pOffset = complement(cube2list(pOnset, pDcset));
|
||||
|
||||
// perform minimization
|
||||
skip_make_sparse = !fSparse;
|
||||
pOnset = espresso( pOnset, pDcset, pOffset );
|
||||
|
||||
// free covers
|
||||
sf_free( pOffset );
|
||||
if ( fNewDcset )
|
||||
sf_free( pDcset );
|
||||
return pOnset;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
/// END OF FILE ///
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
|
@ -26,7 +26,7 @@
|
|||
/// DECLARATIONS ///
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static Abc_Ntk_t * Abc_NtkFromFraig( Fraig_Man_t * pMan, Abc_Ntk_t * pNtk );
|
||||
extern Abc_Ntk_t * Abc_NtkFromFraig( Fraig_Man_t * pMan, Abc_Ntk_t * pNtk );
|
||||
static Abc_Ntk_t * Abc_NtkFromFraig2( Fraig_Man_t * pMan, Abc_Ntk_t * pNtk );
|
||||
static Abc_Obj_t * Abc_NodeFromFraig_rec( Abc_Ntk_t * pNtkNew, Fraig_Node_t * pNodeFraig );
|
||||
static void Abc_NtkFromFraig2_rec( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pNode, Vec_Ptr_t * vNodeReprs );
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ clk = clock();
|
|||
Map_ManFree( pMan );
|
||||
return NULL;
|
||||
}
|
||||
Map_ManPrintStatsToFile( pNtk->pSpec, Map_ManReadAreaFinal(pMan), Map_ManReadRequiredGlo(pMan), clock()-clk );
|
||||
// Map_ManPrintStatsToFile( pNtk->pSpec, Map_ManReadAreaFinal(pMan), Map_ManReadRequiredGlo(pMan), clock()-clk );
|
||||
|
||||
// reconstruct the network after mapping
|
||||
pNtkNew = Abc_NtkFromMap( pMan, pNtk );
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ Abc_Ntk_t * Abc_NtkMiterInt( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int fComb )
|
|||
// start the new network
|
||||
pNtkMiter = Abc_NtkAlloc( ABC_NTK_STRASH, ABC_FUNC_AIG );
|
||||
sprintf( Buffer, "%s_%s_miter", pNtk1->pName, pNtk2->pName );
|
||||
pNtkMiter->pName = util_strsav(Buffer);
|
||||
pNtkMiter->pName = Extra_UtilStrsav(Buffer);
|
||||
|
||||
// perform strashing
|
||||
Abc_NtkMiterPrepare( pNtk1, pNtk2, pNtkMiter, fComb );
|
||||
|
|
@ -308,7 +308,7 @@ Abc_Ntk_t * Abc_NtkMiterForCofactors( Abc_Ntk_t * pNtk, int Out, int In1, int In
|
|||
// start the new network
|
||||
pNtkMiter = Abc_NtkAlloc( ABC_NTK_STRASH, ABC_FUNC_AIG );
|
||||
sprintf( Buffer, "%s_miter", Abc_ObjName(Abc_NtkCo(pNtk, Out)) );
|
||||
pNtkMiter->pName = util_strsav(Buffer);
|
||||
pNtkMiter->pName = Extra_UtilStrsav(Buffer);
|
||||
|
||||
// get the root output
|
||||
pRoot = Abc_NtkCo( pNtk, Out );
|
||||
|
|
@ -372,7 +372,7 @@ Abc_Ntk_t * Abc_NtkMiterQuantify( Abc_Ntk_t * pNtk, int In, int fExist )
|
|||
|
||||
// start the new network
|
||||
pNtkMiter = Abc_NtkAlloc( ABC_NTK_STRASH, ABC_FUNC_AIG );
|
||||
pNtkMiter->pName = util_strsav( Abc_ObjName(Abc_NtkCo(pNtk, 0)) );
|
||||
pNtkMiter->pName = Extra_UtilStrsav( Abc_ObjName(Abc_NtkCo(pNtk, 0)) );
|
||||
|
||||
// get the root output
|
||||
pRoot = Abc_NtkCo( pNtk, 0 );
|
||||
|
|
@ -384,14 +384,16 @@ Abc_Ntk_t * Abc_NtkMiterQuantify( Abc_Ntk_t * pNtk, int In, int fExist )
|
|||
// add the first cofactor
|
||||
Abc_NtkMiterAddCone( pNtk, pNtkMiter, pRoot );
|
||||
// save the output
|
||||
pOutput1 = Abc_ObjFanin0(pRoot)->pCopy;
|
||||
// pOutput1 = Abc_ObjFanin0(pRoot)->pCopy;
|
||||
pOutput1 = Abc_ObjNotCond( Abc_ObjFanin0(pRoot)->pCopy, Abc_ObjFaninC0(pRoot) );
|
||||
|
||||
// set the second cofactor
|
||||
Abc_NtkCi(pNtk, In)->pCopy = Abc_NtkConst1( pNtkMiter );
|
||||
// add the second cofactor
|
||||
Abc_NtkMiterAddCone( pNtk, pNtkMiter, pRoot );
|
||||
// save the output
|
||||
pOutput2 = Abc_ObjFanin0(pRoot)->pCopy;
|
||||
// pOutput2 = Abc_ObjFanin0(pRoot)->pCopy;
|
||||
pOutput2 = Abc_ObjNotCond( Abc_ObjFanin0(pRoot)->pCopy, Abc_ObjFaninC0(pRoot) );
|
||||
|
||||
// create the miter of the two outputs
|
||||
if ( fExist )
|
||||
|
|
@ -461,7 +463,7 @@ int Abc_NtkMiterIsConstant( Abc_Ntk_t * pMiter )
|
|||
assert( Abc_NtkIsStrash(pMiter) );
|
||||
Abc_NtkForEachPo( pMiter, pNodePo, i )
|
||||
{
|
||||
pChild = Abc_ObjChild0( Abc_NtkPo(pMiter,i) );
|
||||
pChild = Abc_ObjChild0( pNodePo );
|
||||
if ( Abc_ObjIsNode(Abc_ObjRegular(pChild)) && Abc_NodeIsConst(pChild) )
|
||||
{
|
||||
assert( Abc_ObjRegular(pChild) == Abc_NtkConst1(pMiter) );
|
||||
|
|
@ -552,7 +554,7 @@ Abc_Ntk_t * Abc_NtkFrames( Abc_Ntk_t * pNtk, int nFrames, int fInitial )
|
|||
// start the new network
|
||||
pNtkFrames = Abc_NtkAlloc( ABC_NTK_STRASH, ABC_FUNC_AIG );
|
||||
sprintf( Buffer, "%s_%d_frames", pNtk->pName, nFrames );
|
||||
pNtkFrames->pName = util_strsav(Buffer);
|
||||
pNtkFrames->pName = Extra_UtilStrsav(Buffer);
|
||||
// create new latches (or their initial values) and remember them in the new latches
|
||||
if ( !fInitial )
|
||||
{
|
||||
|
|
@ -682,7 +684,7 @@ Abc_Ntk_t * Abc_NtkFrames2( Abc_Ntk_t * pNtk, int nFrames, int fInitial, AddFram
|
|||
// start the new network
|
||||
pNtkFrames = Abc_NtkAlloc( ABC_NTK_STRASH, ABC_FUNC_AIG );
|
||||
sprintf( Buffer, "%s_%d_frames", pNtk->pName, nFrames );
|
||||
pNtkFrames->pName = util_strsav(Buffer);
|
||||
pNtkFrames->pName = Extra_UtilStrsav(Buffer);
|
||||
// create new latches (or their initial values) and remember them in the new latches
|
||||
if ( !fInitial )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -56,9 +56,11 @@ Abc_Ntk_t * Abc_NtkNewAig( Abc_Ntk_t * pNtk )
|
|||
{
|
||||
Aig_Man_t * pMan;
|
||||
Abc_Ntk_t * pNtkAig;
|
||||
Aig_ProofType_t RetValue;
|
||||
// Aig_ProofType_t RetValue;
|
||||
int fCleanup = 1;
|
||||
int nNodes;
|
||||
extern void Aig_MffcTest( Aig_Man_t * pMan );
|
||||
|
||||
|
||||
assert( !Abc_NtkIsNetlist(pNtk) );
|
||||
assert( !Abc_NtkIsSeq(pNtk) );
|
||||
|
|
@ -70,6 +72,10 @@ Abc_Ntk_t * Abc_NtkNewAig( Abc_Ntk_t * pNtk )
|
|||
|
||||
// convert to the AIG manager
|
||||
pMan = Abc_NtkToAig( pNtk );
|
||||
|
||||
Aig_MffcTest( pMan );
|
||||
|
||||
/*
|
||||
// execute a command in the AIG manager
|
||||
RetValue = Aig_FraigProve( pMan );
|
||||
if ( RetValue == AIG_PROOF_SAT )
|
||||
|
|
@ -80,6 +86,7 @@ Abc_Ntk_t * Abc_NtkNewAig( Abc_Ntk_t * pNtk )
|
|||
printf( "Undecided.\n" );
|
||||
else
|
||||
assert( 0 );
|
||||
*/
|
||||
|
||||
// convert from the AIG manager
|
||||
pNtkAig = Abc_NtkFromAig( pNtk, pMan );
|
||||
|
|
@ -173,6 +180,8 @@ Aig_Man_t * Abc_NtkToAig( Abc_Ntk_t * pNtkOld )
|
|||
Abc_NtkConst1(pNtkOld)->pCopy = (Abc_Obj_t *)Aig_ManConst1(pMan);
|
||||
Abc_NtkForEachCi( pNtkOld, pObj, i )
|
||||
pObj->pCopy = (Abc_Obj_t *)Aig_NodeCreatePi(pMan);
|
||||
Abc_NtkForEachCo( pNtkOld, pObj, i )
|
||||
pObj->pCopy = (Abc_Obj_t *)Aig_NodeCreatePo(pMan);
|
||||
// perform the conversion of the internal nodes
|
||||
Abc_NtkStrashPerformAig( pNtkOld, pMan );
|
||||
// create the POs
|
||||
|
|
@ -180,7 +189,7 @@ Aig_Man_t * Abc_NtkToAig( Abc_Ntk_t * pNtkOld )
|
|||
{
|
||||
pFanin = (Aig_Node_t *)Abc_ObjFanin0(pObj)->pCopy;
|
||||
pFanin = Aig_NotCond( pFanin, Abc_ObjFaninC0(pObj) );
|
||||
pObj->pCopy = (Abc_Obj_t *)Aig_NodeCreatePo( pMan, pFanin );
|
||||
Aig_NodeConnectPo( pMan, (Aig_Node_t *)pObj->pCopy, pFanin );
|
||||
}
|
||||
return pMan;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ Abc_Ntk_t * Abc_NtkDeriveFromBdd( DdManager * dd, DdNode * bFunc, char * pNamePo
|
|||
|
||||
// start the network
|
||||
pNtk = Abc_NtkAlloc( ABC_NTK_LOGIC, ABC_FUNC_BDD );
|
||||
pNtk->pName = util_strsav(pNamePo);
|
||||
pNtk->pName = Extra_UtilStrsav(pNamePo);
|
||||
// make sure the new manager has enough inputs
|
||||
Cudd_bddIthVar( pNtk->pManFunc, Vec_PtrSize(vNamesPi) );
|
||||
// add the PIs corresponding to the names
|
||||
|
|
|
|||
|
|
@ -0,0 +1,232 @@
|
|||
/**CFile****************************************************************
|
||||
|
||||
FileName [abcProve.c]
|
||||
|
||||
SystemName [ABC: Logic synthesis and verification system.]
|
||||
|
||||
PackageName [Network and node package.]
|
||||
|
||||
Synopsis [Proves the miter using AIG rewriting, FRAIGing, and SAT solving.]
|
||||
|
||||
Author [Alan Mishchenko]
|
||||
|
||||
Affiliation [UC Berkeley]
|
||||
|
||||
Date [Ver. 1.0. Started - June 20, 2005.]
|
||||
|
||||
Revision [$Id: abcProve.c,v 1.00 2005/06/20 00:00:00 alanmi Exp $]
|
||||
|
||||
***********************************************************************/
|
||||
|
||||
#include "abc.h"
|
||||
#include "fraig.h"
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
/// DECLARATIONS ///
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
extern int Abc_NtkRewrite( Abc_Ntk_t * pNtk, int fUpdateLevel, int fUseZeros, int fVerbose );
|
||||
extern int Abc_NtkRefactor( Abc_Ntk_t * pNtk, int nNodeSizeMax, int nConeSizeMax, bool fUpdateLevel, bool fUseZeros, bool fUseDcs, bool fVerbose );
|
||||
extern Abc_Ntk_t * Abc_NtkFromFraig( Fraig_Man_t * pMan, Abc_Ntk_t * pNtk );
|
||||
|
||||
static Abc_Ntk_t * Abc_NtkMiterFraig( Abc_Ntk_t * pNtk, int nBTLimit, int * pRetValue );
|
||||
static void Abc_NtkMiterPrint( Abc_Ntk_t * pNtk, char * pString, int clk, int fVerbose );
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
/// FUNCTION DEFINITIONS ///
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/**Function*************************************************************
|
||||
|
||||
Synopsis [Attempts to solve the miter using a number of tricks.]
|
||||
|
||||
Description [Returns -1 if timed out; 0 if SAT; 1 if UNSAT. Returns
|
||||
a simplified version of the original network (or a constant 0 network).
|
||||
In case the network is not a constant zero and a SAT assignment is found,
|
||||
pNtk->pModel contains a satisfying assignment.]
|
||||
|
||||
SideEffects []
|
||||
|
||||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
int Abc_NtkMiterProve( Abc_Ntk_t ** ppNtk, int nConfLimit, int nImpLimit, int fUseRewrite, int fUseFraig, int fVerbose )
|
||||
{
|
||||
Abc_Ntk_t * pNtk, * pNtkTemp;
|
||||
int nConfsStart = 1000, nImpsStart = 0, nBTLimitStart = 2;
|
||||
int nConfs, nImps, nBTLimit, RetValue;
|
||||
int nIter = 0, clk, timeStart = clock();
|
||||
|
||||
// get the starting network
|
||||
pNtk = *ppNtk;
|
||||
assert( Abc_NtkIsStrash(pNtk) );
|
||||
assert( Abc_NtkPoNum(pNtk) == 1 );
|
||||
|
||||
// set the initial limits
|
||||
nConfs = !nConfLimit? nConfsStart : ABC_MIN( nConfsStart, nConfLimit );
|
||||
nImps = !nImpLimit ? nImpsStart : ABC_MIN( nImpsStart , nImpLimit );
|
||||
nBTLimit = nBTLimitStart;
|
||||
|
||||
if ( fVerbose )
|
||||
printf( "Global resource limits: ConfsLim = %6d. ImpsLim = %d.\n", nConfLimit, nImpLimit );
|
||||
|
||||
// if SAT only, solve without iteration
|
||||
if ( !fUseRewrite && !fUseFraig )
|
||||
{
|
||||
clk = clock();
|
||||
RetValue = Abc_NtkMiterSat( pNtk, nConfLimit, nImpLimit, 0 );
|
||||
Abc_NtkMiterPrint( pNtk, "SAT solving", clk, fVerbose );
|
||||
*ppNtk = pNtk;
|
||||
return RetValue;
|
||||
}
|
||||
|
||||
// check the current resource limits
|
||||
do {
|
||||
nIter++;
|
||||
|
||||
if ( fVerbose )
|
||||
printf( "ITERATION %2d : Confs = %6d. FraigBTL = %3d. \n", nIter, nConfs, nBTLimit );
|
||||
|
||||
// try brute-force SAT
|
||||
clk = clock();
|
||||
RetValue = Abc_NtkMiterSat( pNtk, nConfs, nImps, 0 );
|
||||
Abc_NtkMiterPrint( pNtk, "SAT solving", clk, fVerbose );
|
||||
if ( RetValue >= 0 )
|
||||
break;
|
||||
|
||||
if ( fUseRewrite )
|
||||
{
|
||||
clk = clock();
|
||||
|
||||
// try rewriting
|
||||
Abc_NtkRewrite( pNtk, 0, 0, 0 );
|
||||
if ( (RetValue = Abc_NtkMiterIsConstant(pNtk)) >= 0 )
|
||||
break;
|
||||
Abc_NtkRefactor( pNtk, 10, 16, 0, 0, 0, 0 );
|
||||
if ( (RetValue = Abc_NtkMiterIsConstant(pNtk)) >= 0 )
|
||||
break;
|
||||
pNtk = Abc_NtkBalance( pNtkTemp = pNtk, 0, 0, 0 ); Abc_NtkDelete( pNtkTemp );
|
||||
if ( (RetValue = Abc_NtkMiterIsConstant(pNtk)) >= 0 )
|
||||
break;
|
||||
|
||||
Abc_NtkMiterPrint( pNtk, "Rewriting ", clk, fVerbose );
|
||||
}
|
||||
|
||||
if ( fUseFraig )
|
||||
{
|
||||
// try FRAIGing
|
||||
clk = clock();
|
||||
pNtk = Abc_NtkMiterFraig( pNtkTemp = pNtk, nBTLimit, &RetValue ); Abc_NtkDelete( pNtkTemp );
|
||||
Abc_NtkMiterPrint( pNtk, "FRAIGing ", clk, fVerbose );
|
||||
if ( RetValue >= 0 )
|
||||
break;
|
||||
}
|
||||
|
||||
// increase resource limits
|
||||
nConfs = ABC_MIN( nConfs * 3 / 2, 1000000000 );
|
||||
nImps = ABC_MIN( nImps * 3 / 2, 1000000000 );
|
||||
nBTLimit = ABC_MIN( nBTLimit * 8, 1000000000 );
|
||||
|
||||
// timeout at 5 minutes
|
||||
if ( clock() - timeStart >= 300 * CLOCKS_PER_SEC )
|
||||
break;
|
||||
if ( nIter == 4 )
|
||||
break;
|
||||
}
|
||||
while ( (nConfLimit == 0 || nConfs <= nConfLimit) &&
|
||||
(nImpLimit == 0 || nImps <= nImpLimit ) );
|
||||
|
||||
// try to prove it using brute force SAT
|
||||
if ( RetValue < 0 )
|
||||
{
|
||||
clk = clock();
|
||||
RetValue = Abc_NtkMiterSat( pNtk, nConfLimit, nImpLimit, 0 );
|
||||
Abc_NtkMiterPrint( pNtk, "SAT solving", clk, fVerbose );
|
||||
}
|
||||
|
||||
*ppNtk = pNtk;
|
||||
return RetValue;
|
||||
}
|
||||
|
||||
/**Function*************************************************************
|
||||
|
||||
Synopsis [Attempts to solve the miter using a number of tricks.]
|
||||
|
||||
Description [Returns -1 if timed out; 0 if SAT; 1 if UNSAT.]
|
||||
|
||||
SideEffects []
|
||||
|
||||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
Abc_Ntk_t * Abc_NtkMiterFraig( Abc_Ntk_t * pNtk, int nBTLimit, int * pRetValue )
|
||||
{
|
||||
Abc_Ntk_t * pNtkNew;
|
||||
Fraig_Params_t Params, * pParams = &Params;
|
||||
Fraig_Man_t * pMan;
|
||||
int nWords1, nWords2, nWordsMin, RetValue;
|
||||
int * pModel;
|
||||
|
||||
// to determine the number of simulation patterns
|
||||
// use the following strategy
|
||||
// at least 64 words (32 words random and 32 words dynamic)
|
||||
// no more than 256M for one circuit (128M + 128M)
|
||||
nWords1 = 32;
|
||||
nWords2 = (1<<27) / (Abc_NtkNodeNum(pNtk) + Abc_NtkCiNum(pNtk));
|
||||
nWordsMin = ABC_MIN( nWords1, nWords2 );
|
||||
|
||||
// set the FRAIGing parameters
|
||||
Fraig_ParamsSetDefault( pParams );
|
||||
pParams->nPatsRand = nWordsMin * 32; // the number of words of random simulation info
|
||||
pParams->nPatsDyna = nWordsMin * 32; // the number of words of dynamic simulation info
|
||||
pParams->nBTLimit = nBTLimit; // the max number of backtracks
|
||||
pParams->nSeconds = -1; // the runtime limit
|
||||
pParams->fTryProve = 0; // do not try to prove the final miter
|
||||
pParams->fDoSparse = 1; // try proving sparse functions
|
||||
pParams->fVerbose = 0;
|
||||
|
||||
// transform the target into a fraig
|
||||
pMan = Abc_NtkToFraig( pNtk, pParams, 0, 0 );
|
||||
Fraig_ManProveMiter( pMan );
|
||||
RetValue = Fraig_ManCheckMiter( pMan );
|
||||
|
||||
// save model
|
||||
if ( RetValue == 0 )
|
||||
{
|
||||
pModel = Fraig_ManReadModel( pMan );
|
||||
FREE( pNtk->pModel );
|
||||
pNtk->pModel = ALLOC( int, Abc_NtkCiNum(pNtk) );
|
||||
memcpy( pNtk->pModel, pModel, sizeof(int) * Abc_NtkCiNum(pNtk) );
|
||||
}
|
||||
// create the network
|
||||
pNtkNew = Abc_NtkFromFraig( pMan, pNtk );
|
||||
// delete the fraig manager
|
||||
Fraig_ManFree( pMan );
|
||||
*pRetValue = RetValue;
|
||||
return pNtkNew;
|
||||
}
|
||||
|
||||
/**Function*************************************************************
|
||||
|
||||
Synopsis [Attempts to solve the miter using a number of tricks.]
|
||||
|
||||
Description [Returns -1 if timed out; 0 if SAT; 1 if UNSAT.]
|
||||
|
||||
SideEffects []
|
||||
|
||||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
void Abc_NtkMiterPrint( Abc_Ntk_t * pNtk, char * pString, int clk, int fVerbose )
|
||||
{
|
||||
if ( !fVerbose )
|
||||
return;
|
||||
printf( "Nodes = %7d. Levels = %4d. ", Abc_NtkNodeNum(pNtk), Abc_AigGetLevelNum(pNtk) );
|
||||
PRT( pString, clock() - clk );
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
/// END OF FILE ///
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
|
@ -407,7 +407,7 @@ void Abc_NtkRenodeSetBounds( Abc_Ntk_t * pNtk, int nThresh, int nFaninMax )
|
|||
continue;
|
||||
if ( pNode->fMarkA == 0 )
|
||||
continue;
|
||||
// continue cutting branches ntil it meets the fanin limit
|
||||
// continue cutting branches until it meets the fanin limit
|
||||
while ( Abc_NtkRenodeLimit(pNode, vCone, nFaninMax) );
|
||||
assert( vCone->nSize <= nFaninMax );
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -96,6 +96,14 @@ Rwr_ManAddTimeCuts( pManRwr, clock() - clk );
|
|||
{
|
||||
Dec_Graph_t * pGraph = Rwr_ManReadDecs(pManRwr);
|
||||
int fCompl = Rwr_ManReadCompl(pManRwr);
|
||||
/*
|
||||
if ( nGain > 0 )
|
||||
{ // print stats on the MFFC
|
||||
extern void Abc_NodeMffsConeSuppPrint( Abc_Obj_t * pNode );
|
||||
printf( "Node %6d : Gain = %4d ", pNode->Id, nGain );
|
||||
Abc_NodeMffsConeSuppPrint( pNode );
|
||||
}
|
||||
*/
|
||||
// complement the FF if needed
|
||||
if ( fCompl ) Dec_GraphComplement( pGraph );
|
||||
clk = clock();
|
||||
|
|
|
|||
|
|
@ -24,13 +24,7 @@
|
|||
/// DECLARATIONS ///
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static int Abc_NodeAddClauses( solver * pSat, char * pSop0, char * pSop1, Abc_Obj_t * pNode, Vec_Int_t * vVars );
|
||||
static int Abc_NodeAddClausesTop( solver * pSat, Abc_Obj_t * pNode, Vec_Int_t * vVars );
|
||||
|
||||
static solver * Abc_NtkMiterSatCreate2( Abc_Ntk_t * pNtk );
|
||||
|
||||
static Vec_Int_t * Abc_NtkGetCiSatVarNums( Abc_Ntk_t * pNtk );
|
||||
|
||||
static nMuxes;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -48,13 +42,13 @@ static nMuxes;
|
|||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
int Abc_NtkMiterSat_OldAndRusty( Abc_Ntk_t * pNtk, int nSeconds, int fVerbose )
|
||||
int Abc_NtkMiterSat( Abc_Ntk_t * pNtk, int nConfLimit, int nImpLimit, int fVerbose )
|
||||
{
|
||||
solver * pSat;
|
||||
lbool status;
|
||||
int RetValue, clk;
|
||||
|
||||
assert( Abc_NtkIsBddLogic(pNtk) );
|
||||
assert( Abc_NtkIsStrash(pNtk) );
|
||||
assert( Abc_NtkLatchNum(pNtk) == 0 );
|
||||
|
||||
if ( Abc_NtkPoNum(pNtk) > 1 )
|
||||
|
|
@ -84,7 +78,7 @@ int Abc_NtkMiterSat_OldAndRusty( Abc_Ntk_t * pNtk, int nSeconds, int fVerbose )
|
|||
clk = clock();
|
||||
if ( fVerbose )
|
||||
pSat->verbosity = 1;
|
||||
status = solver_solve( pSat, NULL, NULL, nSeconds );
|
||||
status = solver_solve( pSat, NULL, NULL, nConfLimit, nImpLimit );
|
||||
if ( status == l_Undef )
|
||||
{
|
||||
// printf( "The problem timed out.\n" );
|
||||
|
|
@ -104,277 +98,6 @@ int Abc_NtkMiterSat_OldAndRusty( Abc_Ntk_t * pNtk, int nSeconds, int fVerbose )
|
|||
assert( 0 );
|
||||
// PRT( "SAT solver time", clock() - clk );
|
||||
|
||||
// if the problem is SAT, get the counterexample
|
||||
if ( status == l_True )
|
||||
{
|
||||
Vec_Int_t * vCiIds = Abc_NtkGetCiIds( pNtk );
|
||||
pNtk->pModel = solver_get_model( pSat, vCiIds->pArray, vCiIds->nSize );
|
||||
Vec_IntFree( vCiIds );
|
||||
}
|
||||
// free the solver
|
||||
solver_delete( pSat );
|
||||
return RetValue;
|
||||
}
|
||||
|
||||
/**Function*************************************************************
|
||||
|
||||
Synopsis [Sets up the SAT solver.]
|
||||
|
||||
Description []
|
||||
|
||||
SideEffects []
|
||||
|
||||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
solver * Abc_NtkMiterSatCreate( Abc_Ntk_t * pNtk )
|
||||
{
|
||||
solver * pSat;
|
||||
Extra_MmFlex_t * pMmFlex;
|
||||
Abc_Obj_t * pNode;
|
||||
Vec_Str_t * vCube;
|
||||
Vec_Int_t * vVars;
|
||||
char * pSop0, * pSop1;
|
||||
int i, clk = clock();
|
||||
|
||||
assert( Abc_NtkIsBddLogic(pNtk) );
|
||||
|
||||
// start the data structures
|
||||
pSat = solver_new();
|
||||
pMmFlex = Extra_MmFlexStart();
|
||||
vCube = Vec_StrAlloc( 100 );
|
||||
vVars = Vec_IntAlloc( 100 );
|
||||
|
||||
// add clauses for each internal nodes
|
||||
Abc_NtkForEachNode( pNtk, pNode, i )
|
||||
{
|
||||
// derive SOPs for both phases of the node
|
||||
Abc_NodeBddToCnf( pNode, pMmFlex, vCube, &pSop0, &pSop1 );
|
||||
// add the clauses to the solver
|
||||
if ( !Abc_NodeAddClauses( pSat, pSop0, pSop1, pNode, vVars ) )
|
||||
{
|
||||
solver_delete( pSat );
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
// add clauses for the POs
|
||||
if ( !Abc_NodeAddClausesTop( pSat, Abc_NtkPo(pNtk, Abc_NtkPoNum(pNtk)-1), vVars ) )
|
||||
{
|
||||
solver_delete( pSat );
|
||||
return NULL;
|
||||
}
|
||||
// Asat_SolverWriteDimacs( pSat, "test.cnf", NULL, NULL, 0 );
|
||||
|
||||
PRT( "Creating solver", clock() - clk );
|
||||
|
||||
// delete
|
||||
Vec_StrFree( vCube );
|
||||
Vec_IntFree( vVars );
|
||||
Extra_MmFlexStop( pMmFlex, 0 );
|
||||
return pSat;
|
||||
}
|
||||
|
||||
/**Function*************************************************************
|
||||
|
||||
Synopsis [Adds clauses for the internal node.]
|
||||
|
||||
Description []
|
||||
|
||||
SideEffects []
|
||||
|
||||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
int Abc_NodeAddClauses( solver * pSat, char * pSop0, char * pSop1, Abc_Obj_t * pNode, Vec_Int_t * vVars )
|
||||
{
|
||||
Abc_Obj_t * pFanin;
|
||||
int i, c, nFanins;
|
||||
char * pCube;
|
||||
|
||||
nFanins = Abc_ObjFaninNum( pNode );
|
||||
assert( nFanins == Abc_SopGetVarNum( pSop0 ) );
|
||||
|
||||
if ( nFanins == 0 )
|
||||
{
|
||||
vVars->nSize = 0;
|
||||
if ( Abc_SopIsConst1(pSop1) )
|
||||
Vec_IntPush( vVars, toLit(pNode->Id) );
|
||||
else
|
||||
Vec_IntPush( vVars, neg(toLit(pNode->Id)) );
|
||||
return solver_addclause( pSat, vVars->pArray, vVars->pArray + vVars->nSize );
|
||||
}
|
||||
|
||||
// add clauses for the negative phase
|
||||
for ( c = 0; ; c++ )
|
||||
{
|
||||
// get the cube
|
||||
pCube = pSop0 + c * (nFanins + 3);
|
||||
if ( *pCube == 0 )
|
||||
break;
|
||||
// add the clause
|
||||
vVars->nSize = 0;
|
||||
Abc_ObjForEachFanin( pNode, pFanin, i )
|
||||
{
|
||||
if ( pCube[i] == '0' )
|
||||
Vec_IntPush( vVars, toLit(pFanin->Id) );
|
||||
else if ( pCube[i] == '1' )
|
||||
Vec_IntPush( vVars, neg(toLit(pFanin->Id)) );
|
||||
}
|
||||
Vec_IntPush( vVars, neg(toLit(pNode->Id)) );
|
||||
if ( !solver_addclause( pSat, vVars->pArray, vVars->pArray + vVars->nSize ) )
|
||||
return 0;
|
||||
}
|
||||
|
||||
// add clauses for the positive phase
|
||||
for ( c = 0; ; c++ )
|
||||
{
|
||||
// get the cube
|
||||
pCube = pSop1 + c * (nFanins + 3);
|
||||
if ( *pCube == 0 )
|
||||
break;
|
||||
// add the clause
|
||||
vVars->nSize = 0;
|
||||
Abc_ObjForEachFanin( pNode, pFanin, i )
|
||||
{
|
||||
if ( pCube[i] == '0' )
|
||||
Vec_IntPush( vVars, toLit(pFanin->Id) );
|
||||
else if ( pCube[i] == '1' )
|
||||
Vec_IntPush( vVars, neg(toLit(pFanin->Id)) );
|
||||
}
|
||||
Vec_IntPush( vVars, toLit(pNode->Id) );
|
||||
if ( !solver_addclause( pSat, vVars->pArray, vVars->pArray + vVars->nSize ) )
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**Function*************************************************************
|
||||
|
||||
Synopsis [Adds clauses for the PO node.]
|
||||
|
||||
Description []
|
||||
|
||||
SideEffects []
|
||||
|
||||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
int Abc_NodeAddClausesTop( solver * pSat, Abc_Obj_t * pNode, Vec_Int_t * vVars )
|
||||
{
|
||||
Abc_Obj_t * pFanin;
|
||||
|
||||
pFanin = Abc_ObjFanin0(pNode);
|
||||
if ( Abc_ObjFaninC0(pNode) )
|
||||
{
|
||||
vVars->nSize = 0;
|
||||
Vec_IntPush( vVars, toLit(pFanin->Id) );
|
||||
Vec_IntPush( vVars, toLit(pNode->Id) );
|
||||
if ( !solver_addclause( pSat, vVars->pArray, vVars->pArray + vVars->nSize ) )
|
||||
return 0;
|
||||
|
||||
vVars->nSize = 0;
|
||||
Vec_IntPush( vVars, neg(toLit(pFanin->Id)) );
|
||||
Vec_IntPush( vVars, neg(toLit(pNode->Id)) );
|
||||
if ( !solver_addclause( pSat, vVars->pArray, vVars->pArray + vVars->nSize ) )
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
vVars->nSize = 0;
|
||||
Vec_IntPush( vVars, neg(toLit(pFanin->Id)) );
|
||||
Vec_IntPush( vVars, toLit(pNode->Id) );
|
||||
if ( !solver_addclause( pSat, vVars->pArray, vVars->pArray + vVars->nSize ) )
|
||||
return 0;
|
||||
|
||||
vVars->nSize = 0;
|
||||
Vec_IntPush( vVars, toLit(pFanin->Id) );
|
||||
Vec_IntPush( vVars, neg(toLit(pNode->Id)) );
|
||||
if ( !solver_addclause( pSat, vVars->pArray, vVars->pArray + vVars->nSize ) )
|
||||
return 0;
|
||||
}
|
||||
|
||||
vVars->nSize = 0;
|
||||
Vec_IntPush( vVars, toLit(pNode->Id) );
|
||||
return solver_addclause( pSat, vVars->pArray, vVars->pArray + vVars->nSize );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**Function*************************************************************
|
||||
|
||||
Synopsis [Attempts to solve the miter using an internal SAT solver.]
|
||||
|
||||
Description [Returns -1 if timed out; 0 if SAT; 1 if UNSAT.]
|
||||
|
||||
SideEffects []
|
||||
|
||||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
int Abc_NtkMiterSat( Abc_Ntk_t * pNtk, int nSeconds, int fVerbose )
|
||||
{
|
||||
solver * pSat;
|
||||
lbool status;
|
||||
int RetValue, clk;
|
||||
|
||||
assert( Abc_NtkIsStrash(pNtk) );
|
||||
assert( Abc_NtkLatchNum(pNtk) == 0 );
|
||||
|
||||
if ( Abc_NtkPoNum(pNtk) > 1 )
|
||||
fprintf( stdout, "Warning: The miter has %d outputs. SAT will try to prove all of them.\n", Abc_NtkPoNum(pNtk) );
|
||||
|
||||
// load clauses into the solver
|
||||
clk = clock();
|
||||
pSat = Abc_NtkMiterSatCreate2( pNtk );
|
||||
if ( pSat == NULL )
|
||||
return 1;
|
||||
// printf( "Created SAT problem with %d variable and %d clauses. ", solver_nvars(pSat), solver_nclauses(pSat) );
|
||||
// PRT( "Time", clock() - clk );
|
||||
|
||||
// simplify the problem
|
||||
clk = clock();
|
||||
status = solver_simplify(pSat);
|
||||
// printf( "Simplified the problem to %d variables and %d clauses. ", solver_nvars(pSat), solver_nclauses(pSat) );
|
||||
// PRT( "Time", clock() - clk );
|
||||
if ( status == 0 )
|
||||
{
|
||||
solver_delete( pSat );
|
||||
// printf( "The problem is UNSATISFIABLE after simplification.\n" );
|
||||
return 1;
|
||||
}
|
||||
|
||||
// solve the miter
|
||||
clk = clock();
|
||||
if ( fVerbose )
|
||||
pSat->verbosity = 1;
|
||||
status = solver_solve( pSat, NULL, NULL, nSeconds );
|
||||
if ( status == l_Undef )
|
||||
{
|
||||
// printf( "The problem timed out.\n" );
|
||||
RetValue = -1;
|
||||
}
|
||||
else if ( status == l_True )
|
||||
{
|
||||
// printf( "The problem is SATISFIABLE.\n" );
|
||||
RetValue = 0;
|
||||
}
|
||||
else if ( status == l_False )
|
||||
{
|
||||
// printf( "The problem is UNSATISFIABLE.\n" );
|
||||
RetValue = 1;
|
||||
}
|
||||
else
|
||||
assert( 0 );
|
||||
PRT( "SAT solver time", clock() - clk );
|
||||
|
||||
// if the problem is SAT, get the counterexample
|
||||
if ( status == l_True )
|
||||
{
|
||||
|
|
@ -411,7 +134,6 @@ Vec_Int_t * Abc_NtkGetCiSatVarNums( Abc_Ntk_t * pNtk )
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**Function*************************************************************
|
||||
|
||||
|
|
@ -669,7 +391,7 @@ void Abc_NtkCollectSupergate( Abc_Obj_t * pNode, int fStopAtMux, Vec_Ptr_t * vNo
|
|||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
int Abc_NtkMiterSatCreate2Int( solver * pSat, Abc_Ntk_t * pNtk )
|
||||
int Abc_NtkMiterSatCreateInt( solver * pSat, Abc_Ntk_t * pNtk )
|
||||
{
|
||||
Abc_Obj_t * pNode, * pFanin, * pNodeC, * pNodeT, * pNodeE;
|
||||
Vec_Ptr_t * vNodes, * vSuper;
|
||||
|
|
@ -787,7 +509,7 @@ int Abc_NtkMiterSatCreate2Int( solver * pSat, Abc_Ntk_t * pNtk )
|
|||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
solver * Abc_NtkMiterSatCreate2( Abc_Ntk_t * pNtk )
|
||||
solver * Abc_NtkMiterSatCreate( Abc_Ntk_t * pNtk )
|
||||
{
|
||||
solver * pSat;
|
||||
Abc_Obj_t * pNode;
|
||||
|
|
@ -796,7 +518,7 @@ solver * Abc_NtkMiterSatCreate2( Abc_Ntk_t * pNtk )
|
|||
nMuxes = 0;
|
||||
|
||||
pSat = solver_new();
|
||||
RetValue = Abc_NtkMiterSatCreate2Int( pSat, pNtk );
|
||||
RetValue = Abc_NtkMiterSatCreateInt( pSat, pNtk );
|
||||
Abc_NtkForEachObj( pNtk, pNode, i )
|
||||
pNode->fMarkA = 0;
|
||||
// Asat_SolverWriteDimacs( pSat, "temp_sat.cnf", NULL, NULL, 1 );
|
||||
|
|
@ -805,8 +527,8 @@ solver * Abc_NtkMiterSatCreate2( Abc_Ntk_t * pNtk )
|
|||
solver_delete(pSat);
|
||||
return NULL;
|
||||
}
|
||||
printf( "The number of MUXes detected = %d (%5.2f %% of logic). ", nMuxes, 300.0*nMuxes/Abc_NtkNodeNum(pNtk) );
|
||||
PRT( "Creating solver", clock() - clk );
|
||||
// printf( "Ands = %6d. Muxes = %6d (%5.2f %%). ", Abc_NtkNodeNum(pNtk), nMuxes, 300.0*nMuxes/Abc_NtkNodeNum(pNtk) );
|
||||
// PRT( "Creating solver", clock() - clk );
|
||||
return pSat;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -285,7 +285,7 @@ Abc_Ntk_t * Abc_NtkConstructExdc( DdManager * dd, Abc_Ntk_t * pNtk, DdNode * bUn
|
|||
|
||||
// start the new network
|
||||
pNtkNew = Abc_NtkAlloc( ABC_NTK_LOGIC, ABC_FUNC_BDD );
|
||||
pNtkNew->pName = util_strsav( "exdc" );
|
||||
pNtkNew->pName = Extra_UtilStrsav( "exdc" );
|
||||
pNtkNew->pSpec = NULL;
|
||||
|
||||
// create PIs corresponding to LOs
|
||||
|
|
|
|||
|
|
@ -517,13 +517,13 @@ Abc_Ntk_t * Abc_NtkVanEijkFrames( Abc_Ntk_t * pNtk, Vec_Ptr_t * vCorresp, int nF
|
|||
pNtkFrames = Abc_NtkAlloc( ABC_NTK_STRASH, ABC_FUNC_AIG );
|
||||
if ( fShortNames )
|
||||
{
|
||||
pNtkFrames->pName = util_strsav(pNtk->pName);
|
||||
pNtkFrames->pSpec = util_strsav(pNtk->pSpec);
|
||||
pNtkFrames->pName = Extra_UtilStrsav(pNtk->pName);
|
||||
pNtkFrames->pSpec = Extra_UtilStrsav(pNtk->pSpec);
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf( Buffer, "%s_%d_frames", pNtk->pName, nFrames + fAddLast );
|
||||
pNtkFrames->pName = util_strsav(Buffer);
|
||||
pNtkFrames->pName = Extra_UtilStrsav(Buffer);
|
||||
}
|
||||
// map the constant nodes
|
||||
Abc_NtkConst1(pNtk)->pCopy = Abc_NtkConst1(pNtkFrames);
|
||||
|
|
@ -722,7 +722,7 @@ Abc_Ntk_t * Abc_NtkVanEijkDeriveExdc( Abc_Ntk_t * pNtk, Vec_Ptr_t * vClasses )
|
|||
|
||||
// start the network
|
||||
pNtkNew = Abc_NtkAlloc( pNtk->ntkType, pNtk->ntkFunc );
|
||||
pNtkNew->pName = util_strsav("exdc");
|
||||
pNtkNew->pName = Extra_UtilStrsav("exdc");
|
||||
pNtkNew->pSpec = NULL;
|
||||
|
||||
// map the constant nodes
|
||||
|
|
|
|||
|
|
@ -878,7 +878,7 @@ Abc_Ntk_t * Abc_NtkVanImpDeriveExdc( Abc_Ntk_t * pNtk, Vec_Ptr_t * vZeros, Vec_I
|
|||
|
||||
// start the network
|
||||
pNtkNew = Abc_NtkAlloc( pNtk->ntkType, pNtk->ntkFunc );
|
||||
pNtkNew->pName = util_strsav( "exdc" );
|
||||
pNtkNew->pName = Extra_UtilStrsav( "exdc" );
|
||||
pNtkNew->pSpec = NULL;
|
||||
|
||||
// map the constant nodes
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ static void Abc_NtkVerifyReportErrorSeq( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2,
|
|||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
void Abc_NtkCecSat( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int nSeconds )
|
||||
void Abc_NtkCecSat( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int nConfLimit, int nImpLimit )
|
||||
{
|
||||
Abc_Ntk_t * pMiter;
|
||||
Abc_Ntk_t * pCnf;
|
||||
|
|
@ -87,7 +87,7 @@ void Abc_NtkCecSat( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int nSeconds )
|
|||
}
|
||||
|
||||
// solve the CNF using the SAT solver
|
||||
RetValue = Abc_NtkMiterSat( pCnf, nSeconds, 0 );
|
||||
RetValue = Abc_NtkMiterSat( pCnf, nConfLimit, nImpLimit, 0 );
|
||||
if ( RetValue == -1 )
|
||||
printf( "Networks are undecided (SAT solver timed out).\n" );
|
||||
else if ( RetValue == 0 )
|
||||
|
|
@ -184,7 +184,7 @@ void Abc_NtkCecFraig( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int nSeconds, int fV
|
|||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
void Abc_NtkSecSat( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int nSeconds, int nFrames )
|
||||
void Abc_NtkSecSat( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int nConfLimit, int nImpLimit, int nFrames )
|
||||
{
|
||||
Abc_Ntk_t * pMiter;
|
||||
Abc_Ntk_t * pFrames;
|
||||
|
|
@ -244,7 +244,7 @@ void Abc_NtkSecSat( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int nSeconds, int nFra
|
|||
}
|
||||
|
||||
// solve the CNF using the SAT solver
|
||||
RetValue = Abc_NtkMiterSat( pCnf, nSeconds, 0 );
|
||||
RetValue = Abc_NtkMiterSat( pCnf, nConfLimit, nImpLimit, 0 );
|
||||
if ( RetValue == -1 )
|
||||
printf( "Networks are undecided (SAT solver timed out).\n" );
|
||||
else if ( RetValue == 0 )
|
||||
|
|
|
|||
|
|
@ -2,9 +2,11 @@ SRC += src/base/abci/abc.c \
|
|||
src/base/abci/abcAttach.c \
|
||||
src/base/abci/abcAuto.c \
|
||||
src/base/abci/abcBalance.c \
|
||||
src/base/abci/abcCollapse.c \
|
||||
src/base/abci/abcClpBdd.c \
|
||||
src/base/abci/abcClpSop.c \
|
||||
src/base/abci/abcCut.c \
|
||||
src/base/abci/abcDsd.c \
|
||||
src/base/abci/abcEspresso.c \
|
||||
src/base/abci/abcFpga.c \
|
||||
src/base/abci/abcFraig.c \
|
||||
src/base/abci/abcFxu.c \
|
||||
|
|
@ -13,6 +15,7 @@ SRC += src/base/abci/abc.c \
|
|||
src/base/abci/abcNtbdd.c \
|
||||
src/base/abci/abcPga.c \
|
||||
src/base/abci/abcPrint.c \
|
||||
src/base/abci/abcProve.c \
|
||||
src/base/abci/abcReconv.c \
|
||||
src/base/abci/abcRefactor.c \
|
||||
src/base/abci/abcRenode.c \
|
||||
|
|
|
|||
|
|
@ -142,8 +142,8 @@ int CmdCommandTime( Abc_Frame_t * pAbc, int argc, char **argv )
|
|||
{
|
||||
int c;
|
||||
|
||||
util_getopt_reset();
|
||||
while ( ( c = util_getopt( argc, argv, "h" ) ) != EOF )
|
||||
Extra_UtilGetoptReset();
|
||||
while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
|
||||
{
|
||||
switch ( c )
|
||||
{
|
||||
|
|
@ -154,7 +154,7 @@ int CmdCommandTime( Abc_Frame_t * pAbc, int argc, char **argv )
|
|||
}
|
||||
}
|
||||
|
||||
if ( argc != util_optind )
|
||||
if ( argc != globalUtilOptind )
|
||||
{
|
||||
goto usage;
|
||||
}
|
||||
|
|
@ -188,8 +188,8 @@ int CmdCommandEcho( Abc_Frame_t * pAbc, int argc, char **argv )
|
|||
int c;
|
||||
int n = 1;
|
||||
|
||||
util_getopt_reset();
|
||||
while ( ( c = util_getopt( argc, argv, "hn" ) ) != EOF )
|
||||
Extra_UtilGetoptReset();
|
||||
while ( ( c = Extra_UtilGetopt( argc, argv, "hn" ) ) != EOF )
|
||||
{
|
||||
switch ( c )
|
||||
{
|
||||
|
|
@ -204,7 +204,7 @@ int CmdCommandEcho( Abc_Frame_t * pAbc, int argc, char **argv )
|
|||
}
|
||||
}
|
||||
|
||||
for ( i = util_optind; i < argc; i++ )
|
||||
for ( i = globalUtilOptind; i < argc; i++ )
|
||||
fprintf( pAbc->Out, "%s ", argv[i] );
|
||||
if ( n )
|
||||
fprintf( pAbc->Out, "\n" );
|
||||
|
|
@ -234,8 +234,8 @@ int CmdCommandQuit( Abc_Frame_t * pAbc, int argc, char **argv )
|
|||
{
|
||||
int c;
|
||||
|
||||
util_getopt_reset();
|
||||
while ( ( c = util_getopt( argc, argv, "hs" ) ) != EOF )
|
||||
Extra_UtilGetoptReset();
|
||||
while ( ( c = Extra_UtilGetopt( argc, argv, "hs" ) ) != EOF )
|
||||
{
|
||||
switch ( c )
|
||||
{
|
||||
|
|
@ -250,7 +250,7 @@ int CmdCommandQuit( Abc_Frame_t * pAbc, int argc, char **argv )
|
|||
}
|
||||
}
|
||||
|
||||
if ( argc != util_optind )
|
||||
if ( argc != globalUtilOptind )
|
||||
goto usage;
|
||||
return -1;
|
||||
|
||||
|
|
@ -294,8 +294,8 @@ int CmdCommandHistory( Abc_Frame_t * pAbc, int argc, char **argv )
|
|||
int i, c, num, size;
|
||||
|
||||
num = 20;
|
||||
util_getopt_reset();
|
||||
while ( ( c = util_getopt( argc, argv, "h" ) ) != EOF )
|
||||
Extra_UtilGetoptReset();
|
||||
while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
|
||||
{
|
||||
switch ( c )
|
||||
{
|
||||
|
|
@ -309,8 +309,8 @@ int CmdCommandHistory( Abc_Frame_t * pAbc, int argc, char **argv )
|
|||
goto usage;
|
||||
|
||||
// get the number of commands to print
|
||||
if ( argc == util_optind + 1 )
|
||||
num = atoi(argv[util_optind]);
|
||||
if ( argc == globalUtilOptind + 1 )
|
||||
num = atoi(argv[globalUtilOptind]);
|
||||
// print the commands
|
||||
size = pAbc->aHistory->nSize;
|
||||
num = ( num < size ) ? num : size;
|
||||
|
|
@ -342,8 +342,8 @@ int CmdCommandAlias( Abc_Frame_t * pAbc, int argc, char **argv )
|
|||
char *key, *value;
|
||||
int c;
|
||||
|
||||
util_getopt_reset();
|
||||
while ( ( c = util_getopt( argc, argv, "h" ) ) != EOF )
|
||||
Extra_UtilGetoptReset();
|
||||
while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
|
||||
{
|
||||
switch ( c )
|
||||
{
|
||||
|
|
@ -399,8 +399,8 @@ int CmdCommandUnalias( Abc_Frame_t * pAbc, int argc, char **argv )
|
|||
char *key, *value;
|
||||
int c;
|
||||
|
||||
util_getopt_reset();
|
||||
while ( ( c = util_getopt( argc, argv, "h" ) ) != EOF )
|
||||
Extra_UtilGetoptReset();
|
||||
while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
|
||||
{
|
||||
switch ( c )
|
||||
{
|
||||
|
|
@ -450,8 +450,8 @@ int CmdCommandHelp( Abc_Frame_t * pAbc, int argc, char **argv )
|
|||
int c;
|
||||
|
||||
fPrintAll = 0;
|
||||
util_getopt_reset();
|
||||
while ( ( c = util_getopt( argc, argv, "ah" ) ) != EOF )
|
||||
Extra_UtilGetoptReset();
|
||||
while ( ( c = Extra_UtilGetopt( argc, argv, "ah" ) ) != EOF )
|
||||
{
|
||||
switch ( c )
|
||||
{
|
||||
|
|
@ -468,7 +468,7 @@ int CmdCommandHelp( Abc_Frame_t * pAbc, int argc, char **argv )
|
|||
}
|
||||
}
|
||||
|
||||
if ( argc != util_optind )
|
||||
if ( argc != globalUtilOptind )
|
||||
goto usage;
|
||||
|
||||
CmdCommandPrint( pAbc, fPrintAll );
|
||||
|
|
@ -503,8 +503,8 @@ int CmdCommandSource( Abc_Frame_t * pAbc, int argc, char **argv )
|
|||
|
||||
interactive = silent = prompt = echo = 0;
|
||||
|
||||
util_getopt_reset();
|
||||
while ( ( c = util_getopt( argc, argv, "hipsx" ) ) != EOF )
|
||||
Extra_UtilGetoptReset();
|
||||
while ( ( c = Extra_UtilGetopt( argc, argv, "hipsx" ) ) != EOF )
|
||||
{
|
||||
switch ( c )
|
||||
{
|
||||
|
|
@ -529,12 +529,12 @@ int CmdCommandSource( Abc_Frame_t * pAbc, int argc, char **argv )
|
|||
}
|
||||
|
||||
/* added to avoid core-dumping when no script file is specified */
|
||||
if ( argc == util_optind )
|
||||
if ( argc == globalUtilOptind )
|
||||
{
|
||||
goto usage;
|
||||
}
|
||||
|
||||
lp_file_index = util_optind;
|
||||
lp_file_index = globalUtilOptind;
|
||||
lp_count = 0;
|
||||
|
||||
/*
|
||||
|
|
@ -568,7 +568,7 @@ int CmdCommandSource( Abc_Frame_t * pAbc, int argc, char **argv )
|
|||
}
|
||||
else
|
||||
{
|
||||
prompt_string = NIL( char );
|
||||
prompt_string = NULL;
|
||||
}
|
||||
|
||||
/* clear errors -- e.g., EOF reached from stdin */
|
||||
|
|
@ -602,7 +602,7 @@ int CmdCommandSource( Abc_Frame_t * pAbc, int argc, char **argv )
|
|||
fprintf( pAbc->Out, "abc - > %s", line );
|
||||
}
|
||||
command = CmdHistorySubstitution( pAbc, line, &did_subst );
|
||||
if ( command == NIL( char ) )
|
||||
if ( command == NULL )
|
||||
{
|
||||
status = 1;
|
||||
break;
|
||||
|
|
@ -620,8 +620,8 @@ int CmdCommandSource( Abc_Frame_t * pAbc, int argc, char **argv )
|
|||
}
|
||||
if ( interactive && *line != '\0' )
|
||||
{
|
||||
Cmd_HistoryAddCommand( pAbc, util_strsav(line) );
|
||||
if ( pAbc->Hst != NIL( FILE ) )
|
||||
Cmd_HistoryAddCommand( pAbc, Extra_UtilStrsav(line) );
|
||||
if ( pAbc->Hst != NULL )
|
||||
{
|
||||
fprintf( pAbc->Hst, "%s\n", line );
|
||||
( void ) fflush( pAbc->Hst );
|
||||
|
|
@ -674,8 +674,8 @@ int CmdCommandSetVariable( Abc_Frame_t * pAbc, int argc, char **argv )
|
|||
char *flag_value, *key, *value;
|
||||
int c;
|
||||
|
||||
util_getopt_reset();
|
||||
while ( ( c = util_getopt( argc, argv, "h" ) ) != EOF )
|
||||
Extra_UtilGetoptReset();
|
||||
while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
|
||||
{
|
||||
switch ( c )
|
||||
{
|
||||
|
|
@ -703,9 +703,9 @@ int CmdCommandSetVariable( Abc_Frame_t * pAbc, int argc, char **argv )
|
|||
FREE( value );
|
||||
}
|
||||
|
||||
flag_value = argc == 2 ? util_strsav( "" ) : util_strsav( argv[2] );
|
||||
// flag_value = argc == 2 ? NULL : util_strsav(argv[2]);
|
||||
st_insert( pAbc->tFlags, util_strsav(argv[1]), flag_value );
|
||||
flag_value = argc == 2 ? Extra_UtilStrsav( "" ) : Extra_UtilStrsav( argv[2] );
|
||||
// flag_value = argc == 2 ? NULL : Extra_UtilStrsav(argv[2]);
|
||||
st_insert( pAbc->tFlags, Extra_UtilStrsav(argv[1]), flag_value );
|
||||
|
||||
if ( strcmp( argv[1], "abcout" ) == 0 )
|
||||
{
|
||||
|
|
@ -713,7 +713,7 @@ int CmdCommandSetVariable( Abc_Frame_t * pAbc, int argc, char **argv )
|
|||
fclose( pAbc->Out );
|
||||
if ( strcmp( flag_value, "" ) == 0 )
|
||||
flag_value = "-";
|
||||
pAbc->Out = CmdFileOpen( pAbc, flag_value, "w", NIL( char * ), 0 );
|
||||
pAbc->Out = CmdFileOpen( pAbc, flag_value, "w", NULL, 0 );
|
||||
if ( pAbc->Out == NULL )
|
||||
pAbc->Out = stdout;
|
||||
#if HAVE_SETVBUF
|
||||
|
|
@ -726,7 +726,7 @@ int CmdCommandSetVariable( Abc_Frame_t * pAbc, int argc, char **argv )
|
|||
fclose( pAbc->Err );
|
||||
if ( strcmp( flag_value, "" ) == 0 )
|
||||
flag_value = "-";
|
||||
pAbc->Err = CmdFileOpen( pAbc, flag_value, "w", NIL( char * ), 0 );
|
||||
pAbc->Err = CmdFileOpen( pAbc, flag_value, "w", NULL, 0 );
|
||||
if ( pAbc->Err == NULL )
|
||||
pAbc->Err = stderr;
|
||||
#if HAVE_SETVBUF
|
||||
|
|
@ -735,15 +735,15 @@ int CmdCommandSetVariable( Abc_Frame_t * pAbc, int argc, char **argv )
|
|||
}
|
||||
if ( strcmp( argv[1], "history" ) == 0 )
|
||||
{
|
||||
if ( pAbc->Hst != NIL( FILE ) )
|
||||
if ( pAbc->Hst != NULL )
|
||||
fclose( pAbc->Hst );
|
||||
if ( strcmp( flag_value, "" ) == 0 )
|
||||
pAbc->Hst = NIL( FILE );
|
||||
pAbc->Hst = NULL;
|
||||
else
|
||||
{
|
||||
pAbc->Hst = CmdFileOpen( pAbc, flag_value, "w", NIL( char * ), 0 );
|
||||
pAbc->Hst = CmdFileOpen( pAbc, flag_value, "w", NULL, 0 );
|
||||
if ( pAbc->Hst == NULL )
|
||||
pAbc->Hst = NIL( FILE );
|
||||
pAbc->Hst = NULL;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
|
@ -774,8 +774,8 @@ int CmdCommandUnsetVariable( Abc_Frame_t * pAbc, int argc, char **argv )
|
|||
char *key, *value;
|
||||
int c;
|
||||
|
||||
util_getopt_reset();
|
||||
while ( ( c = util_getopt( argc, argv, "h" ) ) != EOF )
|
||||
Extra_UtilGetoptReset();
|
||||
while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
|
||||
{
|
||||
switch ( c )
|
||||
{
|
||||
|
|
@ -867,8 +867,8 @@ int CmdCommandRecall( Abc_Frame_t * pAbc, int argc, char **argv )
|
|||
}
|
||||
|
||||
|
||||
util_getopt_reset();
|
||||
while ( ( c = util_getopt( argc, argv, "h" ) ) != EOF )
|
||||
Extra_UtilGetoptReset();
|
||||
while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
|
||||
{
|
||||
switch ( c )
|
||||
{
|
||||
|
|
@ -979,8 +979,8 @@ int CmdCommandEmpty( Abc_Frame_t * pAbc, int argc, char **argv )
|
|||
return 0;
|
||||
}
|
||||
|
||||
util_getopt_reset();
|
||||
while ( ( c = util_getopt( argc, argv, "h" ) ) != EOF )
|
||||
Extra_UtilGetoptReset();
|
||||
while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
|
||||
{
|
||||
switch ( c )
|
||||
{
|
||||
|
|
@ -1021,7 +1021,7 @@ int CmdCommandUndo( Abc_Frame_t * pAbc, int argc, char **argv )
|
|||
Abc_Ntk_t * pNtkTemp;
|
||||
int id, c;
|
||||
|
||||
while ( ( c = util_getopt( argc, argv, "h" ) ) != EOF )
|
||||
while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
|
||||
{
|
||||
switch ( c )
|
||||
{
|
||||
|
|
@ -1032,12 +1032,12 @@ int CmdCommandUndo( Abc_Frame_t * pAbc, int argc, char **argv )
|
|||
goto usage;
|
||||
}
|
||||
}
|
||||
if (util_optind <= argc) {
|
||||
if (globalUtilOptind <= argc) {
|
||||
pNtkTemp = pAbc->pNtk;
|
||||
pAbc->pNtk = pAbc->pNtkSaved;
|
||||
pAbc->pNtkSaved = pNtkTemp;
|
||||
}
|
||||
id = atoi(argv[util_optind]);
|
||||
id = atoi(argv[globalUtilOptind]);
|
||||
pNtkTemp = Cmd_HistoryGetSnapshot(pAbc, id);
|
||||
if (!pNtkTemp)
|
||||
fprintf( pAbc->Err, "Snapshot %d does not exist\n", id);
|
||||
|
|
@ -1095,8 +1095,8 @@ int CmdCommandLs( Abc_Frame_t * pAbc, int argc, char **argv )
|
|||
int fPrintedNewLine;
|
||||
char c;
|
||||
|
||||
util_getopt_reset();
|
||||
while ( (c = util_getopt(argc, argv, "lb") ) != EOF )
|
||||
Extra_UtilGetoptReset();
|
||||
while ( (c = Extra_UtilGetopt(argc, argv, "lb") ) != EOF )
|
||||
{
|
||||
switch (c)
|
||||
{
|
||||
|
|
@ -1294,7 +1294,7 @@ int CmdCommandSis( Abc_Frame_t * pAbc, int argc, char **argv )
|
|||
if ( pNtk->pSpec )
|
||||
{
|
||||
FREE( pNtkNew->pSpec );
|
||||
pNtkNew->pSpec = util_strsav( pNtk->pSpec );
|
||||
pNtkNew->pSpec = Extra_UtilStrsav( pNtk->pSpec );
|
||||
}
|
||||
// replace the current network
|
||||
Abc_FrameReplaceCurrentNetwork( pAbc, pNtkNew );
|
||||
|
|
@ -1430,7 +1430,7 @@ int CmdCommandMvsis( Abc_Frame_t * pAbc, int argc, char **argv )
|
|||
if ( pNtk->pSpec )
|
||||
{
|
||||
FREE( pNtkNew->pSpec );
|
||||
pNtkNew->pSpec = util_strsav( pNtk->pSpec );
|
||||
pNtkNew->pSpec = Extra_UtilStrsav( pNtk->pSpec );
|
||||
}
|
||||
// replace the current network
|
||||
Abc_FrameReplaceCurrentNetwork( pAbc, pNtkNew );
|
||||
|
|
|
|||
|
|
@ -45,11 +45,11 @@ void CmdCommandAliasAdd( Abc_Frame_t * pAbc, char * sName, int argc, char ** arg
|
|||
int fStatus, i;
|
||||
|
||||
pAlias = ALLOC(Abc_Alias, 1);
|
||||
pAlias->sName = util_strsav(sName);
|
||||
pAlias->sName = Extra_UtilStrsav(sName);
|
||||
pAlias->argc = argc;
|
||||
pAlias->argv = ALLOC(char *, pAlias->argc);
|
||||
for(i = 0; i < argc; i++)
|
||||
pAlias->argv[i] = util_strsav(argv[i]);
|
||||
pAlias->argv[i] = Extra_UtilStrsav(argv[i]);
|
||||
fStatus = st_insert( pAbc->tAliases, pAlias->sName, (char *) pAlias );
|
||||
assert(!fStatus);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,8 +57,8 @@ void Cmd_CommandAdd( Abc_Frame_t * pAbc, char * sGroup, char * sName, void * pFu
|
|||
|
||||
// create the new command
|
||||
pCommand = ALLOC( Abc_Command, 1 );
|
||||
pCommand->sName = util_strsav( sName );
|
||||
pCommand->sGroup = util_strsav( sGroup );
|
||||
pCommand->sName = Extra_UtilStrsav( sName );
|
||||
pCommand->sGroup = Extra_UtilStrsav( sGroup );
|
||||
pCommand->pFunc = pFunc;
|
||||
pCommand->fChange = fChanges;
|
||||
fStatus = st_insert( pAbc->tCommands, sName, (char *)pCommand );
|
||||
|
|
|
|||
|
|
@ -35,8 +35,7 @@
|
|||
|
||||
Description [The command parser maintains a table of named values. These
|
||||
are manipulated using the 'set' and 'unset' commands. The value of the
|
||||
named flag is returned, or NIL(char) is returned if the flag has not been
|
||||
set.]
|
||||
named flag is returned, or NULL is returned if the flag has not been set.]
|
||||
|
||||
SideEffects []
|
||||
|
||||
|
|
@ -65,9 +64,9 @@ void Cmd_FlagUpdateValue( Abc_Frame_t * pAbc, char * key, char * value )
|
|||
if ( !key )
|
||||
return;
|
||||
if ( value )
|
||||
newValue = util_strsav(value);
|
||||
newValue = Extra_UtilStrsav(value);
|
||||
else
|
||||
newValue = util_strsav("");
|
||||
newValue = Extra_UtilStrsav("");
|
||||
// newValue = NULL;
|
||||
if ( st_delete(pAbc->tFlags, &key, &oldValue) )
|
||||
FREE(oldValue);
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ void Cmd_HistoryAddCommand( Abc_Frame_t * p, char * command )
|
|||
strcpy( Buffer, command );
|
||||
if ( command[strlen(command)-1] != '\n' )
|
||||
strcat( Buffer, "\n" );
|
||||
Vec_PtrPush( p->aHistory, util_strsav(Buffer) );
|
||||
Vec_PtrPush( p->aHistory, Extra_UtilStrsav(Buffer) );
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
|||
|
|
@ -121,10 +121,10 @@ int CmdCommandDispatch( Abc_Frame_t * pAbc, int argc, char **argv )
|
|||
}
|
||||
|
||||
// execute the command
|
||||
clk = util_cpu_time();
|
||||
clk = Extra_CpuTime();
|
||||
pFunc = (int (*)(Abc_Frame_t *, int, char **))pCommand->pFunc;
|
||||
fError = (*pFunc)( pAbc, argc, argv );
|
||||
pAbc->TimeCommand += (util_cpu_time() - clk);
|
||||
pAbc->TimeCommand += (Extra_CpuTime() - clk);
|
||||
|
||||
// automatic execution of arbitrary command after each command
|
||||
// usually this is a passive command ...
|
||||
|
|
@ -270,7 +270,7 @@ int CmdApplyAlias( Abc_Frame_t * pAbc, int *argcp, char ***argvp, int *loop )
|
|||
}
|
||||
for ( i = 1; i <= added; i++ )
|
||||
{
|
||||
argv[i] = NIL( char );
|
||||
argv[i] = NULL;
|
||||
}
|
||||
argc += added;
|
||||
}
|
||||
|
|
@ -278,7 +278,7 @@ int CmdApplyAlias( Abc_Frame_t * pAbc, int *argcp, char ***argvp, int *loop )
|
|||
for ( i = 0, offset = 0; i < alias->argc; i++, offset++ )
|
||||
{
|
||||
arg = CmdHistorySubstitution( pAbc, alias->argv[i], &did_subst );
|
||||
if ( arg == NIL( char ) )
|
||||
if ( arg == NULL )
|
||||
{
|
||||
*argcp = argc;
|
||||
*argvp = argv;
|
||||
|
|
@ -383,11 +383,11 @@ FILE * CmdFileOpen( Abc_Frame_t * pAbc, char *sFileName, char *sMode, char **pFi
|
|||
|
||||
if (strcmp(sFileName, "-") == 0) {
|
||||
if (strcmp(sMode, "w") == 0) {
|
||||
sRealName = util_strsav( "stdout" );
|
||||
sRealName = Extra_UtilStrsav( "stdout" );
|
||||
pFile = stdout;
|
||||
}
|
||||
else {
|
||||
sRealName = util_strsav( "stdin" );
|
||||
sRealName = Extra_UtilStrsav( "stdin" );
|
||||
pFile = stdin;
|
||||
}
|
||||
}
|
||||
|
|
@ -403,24 +403,24 @@ FILE * CmdFileOpen( Abc_Frame_t * pAbc, char *sFileName, char *sMode, char **pFi
|
|||
sPathAll = NULL;
|
||||
}
|
||||
else if ( sPathUsr == NULL ) {
|
||||
sPathAll = util_strsav( sPathLib );
|
||||
sPathAll = Extra_UtilStrsav( sPathLib );
|
||||
}
|
||||
else if ( sPathLib == NULL ) {
|
||||
sPathAll = util_strsav( sPathUsr );
|
||||
sPathAll = Extra_UtilStrsav( sPathUsr );
|
||||
}
|
||||
else {
|
||||
sPathAll = ALLOC( char, strlen(sPathLib)+strlen(sPathUsr)+5 );
|
||||
sprintf( sPathAll, "%s:%s",sPathUsr, sPathLib );
|
||||
}
|
||||
if ( sPathAll != NIL(char) ) {
|
||||
sRealName = util_file_search(sFileName, sPathAll, "r");
|
||||
if ( sPathAll != NULL ) {
|
||||
sRealName = Extra_UtilFileSearch(sFileName, sPathAll, "r");
|
||||
FREE( sPathAll );
|
||||
}
|
||||
}
|
||||
if (sRealName == NIL(char)) {
|
||||
sRealName = util_tilde_expand(sFileName);
|
||||
if (sRealName == NULL) {
|
||||
sRealName = Extra_UtilTildeExpand(sFileName);
|
||||
}
|
||||
if ((pFile = fopen(sRealName, sMode)) == NIL(FILE)) {
|
||||
if ((pFile = fopen(sRealName, sMode)) == NULL) {
|
||||
if (! silent) {
|
||||
perror(sRealName);
|
||||
}
|
||||
|
|
|
|||
161
src/base/io/io.c
161
src/base/io/io.c
|
|
@ -120,8 +120,8 @@ int IoCommandRead( Abc_Frame_t * pAbc, int argc, char ** argv )
|
|||
int c;
|
||||
|
||||
fCheck = 1;
|
||||
util_getopt_reset();
|
||||
while ( ( c = util_getopt( argc, argv, "ch" ) ) != EOF )
|
||||
Extra_UtilGetoptReset();
|
||||
while ( ( c = Extra_UtilGetopt( argc, argv, "ch" ) ) != EOF )
|
||||
{
|
||||
switch ( c )
|
||||
{
|
||||
|
|
@ -135,13 +135,13 @@ int IoCommandRead( Abc_Frame_t * pAbc, int argc, char ** argv )
|
|||
}
|
||||
}
|
||||
|
||||
if ( argc != util_optind + 1 )
|
||||
if ( argc != globalUtilOptind + 1 )
|
||||
{
|
||||
goto usage;
|
||||
}
|
||||
|
||||
// get the input file name
|
||||
FileName = argv[util_optind];
|
||||
FileName = argv[globalUtilOptind];
|
||||
if ( (pFile = fopen( FileName, "r" )) == NULL )
|
||||
{
|
||||
fprintf( pAbc->Err, "Cannot open input file \"%s\". ", FileName );
|
||||
|
|
@ -192,8 +192,8 @@ int IoCommandReadBaf( Abc_Frame_t * pAbc, int argc, char ** argv )
|
|||
int c;
|
||||
|
||||
fCheck = 1;
|
||||
util_getopt_reset();
|
||||
while ( ( c = util_getopt( argc, argv, "ch" ) ) != EOF )
|
||||
Extra_UtilGetoptReset();
|
||||
while ( ( c = Extra_UtilGetopt( argc, argv, "ch" ) ) != EOF )
|
||||
{
|
||||
switch ( c )
|
||||
{
|
||||
|
|
@ -207,13 +207,13 @@ int IoCommandReadBaf( Abc_Frame_t * pAbc, int argc, char ** argv )
|
|||
}
|
||||
}
|
||||
|
||||
if ( argc != util_optind + 1 )
|
||||
if ( argc != globalUtilOptind + 1 )
|
||||
{
|
||||
goto usage;
|
||||
}
|
||||
|
||||
// get the input file name
|
||||
FileName = argv[util_optind];
|
||||
FileName = argv[globalUtilOptind];
|
||||
if ( (pFile = fopen( FileName, "r" )) == NULL )
|
||||
{
|
||||
fprintf( pAbc->Err, "Cannot open input file \"%s\". ", FileName );
|
||||
|
|
@ -265,8 +265,8 @@ int IoCommandReadBlif( Abc_Frame_t * pAbc, int argc, char ** argv )
|
|||
int c;
|
||||
|
||||
fCheck = 1;
|
||||
util_getopt_reset();
|
||||
while ( ( c = util_getopt( argc, argv, "ch" ) ) != EOF )
|
||||
Extra_UtilGetoptReset();
|
||||
while ( ( c = Extra_UtilGetopt( argc, argv, "ch" ) ) != EOF )
|
||||
{
|
||||
switch ( c )
|
||||
{
|
||||
|
|
@ -280,13 +280,13 @@ int IoCommandReadBlif( Abc_Frame_t * pAbc, int argc, char ** argv )
|
|||
}
|
||||
}
|
||||
|
||||
if ( argc != util_optind + 1 )
|
||||
if ( argc != globalUtilOptind + 1 )
|
||||
{
|
||||
goto usage;
|
||||
}
|
||||
|
||||
// get the input file name
|
||||
FileName = argv[util_optind];
|
||||
FileName = argv[globalUtilOptind];
|
||||
if ( (pFile = fopen( FileName, "r" )) == NULL )
|
||||
{
|
||||
fprintf( pAbc->Err, "Cannot open input file \"%s\". ", FileName );
|
||||
|
|
@ -346,8 +346,8 @@ int IoCommandReadBench( Abc_Frame_t * pAbc, int argc, char ** argv )
|
|||
int c;
|
||||
|
||||
fCheck = 1;
|
||||
util_getopt_reset();
|
||||
while ( ( c = util_getopt( argc, argv, "ch" ) ) != EOF )
|
||||
Extra_UtilGetoptReset();
|
||||
while ( ( c = Extra_UtilGetopt( argc, argv, "ch" ) ) != EOF )
|
||||
{
|
||||
switch ( c )
|
||||
{
|
||||
|
|
@ -361,13 +361,13 @@ int IoCommandReadBench( Abc_Frame_t * pAbc, int argc, char ** argv )
|
|||
}
|
||||
}
|
||||
|
||||
if ( argc != util_optind + 1 )
|
||||
if ( argc != globalUtilOptind + 1 )
|
||||
{
|
||||
goto usage;
|
||||
}
|
||||
|
||||
// get the input file name
|
||||
FileName = argv[util_optind];
|
||||
FileName = argv[globalUtilOptind];
|
||||
if ( (pFile = fopen( FileName, "r" )) == NULL )
|
||||
{
|
||||
fprintf( pAbc->Err, "Cannot open input file \"%s\". ", FileName );
|
||||
|
|
@ -426,8 +426,8 @@ int IoCommandReadEdif( Abc_Frame_t * pAbc, int argc, char ** argv )
|
|||
int c;
|
||||
|
||||
fCheck = 1;
|
||||
util_getopt_reset();
|
||||
while ( ( c = util_getopt( argc, argv, "ch" ) ) != EOF )
|
||||
Extra_UtilGetoptReset();
|
||||
while ( ( c = Extra_UtilGetopt( argc, argv, "ch" ) ) != EOF )
|
||||
{
|
||||
switch ( c )
|
||||
{
|
||||
|
|
@ -441,13 +441,13 @@ int IoCommandReadEdif( Abc_Frame_t * pAbc, int argc, char ** argv )
|
|||
}
|
||||
}
|
||||
|
||||
if ( argc != util_optind + 1 )
|
||||
if ( argc != globalUtilOptind + 1 )
|
||||
{
|
||||
goto usage;
|
||||
}
|
||||
|
||||
// get the input file name
|
||||
FileName = argv[util_optind];
|
||||
FileName = argv[globalUtilOptind];
|
||||
if ( (pFile = fopen( FileName, "r" )) == NULL )
|
||||
{
|
||||
fprintf( pAbc->Err, "Cannot open input file \"%s\". ", FileName );
|
||||
|
|
@ -506,8 +506,8 @@ int IoCommandReadEqn( Abc_Frame_t * pAbc, int argc, char ** argv )
|
|||
int c;
|
||||
|
||||
fCheck = 1;
|
||||
util_getopt_reset();
|
||||
while ( ( c = util_getopt( argc, argv, "ch" ) ) != EOF )
|
||||
Extra_UtilGetoptReset();
|
||||
while ( ( c = Extra_UtilGetopt( argc, argv, "ch" ) ) != EOF )
|
||||
{
|
||||
switch ( c )
|
||||
{
|
||||
|
|
@ -521,13 +521,13 @@ int IoCommandReadEqn( Abc_Frame_t * pAbc, int argc, char ** argv )
|
|||
}
|
||||
}
|
||||
|
||||
if ( argc != util_optind + 1 )
|
||||
if ( argc != globalUtilOptind + 1 )
|
||||
{
|
||||
goto usage;
|
||||
}
|
||||
|
||||
// get the input file name
|
||||
FileName = argv[util_optind];
|
||||
FileName = argv[globalUtilOptind];
|
||||
if ( (pFile = fopen( FileName, "r" )) == NULL )
|
||||
{
|
||||
fprintf( pAbc->Err, "Cannot open input file \"%s\". ", FileName );
|
||||
|
|
@ -586,8 +586,8 @@ int IoCommandReadVerilog( Abc_Frame_t * pAbc, int argc, char ** argv )
|
|||
int c;
|
||||
|
||||
fCheck = 1;
|
||||
util_getopt_reset();
|
||||
while ( ( c = util_getopt( argc, argv, "ch" ) ) != EOF )
|
||||
Extra_UtilGetoptReset();
|
||||
while ( ( c = Extra_UtilGetopt( argc, argv, "ch" ) ) != EOF )
|
||||
{
|
||||
switch ( c )
|
||||
{
|
||||
|
|
@ -601,13 +601,13 @@ int IoCommandReadVerilog( Abc_Frame_t * pAbc, int argc, char ** argv )
|
|||
}
|
||||
}
|
||||
|
||||
if ( argc != util_optind + 1 )
|
||||
if ( argc != globalUtilOptind + 1 )
|
||||
{
|
||||
goto usage;
|
||||
}
|
||||
|
||||
// get the input file name
|
||||
FileName = argv[util_optind];
|
||||
FileName = argv[globalUtilOptind];
|
||||
if ( (pFile = fopen( FileName, "r" )) == NULL )
|
||||
{
|
||||
fprintf( pAbc->Err, "Cannot open input file \"%s\". ", FileName );
|
||||
|
|
@ -666,8 +666,8 @@ int IoCommandReadPla( Abc_Frame_t * pAbc, int argc, char ** argv )
|
|||
int c;
|
||||
|
||||
fCheck = 1;
|
||||
util_getopt_reset();
|
||||
while ( ( c = util_getopt( argc, argv, "ch" ) ) != EOF )
|
||||
Extra_UtilGetoptReset();
|
||||
while ( ( c = Extra_UtilGetopt( argc, argv, "ch" ) ) != EOF )
|
||||
{
|
||||
switch ( c )
|
||||
{
|
||||
|
|
@ -681,13 +681,13 @@ int IoCommandReadPla( Abc_Frame_t * pAbc, int argc, char ** argv )
|
|||
}
|
||||
}
|
||||
|
||||
if ( argc != util_optind + 1 )
|
||||
if ( argc != globalUtilOptind + 1 )
|
||||
{
|
||||
goto usage;
|
||||
}
|
||||
|
||||
// get the input file name
|
||||
FileName = argv[util_optind];
|
||||
FileName = argv[globalUtilOptind];
|
||||
if ( (pFile = fopen( FileName, "r" )) == NULL )
|
||||
{
|
||||
fprintf( pAbc->Err, "Cannot open input file \"%s\". ", FileName );
|
||||
|
|
@ -745,8 +745,8 @@ int IoCommandReadTruth( Abc_Frame_t * pAbc, int argc, char ** argv )
|
|||
int c;
|
||||
|
||||
fHex = 0;
|
||||
util_getopt_reset();
|
||||
while ( ( c = util_getopt( argc, argv, "xh" ) ) != EOF )
|
||||
Extra_UtilGetoptReset();
|
||||
while ( ( c = Extra_UtilGetopt( argc, argv, "xh" ) ) != EOF )
|
||||
{
|
||||
switch ( c )
|
||||
{
|
||||
|
|
@ -760,16 +760,16 @@ int IoCommandReadTruth( Abc_Frame_t * pAbc, int argc, char ** argv )
|
|||
}
|
||||
}
|
||||
|
||||
if ( argc != util_optind + 1 )
|
||||
if ( argc != globalUtilOptind + 1 )
|
||||
{
|
||||
goto usage;
|
||||
}
|
||||
|
||||
// convert truth table to SOP
|
||||
if ( fHex )
|
||||
pSopCover = Abc_SopFromTruthHex(argv[util_optind]);
|
||||
pSopCover = Abc_SopFromTruthHex(argv[globalUtilOptind]);
|
||||
else
|
||||
pSopCover = Abc_SopFromTruthBin(argv[util_optind]);
|
||||
pSopCover = Abc_SopFromTruthBin(argv[globalUtilOptind]);
|
||||
if ( pSopCover == NULL )
|
||||
{
|
||||
fprintf( pAbc->Err, "Reading truth table has failed.\n" );
|
||||
|
|
@ -814,8 +814,8 @@ int IoCommandWriteBaf( Abc_Frame_t * pAbc, int argc, char **argv )
|
|||
char * FileName;
|
||||
int c;
|
||||
|
||||
util_getopt_reset();
|
||||
while ( ( c = util_getopt( argc, argv, "lh" ) ) != EOF )
|
||||
Extra_UtilGetoptReset();
|
||||
while ( ( c = Extra_UtilGetopt( argc, argv, "lh" ) ) != EOF )
|
||||
{
|
||||
switch ( c )
|
||||
{
|
||||
|
|
@ -833,11 +833,11 @@ int IoCommandWriteBaf( Abc_Frame_t * pAbc, int argc, char **argv )
|
|||
return 0;
|
||||
}
|
||||
|
||||
if ( argc != util_optind + 1 )
|
||||
if ( argc != globalUtilOptind + 1 )
|
||||
{
|
||||
goto usage;
|
||||
}
|
||||
FileName = argv[util_optind];
|
||||
FileName = argv[globalUtilOptind];
|
||||
|
||||
// check the network type
|
||||
if ( !Abc_NtkIsStrash(pNtk) )
|
||||
|
|
@ -875,8 +875,8 @@ int IoCommandWriteBlif( Abc_Frame_t * pAbc, int argc, char **argv )
|
|||
int c;
|
||||
|
||||
fWriteLatches = 1;
|
||||
util_getopt_reset();
|
||||
while ( ( c = util_getopt( argc, argv, "lh" ) ) != EOF )
|
||||
Extra_UtilGetoptReset();
|
||||
while ( ( c = Extra_UtilGetopt( argc, argv, "lh" ) ) != EOF )
|
||||
{
|
||||
switch ( c )
|
||||
{
|
||||
|
|
@ -897,11 +897,11 @@ int IoCommandWriteBlif( Abc_Frame_t * pAbc, int argc, char **argv )
|
|||
return 0;
|
||||
}
|
||||
|
||||
if ( argc != util_optind + 1 )
|
||||
if ( argc != globalUtilOptind + 1 )
|
||||
{
|
||||
goto usage;
|
||||
}
|
||||
FileName = argv[util_optind];
|
||||
FileName = argv[globalUtilOptind];
|
||||
|
||||
// check the network type
|
||||
if ( !Abc_NtkIsLogic(pNtk) && !Abc_NtkIsStrash(pNtk) && !Abc_NtkIsSeq(pNtk) )
|
||||
|
|
@ -941,8 +941,8 @@ int IoCommandWriteBench( Abc_Frame_t * pAbc, int argc, char **argv )
|
|||
int c;
|
||||
|
||||
fWriteLatches = 1;
|
||||
util_getopt_reset();
|
||||
while ( ( c = util_getopt( argc, argv, "lh" ) ) != EOF )
|
||||
Extra_UtilGetoptReset();
|
||||
while ( ( c = Extra_UtilGetopt( argc, argv, "lh" ) ) != EOF )
|
||||
{
|
||||
switch ( c )
|
||||
{
|
||||
|
|
@ -963,12 +963,12 @@ int IoCommandWriteBench( Abc_Frame_t * pAbc, int argc, char **argv )
|
|||
return 0;
|
||||
}
|
||||
|
||||
if ( argc != util_optind + 1 )
|
||||
if ( argc != globalUtilOptind + 1 )
|
||||
{
|
||||
goto usage;
|
||||
}
|
||||
// get the input file name
|
||||
FileName = argv[util_optind];
|
||||
FileName = argv[globalUtilOptind];
|
||||
|
||||
if ( !Abc_NtkIsStrash(pNtk) )
|
||||
{
|
||||
|
|
@ -1012,8 +1012,8 @@ int IoCommandWriteCnf( Abc_Frame_t * pAbc, int argc, char **argv )
|
|||
char * FileName;
|
||||
int c;
|
||||
|
||||
util_getopt_reset();
|
||||
while ( ( c = util_getopt( argc, argv, "h" ) ) != EOF )
|
||||
Extra_UtilGetoptReset();
|
||||
while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
|
||||
{
|
||||
switch ( c )
|
||||
{
|
||||
|
|
@ -1026,17 +1026,22 @@ int IoCommandWriteCnf( Abc_Frame_t * pAbc, int argc, char **argv )
|
|||
|
||||
if ( pAbc->pNtkCur == NULL )
|
||||
{
|
||||
fprintf( pAbc->Out, "Empty network.\n" );
|
||||
printf( "Empty network.\n" );
|
||||
return 0;
|
||||
}
|
||||
if ( !Abc_NtkIsStrash(pAbc->pNtkCur) )
|
||||
{
|
||||
printf( "This command can only be applied to an AIG (run \"strash\").\n" );
|
||||
return 1;
|
||||
}
|
||||
|
||||
if ( argc != util_optind + 1 )
|
||||
if ( argc != globalUtilOptind + 1 )
|
||||
{
|
||||
goto usage;
|
||||
}
|
||||
|
||||
// get the input file name
|
||||
FileName = argv[util_optind];
|
||||
FileName = argv[globalUtilOptind];
|
||||
// write the file
|
||||
if ( !Io_WriteCnf( pAbc->pNtkCur, FileName ) )
|
||||
{
|
||||
|
|
@ -1070,8 +1075,8 @@ int IoCommandWriteDot( Abc_Frame_t * pAbc, int argc, char **argv )
|
|||
Vec_Ptr_t * vNodes;
|
||||
int c;
|
||||
|
||||
util_getopt_reset();
|
||||
while ( ( c = util_getopt( argc, argv, "h" ) ) != EOF )
|
||||
Extra_UtilGetoptReset();
|
||||
while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
|
||||
{
|
||||
switch ( c )
|
||||
{
|
||||
|
|
@ -1094,13 +1099,13 @@ int IoCommandWriteDot( Abc_Frame_t * pAbc, int argc, char **argv )
|
|||
return 0;
|
||||
}
|
||||
|
||||
if ( argc != util_optind + 1 )
|
||||
if ( argc != globalUtilOptind + 1 )
|
||||
{
|
||||
goto usage;
|
||||
}
|
||||
|
||||
// get the input file name
|
||||
FileName = argv[util_optind];
|
||||
FileName = argv[globalUtilOptind];
|
||||
// write the file
|
||||
vNodes = Abc_NtkCollectObjects( pAbc->pNtkCur );
|
||||
Io_WriteDotAig( pAbc->pNtkCur, vNodes, NULL, FileName, 0 );
|
||||
|
|
@ -1132,8 +1137,8 @@ int IoCommandWriteEqn( Abc_Frame_t * pAbc, int argc, char **argv )
|
|||
char * FileName;
|
||||
int c;
|
||||
|
||||
util_getopt_reset();
|
||||
while ( ( c = util_getopt( argc, argv, "h" ) ) != EOF )
|
||||
Extra_UtilGetoptReset();
|
||||
while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
|
||||
{
|
||||
switch ( c )
|
||||
{
|
||||
|
|
@ -1151,7 +1156,7 @@ int IoCommandWriteEqn( Abc_Frame_t * pAbc, int argc, char **argv )
|
|||
return 0;
|
||||
}
|
||||
|
||||
if ( argc != util_optind + 1 )
|
||||
if ( argc != globalUtilOptind + 1 )
|
||||
{
|
||||
goto usage;
|
||||
}
|
||||
|
|
@ -1163,7 +1168,7 @@ int IoCommandWriteEqn( Abc_Frame_t * pAbc, int argc, char **argv )
|
|||
}
|
||||
|
||||
// get the input file name
|
||||
FileName = argv[util_optind];
|
||||
FileName = argv[globalUtilOptind];
|
||||
// write the file
|
||||
// get rid of complemented covers if present
|
||||
if ( Abc_NtkIsSopLogic(pNtk) )
|
||||
|
|
@ -1203,8 +1208,8 @@ int IoCommandWriteGml( Abc_Frame_t * pAbc, int argc, char **argv )
|
|||
char * FileName;
|
||||
int c;
|
||||
|
||||
util_getopt_reset();
|
||||
while ( ( c = util_getopt( argc, argv, "h" ) ) != EOF )
|
||||
Extra_UtilGetoptReset();
|
||||
while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
|
||||
{
|
||||
switch ( c )
|
||||
{
|
||||
|
|
@ -1227,13 +1232,13 @@ int IoCommandWriteGml( Abc_Frame_t * pAbc, int argc, char **argv )
|
|||
return 0;
|
||||
}
|
||||
|
||||
if ( argc != util_optind + 1 )
|
||||
if ( argc != globalUtilOptind + 1 )
|
||||
{
|
||||
goto usage;
|
||||
}
|
||||
|
||||
// get the input file name
|
||||
FileName = argv[util_optind];
|
||||
FileName = argv[globalUtilOptind];
|
||||
// write the file
|
||||
Io_WriteGml( pAbc->pNtkCur, FileName );
|
||||
return 0;
|
||||
|
|
@ -1264,8 +1269,8 @@ int IoCommandWriteList( Abc_Frame_t * pAbc, int argc, char **argv )
|
|||
int c;
|
||||
|
||||
fUseHost = 1;
|
||||
util_getopt_reset();
|
||||
while ( ( c = util_getopt( argc, argv, "nh" ) ) != EOF )
|
||||
Extra_UtilGetoptReset();
|
||||
while ( ( c = Extra_UtilGetopt( argc, argv, "nh" ) ) != EOF )
|
||||
{
|
||||
switch ( c )
|
||||
{
|
||||
|
|
@ -1291,13 +1296,13 @@ int IoCommandWriteList( Abc_Frame_t * pAbc, int argc, char **argv )
|
|||
return 0;
|
||||
}
|
||||
|
||||
if ( argc != util_optind + 1 )
|
||||
if ( argc != globalUtilOptind + 1 )
|
||||
{
|
||||
goto usage;
|
||||
}
|
||||
|
||||
// get the input file name
|
||||
FileName = argv[util_optind];
|
||||
FileName = argv[globalUtilOptind];
|
||||
// write the file
|
||||
Io_WriteList( pAbc->pNtkCur, FileName, fUseHost );
|
||||
return 0;
|
||||
|
|
@ -1328,8 +1333,8 @@ int IoCommandWritePla( Abc_Frame_t * pAbc, int argc, char **argv )
|
|||
char * FileName;
|
||||
int c;
|
||||
|
||||
util_getopt_reset();
|
||||
while ( ( c = util_getopt( argc, argv, "h" ) ) != EOF )
|
||||
Extra_UtilGetoptReset();
|
||||
while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
|
||||
{
|
||||
switch ( c )
|
||||
{
|
||||
|
|
@ -1359,12 +1364,12 @@ int IoCommandWritePla( Abc_Frame_t * pAbc, int argc, char **argv )
|
|||
return 0;
|
||||
}
|
||||
|
||||
if ( argc != util_optind + 1 )
|
||||
if ( argc != globalUtilOptind + 1 )
|
||||
{
|
||||
goto usage;
|
||||
}
|
||||
// get the input file name
|
||||
FileName = argv[util_optind];
|
||||
FileName = argv[globalUtilOptind];
|
||||
|
||||
// derive the netlist
|
||||
pNtkTemp = Abc_NtkLogicToNetlist(pNtk);
|
||||
|
|
@ -1402,8 +1407,8 @@ int IoCommandWriteVerilog( Abc_Frame_t * pAbc, int argc, char **argv )
|
|||
char * FileName;
|
||||
int c;
|
||||
|
||||
util_getopt_reset();
|
||||
while ( ( c = util_getopt( argc, argv, "h" ) ) != EOF )
|
||||
Extra_UtilGetoptReset();
|
||||
while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
|
||||
{
|
||||
switch ( c )
|
||||
{
|
||||
|
|
@ -1421,12 +1426,12 @@ int IoCommandWriteVerilog( Abc_Frame_t * pAbc, int argc, char **argv )
|
|||
return 0;
|
||||
}
|
||||
|
||||
if ( argc != util_optind + 1 )
|
||||
if ( argc != globalUtilOptind + 1 )
|
||||
{
|
||||
goto usage;
|
||||
}
|
||||
// get the input file name
|
||||
FileName = argv[util_optind];
|
||||
FileName = argv[globalUtilOptind];
|
||||
|
||||
// derive the netlist
|
||||
pNtkTemp = Abc_NtkLogicToNetlist(pNtk);
|
||||
|
|
|
|||
|
|
@ -74,8 +74,8 @@ Abc_Ntk_t * Io_ReadBaf( char * pFileName, int fCheck )
|
|||
|
||||
// allocate the empty AIG
|
||||
pNtkNew = Abc_NtkAlloc( ABC_NTK_STRASH, ABC_FUNC_AIG );
|
||||
pNtkNew->pName = util_strsav( pName );
|
||||
pNtkNew->pSpec = util_strsav( pFileName );
|
||||
pNtkNew->pName = Extra_UtilStrsav( pName );
|
||||
pNtkNew->pSpec = Extra_UtilStrsav( pFileName );
|
||||
|
||||
// prepare the array of nodes
|
||||
vNodes = Vec_PtrAlloc( 1 + nInputs + nLatches + nAnds );
|
||||
|
|
|
|||
|
|
@ -230,7 +230,7 @@ Vec_Ptr_t * Io_ReadBlifGetTokens( Io_ReadBlif_t * p )
|
|||
vTokens->nSize--;
|
||||
// load them into the new array
|
||||
for ( i = 0; i < vTokens->nSize; i++ )
|
||||
Vec_PtrPush( p->vNewTokens, util_strsav(vTokens->pArray[i]) );
|
||||
Vec_PtrPush( p->vNewTokens, Extra_UtilStrsav(vTokens->pArray[i]) );
|
||||
|
||||
// load as long as there is the line break
|
||||
while ( 1 )
|
||||
|
|
@ -249,12 +249,12 @@ Vec_Ptr_t * Io_ReadBlifGetTokens( Io_ReadBlif_t * p )
|
|||
vTokens->nSize--;
|
||||
// load them into the new array
|
||||
for ( i = 0; i < vTokens->nSize; i++ )
|
||||
Vec_PtrPush( p->vNewTokens, util_strsav(vTokens->pArray[i]) );
|
||||
Vec_PtrPush( p->vNewTokens, Extra_UtilStrsav(vTokens->pArray[i]) );
|
||||
continue;
|
||||
}
|
||||
// otherwise, load them and break
|
||||
for ( i = 0; i < vTokens->nSize; i++ )
|
||||
Vec_PtrPush( p->vNewTokens, util_strsav(vTokens->pArray[i]) );
|
||||
Vec_PtrPush( p->vNewTokens, Extra_UtilStrsav(vTokens->pArray[i]) );
|
||||
break;
|
||||
}
|
||||
return p->vNewTokens;
|
||||
|
|
@ -294,8 +294,8 @@ Abc_Ntk_t * Io_ReadBlifNetwork( Io_ReadBlif_t * p )
|
|||
pModelName = vTokens->pArray[1];
|
||||
// allocate the empty network
|
||||
p->pNtk = Abc_NtkAlloc( ABC_NTK_NETLIST, ABC_FUNC_SOP );
|
||||
p->pNtk->pName = util_strsav( pModelName );
|
||||
p->pNtk->pSpec = util_strsav( p->pFileName );
|
||||
p->pNtk->pName = Extra_UtilStrsav( pModelName );
|
||||
p->pNtk->pSpec = Extra_UtilStrsav( p->pFileName );
|
||||
}
|
||||
else
|
||||
p->pNtk = Abc_NtkAlloc( ABC_NTK_NETLIST, ABC_FUNC_SOP );
|
||||
|
|
@ -681,7 +681,7 @@ int Io_ReadBlifNetworkInputArrival( Io_ReadBlif_t * p, Vec_Ptr_t * vTokens )
|
|||
return 1;
|
||||
}
|
||||
// set the arrival time
|
||||
Abc_NtkTimeSetArrival( p->pNtk, pNet->Id, (float)TimeRise, (float)TimeFall );
|
||||
Abc_NtkTimeSetArrival( p->pNtk, Abc_ObjFanin0(pNet)->Id, (float)TimeRise, (float)TimeFall );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -181,7 +181,7 @@ Abc_Ntk_t * Io_ReadEdifNetwork( Extra_FileReader_t * p )
|
|||
else if ( strcmp( vTokens->pArray[0], "design" ) == 0 )
|
||||
{
|
||||
free( pNtk->pName );
|
||||
pNtk->pName = util_strsav( vTokens->pArray[3] );
|
||||
pNtk->pName = Extra_UtilStrsav( vTokens->pArray[3] );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -145,7 +145,7 @@ Abc_Ntk_t * Io_ReadEqnNetwork( Extra_FileReader_t * p )
|
|||
continue;
|
||||
}
|
||||
// determine unique variables
|
||||
pCubesCopy = util_strsav( pCubesCopy );
|
||||
pCubesCopy = Extra_UtilStrsav( pCubesCopy );
|
||||
// find the names of the fanins of this node
|
||||
Io_ReadEqnStrCutAt( pCubesCopy, "!*+", 1, vVars );
|
||||
// create the node
|
||||
|
|
|
|||
|
|
@ -272,8 +272,8 @@ Abc_Ntk_t * Io_ReadVerNetwork( Io_ReadVer_t * p )
|
|||
|
||||
// allocate the empty network
|
||||
pNtk = Abc_NtkAlloc( ABC_NTK_NETLIST, ABC_FUNC_SOP );
|
||||
pNtk->pName = util_strsav( pModelName );
|
||||
pNtk->pSpec = util_strsav( p->pFileName );
|
||||
pNtk->pName = Extra_UtilStrsav( pModelName );
|
||||
pNtk->pSpec = Extra_UtilStrsav( p->pFileName );
|
||||
|
||||
// create constant nodes and nets
|
||||
Abc_NtkFindOrCreateNet( pNtk, "1'b0" );
|
||||
|
|
@ -334,7 +334,7 @@ Abc_Ntk_t * Io_ReadVerNetwork( Io_ReadVer_t * p )
|
|||
}
|
||||
// add the tri-state element to the skipped ones
|
||||
sprintf( Buffer, "%s %s", vTokens->pArray[0], vTokens->pArray[1] );
|
||||
Vec_PtrPush( p->vSkipped, util_strsav(Buffer) );
|
||||
Vec_PtrPush( p->vSkipped, Extra_UtilStrsav(Buffer) );
|
||||
}
|
||||
Extra_ProgressBarStop( pProgress );
|
||||
|
||||
|
|
|
|||
|
|
@ -223,7 +223,7 @@ FILE * Io_FileOpen( const char * FileName, const char * PathVar, const char * Mo
|
|||
{
|
||||
char ActualFileName[4096];
|
||||
FILE * fp = 0;
|
||||
t = util_strsav( c );
|
||||
t = Extra_UtilStrsav( c );
|
||||
for (i = strtok( t, ":" ); i != 0; i = strtok( 0, ":") )
|
||||
{
|
||||
#ifdef WIN32
|
||||
|
|
|
|||
|
|
@ -42,19 +42,19 @@
|
|||
int Io_WriteCnf( Abc_Ntk_t * pNtk, char * pFileName )
|
||||
{
|
||||
solver * pSat;
|
||||
if ( !Abc_NtkIsBddLogic(pNtk) )
|
||||
if ( !Abc_NtkIsStrash(pNtk) )
|
||||
{
|
||||
fprintf( stdout, "Io_WriteCnf(): Currently can only process logic networks with BDDs.\n" );
|
||||
fprintf( stdout, "Io_WriteCnf(): Currently can only process AIGs.\n" );
|
||||
return 0;
|
||||
}
|
||||
if ( Abc_NtkPoNum(pNtk) != 1 )
|
||||
{
|
||||
fprintf( stdout, "Io_WriteCnf(): Currently can only solve the miter (the network with one PO).\n" );
|
||||
fprintf( stdout, "Io_WriteCnf(): Currently can only process the miter (the network with one PO).\n" );
|
||||
return 0;
|
||||
}
|
||||
if ( Abc_NtkLatchNum(pNtk) != 0 )
|
||||
{
|
||||
fprintf( stdout, "Io_WriteCnf(): Currently can only solve the miter for combinational circuits.\n" );
|
||||
fprintf( stdout, "Io_WriteCnf(): Currently can only process the miter for combinational circuits.\n" );
|
||||
return 0;
|
||||
}
|
||||
// create solver with clauses
|
||||
|
|
|
|||
|
|
@ -75,21 +75,21 @@ int main( int argc, char * argv[] )
|
|||
sprintf( sReadCmd, "read" );
|
||||
sprintf( sWriteCmd, "write" );
|
||||
|
||||
util_getopt_reset();
|
||||
while ((c = util_getopt(argc, argv, "c:hf:F:o:st:T:x")) != EOF) {
|
||||
Extra_UtilGetoptReset();
|
||||
while ((c = Extra_UtilGetopt(argc, argv, "c:hf:F:o:st:T:x")) != EOF) {
|
||||
switch(c) {
|
||||
case 'c':
|
||||
strcpy( sCommandUsr, util_optarg );
|
||||
strcpy( sCommandUsr, globalUtilOptarg );
|
||||
fBatch = 1;
|
||||
break;
|
||||
|
||||
case 'f':
|
||||
sprintf(sCommandUsr, "source %s", util_optarg);
|
||||
sprintf(sCommandUsr, "source %s", globalUtilOptarg);
|
||||
fBatch = 1;
|
||||
break;
|
||||
|
||||
case 'F':
|
||||
sprintf(sCommandUsr, "source -x %s", util_optarg);
|
||||
sprintf(sCommandUsr, "source -x %s", globalUtilOptarg);
|
||||
fBatch = 1;
|
||||
break;
|
||||
|
||||
|
|
@ -98,7 +98,7 @@ int main( int argc, char * argv[] )
|
|||
break;
|
||||
|
||||
case 'o':
|
||||
sOutFile = util_optarg;
|
||||
sOutFile = globalUtilOptarg;
|
||||
fFinalWrite = 1;
|
||||
break;
|
||||
|
||||
|
|
@ -107,12 +107,12 @@ int main( int argc, char * argv[] )
|
|||
break;
|
||||
|
||||
case 't':
|
||||
if ( TypeCheck( pAbc, util_optarg ) )
|
||||
if ( TypeCheck( pAbc, globalUtilOptarg ) )
|
||||
{
|
||||
if ( !strcmp(util_optarg, "none") == 0 )
|
||||
if ( !strcmp(globalUtilOptarg, "none") == 0 )
|
||||
{
|
||||
fInitRead = 1;
|
||||
sprintf( sReadCmd, "read_%s", util_optarg );
|
||||
sprintf( sReadCmd, "read_%s", globalUtilOptarg );
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
|
@ -122,12 +122,12 @@ int main( int argc, char * argv[] )
|
|||
break;
|
||||
|
||||
case 'T':
|
||||
if ( TypeCheck( pAbc, util_optarg ) )
|
||||
if ( TypeCheck( pAbc, globalUtilOptarg ) )
|
||||
{
|
||||
if (!strcmp(util_optarg, "none") == 0)
|
||||
if (!strcmp(globalUtilOptarg, "none") == 0)
|
||||
{
|
||||
fFinalWrite = 1;
|
||||
sprintf( sWriteCmd, "write_%s", util_optarg);
|
||||
sprintf( sWriteCmd, "write_%s", globalUtilOptarg);
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
|
@ -151,14 +151,14 @@ int main( int argc, char * argv[] )
|
|||
{
|
||||
pAbc->fBatchMode = 1;
|
||||
|
||||
if (argc - util_optind == 0)
|
||||
if (argc - globalUtilOptind == 0)
|
||||
{
|
||||
sInFile = NULL;
|
||||
}
|
||||
else if (argc - util_optind == 1)
|
||||
else if (argc - globalUtilOptind == 1)
|
||||
{
|
||||
fInitRead = 1;
|
||||
sInFile = argv[util_optind];
|
||||
sInFile = argv[globalUtilOptind];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -221,10 +221,7 @@ int main( int argc, char * argv[] )
|
|||
// if the memory should be freed, quit packages
|
||||
if ( fStatus < 0 )
|
||||
{
|
||||
// perform uninitializations
|
||||
Abc_FrameEnd( pAbc );
|
||||
// stop the framework
|
||||
Abc_FrameDeallocate( pAbc );
|
||||
Abc_Stop();
|
||||
}
|
||||
return 0;
|
||||
|
||||
|
|
@ -250,16 +247,12 @@ usage:
|
|||
void Abc_Start()
|
||||
{
|
||||
Abc_Frame_t * pAbc;
|
||||
|
||||
// added to detect memory leaks:
|
||||
#ifdef _DEBUG
|
||||
_CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
|
||||
#endif
|
||||
|
||||
// get global frame (singleton pattern)
|
||||
// will be initialized on first call
|
||||
// start the glocal frame
|
||||
pAbc = Abc_FrameGetGlobalFrame();
|
||||
|
||||
// source the resource file
|
||||
// Abc_UtilsSource( pAbc );
|
||||
}
|
||||
|
|
@ -278,17 +271,11 @@ void Abc_Start()
|
|||
void Abc_Stop()
|
||||
{
|
||||
Abc_Frame_t * pAbc;
|
||||
int fStatus = 0;
|
||||
|
||||
// if the memory should be freed, quit packages
|
||||
if ( fStatus == -2 )
|
||||
{
|
||||
pAbc = Abc_FrameGetGlobalFrame();
|
||||
// perform uninitializations
|
||||
Abc_FrameEnd( pAbc );
|
||||
// stop the framework
|
||||
Abc_FrameDeallocate( pAbc );
|
||||
}
|
||||
pAbc = Abc_FrameGetGlobalFrame();
|
||||
// perform uninitializations
|
||||
Abc_FrameEnd( pAbc );
|
||||
// stop the framework
|
||||
Abc_FrameDeallocate( pAbc );
|
||||
}
|
||||
|
||||
/**Function********************************************************************
|
||||
|
|
|
|||
|
|
@ -40,17 +40,10 @@ typedef struct Abc_Frame_t_ Abc_Frame_t;
|
|||
// it is used to catch memory leaks on Windows
|
||||
#include "leaks.h"
|
||||
|
||||
// standard includes
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
// includes from GLU
|
||||
#include "util.h"
|
||||
#include "st.h"
|
||||
|
||||
// data structure packages
|
||||
#include "extra.h"
|
||||
#include "vec.h"
|
||||
#include "st.h"
|
||||
|
||||
// core packages
|
||||
#include "abc.h"
|
||||
|
|
|
|||
|
|
@ -48,8 +48,8 @@ int Abc_FrameReadNtkStoreSize() { return s_GlobalFrame->nSt
|
|||
void * Abc_FrameReadLibLut() { return s_GlobalFrame->pLibLut; }
|
||||
void * Abc_FrameReadLibGen() { return s_GlobalFrame->pLibGen; }
|
||||
void * Abc_FrameReadLibSuper() { return s_GlobalFrame->pLibSuper; }
|
||||
void * Abc_FrameReadManDd() { return s_GlobalFrame->dd; }
|
||||
void * Abc_FrameReadManDec() { return s_GlobalFrame->pManDec; }
|
||||
void * Abc_FrameReadManDd() { if ( s_GlobalFrame->dd == NULL ) s_GlobalFrame->dd = Cudd_Init( 0, 0, CUDD_UNIQUE_SLOTS, CUDD_CACHE_SLOTS, 0 ); return s_GlobalFrame->dd; }
|
||||
void * Abc_FrameReadManDec() { if ( s_GlobalFrame->pManDec == NULL ) s_GlobalFrame->pManDec = Dec_ManStart(); return s_GlobalFrame->pManDec; }
|
||||
char * Abc_FrameReadFlag( char * pFlag ) { return Cmd_FlagReadByName( s_GlobalFrame, pFlag ); }
|
||||
|
||||
void Abc_FrameSetNtkStore( Abc_Ntk_t * pNtk ) { s_GlobalFrame->pStored = pNtk; }
|
||||
|
|
@ -97,7 +97,8 @@ bool Abc_FrameIsFlagEnabled( char * pFlag )
|
|||
Abc_Frame_t * Abc_FrameAllocate()
|
||||
{
|
||||
Abc_Frame_t * p;
|
||||
|
||||
extern void define_cube_size( int n );
|
||||
extern void set_espresso_flags();
|
||||
// allocate and clean
|
||||
p = ALLOC( Abc_Frame_t, 1 );
|
||||
memset( p, 0, sizeof(Abc_Frame_t) );
|
||||
|
|
@ -111,8 +112,8 @@ Abc_Frame_t * Abc_FrameAllocate()
|
|||
p->nSteps = 1;
|
||||
p->fBatchMode = 0;
|
||||
// initialize decomposition manager
|
||||
p->pManDec = Dec_ManStart();
|
||||
p->dd = Cudd_Init( 0, 0, CUDD_UNIQUE_SLOTS, CUDD_CACHE_SLOTS, 0 );
|
||||
define_cube_size(20);
|
||||
set_espresso_flags();
|
||||
return p;
|
||||
}
|
||||
|
||||
|
|
@ -130,11 +131,13 @@ Abc_Frame_t * Abc_FrameAllocate()
|
|||
***********************************************************************/
|
||||
void Abc_FrameDeallocate( Abc_Frame_t * p )
|
||||
{
|
||||
Dec_ManStop( p->pManDec );
|
||||
Extra_StopManager( p->dd );
|
||||
extern void undefine_cube_size();
|
||||
undefine_cube_size();
|
||||
if ( p->pManDec ) Dec_ManStop( p->pManDec );
|
||||
if ( p->dd ) Extra_StopManager( p->dd );
|
||||
Abc_FrameDeleteAllNetworks( p );
|
||||
free( p );
|
||||
p = NULL;
|
||||
s_GlobalFrame = NULL;
|
||||
}
|
||||
|
||||
/**Function*************************************************************
|
||||
|
|
|
|||
|
|
@ -139,8 +139,8 @@ void Abc_UtilsSource( Abc_Frame_t * pAbc )
|
|||
|
||||
// If .rc is present in both the home and current directories, then read
|
||||
// it from the home directory. Otherwise, read it from wherever it's located.
|
||||
sPath1 = util_file_search(".rc", "~/", "r");
|
||||
sPath2 = util_file_search(".rc", ".", "r");
|
||||
sPath1 = Extra_UtilFileSearch(".rc", "~/", "r");
|
||||
sPath2 = Extra_UtilFileSearch(".rc", ".", "r");
|
||||
|
||||
if ( sPath1 && sPath2 ) {
|
||||
/* ~/.rc == .rc : Source the file only once */
|
||||
|
|
|
|||
|
|
@ -343,7 +343,7 @@ int Seq_NtkImplementRetimingBackward( Abc_Ntk_t * pNtk, Vec_Ptr_t * vMoves, int
|
|||
}
|
||||
|
||||
// get the miter cone
|
||||
pNtkMiter = Abc_NtkCreateCone( pNtkProb, pNtkProb->vCos, vValues );
|
||||
pNtkMiter = Abc_NtkCreateTarget( pNtkProb, pNtkProb->vCos, vValues );
|
||||
Abc_NtkDelete( pNtkProb );
|
||||
Vec_IntFree( vValues );
|
||||
|
||||
|
|
@ -358,7 +358,7 @@ int Seq_NtkImplementRetimingBackward( Abc_Ntk_t * pNtk, Vec_Ptr_t * vMoves, int
|
|||
// solve the miter
|
||||
clk = clock();
|
||||
// RetValue = Abc_NtkMiterSat_OldAndRusty( pNtkCnf, 30, 0 );
|
||||
RetValue = Abc_NtkMiterSat( pNtkCnf, 30, 0 );
|
||||
RetValue = Abc_NtkMiterSat( pNtkCnf, 500000, 50000000, 0 );
|
||||
if ( fVerbose )
|
||||
if ( clock() - clk > 100 )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -88,8 +88,8 @@ Abc_Ntk_t * Abc_NtkAigToSeq( Abc_Ntk_t * pNtk )
|
|||
// start the network
|
||||
pNtkNew = Abc_NtkAlloc( ABC_NTK_SEQ, ABC_FUNC_AIG );
|
||||
// duplicate the name and the spec
|
||||
pNtkNew->pName = util_strsav(pNtk->pName);
|
||||
pNtkNew->pSpec = util_strsav(pNtk->pSpec);
|
||||
pNtkNew->pName = Extra_UtilStrsav(pNtk->pName);
|
||||
pNtkNew->pSpec = Extra_UtilStrsav(pNtk->pSpec);
|
||||
|
||||
// map the constant nodes
|
||||
Abc_NtkCleanCopy( pNtk );
|
||||
|
|
|
|||
|
|
@ -112,8 +112,8 @@ Abc_Ntk_t * Seq_NtkRetimeDerive( Abc_Ntk_t * pNtk, int fVerbose )
|
|||
// start the network
|
||||
pNtkNew = Abc_NtkAlloc( ABC_NTK_SEQ, ABC_FUNC_AIG );
|
||||
// duplicate the name and the spec
|
||||
pNtkNew->pName = util_strsav(pNtk->pName);
|
||||
pNtkNew->pSpec = util_strsav(pNtk->pSpec);
|
||||
pNtkNew->pName = Extra_UtilStrsav(pNtk->pName);
|
||||
pNtkNew->pSpec = Extra_UtilStrsav(pNtk->pSpec);
|
||||
|
||||
// map the constant nodes
|
||||
Abc_NtkCleanCopy( pNtk );
|
||||
|
|
|
|||
|
|
@ -164,7 +164,7 @@
|
|||
|
||||
******************************************************************************/
|
||||
|
||||
#include "util.h"
|
||||
#include "util_hack.h"
|
||||
#include "cuddInt.h"
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
|
||||
******************************************************************************/
|
||||
|
||||
#include "util.h"
|
||||
#include "util_hack.h"
|
||||
#include "cuddInt.h"
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@
|
|||
|
||||
******************************************************************************/
|
||||
|
||||
#include "util.h"
|
||||
#include "util_hack.h"
|
||||
#include "cuddInt.h"
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
******************************************************************************/
|
||||
|
||||
#include "util.h"
|
||||
#include "util_hack.h"
|
||||
#include "cuddInt.h"
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
******************************************************************************/
|
||||
|
||||
#include "util.h"
|
||||
#include "util_hack.h"
|
||||
#include "cuddInt.h"
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@
|
|||
|
||||
******************************************************************************/
|
||||
|
||||
#include "util.h"
|
||||
#include "util_hack.h"
|
||||
#include "cuddInt.h"
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
******************************************************************************/
|
||||
|
||||
#include "util.h"
|
||||
#include "util_hack.h"
|
||||
#include "cuddInt.h"
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
******************************************************************************/
|
||||
|
||||
#include "util.h"
|
||||
#include "util_hack.h"
|
||||
#include "cuddInt.h"
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
******************************************************************************/
|
||||
|
||||
#include "util.h"
|
||||
#include "util_hack.h"
|
||||
#include "cuddInt.h"
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@
|
|||
|
||||
******************************************************************************/
|
||||
|
||||
#include "util.h"
|
||||
#include "util_hack.h"
|
||||
#include "cuddInt.h"
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
******************************************************************************/
|
||||
|
||||
#include "util.h"
|
||||
#include "util_hack.h"
|
||||
#include "cuddInt.h"
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@
|
|||
#else
|
||||
#define DBL_MAX_EXP 1024
|
||||
#endif
|
||||
#include "util.h"
|
||||
#include "util_hack.h"
|
||||
#include "cuddInt.h"
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@
|
|||
|
||||
******************************************************************************/
|
||||
|
||||
#include "util.h"
|
||||
#include "util_hack.h"
|
||||
#include "cuddInt.h"
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@
|
|||
|
||||
******************************************************************************/
|
||||
|
||||
#include "util.h"
|
||||
#include "util_hack.h"
|
||||
#include "cuddInt.h"
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@
|
|||
|
||||
******************************************************************************/
|
||||
|
||||
#include "util.h"
|
||||
#include "util_hack.h"
|
||||
#include "cuddInt.h"
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@
|
|||
|
||||
******************************************************************************/
|
||||
|
||||
#include "util.h"
|
||||
#include "util_hack.h"
|
||||
#include "cuddInt.h"
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
|
||||
******************************************************************************/
|
||||
|
||||
#include "util.h"
|
||||
#include "util_hack.h"
|
||||
#include "cuddInt.h"
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
|
||||
******************************************************************************/
|
||||
|
||||
#include "util.h"
|
||||
#include "util_hack.h"
|
||||
#include "cuddInt.h"
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@
|
|||
|
||||
******************************************************************************/
|
||||
|
||||
#include "util.h"
|
||||
#include "util_hack.h"
|
||||
#include "cuddInt.h"
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
******************************************************************************/
|
||||
|
||||
#include "util.h"
|
||||
#include "util_hack.h"
|
||||
#include "cuddInt.h"
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@
|
|||
|
||||
******************************************************************************/
|
||||
|
||||
#include "util.h"
|
||||
#include "util_hack.h"
|
||||
#include "cuddInt.h"
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
|
||||
******************************************************************************/
|
||||
|
||||
#include "util.h"
|
||||
#include "util_hack.h"
|
||||
#include "cuddInt.h"
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
******************************************************************************/
|
||||
|
||||
#include "util.h"
|
||||
#include "util_hack.h"
|
||||
#include "cuddInt.h"
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@
|
|||
|
||||
******************************************************************************/
|
||||
|
||||
#include "util.h"
|
||||
#include "util_hack.h"
|
||||
#include "cuddInt.h"
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@
|
|||
|
||||
******************************************************************************/
|
||||
|
||||
#include "util.h"
|
||||
#include "util_hack.h"
|
||||
#include "cuddInt.h"
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@
|
|||
|
||||
******************************************************************************/
|
||||
|
||||
#include "util.h"
|
||||
#include "util_hack.h"
|
||||
#include "cuddInt.h"
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@
|
|||
|
||||
******************************************************************************/
|
||||
|
||||
#include "util.h"
|
||||
#include "util_hack.h"
|
||||
#include "cuddInt.h"
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@
|
|||
|
||||
******************************************************************************/
|
||||
|
||||
#include "util.h"
|
||||
#include "util_hack.h"
|
||||
#include "cuddInt.h"
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
******************************************************************************/
|
||||
|
||||
#include "util.h"
|
||||
#include "util_hack.h"
|
||||
#include "cuddInt.h"
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
******************************************************************************/
|
||||
|
||||
#include "util.h"
|
||||
#include "util_hack.h"
|
||||
#define CUDD_MAIN
|
||||
#include "cuddInt.h"
|
||||
#undef CUDD_MAIN
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@
|
|||
|
||||
******************************************************************************/
|
||||
|
||||
#include "util.h"
|
||||
#include "util_hack.h"
|
||||
#include "cuddInt.h"
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@
|
|||
|
||||
******************************************************************************/
|
||||
|
||||
#include "util.h"
|
||||
#include "util_hack.h"
|
||||
#include "cuddInt.h"
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@
|
|||
|
||||
******************************************************************************/
|
||||
|
||||
#include "util.h"
|
||||
#include "util_hack.h"
|
||||
#include "cuddInt.h"
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
|
||||
******************************************************************************/
|
||||
|
||||
#include "util.h"
|
||||
#include "util_hack.h"
|
||||
#include "cuddInt.h"
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
******************************************************************************/
|
||||
|
||||
#include "util.h"
|
||||
#include "util_hack.h"
|
||||
#include "cuddInt.h"
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
******************************************************************************/
|
||||
|
||||
#include "util.h"
|
||||
#include "util_hack.h"
|
||||
#include "cuddInt.h"
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@
|
|||
|
||||
******************************************************************************/
|
||||
|
||||
#include "util.h"
|
||||
#include "util_hack.h"
|
||||
#include "cuddInt.h"
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
******************************************************************************/
|
||||
|
||||
#include "util.h"
|
||||
#include "util_hack.h"
|
||||
#include "cuddInt.h"
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@
|
|||
|
||||
******************************************************************************/
|
||||
|
||||
#include "util.h"
|
||||
#include "util_hack.h"
|
||||
#include "cuddInt.h"
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@
|
|||
|
||||
******************************************************************************/
|
||||
|
||||
#include "util.h"
|
||||
#include "util_hack.h"
|
||||
#include "cuddInt.h"
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@
|
|||
|
||||
******************************************************************************/
|
||||
|
||||
#include "util.h"
|
||||
#include "util_hack.h"
|
||||
#include "cuddInt.h"
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
******************************************************************************/
|
||||
|
||||
#include "util.h"
|
||||
#include "util_hack.h"
|
||||
#include "cuddInt.h"
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
******************************************************************************/
|
||||
|
||||
#include "util.h"
|
||||
#include "util_hack.h"
|
||||
#include "cuddInt.h"
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
|
||||
******************************************************************************/
|
||||
|
||||
#include "util.h"
|
||||
#include "util_hack.h"
|
||||
#include "cuddInt.h"
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue