From b35edf38170919acdd9c31390933d3aaa066c7b8 Mon Sep 17 00:00:00 2001 From: Stephen L Arnold Date: Sun, 23 Feb 2025 16:51:35 -0800 Subject: [PATCH] fix: dev: refactor symbol visibility, use ABC_DLL to expose public API * follow modern guidelines summarized in [1] * set default visibility and visibility-inlines to hidden when using C++ namespace * MSVC is hidden by default, so set GNU, LLVM, and AppleClang the same way * remove parallel args from tox Makefile commands in favor of posargs eg, ``tox -e abc -- -j4`` [1] https://gist.github.com/ax3l/ba17f4bb1edb5885a6bd01f58de4d542 Signed-off-by: Stephen L Arnold --- CMakeLists.txt | 12 ++- Makefile | 7 +- src/aig/gia/gia.h | 207 ++++++++++++++++++++------------------- src/base/acb/acbTest.c | 50 +++++----- src/base/main/abcapis.h | 66 ++++++------- src/base/main/main.c | 2 +- src/base/main/main.h | 198 ++++++++++++++++++------------------- src/base/main/mainLib.c | 22 ++--- src/base/main/mainReal.c | 61 ++++++------ tox.ini | 6 +- 10 files changed, 321 insertions(+), 310 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d690578f0c..349d3b4931 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,6 +28,13 @@ set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) +# MSVC has symbols hidden by default. On GCC and Clang we need to explicitly +# set the visibility to hidden to achieve the same result and then manually +# expose what we need. This results in smaller abc dynamic library and thus +# a shorter loading time and higher performance. +set(CMAKE_CXX_VISIBILITY_PRESET hidden) +set(CMAKE_VISIBILITY_INLINES_HIDDEN ON) + if(CMAKE_CXX_COMPILER_ID STREQUAL Clang) set(CLANG_DEFAULT_CXX_STDLIB libc++) set(CLANG_DEFAULT_RTLIB compiler-rt) @@ -75,6 +82,10 @@ option(COVERAGE_BUILD "Enable source-based LLVM code coverage" OFF) option(ABC_SKIP_EXE "Skip building executable (build libs only)" OFF) option(VENDOR_GTEST "download googletest" OFF) +if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") + add_definitions(-DABC_DLL=__attribute__\(\(visibility\(\"default\"\)\)\)) +endif() + add_library(abc_interface INTERFACE) set(ABC_HEADERS @@ -161,7 +172,6 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang target_compile_options(abc_interface INTERFACE $<$:-fpermissive> - $<$:-fvisibility=hidden> ) endif() elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") diff --git a/Makefile b/Makefile index fe6be2b5ea..d5c02856c7 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,7 @@ VPATH = $(ABCSRC) PROG := abc OS := $(shell uname -s) -VERSION ?= 1.1.0 +VERSION ?= 1.2.0 SOVERSION ?= 1 SONAME := lib$(PROG).so.$(SOVERSION) @@ -65,11 +65,14 @@ endif # compile ABC using the C++ compiler and put everything in the namespace $(ABC_NAMESPACE) ifdef ABC_USE_NAMESPACE - CFLAGS += -DABC_NAMESPACE=$(ABC_USE_NAMESPACE) -std=c++11 -fvisibility=hidden -fpermissive + CFLAGS += -DABC_DLL="__attribute__((visibility(\"default\")))" -DABC_NAMESPACE=$(ABC_USE_NAMESPACE) -std=c++17 -fvisibility=hidden -fvisibility-inlines-hidden -fpermissive + CXXFLAGS := $(CFLAGS) CC := $(CXX) DLIBS := -lstdc++ $(info $(MSG_PREFIX)Compiling in namespace $(ABC_NAMESPACE)) else + CFLAGS += -DABC_DLL= + CXXFLAGS := $(CFLAGS) ABC_USE_LIBSTDCXX := 1 endif diff --git a/src/aig/gia/gia.h b/src/aig/gia/gia.h index a8f3c4875d..1af90e042a 100644 --- a/src/aig/gia/gia.h +++ b/src/aig/gia/gia.h @@ -9,7 +9,7 @@ Synopsis [External declarations.] Author [Alan Mishchenko] - + Affiliation [UC Berkeley] Date [Ver. 1.0. Started - June 20, 2005.] @@ -17,7 +17,7 @@ Revision [$Id: gia.h,v 1.00 2005/06/20 00:00:00 alanmi Exp $] ***********************************************************************/ - + #ifndef ABC__aig__gia__gia_h #define ABC__aig__gia__gia_h @@ -31,6 +31,7 @@ #include #include +#include "misc/st/st.h" #include "misc/vec/vec.h" #include "misc/vec/vecWec.h" #include "misc/util/utilCex.h" @@ -49,9 +50,9 @@ ABC_NAMESPACE_HEADER_START /// BASIC TYPES /// //////////////////////////////////////////////////////////////////////// -typedef struct Gia_MmFixed_t_ Gia_MmFixed_t; -typedef struct Gia_MmFlex_t_ Gia_MmFlex_t; -typedef struct Gia_MmStep_t_ Gia_MmStep_t; +typedef struct Gia_MmFixed_t_ Gia_MmFixed_t; +typedef struct Gia_MmFlex_t_ Gia_MmFlex_t; +typedef struct Gia_MmStep_t_ Gia_MmStep_t; typedef struct Gia_Dat_t_ Gia_Dat_t; typedef struct Gia_Rpr_t_ Gia_Rpr_t; @@ -90,7 +91,7 @@ struct Gia_Obj_t_ }; // Value is currently used to store several types of information // - pointer to the next node in the hash table during structural hashing -// - pointer to the node copy during duplication +// - pointer to the node copy during duplication // new AIG manager typedef struct Gia_Man_t_ Gia_Man_t; @@ -105,7 +106,7 @@ struct Gia_Man_t_ Gia_Obj_t * pObjs; // the array of objects unsigned * pMuxes; // control signals of MUXes int nXors; // the number of XORs - int nMuxes; // the number of MUXes + int nMuxes; // the number of MUXes int nBufs; // the number of buffers Vec_Int_t * vCis; // the vector of CIs (PIs + LOs) Vec_Int_t * vCos; // the vector of COs (POs + LIs) @@ -121,13 +122,13 @@ struct Gia_Man_t_ int nLevels; // the mamixum level int nConstrs; // the number of constraints int nTravIds; // the current traversal ID - int nFront; // frontier size + int nFront; // frontier size int * pReprsOld; // representatives (for CIs and ANDs) Gia_Rpr_t * pReprs; // representatives (for CIs and ANDs) int * pNexts; // next nodes in the equivalence classes int * pSibls; // next nodes in the choice nodes int * pIso; // pairs of structurally isomorphic nodes - int nTerLoop; // the state where loop begins + int nTerLoop; // the state where loop begins int nTerStates; // the total number of ternary states int * pFanData; // the database to store fanout information int nFansAlloc; // the size of fanout representation @@ -135,7 +136,7 @@ struct Gia_Man_t_ Vec_Int_t * vFanout; // static fanout Vec_Int_t * vMapping; // mapping for each node Vec_Wec_t * vMapping2; // mapping for each node - Vec_Wec_t * vFanouts2; // mapping fanouts + Vec_Wec_t * vFanouts2; // mapping fanouts Vec_Int_t * vCellMapping; // mapping for each node void * pSatlutWinman; // windowing for SAT-based mapping Vec_Int_t * vPacking; // packing information @@ -172,13 +173,13 @@ struct Gia_Man_t_ Vec_Int_t * vCoArrs; // CO arrival times Vec_Int_t * vCoAttrs; // CO attributes Vec_Int_t * vWeights; // object attributes - int And2Delay; // delay of the AND gate + int And2Delay; // delay of the AND gate float DefInArrs; // default PI arrival times float DefOutReqs; // default PO required times Vec_Int_t * vSwitching; // switching activity int * pTravIds; // separate traversal ID representation int nTravIdsAlloc; // the number of trav IDs allocated - Vec_Ptr_t * vNamesIn; // the input names + Vec_Ptr_t * vNamesIn; // the input names Vec_Ptr_t * vNamesOut; // the output names Vec_Ptr_t * vNamesNode; // the node names Vec_Int_t * vUserPiIds; // numbers assigned to PIs by the user @@ -232,7 +233,7 @@ struct Gia_Man_t_ Vec_Wrd_t * vTtMemory; // truth tables for internal nodes // balancing Vec_Int_t * vSuper; // supergate - Vec_Int_t * vStore; // node storage + Vec_Int_t * vStore; // node storage // existential quantification int iSuppPi; // the number of support variables int nSuppWords; // the number of support words @@ -280,11 +281,11 @@ struct Emb_Par_t_ int nSols; // the number of solutions (typically, 2) int nIters; // the number of iterations of FORCE int fRefine; // use refinement by FORCE - int fCluster; // use clustered representation + int fCluster; // use clustered representation int fDump; // dump Gnuplot file int fDumpLarge; // dump Gnuplot file for large benchmarks int fShowImage; // shows image if Gnuplot is installed - int fVerbose; // verbose flag + int fVerbose; // verbose flag }; @@ -319,7 +320,7 @@ typedef struct Gia_ManSim_t_ Gia_ManSim_t; struct Gia_ManSim_t_ { Gia_Man_t * pAig; - Gia_ParSim_t * pPars; + Gia_ParSim_t * pPars; int nWords; Vec_Int_t * vCis2Ids; Vec_Int_t * vConsts; @@ -329,7 +330,7 @@ struct Gia_ManSim_t_ unsigned * pDataSimCos; // simulation data for COs }; -typedef struct Jf_Par_t_ Jf_Par_t; +typedef struct Jf_Par_t_ Jf_Par_t; struct Jf_Par_t_ { int nLutSize; @@ -475,9 +476,9 @@ static inline int Gia_ManBufNum( Gia_Man_t * p ) { return p->nBufs static inline int Gia_ManAndNotBufNum( Gia_Man_t * p ){ return Gia_ManAndNum(p) - Gia_ManBufNum(p); } static inline int Gia_ManCandNum( Gia_Man_t * p ) { return Gia_ManCiNum(p) + Gia_ManAndNum(p); } static inline int Gia_ManConstrNum( Gia_Man_t * p ) { return p->nConstrs; } -static inline void Gia_ManFlipVerbose( Gia_Man_t * p ) { p->fVerbose ^= 1; } -static inline int Gia_ManHasChoices( Gia_Man_t * p ) { return p->pSibls != NULL; } -static inline int Gia_ManChoiceNum( Gia_Man_t * p ) { int c = 0; if (p->pSibls) { int i; for (i = 0; i < p->nObjs; i++) c += (int)(p->pSibls[i] > 0); } return c; } +static inline void Gia_ManFlipVerbose( Gia_Man_t * p ) { p->fVerbose ^= 1; } +static inline int Gia_ManHasChoices( Gia_Man_t * p ) { return p->pSibls != NULL; } +static inline int Gia_ManChoiceNum( Gia_Man_t * p ) { int c = 0; if (p->pSibls) { int i; for (i = 0; i < p->nObjs; i++) c += (int)(p->pSibls[i] > 0); } return c; } static inline Gia_Obj_t * Gia_ManConst0( Gia_Man_t * p ) { return p->pObjs; } static inline Gia_Obj_t * Gia_ManConst1( Gia_Man_t * p ) { return Gia_Not(Gia_ManConst0(p)); } @@ -502,20 +503,20 @@ static inline char * Gia_ObjCoName( Gia_Man_t * p, int i ) { static inline char * Gia_ObjName( Gia_Man_t * p, int i ) { return p->vNamesNode ? (char*)Vec_PtrEntry(p->vNamesNode, i) : NULL; } static inline char * Gia_ObjNameObj( Gia_Man_t * p, Gia_Obj_t * pObj ) { return p->vNamesNode ? (char*)Vec_PtrEntry(p->vNamesNode, Gia_ObjId(p, pObj)) : NULL; } -static inline int Gia_ObjIsTerm( Gia_Obj_t * pObj ) { return pObj->fTerm; } -static inline int Gia_ObjIsAndOrConst0( Gia_Obj_t * pObj ) { return!pObj->fTerm; } -static inline int Gia_ObjIsCi( Gia_Obj_t * pObj ) { return pObj->fTerm && pObj->iDiff0 == GIA_NONE; } -static inline int Gia_ObjIsCo( Gia_Obj_t * pObj ) { return pObj->fTerm && pObj->iDiff0 != GIA_NONE; } -static inline int Gia_ObjIsAnd( Gia_Obj_t * pObj ) { return!pObj->fTerm && pObj->iDiff0 != GIA_NONE; } -static inline int Gia_ObjIsXor( Gia_Obj_t * pObj ) { return Gia_ObjIsAnd(pObj) && pObj->iDiff0 < pObj->iDiff1; } -static inline int Gia_ObjIsMuxId( Gia_Man_t * p, int iObj ) { return p->pMuxes && p->pMuxes[iObj] > 0; } -static inline int Gia_ObjIsMux( Gia_Man_t * p, Gia_Obj_t * pObj ) { return Gia_ObjIsMuxId( p, Gia_ObjId(p, pObj) ); } -static inline int Gia_ObjIsAndReal( Gia_Man_t * p, Gia_Obj_t * pObj ) { return Gia_ObjIsAnd(pObj) && pObj->iDiff0 > pObj->iDiff1 && !Gia_ObjIsMux(p, pObj); } -static inline int Gia_ObjIsBuf( Gia_Obj_t * pObj ) { return pObj->iDiff0 == pObj->iDiff1 && pObj->iDiff0 != GIA_NONE && !pObj->fTerm; } -static inline int Gia_ObjIsAndNotBuf( Gia_Obj_t * pObj ) { return Gia_ObjIsAnd(pObj) && pObj->iDiff0 != pObj->iDiff1; } -static inline int Gia_ObjIsCand( Gia_Obj_t * pObj ) { return Gia_ObjIsAnd(pObj) || Gia_ObjIsCi(pObj); } -static inline int Gia_ObjIsConst0( Gia_Obj_t * pObj ) { return pObj->iDiff0 == GIA_NONE && pObj->iDiff1 == GIA_NONE; } -static inline int Gia_ManObjIsConst0( Gia_Man_t * p, Gia_Obj_t * pObj){ return pObj == p->pObjs; } +static inline int Gia_ObjIsTerm( Gia_Obj_t * pObj ) { return pObj->fTerm; } +static inline int Gia_ObjIsAndOrConst0( Gia_Obj_t * pObj ) { return!pObj->fTerm; } +static inline int Gia_ObjIsCi( Gia_Obj_t * pObj ) { return pObj->fTerm && pObj->iDiff0 == GIA_NONE; } +static inline int Gia_ObjIsCo( Gia_Obj_t * pObj ) { return pObj->fTerm && pObj->iDiff0 != GIA_NONE; } +static inline int Gia_ObjIsAnd( Gia_Obj_t * pObj ) { return!pObj->fTerm && pObj->iDiff0 != GIA_NONE; } +static inline int Gia_ObjIsXor( Gia_Obj_t * pObj ) { return Gia_ObjIsAnd(pObj) && pObj->iDiff0 < pObj->iDiff1; } +static inline int Gia_ObjIsMuxId( Gia_Man_t * p, int iObj ) { return p->pMuxes && p->pMuxes[iObj] > 0; } +static inline int Gia_ObjIsMux( Gia_Man_t * p, Gia_Obj_t * pObj ) { return Gia_ObjIsMuxId( p, Gia_ObjId(p, pObj) ); } +static inline int Gia_ObjIsAndReal( Gia_Man_t * p, Gia_Obj_t * pObj ) { return Gia_ObjIsAnd(pObj) && pObj->iDiff0 > pObj->iDiff1 && !Gia_ObjIsMux(p, pObj); } +static inline int Gia_ObjIsBuf( Gia_Obj_t * pObj ) { return pObj->iDiff0 == pObj->iDiff1 && pObj->iDiff0 != GIA_NONE && !pObj->fTerm; } +static inline int Gia_ObjIsAndNotBuf( Gia_Obj_t * pObj ) { return Gia_ObjIsAnd(pObj) && pObj->iDiff0 != pObj->iDiff1; } +static inline int Gia_ObjIsCand( Gia_Obj_t * pObj ) { return Gia_ObjIsAnd(pObj) || Gia_ObjIsCi(pObj); } +static inline int Gia_ObjIsConst0( Gia_Obj_t * pObj ) { return pObj->iDiff0 == GIA_NONE && pObj->iDiff1 == GIA_NONE; } +static inline int Gia_ManObjIsConst0( Gia_Man_t * p, Gia_Obj_t * pObj){ return pObj == p->pObjs; } static inline int Gia_Obj2Lit( Gia_Man_t * p, Gia_Obj_t * pObj ) { return Abc_Var2Lit(Gia_ObjId(p, Gia_Regular(pObj)), Gia_IsComplement(pObj)); } static inline Gia_Obj_t * Gia_Lit2Obj( Gia_Man_t * p, int iLit ) { return Gia_NotCond(Gia_ManObj(p, Abc_Lit2Var(iLit)), Abc_LitIsCompl(iLit)); } @@ -525,14 +526,14 @@ static inline int Gia_ManIdToCioId( Gia_Man_t * p, int Id ) { static inline int Gia_ManCiIdToId( Gia_Man_t * p, int CiId ) { return Gia_ObjId( p, Gia_ManCi(p, CiId) ); } static inline int Gia_ManCoIdToId( Gia_Man_t * p, int CoId ) { return Gia_ObjId( p, Gia_ManCo(p, CoId) ); } -static inline int Gia_ObjIsPi( Gia_Man_t * p, Gia_Obj_t * pObj ) { return Gia_ObjIsCi(pObj) && Gia_ObjCioId(pObj) < Gia_ManPiNum(p); } -static inline int Gia_ObjIsPo( Gia_Man_t * p, Gia_Obj_t * pObj ) { return Gia_ObjIsCo(pObj) && Gia_ObjCioId(pObj) < Gia_ManPoNum(p); } -static inline int Gia_ObjIsRo( Gia_Man_t * p, Gia_Obj_t * pObj ) { return Gia_ObjIsCi(pObj) && Gia_ObjCioId(pObj) >= Gia_ManPiNum(p); } -static inline int Gia_ObjIsRi( Gia_Man_t * p, Gia_Obj_t * pObj ) { return Gia_ObjIsCo(pObj) && Gia_ObjCioId(pObj) >= Gia_ManPoNum(p); } +static inline int Gia_ObjIsPi( Gia_Man_t * p, Gia_Obj_t * pObj ) { return Gia_ObjIsCi(pObj) && Gia_ObjCioId(pObj) < Gia_ManPiNum(p); } +static inline int Gia_ObjIsPo( Gia_Man_t * p, Gia_Obj_t * pObj ) { return Gia_ObjIsCo(pObj) && Gia_ObjCioId(pObj) < Gia_ManPoNum(p); } +static inline int Gia_ObjIsRo( Gia_Man_t * p, Gia_Obj_t * pObj ) { return Gia_ObjIsCi(pObj) && Gia_ObjCioId(pObj) >= Gia_ManPiNum(p); } +static inline int Gia_ObjIsRi( Gia_Man_t * p, Gia_Obj_t * pObj ) { return Gia_ObjIsCo(pObj) && Gia_ObjCioId(pObj) >= Gia_ManPoNum(p); } -static inline Gia_Obj_t * Gia_ObjRoToRi( Gia_Man_t * p, Gia_Obj_t * pObj ) { assert( Gia_ObjIsRo(p, pObj) ); return Gia_ManCo(p, Gia_ManCoNum(p) - Gia_ManCiNum(p) + Gia_ObjCioId(pObj)); } -static inline Gia_Obj_t * Gia_ObjRiToRo( Gia_Man_t * p, Gia_Obj_t * pObj ) { assert( Gia_ObjIsRi(p, pObj) ); return Gia_ManCi(p, Gia_ManCiNum(p) - Gia_ManCoNum(p) + Gia_ObjCioId(pObj)); } -static inline int Gia_ObjRoToRiId( Gia_Man_t * p, int ObjId ) { return Gia_ObjId( p, Gia_ObjRoToRi( p, Gia_ManObj(p, ObjId) ) ); } +static inline Gia_Obj_t * Gia_ObjRoToRi( Gia_Man_t * p, Gia_Obj_t * pObj ) { assert( Gia_ObjIsRo(p, pObj) ); return Gia_ManCo(p, Gia_ManCoNum(p) - Gia_ManCiNum(p) + Gia_ObjCioId(pObj)); } +static inline Gia_Obj_t * Gia_ObjRiToRo( Gia_Man_t * p, Gia_Obj_t * pObj ) { assert( Gia_ObjIsRi(p, pObj) ); return Gia_ManCi(p, Gia_ManCiNum(p) - Gia_ManCoNum(p) + Gia_ObjCioId(pObj)); } +static inline int Gia_ObjRoToRiId( Gia_Man_t * p, int ObjId ) { return Gia_ObjId( p, Gia_ObjRoToRi( p, Gia_ManObj(p, ObjId) ) ); } static inline int Gia_ObjRiToRoId( Gia_Man_t * p, int ObjId ) { return Gia_ObjId( p, Gia_ObjRiToRo( p, Gia_ManObj(p, ObjId) ) ); } static inline int Gia_ObjDiff0( Gia_Obj_t * pObj ) { return pObj->iDiff0; } @@ -674,8 +675,8 @@ static inline word * Gia_ObjSimObj( Gia_Man_t * p, Gia_Obj_t * pObj ) { // AIG construction extern void Gia_ObjAddFanout( Gia_Man_t * p, Gia_Obj_t * pObj, Gia_Obj_t * pFanout ); -static inline Gia_Obj_t * Gia_ManAppendObj( Gia_Man_t * p ) -{ +static inline Gia_Obj_t * Gia_ManAppendObj( Gia_Man_t * p ) +{ if ( p->nObjs == p->nObjsAlloc ) { int nObjNew = Abc_MinInt( 2 * p->nObjsAlloc, (1 << 29) ); @@ -697,8 +698,8 @@ static inline Gia_Obj_t * Gia_ManAppendObj( Gia_Man_t * p ) if ( Vec_IntSize(&p->vHTable) ) Vec_IntPush( &p->vHash, 0 ); return Gia_ManObj( p, p->nObjs++ ); } -static inline int Gia_ManAppendCi( Gia_Man_t * p ) -{ +static inline int Gia_ManAppendCi( Gia_Man_t * p ) +{ Gia_Obj_t * pObj = Gia_ManAppendObj( p ); pObj->fTerm = 1; pObj->iDiff0 = GIA_NONE; @@ -710,8 +711,8 @@ static inline int Gia_ManAppendCi( Gia_Man_t * p ) extern void Gia_ManQuantSetSuppAnd( Gia_Man_t * p, Gia_Obj_t * pObj ); extern void Gia_ManBuiltInSimPerform( Gia_Man_t * p, int iObj ); -static inline int Gia_ManAppendAnd( Gia_Man_t * p, int iLit0, int iLit1 ) -{ +static inline int Gia_ManAppendAnd( Gia_Man_t * p, int iLit0, int iLit1 ) +{ Gia_Obj_t * pObj = Gia_ManAppendObj( p ); assert( iLit0 >= 0 && Abc_Lit2Var(iLit0) < Gia_ManObjNum(p) ); assert( iLit1 >= 0 && Abc_Lit2Var(iLit1) < Gia_ManObjNum(p) ); @@ -754,8 +755,8 @@ static inline int Gia_ManAppendAnd( Gia_Man_t * p, int iLit0, int iLit1 ) Gia_ManQuantSetSuppAnd( p, pObj ); return Gia_ObjId( p, pObj ) << 1; } -static inline int Gia_ManAppendXorReal( Gia_Man_t * p, int iLit0, int iLit1 ) -{ +static inline int Gia_ManAppendXorReal( Gia_Man_t * p, int iLit0, int iLit1 ) +{ Gia_Obj_t * pObj = Gia_ManAppendObj( p ); assert( iLit0 >= 0 && Abc_Lit2Var(iLit0) < Gia_ManObjNum(p) ); assert( iLit1 >= 0 && Abc_Lit2Var(iLit1) < Gia_ManObjNum(p) ); @@ -779,8 +780,8 @@ static inline int Gia_ManAppendXorReal( Gia_Man_t * p, int iLit0, int iLit1 ) p->nXors++; return Gia_ObjId( p, pObj ) << 1; } -static inline int Gia_ManAppendMuxReal( Gia_Man_t * p, int iLitC, int iLit1, int iLit0 ) -{ +static inline int Gia_ManAppendMuxReal( Gia_Man_t * p, int iLitC, int iLit1, int iLit0 ) +{ Gia_Obj_t * pObj = Gia_ManAppendObj( p ); assert( p->pMuxes != NULL ); assert( iLit0 >= 0 && Abc_Lit2Var(iLit0) < Gia_ManObjNum(p) ); @@ -809,8 +810,8 @@ static inline int Gia_ManAppendMuxReal( Gia_Man_t * p, int iLitC, int iLit1, int p->nMuxes++; return Gia_ObjId( p, pObj ) << 1; } -static inline int Gia_ManAppendBuf( Gia_Man_t * p, int iLit ) -{ +static inline int Gia_ManAppendBuf( Gia_Man_t * p, int iLit ) +{ Gia_Obj_t * pObj = Gia_ManAppendObj( p ); assert( iLit >= 0 && Abc_Lit2Var(iLit) < Gia_ManObjNum(p) ); pObj->iDiff0 = pObj->iDiff1 = Gia_ObjId(p, pObj) - Abc_Lit2Var(iLit); @@ -818,12 +819,12 @@ static inline int Gia_ManAppendBuf( Gia_Man_t * p, int iLit ) p->nBufs++; return Gia_ObjId( p, pObj ) << 1; } -static inline int Gia_ManAppendCo( Gia_Man_t * p, int iLit0 ) -{ +static inline int Gia_ManAppendCo( Gia_Man_t * p, int iLit0 ) +{ Gia_Obj_t * pObj; assert( iLit0 >= 0 && Abc_Lit2Var(iLit0) < Gia_ManObjNum(p) ); assert( !Gia_ObjIsCo(Gia_ManObj(p, Abc_Lit2Var(iLit0))) ); - pObj = Gia_ManAppendObj( p ); + pObj = Gia_ManAppendObj( p ); pObj->fTerm = 1; pObj->iDiff0 = Gia_ObjId(p, pObj) - Abc_Lit2Var(iLit0); pObj->fCompl0 = Abc_LitIsCompl(iLit0); @@ -837,26 +838,26 @@ static inline int Gia_ManAppendOr( Gia_Man_t * p, int iLit0, int iLit1 ) { return Abc_LitNot(Gia_ManAppendAnd( p, Abc_LitNot(iLit0), Abc_LitNot(iLit1) )); } -static inline int Gia_ManAppendMux( Gia_Man_t * p, int iCtrl, int iData1, int iData0 ) -{ +static inline int Gia_ManAppendMux( Gia_Man_t * p, int iCtrl, int iData1, int iData0 ) +{ int iTemp0 = Gia_ManAppendAnd( p, Abc_LitNot(iCtrl), iData0 ); int iTemp1 = Gia_ManAppendAnd( p, iCtrl, iData1 ); return Abc_LitNotCond( Gia_ManAppendAnd( p, Abc_LitNot(iTemp0), Abc_LitNot(iTemp1) ), 1 ); } -static inline int Gia_ManAppendMaj( Gia_Man_t * p, int iData0, int iData1, int iData2 ) -{ +static inline int Gia_ManAppendMaj( Gia_Man_t * p, int iData0, int iData1, int iData2 ) +{ int iTemp0 = Gia_ManAppendOr( p, iData1, iData2 ); int iTemp1 = Gia_ManAppendAnd( p, iData0, iTemp0 ); int iTemp2 = Gia_ManAppendAnd( p, iData1, iData2 ); return Gia_ManAppendOr( p, iTemp1, iTemp2 ); } -static inline int Gia_ManAppendXor( Gia_Man_t * p, int iLit0, int iLit1 ) -{ +static inline int Gia_ManAppendXor( Gia_Man_t * p, int iLit0, int iLit1 ) +{ return Gia_ManAppendMux( p, iLit0, Abc_LitNot(iLit1), iLit1 ); } -static inline int Gia_ManAppendAnd2( Gia_Man_t * p, int iLit0, int iLit1 ) -{ +static inline int Gia_ManAppendAnd2( Gia_Man_t * p, int iLit0, int iLit1 ) +{ if ( !p->fGiaSimple ) { if ( iLit0 < 2 ) @@ -874,26 +875,26 @@ static inline int Gia_ManAppendOr2( Gia_Man_t * p, int iLit0, int iLit1 ) { return Abc_LitNot(Gia_ManAppendAnd2( p, Abc_LitNot(iLit0), Abc_LitNot(iLit1) )); } -static inline int Gia_ManAppendMux2( Gia_Man_t * p, int iCtrl, int iData1, int iData0 ) -{ +static inline int Gia_ManAppendMux2( Gia_Man_t * p, int iCtrl, int iData1, int iData0 ) +{ int iTemp0 = Gia_ManAppendAnd2( p, Abc_LitNot(iCtrl), iData0 ); int iTemp1 = Gia_ManAppendAnd2( p, iCtrl, iData1 ); return Abc_LitNotCond( Gia_ManAppendAnd2( p, Abc_LitNot(iTemp0), Abc_LitNot(iTemp1) ), 1 ); } -static inline int Gia_ManAppendMaj2( Gia_Man_t * p, int iData0, int iData1, int iData2 ) -{ +static inline int Gia_ManAppendMaj2( Gia_Man_t * p, int iData0, int iData1, int iData2 ) +{ int iTemp0 = Gia_ManAppendOr2( p, iData1, iData2 ); int iTemp1 = Gia_ManAppendAnd2( p, iData0, iTemp0 ); int iTemp2 = Gia_ManAppendAnd2( p, iData1, iData2 ); return Gia_ManAppendOr2( p, iTemp1, iTemp2 ); } -static inline int Gia_ManAppendXor2( Gia_Man_t * p, int iLit0, int iLit1 ) -{ +static inline int Gia_ManAppendXor2( Gia_Man_t * p, int iLit0, int iLit1 ) +{ return Gia_ManAppendMux2( p, iLit0, Abc_LitNot(iLit1), iLit1 ); } -static inline int Gia_ManAppendXorReal2( Gia_Man_t * p, int iLit0, int iLit1 ) -{ +static inline int Gia_ManAppendXorReal2( Gia_Man_t * p, int iLit0, int iLit1 ) +{ if ( !p->fGiaSimple ) { if ( iLit0 < 2 ) @@ -908,7 +909,7 @@ static inline int Gia_ManAppendXorReal2( Gia_Man_t * p, int iLit0, int iLit1 ) return Gia_ManAppendXorReal( p, iLit0, iLit1 ); } -static inline void Gia_ManPatchCoDriver( Gia_Man_t * p, int iCoIndex, int iLit0 ) +static inline void Gia_ManPatchCoDriver( Gia_Man_t * p, int iCoIndex, int iLit0 ) { Gia_Obj_t * pObjCo = Gia_ManCo( p, iCoIndex ); assert( Gia_ObjId(p, pObjCo) > Abc_Lit2Var(iLit0) ); @@ -920,16 +921,16 @@ static inline void Gia_ManPatchCoDriver( Gia_Man_t * p, int iCoIndex, int iLit0 #define GIA_ONE 2 #define GIA_UND 3 -static inline int Gia_XsimNotCond( int Value, int fCompl ) -{ +static inline int Gia_XsimNotCond( int Value, int fCompl ) +{ if ( Value == GIA_UND ) return GIA_UND; if ( Value == GIA_ZER + fCompl ) return GIA_ZER; return GIA_ONE; } -static inline int Gia_XsimAndCond( int Value0, int fCompl0, int Value1, int fCompl1 ) -{ +static inline int Gia_XsimAndCond( int Value0, int fCompl0, int Value1, int fCompl1 ) +{ if ( Value0 == GIA_ZER + fCompl0 || Value1 == GIA_ZER + fCompl1 ) return GIA_ZER; if ( Value0 == GIA_UND || Value1 == GIA_UND ) @@ -963,7 +964,7 @@ static inline void Gia_ObjTerSimAnd( Gia_Obj_t * pObj ) Gia_ObjTerSimSet0( pObj ); else if ( Gia_ObjTerSimGet1Fanin0(pObj) && Gia_ObjTerSimGet1Fanin1(pObj) ) Gia_ObjTerSimSet1( pObj ); - else + else Gia_ObjTerSimSetX( pObj ); } static inline void Gia_ObjTerSimCo( Gia_Obj_t * pObj ) @@ -974,7 +975,7 @@ static inline void Gia_ObjTerSimCo( Gia_Obj_t * pObj ) Gia_ObjTerSimSet0( pObj ); else if ( Gia_ObjTerSimGet1Fanin0(pObj) ) Gia_ObjTerSimSet1( pObj ); - else + else Gia_ObjTerSimSetX( pObj ); } static inline void Gia_ObjTerSimRo( Gia_Man_t * p, Gia_Obj_t * pObj ) @@ -1346,11 +1347,11 @@ extern Gia_Man_t * Gia_ManDupOrderAiger( Gia_Man_t * p ); extern Gia_Man_t * Gia_ManDupLastPis( Gia_Man_t * p, int nLastPis ); extern Gia_Man_t * Gia_ManDupFlip( Gia_Man_t * p, int * pInitState ); extern Gia_Man_t * Gia_ManDupCycled( Gia_Man_t * pAig, Abc_Cex_t * pCex, int nFrames ); -extern Gia_Man_t * Gia_ManDup( Gia_Man_t * p ); -extern Gia_Man_t * Gia_ManDupNoBuf( Gia_Man_t * p ); +extern Gia_Man_t * Gia_ManDup( Gia_Man_t * p ); +extern Gia_Man_t * Gia_ManDupNoBuf( Gia_Man_t * p ); extern Gia_Man_t * Gia_ManDupMap( Gia_Man_t * p, Vec_Int_t * vMap ); extern Gia_Man_t * Gia_ManDup2( Gia_Man_t * p1, Gia_Man_t * p2 ); -extern Gia_Man_t * Gia_ManDupWithAttributes( Gia_Man_t * p ); +extern Gia_Man_t * Gia_ManDupWithAttributes( Gia_Man_t * p ); extern Gia_Man_t * Gia_ManDupRemovePis( Gia_Man_t * p, int nRemPis ); extern Gia_Man_t * Gia_ManDupZero( Gia_Man_t * p ); extern Gia_Man_t * Gia_ManDupPerm( Gia_Man_t * p, Vec_Int_t * vPiPerm ); @@ -1363,12 +1364,12 @@ extern Gia_Man_t * Gia_ManDupAppendCones( Gia_Man_t * p, Gia_Man_t ** pp extern Gia_Man_t * Gia_ManDupSelf( Gia_Man_t * p ); extern Gia_Man_t * Gia_ManDupFlopClass( Gia_Man_t * p, int iClass ); extern Gia_Man_t * Gia_ManDupMarked( Gia_Man_t * p ); -extern Gia_Man_t * Gia_ManDupTimes( Gia_Man_t * p, int nTimes ); -extern Gia_Man_t * Gia_ManDupDfs( Gia_Man_t * p ); +extern Gia_Man_t * Gia_ManDupTimes( Gia_Man_t * p, int nTimes ); +extern Gia_Man_t * Gia_ManDupDfs( Gia_Man_t * p ); extern Gia_Man_t * Gia_ManDupDfsOnePo( Gia_Man_t * p, int iPo ); extern Gia_Man_t * Gia_ManDupDfsRehash( Gia_Man_t * p ); -extern Gia_Man_t * Gia_ManDupCofactorVar( Gia_Man_t * p, int iVar, int Value ); -extern Gia_Man_t * Gia_ManDupCofactorObj( Gia_Man_t * p, int iObj, int Value ); +extern Gia_Man_t * Gia_ManDupCofactorVar( Gia_Man_t * p, int iVar, int Value ); +extern Gia_Man_t * Gia_ManDupCofactorObj( Gia_Man_t * p, int iObj, int Value ); extern Gia_Man_t * Gia_ManDupMux( int iVar, Gia_Man_t * pCof1, Gia_Man_t * pCof0 ); extern Gia_Man_t * Gia_ManDupBlock( Gia_Man_t * p, int nBlock ); extern Gia_Man_t * Gia_ManDupExist( Gia_Man_t * p, int iVar ); @@ -1457,13 +1458,13 @@ extern int Gia_ManFilterEquivsForSpeculation( Gia_Man_t * pGia, extern int Gia_ManFilterEquivsUsingParts( Gia_Man_t * pGia, char * pName1, char * pName2 ); extern void Gia_ManFilterEquivsUsingLatches( Gia_Man_t * pGia, int fFlopsOnly, int fFlopsWith, int fUseRiDrivers ); /*=== giaExist.c =========================================================*/ -extern void Gia_ManQuantSetSuppStart( Gia_Man_t * p ); +ABC_DLL extern void Gia_ManQuantSetSuppStart( Gia_Man_t * p ); extern void Gia_ManQuantSetSuppZero( Gia_Man_t * p ); extern void Gia_ManQuantSetSuppCi( Gia_Man_t * p, Gia_Obj_t * pObj ); extern void Gia_ManQuantUpdateCiSupp( Gia_Man_t * p, int iObj ); extern int Gia_ManQuantExist( Gia_Man_t * p, int iLit, int(*pFuncCiToKeep)(void *, int), void * pData ); /*=== giaFanout.c =========================================================*/ -extern void Gia_ObjAddFanout( Gia_Man_t * p, Gia_Obj_t * pObj, Gia_Obj_t * pFanout ); +ABC_DLL extern void Gia_ObjAddFanout( Gia_Man_t * p, Gia_Obj_t * pObj, Gia_Obj_t * pFanout ); extern void Gia_ObjRemoveFanout( Gia_Man_t * p, Gia_Obj_t * pObj, Gia_Obj_t * pFanout ); extern void Gia_ManFanoutStart( Gia_Man_t * p ); extern void Gia_ManFanoutStop( Gia_Man_t * p ); @@ -1480,7 +1481,7 @@ extern void * Gia_ManUnrollAdd( void * pMan, int fMax ); extern void Gia_ManUnrollStop( void * pMan ); extern int Gia_ManUnrollLastLit( void * pMan ); extern void Gia_ManFraSetDefaultParams( Gia_ParFra_t * p ); -extern Gia_Man_t * Gia_ManFrames( Gia_Man_t * pAig, Gia_ParFra_t * pPars ); +extern Gia_Man_t * Gia_ManFrames( Gia_Man_t * pAig, Gia_ParFra_t * pPars ); extern Gia_Man_t * Gia_ManFramesInitSpecial( Gia_Man_t * pAig, int nFrames, int fVerbose ); /*=== giaFront.c ==========================================================*/ extern Gia_Man_t * Gia_ManFront( Gia_Man_t * p ); @@ -1488,14 +1489,14 @@ extern void Gia_ManFrontTest( Gia_Man_t * p ); /*=== giaFx.c ==========================================================*/ extern Gia_Man_t * Gia_ManPerformFx( Gia_Man_t * p, int nNewNodesMax, int LitCountMax, int fReverse, int fVerbose, int fVeryVerbose ); /*=== giaHash.c ===========================================================*/ -extern void Gia_ManHashAlloc( Gia_Man_t * p ); -extern void Gia_ManHashStart( Gia_Man_t * p ); +extern void Gia_ManHashAlloc( Gia_Man_t * p ); +extern void Gia_ManHashStart( Gia_Man_t * p ); extern void Gia_ManHashStop( Gia_Man_t * p ); extern int Gia_ManHashXorReal( Gia_Man_t * p, int iLit0, int iLit1 ); extern int Gia_ManHashMuxReal( Gia_Man_t * p, int iLitC, int iLit1, int iLit0 ); -extern int Gia_ManHashAnd( Gia_Man_t * p, int iLit0, int iLit1 ); -extern int Gia_ManHashOr( Gia_Man_t * p, int iLit0, int iLit1 ); -extern int Gia_ManHashXor( Gia_Man_t * p, int iLit0, int iLit1 ); +extern int Gia_ManHashAnd( Gia_Man_t * p, int iLit0, int iLit1 ); +extern int Gia_ManHashOr( Gia_Man_t * p, int iLit0, int iLit1 ); +extern int Gia_ManHashXor( Gia_Man_t * p, int iLit0, int iLit1 ); extern int Gia_ManHashMux( Gia_Man_t * p, int iCtrl, int iData1, int iData0 ); extern int Gia_ManHashMaj( Gia_Man_t * p, int iData0, int iData1, int iData2 ); extern int Gia_ManHashAndTry( Gia_Man_t * p, int iLit0, int iLit1 ); @@ -1516,7 +1517,7 @@ extern int Gia_ManLutNum( Gia_Man_t * p ); extern int Gia_ManLutLevel( Gia_Man_t * p, int ** ppLevels ); extern void Gia_ManLutParams( Gia_Man_t * p, int * pnCurLuts, int * pnCurEdges, int * pnCurLevels ); extern void Gia_ManSetRefsMapped( Gia_Man_t * p ); -extern void Gia_ManSetLutRefs( Gia_Man_t * p ); +extern void Gia_ManSetLutRefs( Gia_Man_t * p ); extern void Gia_ManSetIfParsDefault( void * pIfPars ); extern void Gia_ManMappingVerify( Gia_Man_t * p ); extern void Gia_ManTransferMapping( Gia_Man_t * p, Gia_Man_t * pGia ); @@ -1542,13 +1543,13 @@ extern Gia_Man_t * Gia_ManPerformLfMapping( Gia_Man_t * p, Jf_Par_t * pP extern void Gia_ManTestDistance( Gia_Man_t * p ); extern void Gia_ManSolveProblem( Gia_Man_t * pGia, Emb_Par_t * pPars ); /*=== giaMan.c ===========================================================*/ -extern Gia_Man_t * Gia_ManStart( int nObjsMax ); -extern void Gia_ManStop( Gia_Man_t * p ); -extern void Gia_ManStopP( Gia_Man_t ** p ); +ABC_DLL extern Gia_Man_t * Gia_ManStart( int nObjsMax ); +ABC_DLL extern void Gia_ManStop( Gia_Man_t * p ); +extern void Gia_ManStopP( Gia_Man_t ** p ); extern double Gia_ManMemory( Gia_Man_t * p ); -extern void Gia_ManPrintStats( Gia_Man_t * p, Gps_Par_t * pPars ); -extern void Gia_ManPrintStatsShort( Gia_Man_t * p ); -extern void Gia_ManPrintMiterStatus( Gia_Man_t * p ); +extern void Gia_ManPrintStats( Gia_Man_t * p, Gps_Par_t * pPars ); +extern void Gia_ManPrintStatsShort( Gia_Man_t * p ); +extern void Gia_ManPrintMiterStatus( Gia_Man_t * p ); extern void Gia_ManPrintStatsMiter( Gia_Man_t * p, int fVerbose ); extern void Gia_ManSetRegNum( Gia_Man_t * p, int nRegs ); extern void Gia_ManReportImprovement( Gia_Man_t * p, Gia_Man_t * pNew ); @@ -1624,7 +1625,7 @@ extern void Gia_ManSimInfoInit( Gia_ManSim_t * p ); extern void Gia_ManSimInfoTransfer( Gia_ManSim_t * p ); extern void Gia_ManSimulateRound( Gia_ManSim_t * p ); extern void Gia_ManBuiltInSimStart( Gia_Man_t * p, int nWords, int nObjs ); -extern void Gia_ManBuiltInSimPerform( Gia_Man_t * p, int iObj ); +ABC_DLL extern void Gia_ManBuiltInSimPerform( Gia_Man_t * p, int iObj ); extern int Gia_ManBuiltInSimCheckOver( Gia_Man_t * p, int iLit0, int iLit1 ); extern int Gia_ManBuiltInSimCheckEqual( Gia_Man_t * p, int iLit0, int iLit1 ); extern void Gia_ManBuiltInSimResimulateCone( Gia_Man_t * p, int iLit0, int iLit1 ); @@ -1636,7 +1637,7 @@ extern int Gia_ManIncrSimCheckOver( Gia_Man_t * p, int iLit0, in extern int Gia_ManIncrSimCheckEqual( Gia_Man_t * p, int iLit0, int iLit1 ); /*=== giaSimBase.c ============================================================*/ extern Vec_Wrd_t * Gia_ManSimPatSim( Gia_Man_t * p ); -extern Vec_Wrd_t * Gia_ManSimPatSimOut( Gia_Man_t * pGia, Vec_Wrd_t * vSimsPi, int fOuts ); +ABC_DLL extern Vec_Wrd_t * Gia_ManSimPatSimOut( Gia_Man_t * pGia, Vec_Wrd_t * vSimsPi, int fOuts ); extern void Gia_ManSim2ArrayOne( Vec_Wrd_t * vSimsPi, Vec_Int_t * vRes ); extern Vec_Wec_t * Gia_ManSim2Array( Vec_Ptr_t * vSims ); extern Vec_Wrd_t * Gia_ManArray2SimOne( Vec_Int_t * vRes ); diff --git a/src/base/acb/acbTest.c b/src/base/acb/acbTest.c index fc450818ea..9eef818380 100644 --- a/src/base/acb/acbTest.c +++ b/src/base/acb/acbTest.c @@ -9,7 +9,7 @@ Synopsis [] Author [Alan Mishchenko] - + Affiliation [UC Berkeley] Date [Ver. 1.0. Started - July 21, 2015.] @@ -42,7 +42,7 @@ static int fForceZero = 0; Synopsis [] Description [] - + SideEffects [] SeeAlso [] @@ -74,11 +74,11 @@ void Gia_ManSimTry( Gia_Man_t * pF, Gia_Man_t * pG ) int nBitsFx = Abc_TtCountOnesVec(pSimFx, nWords); int nBitsF1 = Abc_TtCountOnesVecMask(pSimFx, pSimFb, nWords, 1); int nBitsF0 = nWords*64 - nBitsFx - nBitsF1; - + int nBitsGx = Abc_TtCountOnesVec(pSimGx, nWords); int nBitsG1 = Abc_TtCountOnesVecMask(pSimGx, pSimGb, nWords, 1); int nBitsG0 = nWords*64 - nBitsGx - nBitsG1; - + printf( "Output %4d : ", i ); printf( " RF : " ); @@ -135,7 +135,7 @@ void Gia_ManSimTry( Gia_Man_t * pF, Gia_Man_t * pG ) Synopsis [] Description [] - + SideEffects [] SeeAlso [] @@ -145,7 +145,7 @@ void Gia_ManDualNot( Gia_Man_t * p, int LitA[2], int LitZ[2] ) { LitZ[0] = Abc_LitNot(LitA[0]); LitZ[1] = LitA[1]; - + if ( fForceZero ) LitZ[0] = Gia_ManHashAnd( p, LitZ[0], Abc_LitNot(LitZ[1]) ); } // computes Z = XOR(A, B) where A, B, Z belong to {0,1,x} encoded as 0=00, 1=01, x=1- @@ -153,7 +153,7 @@ void Gia_ManDualXor2( Gia_Man_t * p, int LitA[2], int LitB[2], int LitZ[2] ) { LitZ[0] = Gia_ManHashXor( p, LitA[0], LitB[0] ); LitZ[1] = Gia_ManHashOr( p, LitA[1], LitB[1] ); - + if ( fForceZero ) LitZ[0] = Gia_ManHashAnd( p, LitZ[0], Abc_LitNot(LitZ[1]) ); } void Gia_ManDualXorN( Gia_Man_t * p, int * pLits, int n, int LitZ[2] ) @@ -192,7 +192,7 @@ void Gia_ManDualAndN( Gia_Man_t * p, int * pLits, int n, int LitZ[2] ) LitZ[0] = Gia_ManHashAnd( p, LitZ[0], pLits[2*i] ); } LitZ[1] = Gia_ManHashAnd( p, LitOne, Abc_LitNot(LitZero) ); - + if ( fForceZero ) LitZ[0] = Gia_ManHashAnd( p, LitZ[0], Abc_LitNot(LitZ[1]) ); } /* @@ -207,7 +207,7 @@ void Gia_ManDualDc( Gia_Man_t * p, int LitC[2], int LitD[2], int LitZ[2] ) LitZ[0] = LitC[0]; // LitZ[0] = Gia_ManHashMux( p, LitD[0], 0, LitC[0] ); LitZ[1] = Gia_ManHashOr(p, Gia_ManHashOr(p,LitD[0],LitD[1]), LitC[1] ); - + if ( fForceZero ) LitZ[0] = Gia_ManHashAnd( p, LitZ[0], Abc_LitNot(LitZ[1]) ); } void Gia_ManDualMux( Gia_Man_t * p, int LitC[2], int LitT[2], int LitE[2], int LitZ[2] ) @@ -248,7 +248,7 @@ int Gia_ManDualCompare( Gia_Man_t * p, unsigned int LitF[2], unsigned int LitS[2 Synopsis [] Description [] - + SideEffects [] SeeAlso [] @@ -267,36 +267,36 @@ void Acb_ObjToGiaDual( Gia_Man_t * pNew, Acb_Ntk_t * p, int iObj, Vec_Int_t * vT Vec_IntPushTwo( vTemp, pLits[0], pLits[1] ); } Type = Acb_ObjType( p, iObj ); - if ( Type == ABC_OPER_CONST_F ) + if ( Type == ABC_OPER_CONST_F ) { pRes[0] = 0; pRes[1] = 0; return; } - if ( Type == ABC_OPER_CONST_T ) + if ( Type == ABC_OPER_CONST_T ) { pRes[0] = 1; pRes[1] = 0; return; } - if ( Type == ABC_OPER_CONST_X ) + if ( Type == ABC_OPER_CONST_X ) { pRes[0] = 0; pRes[1] = 1; return; } - if ( Type == ABC_OPER_BIT_BUF ) + if ( Type == ABC_OPER_BIT_BUF ) { pRes[0] = Vec_IntEntry(vTemp, 0); pRes[1] = Vec_IntEntry(vTemp, 1); return; } - if ( Type == ABC_OPER_BIT_INV ) + if ( Type == ABC_OPER_BIT_INV ) { Gia_ManDualNot( pNew, Vec_IntArray(vTemp), pRes ); return; } - if ( Type == ABC_OPER_TRI ) + if ( Type == ABC_OPER_TRI ) { // in the file inputs are ordered as follows: _DC \n6_5[9] ( .O(\108 ), .C(\96 ), .D(\107 )); // in this code, we expect them as follows: void Gia_ManDualDc( Gia_Man_t * p, int LitC[2], int LitD[2], int LitZ[2] ) @@ -304,7 +304,7 @@ void Acb_ObjToGiaDual( Gia_Man_t * pNew, Acb_Ntk_t * p, int iObj, Vec_Int_t * vT Gia_ManDualDc( pNew, Vec_IntArray(vTemp), Vec_IntArray(vTemp) + 2, pRes ); return; } - if ( Type == ABC_OPER_BIT_MUX ) + if ( Type == ABC_OPER_BIT_MUX ) { // in the file inputs are ordered as follows: _HMUX \U$1 ( .O(\282 ), .I0(1'b1), .I1(\277 ), .S(\281 )); // in this code, we expect them as follows: void Gia_ManDualMux( Gia_Man_t * p, int LitC[2], int LitT[2], int LitE[2], int LitZ[2] ) @@ -386,7 +386,7 @@ Gia_Man_t * Acb_NtkGiaDeriveDual( Acb_Ntk_t * p ) Synopsis [] Description [] - + SideEffects [] SeeAlso [] @@ -443,7 +443,7 @@ Gia_Man_t * Acb_NtkGiaDeriveMiter( Gia_Man_t * pOne, Gia_Man_t * pTwo, int Type { int pLitsF[2] = { (int)Gia_ManCo(pOne, i)->Value, (int)Gia_ManCo(pOne, i+1)->Value }; int pLitsS[2] = { (int)Gia_ManCo(pTwo, i)->Value, (int)Gia_ManCo(pTwo, i+1)->Value }; - Gia_ManAppendCo( pNew, Gia_ManDualCompare( pNew, pLitsF, pLitsS ) ); + Gia_ManAppendCo( pNew, Gia_ManDualCompare( pNew, (unsigned int *)pLitsF, (unsigned int *)pLitsS ) ); } } Gia_ManHashStop( pNew ); @@ -458,7 +458,7 @@ Gia_Man_t * Acb_NtkGiaDeriveMiter( Gia_Man_t * pOne, Gia_Man_t * pTwo, int Type Synopsis [] Description [] - + SideEffects [] SeeAlso [] @@ -475,7 +475,7 @@ void Acb_OutputFile( char * pFileName, Acb_Ntk_t * pNtkF, int * pModel ) } if ( pModel == NULL ) fprintf( pFile, "EQ\n" ); - else + else { /* NEQ @@ -521,7 +521,7 @@ int * Acb_NtkSolve( Gia_Man_t * p ) Synopsis [Various statistics.] Description [] - + SideEffects [] SeeAlso [] @@ -549,7 +549,7 @@ void Acb_NtkPrintCecStats( Acb_Ntk_t * pNtk ) Synopsis [Changing the PI order.] Description [] - + SideEffects [] SeeAlso [] @@ -601,7 +601,7 @@ int Acb_NtkCheckPiOrder( Acb_Ntk_t * pNtkF, Acb_Ntk_t * pNtkG ) Synopsis [] Description [] - + SideEffects [] SeeAlso [] @@ -621,7 +621,7 @@ void Acb_NtkRunTest( char * pFileNames[4], int fFancy, int fVerbose ) Acb_Ntk_t * pNtkG = Acb_VerilogSimpleRead( pFileNames[1], NULL ); if ( !pNtkF || !pNtkG ) return; - + assert( Acb_NtkCiNum(pNtkF) == Acb_NtkCiNum(pNtkG) ); assert( Acb_NtkCoNum(pNtkF) == Acb_NtkCoNum(pNtkG) ); diff --git a/src/base/main/abcapis.h b/src/base/main/abcapis.h index ae81c67879..0974fe1e78 100644 --- a/src/base/main/abcapis.h +++ b/src/base/main/abcapis.h @@ -9,7 +9,7 @@ Synopsis [External declarations.] Author [Alan Mishchenko] - + Affiliation [UC Berkeley] Date [Ver. 1.0. Started - September 29, 2012.] @@ -17,7 +17,7 @@ Revision [$Id: abcapis.h,v 1.00 2012/09/29 00:00:00 alanmi Exp $] ***********************************************************************/ - + #ifndef MINI_AIG__abc_apis_h #define MINI_AIG__abc_apis_h @@ -57,64 +57,62 @@ typedef struct Abc_Frame_t_ Abc_Frame_t; #define ABC_DLL ABC_DLLIMPORT #endif -#pragma GCC visibility push(default) //////////////////////////////////////////////////////////////////////// /// FUNCTION DECLARATIONS /// //////////////////////////////////////////////////////////////////////// // procedures to start and stop the ABC framework -extern ABC_DLL void Abc_Start(); -extern ABC_DLL void Abc_Stop(); +ABC_DLL extern void Abc_Start(); +ABC_DLL extern void Abc_Stop(); // procedures to get the ABC framework (pAbc) and execute commands in it -extern ABC_DLL Abc_Frame_t * Abc_FrameGetGlobalFrame(); -extern ABC_DLL int Cmd_CommandExecute( Abc_Frame_t * pAbc, const char * pCommandLine ); +ABC_DLL extern Abc_Frame_t * Abc_FrameGetGlobalFrame(); +ABC_DLL extern int Cmd_CommandExecute( Abc_Frame_t * pAbc, const char * pCommandLine ); // procedures to input/output 'mini AIG' -extern ABC_DLL void Abc_NtkInputMiniAig( Abc_Frame_t * pAbc, void * pMiniAig ); -extern ABC_DLL void * Abc_NtkOutputMiniAig( Abc_Frame_t * pAbc ); -extern ABC_DLL void Abc_FrameGiaInputMiniAig( Abc_Frame_t * pAbc, void * p ); -extern ABC_DLL void * Abc_FrameGiaOutputMiniAig( Abc_Frame_t * pAbc ); -extern ABC_DLL void Abc_NtkSetFlopNum( Abc_Frame_t * pAbc, int nFlops ); +ABC_DLL extern void Abc_NtkInputMiniAig( Abc_Frame_t * pAbc, void * pMiniAig ); +ABC_DLL extern void * Abc_NtkOutputMiniAig( Abc_Frame_t * pAbc ); +ABC_DLL extern void Abc_FrameGiaInputMiniAig( Abc_Frame_t * pAbc, void * p ); +ABC_DLL extern void * Abc_FrameGiaOutputMiniAig( Abc_Frame_t * pAbc ); +ABC_DLL extern void Abc_NtkSetFlopNum( Abc_Frame_t * pAbc, int nFlops ); // procedures to input/output 'mini LUT' -extern ABC_DLL void Abc_FrameGiaInputMiniLut( Abc_Frame_t * pAbc, void * pMiniLut ); -extern ABC_DLL void Abc_FrameGiaInputMiniLut2( Abc_Frame_t * pAbc, void * pMiniLut ); -extern ABC_DLL void * Abc_FrameGiaOutputMiniLut( Abc_Frame_t * pAbc ); -extern ABC_DLL char * Abc_FrameGiaOutputMiniLutAttr( Abc_Frame_t * pAbc, void * pMiniLut ); -extern ABC_DLL int * Abc_FrameReadMiniLutSwitching( Abc_Frame_t * pAbc ); -extern ABC_DLL int * Abc_FrameReadMiniLutSwitching2( Abc_Frame_t * pAbc, int nRandPiFactor ); -extern ABC_DLL int * Abc_FrameReadMiniLutSwitchingPo( Abc_Frame_t * pAbc ); +ABC_DLL extern void Abc_FrameGiaInputMiniLut( Abc_Frame_t * pAbc, void * pMiniLut ); +ABC_DLL extern void Abc_FrameGiaInputMiniLut2( Abc_Frame_t * pAbc, void * pMiniLut ); +ABC_DLL extern void * Abc_FrameGiaOutputMiniLut( Abc_Frame_t * pAbc ); +ABC_DLL extern char * Abc_FrameGiaOutputMiniLutAttr( Abc_Frame_t * pAbc, void * pMiniLut ); +ABC_DLL extern int * Abc_FrameReadMiniLutSwitching( Abc_Frame_t * pAbc ); +ABC_DLL extern int * Abc_FrameReadMiniLutSwitching2( Abc_Frame_t * pAbc, int nRandPiFactor ); +ABC_DLL extern int * Abc_FrameReadMiniLutSwitchingPo( Abc_Frame_t * pAbc ); // procedures to input/output NDR data-structure -extern ABC_DLL void Abc_FrameInputNdr( Abc_Frame_t * pAbc, void * pData ); -extern ABC_DLL void * Abc_FrameOutputNdr( Abc_Frame_t * pAbc ); -extern ABC_DLL int * Abc_FrameOutputNdrArray( Abc_Frame_t * pAbc ); +ABC_DLL extern void Abc_FrameInputNdr( Abc_Frame_t * pAbc, void * pData ); +ABC_DLL extern void * Abc_FrameOutputNdr( Abc_Frame_t * pAbc ); +ABC_DLL extern int * Abc_FrameOutputNdrArray( Abc_Frame_t * pAbc ); // procedures to set CI/CO arrival/required times -extern ABC_DLL void Abc_NtkSetCiArrivalTime( Abc_Frame_t * pAbc, int iCi, float Rise, float Fall ); -extern ABC_DLL void Abc_NtkSetCoRequiredTime( Abc_Frame_t * pAbc, int iCo, float Rise, float Fall ); +ABC_DLL extern void Abc_NtkSetCiArrivalTime( Abc_Frame_t * pAbc, int iCi, float Rise, float Fall ); +ABC_DLL extern void Abc_NtkSetCoRequiredTime( Abc_Frame_t * pAbc, int iCo, float Rise, float Fall ); // procedure to set AND-gate delay to tech-independent synthesis and mapping -extern ABC_DLL void Abc_NtkSetAndGateDelay( Abc_Frame_t * pAbc, float Delay ); +ABC_DLL extern void Abc_NtkSetAndGateDelay( Abc_Frame_t * pAbc, float Delay ); // procedures to return the mapped network -extern ABC_DLL int * Abc_NtkOutputMiniMapping( Abc_Frame_t * pAbc ); -extern ABC_DLL void Abc_NtkPrintMiniMapping( int * pArray ); -extern ABC_DLL int * Abc_FrameReadArrayMapping( Abc_Frame_t * pAbc ); -extern ABC_DLL int * Abc_FrameReadBoxes( Abc_Frame_t * pAbc ); +ABC_DLL extern int * Abc_NtkOutputMiniMapping( Abc_Frame_t * pAbc ); +ABC_DLL extern void Abc_NtkPrintMiniMapping( int * pArray ); +ABC_DLL extern int * Abc_FrameReadArrayMapping( Abc_Frame_t * pAbc ); +ABC_DLL extern int * Abc_FrameReadBoxes( Abc_Frame_t * pAbc ); // procedures to access verifization status and a counter-example -extern ABC_DLL int Abc_FrameReadProbStatus( Abc_Frame_t * pAbc ); -extern ABC_DLL void * Abc_FrameReadCex( Abc_Frame_t * pAbc ); +ABC_DLL extern int Abc_FrameReadProbStatus( Abc_Frame_t * pAbc ); +ABC_DLL extern void * Abc_FrameReadCex( Abc_Frame_t * pAbc ); // procedure to set retiming data -extern ABC_DLL void Abc_FrameSetRetimingData( Abc_Frame_t * pAbc, int * pRst, int * pSet, int * pEna, int nRegs ); +ABC_DLL extern void Abc_FrameSetRetimingData( Abc_Frame_t * pAbc, int * pRst, int * pSet, int * pEna, int nRegs ); // procedure to return sequential equivalences -extern ABC_DLL int * Abc_FrameReadMiniAigEquivClasses( Abc_Frame_t * pAbc ); +ABC_DLL extern int * Abc_FrameReadMiniAigEquivClasses( Abc_Frame_t * pAbc ); -#pragma GCC visibility pop ABC_NAMESPACE_HEADER_END #endif diff --git a/src/base/main/main.c b/src/base/main/main.c index f440aa33be..2be934f7c2 100644 --- a/src/base/main/main.c +++ b/src/base/main/main.c @@ -2,7 +2,7 @@ ABC_NAMESPACE_IMPL_START -extern ABC_DLL int Abc_RealMain(int argc, char *argv[]); +ABC_DLL extern int Abc_RealMain(int argc, char *argv[]); ABC_NAMESPACE_IMPL_END diff --git a/src/base/main/main.h b/src/base/main/main.h index f3457e27f6..f95a475fcf 100644 --- a/src/base/main/main.h +++ b/src/base/main/main.h @@ -9,7 +9,7 @@ Synopsis [External declarations of the main package.] Author [Alan Mishchenko] - + Affiliation [UC Berkeley] Date [Ver. 1.0. Started - June 20, 2005.] @@ -67,106 +67,106 @@ ABC_NAMESPACE_HEADER_START //////////////////////////////////////////////////////////////////////// /*=== main.c ===========================================================*/ -extern ABC_DLL void Abc_Start(); -extern ABC_DLL void Abc_Stop(); +ABC_DLL extern void Abc_Start(); +ABC_DLL extern void Abc_Stop(); /*=== mainFrame.c ===========================================================*/ -extern ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk( Abc_Frame_t * p ); -extern ABC_DLL Gia_Man_t * Abc_FrameReadGia( Abc_Frame_t * p ); -extern ABC_DLL FILE * Abc_FrameReadOut( Abc_Frame_t * p ); -extern ABC_DLL FILE * Abc_FrameReadErr( Abc_Frame_t * p ); -extern ABC_DLL int Abc_FrameReadMode( Abc_Frame_t * p ); -extern ABC_DLL int Abc_FrameSetMode( Abc_Frame_t * p, int fNameMode ); -extern ABC_DLL void Abc_FrameRestart( Abc_Frame_t * p ); -extern ABC_DLL int Abc_FrameShowProgress( Abc_Frame_t * p ); -extern ABC_DLL void Abc_FrameClearVerifStatus( Abc_Frame_t * p ); -extern ABC_DLL void Abc_FrameUpdateGia( Abc_Frame_t * p, Gia_Man_t * pNew ); -extern ABC_DLL Gia_Man_t * Abc_FrameGetGia( Abc_Frame_t * p ); - -extern ABC_DLL void Abc_FrameSetCurrentNetwork( Abc_Frame_t * p, Abc_Ntk_t * pNet ); -extern ABC_DLL void Abc_FrameSwapCurrentAndBackup( Abc_Frame_t * p ); -extern ABC_DLL void Abc_FrameReplaceCurrentNetwork( Abc_Frame_t * p, Abc_Ntk_t * pNet ); -extern ABC_DLL void Abc_FrameUnmapAllNetworks( Abc_Frame_t * p ); -extern ABC_DLL void Abc_FrameDeleteAllNetworks( Abc_Frame_t * p ); - -extern ABC_DLL void Abc_FrameSetGlobalFrame( Abc_Frame_t * p ); -extern ABC_DLL Abc_Frame_t * Abc_FrameGetGlobalFrame(); -extern ABC_DLL Abc_Frame_t * Abc_FrameReadGlobalFrame(); - -extern ABC_DLL Vec_Ptr_t * Abc_FrameReadStore(); -extern ABC_DLL int Abc_FrameReadStoreSize(); -extern ABC_DLL void * Abc_FrameReadLibLut(); -extern ABC_DLL void * Abc_FrameReadLibBox(); -extern ABC_DLL void * Abc_FrameReadLibGen(); -extern ABC_DLL void * Abc_FrameReadLibGen2(); -extern ABC_DLL void * Abc_FrameReadLibSuper(); -extern ABC_DLL void * Abc_FrameReadLibScl(); -extern ABC_DLL void * Abc_FrameReadManDd(); -extern ABC_DLL void * Abc_FrameReadManDec(); -extern ABC_DLL void * Abc_FrameReadManDsd(); -extern ABC_DLL void * Abc_FrameReadManDsd2(); -extern ABC_DLL Vec_Ptr_t * Abc_FrameReadSignalNames(); -extern ABC_DLL char * Abc_FrameReadSpecName(); - -extern ABC_DLL char * Abc_FrameReadFlag( char * pFlag ); -extern ABC_DLL int Abc_FrameIsFlagEnabled( char * pFlag ); -extern ABC_DLL int Abc_FrameIsBatchMode(); -extern ABC_DLL void Abc_FrameSetBatchMode( int Mode ); -extern ABC_DLL int Abc_FrameIsBridgeMode(); -extern ABC_DLL void Abc_FrameSetBridgeMode(); - -extern ABC_DLL int Abc_FrameReadBmcFrames( Abc_Frame_t * p ); -extern ABC_DLL int Abc_FrameReadProbStatus( Abc_Frame_t * p ); -extern ABC_DLL void * Abc_FrameReadCex( Abc_Frame_t * p ); -extern ABC_DLL Vec_Ptr_t * Abc_FrameReadCexVec( Abc_Frame_t * p ); -extern ABC_DLL Vec_Int_t * Abc_FrameReadStatusVec( Abc_Frame_t * p ); -extern ABC_DLL Vec_Ptr_t * Abc_FrameReadPoEquivs( Abc_Frame_t * p ); -extern ABC_DLL Vec_Int_t * Abc_FrameReadPoStatuses( Abc_Frame_t * p ); -extern ABC_DLL Vec_Int_t * Abc_FrameReadObjIds( Abc_Frame_t * p ); -extern ABC_DLL Abc_Nam_t * Abc_FrameReadJsonStrs( Abc_Frame_t * p ); -extern ABC_DLL Vec_Wec_t * Abc_FrameReadJsonObjs( Abc_Frame_t * p ); - -extern ABC_DLL int Abc_FrameReadCexPiNum( Abc_Frame_t * p ); -extern ABC_DLL int Abc_FrameReadCexRegNum( Abc_Frame_t * p ); -extern ABC_DLL int Abc_FrameReadCexPo( Abc_Frame_t * p ); -extern ABC_DLL int Abc_FrameReadCexFrame( Abc_Frame_t * p ); - -extern ABC_DLL void Abc_FrameSetNtkStore( Abc_Ntk_t * pNtk ); -extern ABC_DLL void Abc_FrameSetNtkStoreSize( int nStored ); -extern ABC_DLL void Abc_FrameSetLibLut( void * pLib ); -extern ABC_DLL void Abc_FrameSetLibBox( void * pLib ); -extern ABC_DLL void Abc_FrameSetLibGen( void * pLib ); -extern ABC_DLL void Abc_FrameSetLibGen2( void * pLib ); -extern ABC_DLL void Abc_FrameSetLibSuper( void * pLib ); -extern ABC_DLL void Abc_FrameSetLibVer( void * pLib ); -extern ABC_DLL void Abc_FrameSetFlag( char * pFlag, char * pValue ); -extern ABC_DLL void Abc_FrameSetCex( Abc_Cex_t * pCex ); -extern ABC_DLL void Abc_FrameSetNFrames( int nFrames ); -extern ABC_DLL void Abc_FrameSetStatus( int Status ); -extern ABC_DLL void Abc_FrameSetManDsd( void * pMan ); -extern ABC_DLL void Abc_FrameSetManDsd2( void * pMan ); -extern ABC_DLL void Abc_FrameSetInv( Vec_Int_t * vInv ); -extern ABC_DLL void Abc_FrameSetCnf( Vec_Int_t * vInv ); -extern ABC_DLL void Abc_FrameSetStr( Vec_Str_t * vInv ); -extern ABC_DLL void Abc_FrameSetJsonStrs( Abc_Nam_t * pStrs ); -extern ABC_DLL void Abc_FrameSetJsonObjs( Vec_Wec_t * vObjs ); -extern ABC_DLL void Abc_FrameSetSignalNames( Vec_Ptr_t * vNames ); -extern ABC_DLL void Abc_FrameSetSpecName( char * pFileName ); - -extern ABC_DLL int Abc_FrameCheckPoConst( Abc_Frame_t * p, int iPoNum ); - -extern ABC_DLL void Abc_FrameReplaceCex( Abc_Frame_t * pAbc, Abc_Cex_t ** ppCex ); -extern ABC_DLL void Abc_FrameReplaceCexVec( Abc_Frame_t * pAbc, Vec_Ptr_t ** pvCexVec ); -extern ABC_DLL void Abc_FrameReplacePoEquivs( Abc_Frame_t * pAbc, Vec_Ptr_t ** pvPoEquivs ); -extern ABC_DLL void Abc_FrameReplacePoStatuses( Abc_Frame_t * pAbc, Vec_Int_t ** pvStatuses ); - -extern ABC_DLL char * Abc_FrameReadDrivingCell(); -extern ABC_DLL float Abc_FrameReadMaxLoad(); -extern ABC_DLL void Abc_FrameSetDrivingCell( char * pName ); -extern ABC_DLL void Abc_FrameSetMaxLoad( float Load ); - -extern ABC_DLL void Abc_FrameSetArrayMapping( int * p ); -extern ABC_DLL void Abc_FrameSetBoxes( int * p ); +ABC_DLL extern Abc_Ntk_t * Abc_FrameReadNtk( Abc_Frame_t * p ); +ABC_DLL extern Gia_Man_t * Abc_FrameReadGia( Abc_Frame_t * p ); +ABC_DLL extern FILE * Abc_FrameReadOut( Abc_Frame_t * p ); +ABC_DLL extern FILE * Abc_FrameReadErr( Abc_Frame_t * p ); +ABC_DLL extern int Abc_FrameReadMode( Abc_Frame_t * p ); +ABC_DLL extern int Abc_FrameSetMode( Abc_Frame_t * p, int fNameMode ); +ABC_DLL extern void Abc_FrameRestart( Abc_Frame_t * p ); +ABC_DLL extern int Abc_FrameShowProgress( Abc_Frame_t * p ); +ABC_DLL extern void Abc_FrameClearVerifStatus( Abc_Frame_t * p ); +ABC_DLL extern void Abc_FrameUpdateGia( Abc_Frame_t * p, Gia_Man_t * pNew ); +ABC_DLL extern Gia_Man_t * Abc_FrameGetGia( Abc_Frame_t * p ); + +ABC_DLL extern void Abc_FrameSetCurrentNetwork( Abc_Frame_t * p, Abc_Ntk_t * pNet ); +ABC_DLL extern void Abc_FrameSwapCurrentAndBackup( Abc_Frame_t * p ); +ABC_DLL extern void Abc_FrameReplaceCurrentNetwork( Abc_Frame_t * p, Abc_Ntk_t * pNet ); +ABC_DLL extern void Abc_FrameUnmapAllNetworks( Abc_Frame_t * p ); +ABC_DLL extern void Abc_FrameDeleteAllNetworks( Abc_Frame_t * p ); + +ABC_DLL extern void Abc_FrameSetGlobalFrame( Abc_Frame_t * p ); +ABC_DLL extern Abc_Frame_t * Abc_FrameGetGlobalFrame(); +ABC_DLL extern Abc_Frame_t * Abc_FrameReadGlobalFrame(); + +ABC_DLL extern Vec_Ptr_t * Abc_FrameReadStore(); +ABC_DLL extern int Abc_FrameReadStoreSize(); +ABC_DLL extern void * Abc_FrameReadLibLut(); +ABC_DLL extern void * Abc_FrameReadLibBox(); +ABC_DLL extern void * Abc_FrameReadLibGen(); +ABC_DLL extern void * Abc_FrameReadLibGen2(); +ABC_DLL extern void * Abc_FrameReadLibSuper(); +ABC_DLL extern void * Abc_FrameReadLibScl(); +ABC_DLL extern void * Abc_FrameReadManDd(); +ABC_DLL extern void * Abc_FrameReadManDec(); +ABC_DLL extern void * Abc_FrameReadManDsd(); +ABC_DLL extern void * Abc_FrameReadManDsd2(); +ABC_DLL extern Vec_Ptr_t * Abc_FrameReadSignalNames(); +ABC_DLL extern char * Abc_FrameReadSpecName(); + +ABC_DLL extern char * Abc_FrameReadFlag( char * pFlag ); +ABC_DLL extern int Abc_FrameIsFlagEnabled( char * pFlag ); +ABC_DLL extern int Abc_FrameIsBatchMode(); +ABC_DLL extern void Abc_FrameSetBatchMode( int Mode ); +ABC_DLL extern int Abc_FrameIsBridgeMode(); +ABC_DLL extern void Abc_FrameSetBridgeMode(); + +ABC_DLL extern int Abc_FrameReadBmcFrames( Abc_Frame_t * p ); +ABC_DLL extern int Abc_FrameReadProbStatus( Abc_Frame_t * p ); +ABC_DLL extern void * Abc_FrameReadCex( Abc_Frame_t * p ); +ABC_DLL extern Vec_Ptr_t * Abc_FrameReadCexVec( Abc_Frame_t * p ); +ABC_DLL extern Vec_Int_t * Abc_FrameReadStatusVec( Abc_Frame_t * p ); +ABC_DLL extern Vec_Ptr_t * Abc_FrameReadPoEquivs( Abc_Frame_t * p ); +ABC_DLL extern Vec_Int_t * Abc_FrameReadPoStatuses( Abc_Frame_t * p ); +ABC_DLL extern Vec_Int_t * Abc_FrameReadObjIds( Abc_Frame_t * p ); +ABC_DLL extern Abc_Nam_t * Abc_FrameReadJsonStrs( Abc_Frame_t * p ); +ABC_DLL extern Vec_Wec_t * Abc_FrameReadJsonObjs( Abc_Frame_t * p ); + +ABC_DLL extern int Abc_FrameReadCexPiNum( Abc_Frame_t * p ); +ABC_DLL extern int Abc_FrameReadCexRegNum( Abc_Frame_t * p ); +ABC_DLL extern int Abc_FrameReadCexPo( Abc_Frame_t * p ); +ABC_DLL extern int Abc_FrameReadCexFrame( Abc_Frame_t * p ); + +ABC_DLL extern void Abc_FrameSetNtkStore( Abc_Ntk_t * pNtk ); +ABC_DLL extern void Abc_FrameSetNtkStoreSize( int nStored ); +ABC_DLL extern void Abc_FrameSetLibLut( void * pLib ); +ABC_DLL extern void Abc_FrameSetLibBox( void * pLib ); +ABC_DLL extern void Abc_FrameSetLibGen( void * pLib ); +ABC_DLL extern void Abc_FrameSetLibGen2( void * pLib ); +ABC_DLL extern void Abc_FrameSetLibSuper( void * pLib ); +ABC_DLL extern void Abc_FrameSetLibVer( void * pLib ); +ABC_DLL extern void Abc_FrameSetFlag( char * pFlag, char * pValue ); +ABC_DLL extern void Abc_FrameSetCex( Abc_Cex_t * pCex ); +ABC_DLL extern void Abc_FrameSetNFrames( int nFrames ); +ABC_DLL extern void Abc_FrameSetStatus( int Status ); +ABC_DLL extern void Abc_FrameSetManDsd( void * pMan ); +ABC_DLL extern void Abc_FrameSetManDsd2( void * pMan ); +ABC_DLL extern void Abc_FrameSetInv( Vec_Int_t * vInv ); +ABC_DLL extern void Abc_FrameSetCnf( Vec_Int_t * vInv ); +ABC_DLL extern void Abc_FrameSetStr( Vec_Str_t * vInv ); +ABC_DLL extern void Abc_FrameSetJsonStrs( Abc_Nam_t * pStrs ); +ABC_DLL extern void Abc_FrameSetJsonObjs( Vec_Wec_t * vObjs ); +ABC_DLL extern void Abc_FrameSetSignalNames( Vec_Ptr_t * vNames ); +ABC_DLL extern void Abc_FrameSetSpecName( char * pFileName ); + +ABC_DLL extern int Abc_FrameCheckPoConst( Abc_Frame_t * p, int iPoNum ); + +ABC_DLL extern void Abc_FrameReplaceCex( Abc_Frame_t * pAbc, Abc_Cex_t ** ppCex ); +ABC_DLL extern void Abc_FrameReplaceCexVec( Abc_Frame_t * pAbc, Vec_Ptr_t ** pvCexVec ); +ABC_DLL extern void Abc_FrameReplacePoEquivs( Abc_Frame_t * pAbc, Vec_Ptr_t ** pvPoEquivs ); +ABC_DLL extern void Abc_FrameReplacePoStatuses( Abc_Frame_t * pAbc, Vec_Int_t ** pvStatuses ); + +ABC_DLL extern char * Abc_FrameReadDrivingCell(); +ABC_DLL extern float Abc_FrameReadMaxLoad(); +ABC_DLL extern void Abc_FrameSetDrivingCell( char * pName ); +ABC_DLL extern void Abc_FrameSetMaxLoad( float Load ); + +ABC_DLL extern void Abc_FrameSetArrayMapping( int * p ); +ABC_DLL extern void Abc_FrameSetBoxes( int * p ); ABC_NAMESPACE_HEADER_END diff --git a/src/base/main/mainLib.c b/src/base/main/mainLib.c index 5af63d79db..79c9abbc1b 100644 --- a/src/base/main/mainLib.c +++ b/src/base/main/mainLib.c @@ -9,7 +9,7 @@ Synopsis [Here everything starts.] Author [Alan Mishchenko] - + Affiliation [UC Berkeley] Date [Ver. 1.0. Started - June 20, 2005.] @@ -27,7 +27,7 @@ ABC_NAMESPACE_IMPL_START //////////////////////////////////////////////////////////////////////// /// DECLARATIONS /// //////////////////////////////////////////////////////////////////////// - + //////////////////////////////////////////////////////////////////////// /// FUNCTION DEFINITIONS /// //////////////////////////////////////////////////////////////////////// @@ -37,23 +37,23 @@ ABC_NAMESPACE_IMPL_START Synopsis [Initialization procedure for the library project.] Description [Note that when Abc_Start() is run in a static library - project, it does not load the resource file by default. As a result, - ABC is not set up the same way, as when it is run on a command line. - For example, some error messages while parsing files will not be - produced, and intermediate networks will not be checked for consistancy. + project, it does not load the resource file by default. As a result, + ABC is not set up the same way, as when it is run on a command line. + For example, some error messages while parsing files will not be + produced, and intermediate networks will not be checked for consistancy. One possibility is to load the resource file after Abc_Start() as follows: Abc_UtilsSource( Abc_FrameGetGlobalFrame() );] - + SideEffects [] SeeAlso [] ***********************************************************************/ -void Abc_Start() +ABC_DLL void Abc_Start() { Abc_Frame_t * pAbc; // added to detect memory leaks: -#if defined(_DEBUG) && defined(_MSC_VER) +#if defined(_DEBUG) && defined(_MSC_VER) _CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF ); #endif // start the glocal frame @@ -67,13 +67,13 @@ void Abc_Start() Synopsis [Deallocation procedure for the library project.] Description [] - + SideEffects [] SeeAlso [] ***********************************************************************/ -void Abc_Stop() +ABC_DLL void Abc_Stop() { Abc_Frame_t * pAbc; pAbc = Abc_FrameGetGlobalFrame(); diff --git a/src/base/main/mainReal.c b/src/base/main/mainReal.c index 51c82ffe0d..c484c07964 100644 --- a/src/base/main/mainReal.c +++ b/src/base/main/mainReal.c @@ -35,7 +35,7 @@ SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. Synopsis [Here everything starts.] Author [Alan Mishchenko] - + Affiliation [UC Berkeley] Date [Ver. 1.0. Started - June 20, 2005.] @@ -45,12 +45,12 @@ SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. ***********************************************************************/ #ifndef WIN32 -#include -#include +#include +#include #include -#include +#include #if !defined(__wasm) -#include +#include #endif #include #endif @@ -59,7 +59,6 @@ SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. #include "mainInt.h" #include "base/wlc/wlc.h" -#pragma GCC visibility push(default) ABC_NAMESPACE_IMPL_START //////////////////////////////////////////////////////////////////////// @@ -72,20 +71,20 @@ static int TypeCheck( Abc_Frame_t * pAbc, const char * s); /// FUNCTION DEFINITIONS /// //////////////////////////////////////////////////////////////////////// -unsigned enable_dbg_outs = 1; +unsigned enable_dbg_outs = 1; /**Function************************************************************* Synopsis [The main() procedure.] Description [] - + SideEffects [] SeeAlso [] ***********************************************************************/ -ABC_DLL int Abc_RealMain( int argc, char * argv[] ) +ABC_DLL extern int Abc_RealMain( int argc, char * argv[] ) { Abc_Frame_t * pAbc; Vec_Str_t* sCommandUsr = Vec_StrAlloc(1000); @@ -129,34 +128,34 @@ ABC_DLL int Abc_RealMain( int argc, char * argv[] ) while ((c = Extra_UtilGetopt(argc, argv, "dm:l:c:q:C:Q:S:hf:F:o:st:T:xb")) != EOF) { switch(c) { - case 'd': - enable_dbg_outs ^= 1; - break; + case 'd': + enable_dbg_outs ^= 1; + break; case 'm': { #if !defined(WIN32) && !defined(ABC_NO_RLIMIT) - int maxMb = atoi(globalUtilOptarg); + int maxMb = atoi(globalUtilOptarg); printf("Limiting memory use to %d MB\n", maxMb); - struct rlimit limit = { - maxMb * (1llu << 20), /* soft limit */ - maxMb * (1llu << 20) /* hard limit */ - }; - setrlimit(RLIMIT_AS, &limit); + struct rlimit limit = { + maxMb * (1llu << 20), /* soft limit */ + maxMb * (1llu << 20) /* hard limit */ + }; + setrlimit(RLIMIT_AS, &limit); #endif - break; - } + break; + } case 'l': { #if !defined(WIN32) && !defined(ABC_NO_RLIMIT) - rlim_t maxTime = atoi(globalUtilOptarg); + rlim_t maxTime = atoi(globalUtilOptarg); printf("Limiting time to %d seconds\n", (int)maxTime); - struct rlimit limit = { - maxTime, /* soft limit */ - maxTime /* hard limit */ - }; - setrlimit(RLIMIT_CPU, &limit); + struct rlimit limit = { + maxTime, /* soft limit */ + maxTime /* hard limit */ + }; + setrlimit(RLIMIT_CPU, &limit); #endif - break; - } + break; + } case 'c': if( Vec_StrSize(sCommandUsr) > 0 ) { @@ -377,7 +376,7 @@ ABC_DLL int Abc_RealMain( int argc, char * argv[] ) } // if the memory should be freed, quit packages -// if ( fStatus < 0 ) +// if ( fStatus < 0 ) { Abc_Stop(); } @@ -393,7 +392,7 @@ ABC_DLL int Abc_RealMain( int argc, char * argv[] ) Synopsis [Returns 1 if s is a file type recognized, else returns 0.] - Description [Returns 1 if s is a file type recognized by ABC, else returns 0. + Description [Returns 1 if s is a file type recognized by ABC, else returns 0. Recognized types are "blif", "bench", "pla", and "none".] SideEffects [] @@ -422,5 +421,5 @@ static int TypeCheck( Abc_Frame_t * pAbc, const char * s ) /// END OF FILE /// //////////////////////////////////////////////////////////////////////// + ABC_NAMESPACE_IMPL_END -#pragma GCC visibility pop diff --git a/tox.ini b/tox.ini index 1fb6dea74c..02203e8898 100644 --- a/tox.ini +++ b/tox.ini @@ -66,9 +66,9 @@ commands_pre = {base,libs,clang}: cmake -E make_directory {toxinidir}/build commands = - abc: make -j{env:CPUS} ABC_USE_PIC=1 {posargs} abc - abc: make -j{env:CPUS} {posargs} libabc.a - soname: make -j{env:CPUS} ABC_USE_PIC=1 ABC_USE_SONAME=1 {posargs} lib + abc: make ABC_USE_PIC=1 {posargs} abc + abc: make {posargs} libabc.a + soname: make ABC_USE_PIC=1 ABC_USE_SONAME=1 {posargs} lib tests: make test # demo requires CC, CXX set in environment or on cmd line # eg: CC=gcc CXX=g++ tox -e demo