00001
00021 #ifndef __ABC_H__
00022 #define __ABC_H__
00023
00024 #ifdef __cplusplus
00025 extern "C" {
00026 #endif
00027
00031
00032 #include <stdio.h>
00033 #include <stdlib.h>
00034 #include <string.h>
00035 #include <assert.h>
00036 #include <time.h>
00037
00038 #include "cuddInt.h"
00039 #include "hop.h"
00040 #include "extra.h"
00041 #include "vec.h"
00042 #include "stmm.h"
00043 #include "nm.h"
00044
00048
00049
00050 typedef enum {
00051 ABC_NTK_NONE = 0,
00052 ABC_NTK_NETLIST,
00053 ABC_NTK_LOGIC,
00054 ABC_NTK_STRASH,
00055 ABC_NTK_OTHER
00056 } Abc_NtkType_t;
00057
00058
00059 typedef enum {
00060 ABC_FUNC_NONE = 0,
00061 ABC_FUNC_SOP,
00062 ABC_FUNC_BDD,
00063 ABC_FUNC_AIG,
00064 ABC_FUNC_MAP,
00065 ABC_FUNC_BLIFMV,
00066 ABC_FUNC_BLACKBOX,
00067 ABC_FUNC_OTHER
00068 } Abc_NtkFunc_t;
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082 typedef enum {
00083 ABC_OBJ_NONE = 0,
00084 ABC_OBJ_CONST1,
00085 ABC_OBJ_PIO,
00086 ABC_OBJ_PI,
00087 ABC_OBJ_PO,
00088 ABC_OBJ_BI,
00089 ABC_OBJ_BO,
00090 ABC_OBJ_ASSERT,
00091 ABC_OBJ_NET,
00092 ABC_OBJ_NODE,
00093 ABC_OBJ_LATCH,
00094 ABC_OBJ_WHITEBOX,
00095 ABC_OBJ_BLACKBOX,
00096 ABC_OBJ_NUMBER
00097 } Abc_ObjType_t;
00098
00099
00100 typedef enum {
00101 ABC_INIT_NONE = 0,
00102 ABC_INIT_ZERO,
00103 ABC_INIT_ONE,
00104 ABC_INIT_DC,
00105 ABC_INIT_OTHER
00106 } Abc_InitType_t;
00107
00111
00112
00113 #ifndef __cplusplus
00114 #ifndef bool
00115 #define bool int
00116 #endif
00117 #endif
00118
00119 #ifndef SINT64
00120 #define SINT64
00121
00122 #ifdef _WIN32
00123 typedef signed __int64 sint64;
00124 #else
00125 typedef long long sint64;
00126 #endif
00127
00128 #endif
00129
00130 typedef struct Abc_Lib_t_ Abc_Lib_t;
00131 typedef struct Abc_Ntk_t_ Abc_Ntk_t;
00132 typedef struct Abc_Obj_t_ Abc_Obj_t;
00133 typedef struct Abc_Aig_t_ Abc_Aig_t;
00134 typedef struct Abc_ManTime_t_ Abc_ManTime_t;
00135 typedef struct Abc_ManCut_t_ Abc_ManCut_t;
00136 typedef struct Abc_Time_t_ Abc_Time_t;
00137
00138 struct Abc_Time_t_
00139 {
00140 float Rise;
00141 float Fall;
00142 float Worst;
00143 };
00144
00145 struct Abc_Obj_t_
00146 {
00147
00148 Abc_Ntk_t * pNtk;
00149 int Id;
00150 int TravId;
00151
00152 unsigned Type : 4;
00153 unsigned fMarkA : 1;
00154 unsigned fMarkB : 1;
00155 unsigned fMarkC : 1;
00156 unsigned fPhase : 1;
00157 unsigned fExor : 1;
00158 unsigned fPersist: 1;
00159 unsigned fCompl0 : 1;
00160 unsigned fCompl1 : 1;
00161 unsigned Level : 20;
00162
00163 Vec_Int_t vFanins;
00164 Vec_Int_t vFanouts;
00165
00166 void * pData;
00167 Abc_Obj_t * pNext;
00168 Abc_Obj_t * pCopy;
00169 Hop_Obj_t * pEquiv;
00170 };
00171
00172 struct Abc_Ntk_t_
00173 {
00174
00175 Abc_NtkType_t ntkType;
00176 Abc_NtkFunc_t ntkFunc;
00177 char * pName;
00178 char * pSpec;
00179 Nm_Man_t * pManName;
00180
00181 Vec_Ptr_t * vObjs;
00182 Vec_Ptr_t * vPis;
00183 Vec_Ptr_t * vPos;
00184 Vec_Ptr_t * vCis;
00185 Vec_Ptr_t * vCos;
00186 Vec_Ptr_t * vPios;
00187 Vec_Ptr_t * vAsserts;
00188 Vec_Ptr_t * vBoxes;
00189
00190 int nObjs;
00191 int nObjCounts[ABC_OBJ_NUMBER];
00192
00193 Abc_Ntk_t * pNetBackup;
00194 int iStep;
00195
00196 Abc_Lib_t * pDesign;
00197 short fHieVisited;
00198 short fHiePath;
00199
00200 int nTravIds;
00201 Extra_MmFixed_t * pMmObj;
00202 Extra_MmStep_t * pMmStep;
00203 void * pManFunc;
00204
00205 Abc_ManTime_t * pManTime;
00206 void * pManCut;
00207 int LevelMax;
00208 Vec_Int_t * vLevelsR;
00209 Vec_Ptr_t * vSupps;
00210 int * pModel;
00211 Abc_Ntk_t * pExdc;
00212 void * pData;
00213 Abc_Ntk_t * pCopy;
00214 Hop_Man_t * pHaig;
00215
00216 Vec_Ptr_t * vAttrs;
00217 };
00218
00219 struct Abc_Lib_t_
00220 {
00221 char * pName;
00222 void * pManFunc;
00223 Vec_Ptr_t * vTops;
00224 Vec_Ptr_t * vModules;
00225 st_table * tModules;
00226 Abc_Lib_t * pLibrary;
00227 void * pGenlib;
00228 };
00229
00233
00234
00235 #define ABC_MIN(a,b) (((a) < (b))? (a) : (b))
00236 #define ABC_MAX(a,b) (((a) > (b))? (a) : (b))
00237 #define ABC_ABS(a) (((a) >= 0)? (a) :-(a))
00238 #define ABC_INFINITY (100000000)
00239
00240
00241 static inline int Abc_Float2Int( float Val ) { return *((int *)&Val); }
00242 static inline float Abc_Int2Float( int Num ) { return *((float *)&Num); }
00243 static inline int Abc_BitWordNum( int nBits ) { return (nBits>>5) + ((nBits&31) > 0); }
00244 static inline int Abc_TruthWordNum( int nVars ) { return nVars <= 5 ? 1 : (1 << (nVars - 5)); }
00245 static inline int Abc_InfoHasBit( unsigned * p, int i ) { return (p[(i)>>5] & (1<<((i) & 31))) > 0; }
00246 static inline void Abc_InfoSetBit( unsigned * p, int i ) { p[(i)>>5] |= (1<<((i) & 31)); }
00247 static inline void Abc_InfoXorBit( unsigned * p, int i ) { p[(i)>>5] ^= (1<<((i) & 31)); }
00248 static inline unsigned Abc_InfoRandomWord() { return ((((unsigned)rand()) << 24) ^ (((unsigned)rand()) << 12) ^ ((unsigned)rand())); }
00249 static inline void Abc_InfoRandom( unsigned * p, int nWords ) { int i; for ( i = nWords - 1; i >= 0; i-- ) p[i] = Abc_InfoRandomWord(); }
00250 static inline void Abc_InfoClear( unsigned * p, int nWords ) { memset( p, 0, sizeof(unsigned) * nWords ); }
00251 static inline void Abc_InfoFill( unsigned * p, int nWords ) { memset( p, 0xff, sizeof(unsigned) * nWords );}
00252 static inline void Abc_InfoNot( unsigned * p, int nWords ) { int i; for ( i = nWords - 1; i >= 0; i-- ) p[i] = ~p[i]; }
00253 static inline int Abc_InfoIsZero( unsigned * p, int nWords ) { int i; for ( i = nWords - 1; i >= 0; i-- ) if ( p[i] ) return 0; return 1; }
00254 static inline int Abc_InfoIsOne( unsigned * p, int nWords ) { int i; for ( i = nWords - 1; i >= 0; i-- ) if ( ~p[i] ) return 0; return 1; }
00255 static inline void Abc_InfoCopy( unsigned * p, unsigned * q, int nWords ) { int i; for ( i = nWords - 1; i >= 0; i-- ) p[i] = q[i]; }
00256 static inline void Abc_InfoAnd( unsigned * p, unsigned * q, int nWords ) { int i; for ( i = nWords - 1; i >= 0; i-- ) p[i] &= q[i]; }
00257 static inline void Abc_InfoOr( unsigned * p, unsigned * q, int nWords ) { int i; for ( i = nWords - 1; i >= 0; i-- ) p[i] |= q[i]; }
00258 static inline void Abc_InfoXor( unsigned * p, unsigned * q, int nWords ) { int i; for ( i = nWords - 1; i >= 0; i-- ) p[i] ^= q[i]; }
00259 static inline int Abc_InfoIsOrOne( unsigned * p, unsigned * q, int nWords ){ int i; for ( i = nWords - 1; i >= 0; i-- ) if ( ~(p[i] | q[i]) ) return 0; return 1; }
00260 static inline int Abc_InfoIsOrOne3( unsigned * p, unsigned * q, unsigned * r, int nWords ){ int i; for ( i = nWords - 1; i >= 0; i-- ) if ( ~(p[i] | q[i] | r[i]) ) return 0; return 1; }
00261
00262
00263 static inline bool Abc_NtkIsNetlist( Abc_Ntk_t * pNtk ) { return pNtk->ntkType == ABC_NTK_NETLIST; }
00264 static inline bool Abc_NtkIsLogic( Abc_Ntk_t * pNtk ) { return pNtk->ntkType == ABC_NTK_LOGIC; }
00265 static inline bool Abc_NtkIsStrash( Abc_Ntk_t * pNtk ) { return pNtk->ntkType == ABC_NTK_STRASH; }
00266
00267 static inline bool Abc_NtkHasSop( Abc_Ntk_t * pNtk ) { return pNtk->ntkFunc == ABC_FUNC_SOP; }
00268 static inline bool Abc_NtkHasBdd( Abc_Ntk_t * pNtk ) { return pNtk->ntkFunc == ABC_FUNC_BDD; }
00269 static inline bool Abc_NtkHasAig( Abc_Ntk_t * pNtk ) { return pNtk->ntkFunc == ABC_FUNC_AIG; }
00270 static inline bool Abc_NtkHasMapping( Abc_Ntk_t * pNtk ) { return pNtk->ntkFunc == ABC_FUNC_MAP; }
00271 static inline bool Abc_NtkHasBlifMv( Abc_Ntk_t * pNtk ) { return pNtk->ntkFunc == ABC_FUNC_BLIFMV; }
00272 static inline bool Abc_NtkHasBlackbox( Abc_Ntk_t * pNtk ) { return pNtk->ntkFunc == ABC_FUNC_BLACKBOX; }
00273
00274 static inline bool Abc_NtkIsSopNetlist( Abc_Ntk_t * pNtk ) { return pNtk->ntkFunc == ABC_FUNC_SOP && pNtk->ntkType == ABC_NTK_NETLIST; }
00275 static inline bool Abc_NtkIsAigNetlist( Abc_Ntk_t * pNtk ) { return pNtk->ntkFunc == ABC_FUNC_AIG && pNtk->ntkType == ABC_NTK_NETLIST; }
00276 static inline bool Abc_NtkIsMappedNetlist( Abc_Ntk_t * pNtk ) { return pNtk->ntkFunc == ABC_FUNC_MAP && pNtk->ntkType == ABC_NTK_NETLIST; }
00277 static inline bool Abc_NtkIsBlifMvNetlist( Abc_Ntk_t * pNtk ) { return pNtk->ntkFunc == ABC_FUNC_BLIFMV && pNtk->ntkType == ABC_NTK_NETLIST; }
00278 static inline bool Abc_NtkIsSopLogic( Abc_Ntk_t * pNtk ) { return pNtk->ntkFunc == ABC_FUNC_SOP && pNtk->ntkType == ABC_NTK_LOGIC ; }
00279 static inline bool Abc_NtkIsBddLogic( Abc_Ntk_t * pNtk ) { return pNtk->ntkFunc == ABC_FUNC_BDD && pNtk->ntkType == ABC_NTK_LOGIC ; }
00280 static inline bool Abc_NtkIsAigLogic( Abc_Ntk_t * pNtk ) { return pNtk->ntkFunc == ABC_FUNC_AIG && pNtk->ntkType == ABC_NTK_LOGIC ; }
00281 static inline bool Abc_NtkIsMappedLogic( Abc_Ntk_t * pNtk ) { return pNtk->ntkFunc == ABC_FUNC_MAP && pNtk->ntkType == ABC_NTK_LOGIC ; }
00282
00283
00284 static inline char * Abc_NtkName( Abc_Ntk_t * pNtk ) { return pNtk->pName; }
00285 static inline char * Abc_NtkSpec( Abc_Ntk_t * pNtk ) { return pNtk->pSpec; }
00286 static inline int Abc_NtkTravId( Abc_Ntk_t * pNtk ) { return pNtk->nTravIds; }
00287 static inline Abc_Ntk_t * Abc_NtkExdc( Abc_Ntk_t * pNtk ) { return pNtk->pExdc; }
00288 static inline Abc_Ntk_t * Abc_NtkBackup( Abc_Ntk_t * pNtk ) { return pNtk->pNetBackup; }
00289 static inline int Abc_NtkStep ( Abc_Ntk_t * pNtk ) { return pNtk->iStep; }
00290
00291
00292 static inline void Abc_NtkSetName ( Abc_Ntk_t * pNtk, char * pName ) { pNtk->pName = pName; }
00293 static inline void Abc_NtkSetSpec ( Abc_Ntk_t * pNtk, char * pName ) { pNtk->pSpec = pName; }
00294 static inline void Abc_NtkSetBackup( Abc_Ntk_t * pNtk, Abc_Ntk_t * pNetBackup ) { pNtk->pNetBackup = pNetBackup; }
00295 static inline void Abc_NtkSetStep ( Abc_Ntk_t * pNtk, int iStep ) { pNtk->iStep = iStep; }
00296
00297
00298 static inline int Abc_NtkObjNum( Abc_Ntk_t * pNtk ) { return pNtk->nObjs; }
00299 static inline int Abc_NtkObjNumMax( Abc_Ntk_t * pNtk ) { return Vec_PtrSize(pNtk->vObjs); }
00300 static inline int Abc_NtkPiNum( Abc_Ntk_t * pNtk ) { return Vec_PtrSize(pNtk->vPis); }
00301 static inline int Abc_NtkPoNum( Abc_Ntk_t * pNtk ) { return Vec_PtrSize(pNtk->vPos); }
00302 static inline int Abc_NtkCiNum( Abc_Ntk_t * pNtk ) { return Vec_PtrSize(pNtk->vCis); }
00303 static inline int Abc_NtkCoNum( Abc_Ntk_t * pNtk ) { return Vec_PtrSize(pNtk->vCos); }
00304 static inline int Abc_NtkAssertNum( Abc_Ntk_t * pNtk ) { return Vec_PtrSize(pNtk->vAsserts); }
00305 static inline int Abc_NtkBoxNum( Abc_Ntk_t * pNtk ) { return Vec_PtrSize(pNtk->vBoxes); }
00306 static inline int Abc_NtkBiNum( Abc_Ntk_t * pNtk ) { return pNtk->nObjCounts[ABC_OBJ_BI]; }
00307 static inline int Abc_NtkBoNum( Abc_Ntk_t * pNtk ) { return pNtk->nObjCounts[ABC_OBJ_BO]; }
00308 static inline int Abc_NtkNetNum( Abc_Ntk_t * pNtk ) { return pNtk->nObjCounts[ABC_OBJ_NET]; }
00309 static inline int Abc_NtkNodeNum( Abc_Ntk_t * pNtk ) { return pNtk->nObjCounts[ABC_OBJ_NODE]; }
00310 static inline int Abc_NtkLatchNum( Abc_Ntk_t * pNtk ) { return pNtk->nObjCounts[ABC_OBJ_LATCH]; }
00311 static inline int Abc_NtkWhiteboxNum( Abc_Ntk_t * pNtk ) { return pNtk->nObjCounts[ABC_OBJ_WHITEBOX]; }
00312 static inline int Abc_NtkBlackboxNum( Abc_Ntk_t * pNtk ) { return pNtk->nObjCounts[ABC_OBJ_BLACKBOX]; }
00313 static inline bool Abc_NtkIsComb( Abc_Ntk_t * pNtk ) { return Abc_NtkLatchNum(pNtk) == 0; }
00314 static inline bool Abc_NtkHasOnlyLatchBoxes(Abc_Ntk_t * pNtk ){ return Abc_NtkLatchNum(pNtk) == Abc_NtkBoxNum(pNtk); }
00315
00316
00317 extern Abc_Obj_t * Abc_NtkCreateObj( Abc_Ntk_t * pNtk, Abc_ObjType_t Type );
00318 static inline Abc_Obj_t * Abc_NtkCreatePi( Abc_Ntk_t * pNtk ) { return Abc_NtkCreateObj( pNtk, ABC_OBJ_PI ); }
00319 static inline Abc_Obj_t * Abc_NtkCreatePo( Abc_Ntk_t * pNtk ) { return Abc_NtkCreateObj( pNtk, ABC_OBJ_PO ); }
00320 static inline Abc_Obj_t * Abc_NtkCreateBi( Abc_Ntk_t * pNtk ) { return Abc_NtkCreateObj( pNtk, ABC_OBJ_BI ); }
00321 static inline Abc_Obj_t * Abc_NtkCreateBo( Abc_Ntk_t * pNtk ) { return Abc_NtkCreateObj( pNtk, ABC_OBJ_BO ); }
00322 static inline Abc_Obj_t * Abc_NtkCreateAssert( Abc_Ntk_t * pNtk ) { return Abc_NtkCreateObj( pNtk, ABC_OBJ_ASSERT ); }
00323 static inline Abc_Obj_t * Abc_NtkCreateNet( Abc_Ntk_t * pNtk ) { return Abc_NtkCreateObj( pNtk, ABC_OBJ_NET ); }
00324 static inline Abc_Obj_t * Abc_NtkCreateNode( Abc_Ntk_t * pNtk ) { return Abc_NtkCreateObj( pNtk, ABC_OBJ_NODE ); }
00325 static inline Abc_Obj_t * Abc_NtkCreateLatch( Abc_Ntk_t * pNtk ) { return Abc_NtkCreateObj( pNtk, ABC_OBJ_LATCH ); }
00326 static inline Abc_Obj_t * Abc_NtkCreateWhitebox( Abc_Ntk_t * pNtk ) { return Abc_NtkCreateObj( pNtk, ABC_OBJ_WHITEBOX ); }
00327 static inline Abc_Obj_t * Abc_NtkCreateBlackbox( Abc_Ntk_t * pNtk ) { return Abc_NtkCreateObj( pNtk, ABC_OBJ_BLACKBOX ); }
00328
00329
00330 static inline Abc_Obj_t * Abc_NtkObj( Abc_Ntk_t * pNtk, int i ) { return (Abc_Obj_t *)Vec_PtrEntry( pNtk->vObjs, i ); }
00331 static inline Abc_Obj_t * Abc_NtkPi( Abc_Ntk_t * pNtk, int i ) { return (Abc_Obj_t *)Vec_PtrEntry( pNtk->vPis, i ); }
00332 static inline Abc_Obj_t * Abc_NtkPo( Abc_Ntk_t * pNtk, int i ) { return (Abc_Obj_t *)Vec_PtrEntry( pNtk->vPos, i ); }
00333 static inline Abc_Obj_t * Abc_NtkCi( Abc_Ntk_t * pNtk, int i ) { return (Abc_Obj_t *)Vec_PtrEntry( pNtk->vCis, i ); }
00334 static inline Abc_Obj_t * Abc_NtkCo( Abc_Ntk_t * pNtk, int i ) { return (Abc_Obj_t *)Vec_PtrEntry( pNtk->vCos, i ); }
00335 static inline Abc_Obj_t * Abc_NtkAssert( Abc_Ntk_t * pNtk, int i ) { return (Abc_Obj_t *)Vec_PtrEntry( pNtk->vAsserts, i );}
00336 static inline Abc_Obj_t * Abc_NtkBox( Abc_Ntk_t * pNtk, int i ) { return (Abc_Obj_t *)Vec_PtrEntry( pNtk->vBoxes, i ); }
00337
00338
00339 static inline bool Abc_ObjIsComplement( Abc_Obj_t * p ) { return (bool)((unsigned long)p & (unsigned long)01); }
00340 static inline Abc_Obj_t * Abc_ObjRegular( Abc_Obj_t * p ) { return (Abc_Obj_t *)((unsigned long)p & ~(unsigned long)01); }
00341 static inline Abc_Obj_t * Abc_ObjNot( Abc_Obj_t * p ) { return (Abc_Obj_t *)((unsigned long)p ^ (unsigned long)01); }
00342 static inline Abc_Obj_t * Abc_ObjNotCond( Abc_Obj_t * p, int c ) { return (Abc_Obj_t *)((unsigned long)p ^ (unsigned long)(c!=0)); }
00343
00344
00345 static inline unsigned Abc_ObjType( Abc_Obj_t * pObj ) { return pObj->Type; }
00346 static inline unsigned Abc_ObjId( Abc_Obj_t * pObj ) { return pObj->Id; }
00347 static inline int Abc_ObjTravId( Abc_Obj_t * pObj ) { return pObj->TravId; }
00348 static inline int Abc_ObjLevel( Abc_Obj_t * pObj ) { return pObj->Level; }
00349 static inline Vec_Int_t * Abc_ObjFaninVec( Abc_Obj_t * pObj ) { return &pObj->vFanins; }
00350 static inline Vec_Int_t * Abc_ObjFanoutVec( Abc_Obj_t * pObj ) { return &pObj->vFanouts; }
00351 static inline Abc_Obj_t * Abc_ObjCopy( Abc_Obj_t * pObj ) { return pObj->pCopy; }
00352 static inline Abc_Ntk_t * Abc_ObjNtk( Abc_Obj_t * pObj ) { return pObj->pNtk; }
00353 static inline void * Abc_ObjData( Abc_Obj_t * pObj ) { return pObj->pData; }
00354 static inline Hop_Obj_t * Abc_ObjEquiv( Abc_Obj_t * pObj ) { return pObj->pEquiv; }
00355 static inline Abc_Obj_t * Abc_ObjCopyCond( Abc_Obj_t * pObj ) { return Abc_ObjRegular(pObj)->pCopy? Abc_ObjNotCond(Abc_ObjRegular(pObj)->pCopy, Abc_ObjIsComplement(pObj)) : NULL; }
00356
00357
00358 static inline void Abc_ObjSetLevel( Abc_Obj_t * pObj, int Level ) { pObj->Level = Level; }
00359 static inline void Abc_ObjSetCopy( Abc_Obj_t * pObj, Abc_Obj_t * pCopy ) { pObj->pCopy = pCopy; }
00360 static inline void Abc_ObjSetData( Abc_Obj_t * pObj, void * pData ) { pObj->pData = pData; }
00361
00362
00363 static inline bool Abc_ObjIsPio( Abc_Obj_t * pObj ) { return pObj->Type == ABC_OBJ_PIO; }
00364 static inline bool Abc_ObjIsPi( Abc_Obj_t * pObj ) { return pObj->Type == ABC_OBJ_PI; }
00365 static inline bool Abc_ObjIsPo( Abc_Obj_t * pObj ) { return pObj->Type == ABC_OBJ_PO; }
00366 static inline bool Abc_ObjIsBi( Abc_Obj_t * pObj ) { return pObj->Type == ABC_OBJ_BI; }
00367 static inline bool Abc_ObjIsBo( Abc_Obj_t * pObj ) { return pObj->Type == ABC_OBJ_BO; }
00368 static inline bool Abc_ObjIsAssert( Abc_Obj_t * pObj ) { return pObj->Type == ABC_OBJ_ASSERT; }
00369 static inline bool Abc_ObjIsCi( Abc_Obj_t * pObj ) { return pObj->Type == ABC_OBJ_PI || pObj->Type == ABC_OBJ_BO; }
00370 static inline bool Abc_ObjIsCo( Abc_Obj_t * pObj ) { return pObj->Type == ABC_OBJ_PO || pObj->Type == ABC_OBJ_BI || pObj->Type == ABC_OBJ_ASSERT; }
00371 static inline bool Abc_ObjIsTerm( Abc_Obj_t * pObj ) { return Abc_ObjIsCi(pObj) || Abc_ObjIsCo(pObj); }
00372 static inline bool Abc_ObjIsNet( Abc_Obj_t * pObj ) { return pObj->Type == ABC_OBJ_NET; }
00373 static inline bool Abc_ObjIsNode( Abc_Obj_t * pObj ) { return pObj->Type == ABC_OBJ_NODE; }
00374 static inline bool Abc_ObjIsLatch( Abc_Obj_t * pObj ) { return pObj->Type == ABC_OBJ_LATCH; }
00375 static inline bool Abc_ObjIsBox( Abc_Obj_t * pObj ) { return pObj->Type == ABC_OBJ_LATCH || pObj->Type == ABC_OBJ_WHITEBOX || pObj->Type == ABC_OBJ_BLACKBOX; }
00376 static inline bool Abc_ObjIsWhitebox( Abc_Obj_t * pObj ) { return pObj->Type == ABC_OBJ_WHITEBOX;}
00377 static inline bool Abc_ObjIsBlackbox( Abc_Obj_t * pObj ) { return pObj->Type == ABC_OBJ_BLACKBOX;}
00378 static inline void Abc_ObjBlackboxToWhitebox( Abc_Obj_t * pObj ) { assert( Abc_ObjIsBlackbox(pObj) ); pObj->Type = ABC_OBJ_WHITEBOX; pObj->pNtk->nObjCounts[ABC_OBJ_BLACKBOX]--; pObj->pNtk->nObjCounts[ABC_OBJ_WHITEBOX]++; }
00379
00380
00381 static inline int Abc_ObjFaninNum( Abc_Obj_t * pObj ) { return pObj->vFanins.nSize; }
00382 static inline int Abc_ObjFanoutNum( Abc_Obj_t * pObj ) { return pObj->vFanouts.nSize; }
00383 static inline int Abc_ObjFaninId( Abc_Obj_t * pObj, int i) { return pObj->vFanins.pArray[i]; }
00384 static inline int Abc_ObjFaninId0( Abc_Obj_t * pObj ) { return pObj->vFanins.pArray[0]; }
00385 static inline int Abc_ObjFaninId1( Abc_Obj_t * pObj ) { return pObj->vFanins.pArray[1]; }
00386 static inline int Abc_ObjFanoutEdgeNum( Abc_Obj_t * pObj, Abc_Obj_t * pFanout ) { assert( Abc_NtkHasAig(pObj->pNtk) ); if ( Abc_ObjFaninId0(pFanout) == pObj->Id ) return 0; if ( Abc_ObjFaninId1(pFanout) == pObj->Id ) return 1; assert( 0 ); return -1; }
00387 static inline Abc_Obj_t * Abc_ObjFanout( Abc_Obj_t * pObj, int i ) { return (Abc_Obj_t *)pObj->pNtk->vObjs->pArray[ pObj->vFanouts.pArray[i] ]; }
00388 static inline Abc_Obj_t * Abc_ObjFanout0( Abc_Obj_t * pObj ) { return (Abc_Obj_t *)pObj->pNtk->vObjs->pArray[ pObj->vFanouts.pArray[0] ]; }
00389 static inline Abc_Obj_t * Abc_ObjFanin( Abc_Obj_t * pObj, int i ) { return (Abc_Obj_t *)pObj->pNtk->vObjs->pArray[ pObj->vFanins.pArray[i] ]; }
00390 static inline Abc_Obj_t * Abc_ObjFanin0( Abc_Obj_t * pObj ) { return (Abc_Obj_t *)pObj->pNtk->vObjs->pArray[ pObj->vFanins.pArray[0] ]; }
00391 static inline Abc_Obj_t * Abc_ObjFanin1( Abc_Obj_t * pObj ) { return (Abc_Obj_t *)pObj->pNtk->vObjs->pArray[ pObj->vFanins.pArray[1] ]; }
00392 static inline Abc_Obj_t * Abc_ObjFanin0Ntk( Abc_Obj_t * pObj ) { return (Abc_NtkIsNetlist(pObj->pNtk)? Abc_ObjFanin0(pObj) : pObj); }
00393 static inline Abc_Obj_t * Abc_ObjFanout0Ntk( Abc_Obj_t * pObj ) { return (Abc_NtkIsNetlist(pObj->pNtk)? Abc_ObjFanout0(pObj) : pObj); }
00394 static inline bool Abc_ObjFaninC0( Abc_Obj_t * pObj ) { return pObj->fCompl0; }
00395 static inline bool Abc_ObjFaninC1( Abc_Obj_t * pObj ) { return pObj->fCompl1; }
00396 static inline bool Abc_ObjFaninC( Abc_Obj_t * pObj, int i ) { assert( i >=0 && i < 2 ); return i? pObj->fCompl1 : pObj->fCompl0; }
00397 static inline void Abc_ObjSetFaninC( Abc_Obj_t * pObj, int i ){ assert( i >=0 && i < 2 ); if ( i ) pObj->fCompl1 = 1; else pObj->fCompl0 = 1; }
00398 static inline void Abc_ObjXorFaninC( Abc_Obj_t * pObj, int i ){ assert( i >=0 && i < 2 ); if ( i ) pObj->fCompl1^= 1; else pObj->fCompl0^= 1; }
00399 static inline Abc_Obj_t * Abc_ObjChild( Abc_Obj_t * pObj, int i ) { return Abc_ObjNotCond( Abc_ObjFanin(pObj,i), Abc_ObjFaninC(pObj,i) );}
00400 static inline Abc_Obj_t * Abc_ObjChild0( Abc_Obj_t * pObj ) { return Abc_ObjNotCond( Abc_ObjFanin0(pObj), Abc_ObjFaninC0(pObj) ); }
00401 static inline Abc_Obj_t * Abc_ObjChild1( Abc_Obj_t * pObj ) { return Abc_ObjNotCond( Abc_ObjFanin1(pObj), Abc_ObjFaninC1(pObj) ); }
00402 static inline Abc_Obj_t * Abc_ObjChildCopy( Abc_Obj_t * pObj, int i ){ return Abc_ObjNotCond( Abc_ObjFanin(pObj,i)->pCopy, Abc_ObjFaninC(pObj,i) ); }
00403 static inline Abc_Obj_t * Abc_ObjChild0Copy( Abc_Obj_t * pObj ) { return Abc_ObjNotCond( Abc_ObjFanin0(pObj)->pCopy, Abc_ObjFaninC0(pObj) ); }
00404 static inline Abc_Obj_t * Abc_ObjChild1Copy( Abc_Obj_t * pObj ) { return Abc_ObjNotCond( Abc_ObjFanin1(pObj)->pCopy, Abc_ObjFaninC1(pObj) ); }
00405 static inline Abc_Obj_t * Abc_ObjChild0Data( Abc_Obj_t * pObj ) { return Abc_ObjNotCond( (Abc_Obj_t *)Abc_ObjFanin0(pObj)->pData, Abc_ObjFaninC0(pObj) ); }
00406 static inline Abc_Obj_t * Abc_ObjChild1Data( Abc_Obj_t * pObj ) { return Abc_ObjNotCond( (Abc_Obj_t *)Abc_ObjFanin1(pObj)->pData, Abc_ObjFaninC1(pObj) ); }
00407 static inline Hop_Obj_t * Abc_ObjChild0Equiv( Abc_Obj_t * pObj ) { return Hop_NotCond( Abc_ObjFanin0(pObj)->pEquiv, Abc_ObjFaninC0(pObj) ); }
00408 static inline Hop_Obj_t * Abc_ObjChild1Equiv( Abc_Obj_t * pObj ) { return Hop_NotCond( Abc_ObjFanin1(pObj)->pEquiv, Abc_ObjFaninC1(pObj) ); }
00409
00410
00411 static inline bool Abc_AigNodeIsConst( Abc_Obj_t * pNode ) { assert(Abc_NtkIsStrash(Abc_ObjRegular(pNode)->pNtk)); return Abc_ObjRegular(pNode)->Type == ABC_OBJ_CONST1; }
00412 static inline bool Abc_AigNodeIsAnd( Abc_Obj_t * pNode ) { assert(!Abc_ObjIsComplement(pNode)); assert(Abc_NtkIsStrash(pNode->pNtk)); return Abc_ObjFaninNum(pNode) == 2; }
00413 static inline bool Abc_AigNodeIsChoice( Abc_Obj_t * pNode ) { assert(!Abc_ObjIsComplement(pNode)); assert(Abc_NtkIsStrash(pNode->pNtk)); return pNode->pData != NULL && Abc_ObjFanoutNum(pNode) > 0; }
00414
00415
00416 static inline int Abc_NodeIsPersistant( Abc_Obj_t * pNode ) { assert( Abc_AigNodeIsAnd(pNode) ); return pNode->fPersist; }
00417 static inline void Abc_NodeSetPersistant( Abc_Obj_t * pNode ) { assert( Abc_AigNodeIsAnd(pNode) ); pNode->fPersist = 1; }
00418 static inline void Abc_NodeClearPersistant( Abc_Obj_t * pNode ) { assert( Abc_AigNodeIsAnd(pNode) ); pNode->fPersist = 0; }
00419
00420
00421 static inline void Abc_NodeSetTravId( Abc_Obj_t * pNode, int TravId ) { pNode->TravId = TravId; }
00422 static inline void Abc_NodeSetTravIdCurrent( Abc_Obj_t * pNode ) { pNode->TravId = pNode->pNtk->nTravIds; }
00423 static inline void Abc_NodeSetTravIdPrevious( Abc_Obj_t * pNode ) { pNode->TravId = pNode->pNtk->nTravIds - 1; }
00424 static inline bool Abc_NodeIsTravIdCurrent( Abc_Obj_t * pNode ) { return (bool)(pNode->TravId == pNode->pNtk->nTravIds); }
00425 static inline bool Abc_NodeIsTravIdPrevious( Abc_Obj_t * pNode ) { return (bool)(pNode->TravId == pNode->pNtk->nTravIds - 1); }
00426
00427
00428 static inline void Abc_LatchSetInitNone( Abc_Obj_t * pLatch ) { assert(Abc_ObjIsLatch(pLatch)); pLatch->pData = (void *)ABC_INIT_NONE; }
00429 static inline void Abc_LatchSetInit0( Abc_Obj_t * pLatch ) { assert(Abc_ObjIsLatch(pLatch)); pLatch->pData = (void *)ABC_INIT_ZERO; }
00430 static inline void Abc_LatchSetInit1( Abc_Obj_t * pLatch ) { assert(Abc_ObjIsLatch(pLatch)); pLatch->pData = (void *)ABC_INIT_ONE; }
00431 static inline void Abc_LatchSetInitDc( Abc_Obj_t * pLatch ) { assert(Abc_ObjIsLatch(pLatch)); pLatch->pData = (void *)ABC_INIT_DC; }
00432 static inline bool Abc_LatchIsInitNone( Abc_Obj_t * pLatch ) { assert(Abc_ObjIsLatch(pLatch)); return pLatch->pData == (void *)ABC_INIT_NONE; }
00433 static inline bool Abc_LatchIsInit0( Abc_Obj_t * pLatch ) { assert(Abc_ObjIsLatch(pLatch)); return pLatch->pData == (void *)ABC_INIT_ZERO; }
00434 static inline bool Abc_LatchIsInit1( Abc_Obj_t * pLatch ) { assert(Abc_ObjIsLatch(pLatch)); return pLatch->pData == (void *)ABC_INIT_ONE; }
00435 static inline bool Abc_LatchIsInitDc( Abc_Obj_t * pLatch ) { assert(Abc_ObjIsLatch(pLatch)); return pLatch->pData == (void *)ABC_INIT_DC; }
00436 static inline int Abc_LatchInit( Abc_Obj_t * pLatch ) { assert(Abc_ObjIsLatch(pLatch)); return (int)pLatch->pData; }
00437
00438
00439 static inline void * Abc_NtkGlobalBdd( Abc_Ntk_t * pNtk ) { return (void *)Vec_PtrEntry(pNtk->vAttrs, VEC_ATTR_GLOBAL_BDD); }
00440 static inline DdManager * Abc_NtkGlobalBddMan( Abc_Ntk_t * pNtk ) { return (DdManager *)Vec_AttMan( (Vec_Att_t *)Abc_NtkGlobalBdd(pNtk) ); }
00441 static inline DdNode ** Abc_NtkGlobalBddArray( Abc_Ntk_t * pNtk ) { return (DdNode **)Vec_AttArray( (Vec_Att_t *)Abc_NtkGlobalBdd(pNtk) ); }
00442 static inline DdNode * Abc_ObjGlobalBdd( Abc_Obj_t * pObj ) { return (DdNode *)Vec_AttEntry( (Vec_Att_t *)Abc_NtkGlobalBdd(pObj->pNtk), pObj->Id ); }
00443 static inline void Abc_ObjSetGlobalBdd( Abc_Obj_t * pObj, DdNode * bF ) { Vec_AttWriteEntry( (Vec_Att_t *)Abc_NtkGlobalBdd(pObj->pNtk), pObj->Id, bF ); }
00444
00445
00446 static inline void * Abc_NtkMvVar( Abc_Ntk_t * pNtk ) { return Vec_PtrEntry(pNtk->vAttrs, VEC_ATTR_MVVAR); }
00447 static inline void * Abc_NtkMvVarMan( Abc_Ntk_t * pNtk ) { return Abc_NtkMvVar(pNtk)? Vec_AttMan( (Vec_Att_t *)Abc_NtkMvVar(pNtk) ) : NULL; }
00448 static inline void * Abc_ObjMvVar( Abc_Obj_t * pObj ) { return Abc_NtkMvVar(pObj->pNtk)? Vec_AttEntry( (Vec_Att_t *)Abc_NtkMvVar(pObj->pNtk), pObj->Id ) : NULL; }
00449 static inline int Abc_ObjMvVarNum( Abc_Obj_t * pObj ) { return (Abc_NtkMvVar(pObj->pNtk) && Abc_ObjMvVar(pObj))? *((int*)Abc_ObjMvVar(pObj)) : 2; }
00450 static inline void Abc_ObjSetMvVar( Abc_Obj_t * pObj, void * pV) { Vec_AttWriteEntry( (Vec_Att_t *)Abc_NtkMvVar(pObj->pNtk), pObj->Id, pV ); }
00451
00452
00453 #define PRT(a,t) printf("%s = ", (a)); printf("%6.2f sec\n", (float)(t)/(float)(CLOCKS_PER_SEC))
00454
00458
00459
00460 #define Abc_NtkForEachObj( pNtk, pObj, i ) \
00461 for ( i = 0; (i < Vec_PtrSize((pNtk)->vObjs)) && (((pObj) = Abc_NtkObj(pNtk, i)), 1); i++ ) \
00462 if ( (pObj) == NULL ) {} else
00463 #define Abc_NtkForEachNet( pNtk, pNet, i ) \
00464 for ( i = 0; (i < Vec_PtrSize((pNtk)->vObjs)) && (((pNet) = Abc_NtkObj(pNtk, i)), 1); i++ ) \
00465 if ( (pNet) == NULL || !Abc_ObjIsNet(pNet) ) {} else
00466 #define Abc_NtkForEachNode( pNtk, pNode, i ) \
00467 for ( i = 0; (i < Vec_PtrSize((pNtk)->vObjs)) && (((pNode) = Abc_NtkObj(pNtk, i)), 1); i++ ) \
00468 if ( (pNode) == NULL || !Abc_ObjIsNode(pNode) ) {} else
00469 #define Abc_NtkForEachGate( pNtk, pNode, i ) \
00470 for ( i = 0; (i < Vec_PtrSize((pNtk)->vObjs)) && (((pNode) = Abc_NtkObj(pNtk, i)), 1); i++ ) \
00471 if ( (pNode) == NULL || !Abc_ObjIsGate(pNode) ) {} else
00472 #define Abc_AigForEachAnd( pNtk, pNode, i ) \
00473 for ( i = 0; (i < Vec_PtrSize((pNtk)->vObjs)) && (((pNode) = Abc_NtkObj(pNtk, i)), 1); i++ ) \
00474 if ( (pNode) == NULL || !Abc_AigNodeIsAnd(pNode) ) {} else
00475
00476 #define Abc_NtkForEachBox( pNtk, pObj, i ) \
00477 for ( i = 0; (i < Vec_PtrSize((pNtk)->vBoxes)) && (((pObj) = Abc_NtkBox(pNtk, i)), 1); i++ )
00478 #define Abc_NtkForEachLatch( pNtk, pObj, i ) \
00479 for ( i = 0; (i < Vec_PtrSize((pNtk)->vBoxes)) && (((pObj) = Abc_NtkBox(pNtk, i)), 1); i++ ) \
00480 if ( !Abc_ObjIsLatch(pObj) ) {} else
00481 #define Abc_NtkForEachLatchInput( pNtk, pObj, i ) \
00482 for ( i = 0; (i < Vec_PtrSize((pNtk)->vBoxes)); i++ ) \
00483 if ( !(Abc_ObjIsLatch(Abc_NtkBox(pNtk, i)) && (((pObj) = Abc_ObjFanin0(Abc_NtkBox(pNtk, i))), 1)) ) {} else
00484 #define Abc_NtkForEachLatchOutput( pNtk, pObj, i ) \
00485 for ( i = 0; (i < Vec_PtrSize((pNtk)->vBoxes)); i++ ) \
00486 if ( !(Abc_ObjIsLatch(Abc_NtkBox(pNtk, i)) && (((pObj) = Abc_ObjFanout0(Abc_NtkBox(pNtk, i))), 1)) ) {} else
00487 #define Abc_NtkForEachWhitebox( pNtk, pObj, i ) \
00488 for ( i = 0; (i < Vec_PtrSize((pNtk)->vBoxes)) && (((pObj) = Abc_NtkBox(pNtk, i)), 1); i++ ) \
00489 if ( !Abc_ObjIsWhitebox(pObj) ) {} else
00490 #define Abc_NtkForEachBlackbox( pNtk, pObj, i ) \
00491 for ( i = 0; (i < Vec_PtrSize((pNtk)->vBoxes)) && (((pObj) = Abc_NtkBox(pNtk, i)), 1); i++ ) \
00492 if ( !Abc_ObjIsBlackbox(pObj) ) {} else
00493
00494 #define Abc_NtkForEachPi( pNtk, pPi, i ) \
00495 for ( i = 0; (i < Abc_NtkPiNum(pNtk)) && (((pPi) = Abc_NtkPi(pNtk, i)), 1); i++ )
00496 #define Abc_NtkForEachCi( pNtk, pCi, i ) \
00497 for ( i = 0; (i < Abc_NtkCiNum(pNtk)) && (((pCi) = Abc_NtkCi(pNtk, i)), 1); i++ )
00498 #define Abc_NtkForEachPo( pNtk, pPo, i ) \
00499 for ( i = 0; (i < Abc_NtkPoNum(pNtk)) && (((pPo) = Abc_NtkPo(pNtk, i)), 1); i++ )
00500 #define Abc_NtkForEachCo( pNtk, pCo, i ) \
00501 for ( i = 0; (i < Abc_NtkCoNum(pNtk)) && (((pCo) = Abc_NtkCo(pNtk, i)), 1); i++ )
00502 #define Abc_NtkForEachAssert( pNtk, pObj, i ) \
00503 for ( i = 0; (i < Vec_PtrSize((pNtk)->vAsserts)) && (((pObj) = Abc_NtkAssert(pNtk, i)), 1); i++ )
00504
00505 #define Abc_ObjForEachFanin( pObj, pFanin, i ) \
00506 for ( i = 0; (i < Abc_ObjFaninNum(pObj)) && (((pFanin) = Abc_ObjFanin(pObj, i)), 1); i++ )
00507 #define Abc_ObjForEachFanout( pObj, pFanout, i ) \
00508 for ( i = 0; (i < Abc_ObjFanoutNum(pObj)) && (((pFanout) = Abc_ObjFanout(pObj, i)), 1); i++ )
00509
00510 #define Abc_SopForEachCube( pSop, nFanins, pCube ) \
00511 for ( pCube = (pSop); *pCube; pCube += (nFanins) + 3 )
00512 #define Abc_CubeForEachVar( pCube, Value, i ) \
00513 for ( i = 0; (pCube[i] != ' ') && (Value = pCube[i]); i++ )
00514
00515
00519
00520
00521 extern Abc_Aig_t * Abc_AigAlloc( Abc_Ntk_t * pNtk );
00522 extern void Abc_AigFree( Abc_Aig_t * pMan );
00523 extern int Abc_AigCleanup( Abc_Aig_t * pMan );
00524 extern bool Abc_AigCheck( Abc_Aig_t * pMan );
00525 extern int Abc_AigLevel( Abc_Ntk_t * pNtk );
00526 extern Abc_Obj_t * Abc_AigConst1( Abc_Ntk_t * pNtk );
00527 extern Abc_Obj_t * Abc_AigAnd( Abc_Aig_t * pMan, Abc_Obj_t * p0, Abc_Obj_t * p1 );
00528 extern Abc_Obj_t * Abc_AigAndLookup( Abc_Aig_t * pMan, Abc_Obj_t * p0, Abc_Obj_t * p1 );
00529 extern Abc_Obj_t * Abc_AigXorLookup( Abc_Aig_t * pMan, Abc_Obj_t * p0, Abc_Obj_t * p1, int * pType );
00530 extern Abc_Obj_t * Abc_AigMuxLookup( Abc_Aig_t * pMan, Abc_Obj_t * pC, Abc_Obj_t * pT, Abc_Obj_t * pE, int * pType );
00531 extern Abc_Obj_t * Abc_AigOr( Abc_Aig_t * pMan, Abc_Obj_t * p0, Abc_Obj_t * p1 );
00532 extern Abc_Obj_t * Abc_AigXor( Abc_Aig_t * pMan, Abc_Obj_t * p0, Abc_Obj_t * p1 );
00533 extern Abc_Obj_t * Abc_AigMiter( Abc_Aig_t * pMan, Vec_Ptr_t * vPairs );
00534 extern void Abc_AigReplace( Abc_Aig_t * pMan, Abc_Obj_t * pOld, Abc_Obj_t * pNew, bool fUpdateLevel );
00535 extern void Abc_AigDeleteNode( Abc_Aig_t * pMan, Abc_Obj_t * pOld );
00536 extern void Abc_AigRehash( Abc_Aig_t * pMan );
00537 extern bool Abc_AigNodeHasComplFanoutEdge( Abc_Obj_t * pNode );
00538 extern bool Abc_AigNodeHasComplFanoutEdgeTrav( Abc_Obj_t * pNode );
00539 extern void Abc_AigPrintNode( Abc_Obj_t * pNode );
00540 extern bool Abc_AigNodeIsAcyclic( Abc_Obj_t * pNode, Abc_Obj_t * pRoot );
00541 extern void Abc_AigCheckFaninOrder( Abc_Aig_t * pMan );
00542 extern void Abc_AigSetNodePhases( Abc_Ntk_t * pNtk );
00543 extern Vec_Ptr_t * Abc_AigUpdateStart( Abc_Aig_t * pMan, Vec_Ptr_t ** pvUpdatedNets );
00544 extern void Abc_AigUpdateStop( Abc_Aig_t * pMan );
00545 extern void Abc_AigUpdateReset( Abc_Aig_t * pMan );
00546
00547 extern int Abc_NtkAttach( Abc_Ntk_t * pNtk );
00548
00549 extern void Abc_NtkStartMvVars( Abc_Ntk_t * pNtk );
00550 extern void Abc_NtkFreeMvVars( Abc_Ntk_t * pNtk );
00551 extern void Abc_NtkSetMvVarValues( Abc_Obj_t * pObj, int nValues );
00552 extern Abc_Ntk_t * Abc_NtkStrashBlifMv( Abc_Ntk_t * pNtk );
00553 extern Abc_Ntk_t * Abc_NtkInsertBlifMv( Abc_Ntk_t * pNtkBase, Abc_Ntk_t * pNtkLogic );
00554 extern int Abc_NtkConvertToBlifMv( Abc_Ntk_t * pNtk );
00555 extern char * Abc_NodeConvertSopToMvSop( int nVars, Vec_Int_t * vSop0, Vec_Int_t * vSop1 );
00556 extern int Abc_NodeEvalMvCost( int nVars, Vec_Int_t * vSop0, Vec_Int_t * vSop1 );
00557
00558 extern Abc_Ntk_t * Abc_NtkBalance( Abc_Ntk_t * pNtk, bool fDuplicate, bool fSelective, bool fUpdateLevel );
00559
00560 extern bool Abc_NtkCheck( Abc_Ntk_t * pNtk );
00561 extern bool Abc_NtkCheckRead( Abc_Ntk_t * pNtk );
00562 extern bool Abc_NtkDoCheck( Abc_Ntk_t * pNtk );
00563 extern bool Abc_NtkCheckObj( Abc_Ntk_t * pNtk, Abc_Obj_t * pObj );
00564 extern bool Abc_NtkCompareSignals( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int fOnlyPis, int fComb );
00565 extern int Abc_NtkIsAcyclicHierarchy( Abc_Ntk_t * pNtk );
00566 extern int Abc_NtkCheckUniqueCiNames( Abc_Ntk_t * pNtk );
00567 extern int Abc_NtkCheckUniqueCoNames( Abc_Ntk_t * pNtk );
00568 extern int Abc_NtkCheckUniqueCioNames( Abc_Ntk_t * pNtk );
00569
00570 extern Abc_Ntk_t * Abc_NtkCollapse( Abc_Ntk_t * pNtk, int fBddSizeMax, int fDualRail, int fReorder, int fVerbose );
00571
00572 extern void * Abc_NodeGetCutsRecursive( void * p, Abc_Obj_t * pObj, int fDag, int fTree );
00573 extern void * Abc_NodeGetCuts( void * p, Abc_Obj_t * pObj, int fDag, int fTree );
00574 extern void Abc_NodeGetCutsSeq( void * p, Abc_Obj_t * pObj, int fFirst );
00575 extern void * Abc_NodeReadCuts( void * p, Abc_Obj_t * pObj );
00576 extern void Abc_NodeFreeCuts( void * p, Abc_Obj_t * pObj );
00577
00578 extern Vec_Ptr_t * Abc_NtkDfs( Abc_Ntk_t * pNtk, int fCollectAll );
00579 extern Vec_Ptr_t * Abc_NtkDfsNodes( Abc_Ntk_t * pNtk, Abc_Obj_t ** ppNodes, int nNodes );
00580 extern Vec_Ptr_t * Abc_NtkDfsReverse( Abc_Ntk_t * pNtk );
00581 extern Vec_Ptr_t * Abc_NtkDfsReverseNodes( Abc_Ntk_t * pNtk, Abc_Obj_t ** ppNodes, int nNodes );
00582 extern Vec_Ptr_t * Abc_NtkDfsReverseNodesContained( Abc_Ntk_t * pNtk, Abc_Obj_t ** ppNodes, int nNodes );
00583 extern Vec_Ptr_t * Abc_NtkDfsSeq( Abc_Ntk_t * pNtk );
00584 extern Vec_Ptr_t * Abc_NtkDfsSeqReverse( Abc_Ntk_t * pNtk );
00585 extern Vec_Ptr_t * Abc_NtkDfsIter( Abc_Ntk_t * pNtk, int fCollectAll );
00586 extern Vec_Ptr_t * Abc_NtkDfsHie( Abc_Ntk_t * pNtk, int fCollectAll );
00587 extern bool Abc_NtkIsDfsOrdered( Abc_Ntk_t * pNtk );
00588 extern Vec_Ptr_t * Abc_NtkSupport( Abc_Ntk_t * pNtk );
00589 extern Vec_Ptr_t * Abc_NtkNodeSupport( Abc_Ntk_t * pNtk, Abc_Obj_t ** ppNodes, int nNodes );
00590 extern Vec_Ptr_t * Abc_AigDfs( Abc_Ntk_t * pNtk, int fCollectAll, int fCollectCos );
00591 extern Vec_Vec_t * Abc_DfsLevelized( Abc_Obj_t * pNode, bool fTfi );
00592 extern int Abc_NtkLevel( Abc_Ntk_t * pNtk );
00593 extern int Abc_NtkLevelReverse( Abc_Ntk_t * pNtk );
00594 extern bool Abc_NtkIsAcyclic( Abc_Ntk_t * pNtk );
00595 extern Vec_Ptr_t * Abc_AigGetLevelizedOrder( Abc_Ntk_t * pNtk, int fCollectCis );
00596
00597 extern void Abc_ObjAddFanin( Abc_Obj_t * pObj, Abc_Obj_t * pFanin );
00598 extern void Abc_ObjDeleteFanin( Abc_Obj_t * pObj, Abc_Obj_t * pFanin );
00599 extern void Abc_ObjRemoveFanins( Abc_Obj_t * pObj );
00600 extern void Abc_ObjPatchFanin( Abc_Obj_t * pObj, Abc_Obj_t * pFaninOld, Abc_Obj_t * pFaninNew );
00601 extern Abc_Obj_t * Abc_ObjInsertBetween( Abc_Obj_t * pNodeIn, Abc_Obj_t * pNodeOut, Abc_ObjType_t Type );
00602 extern void Abc_ObjTransferFanout( Abc_Obj_t * pObjOld, Abc_Obj_t * pObjNew );
00603 extern void Abc_ObjReplace( Abc_Obj_t * pObjOld, Abc_Obj_t * pObjNew );
00604 extern int Abc_ObjFanoutFaninNum( Abc_Obj_t * pFanout, Abc_Obj_t * pFanin );
00605
00606 extern Abc_Ntk_t * Abc_NtkFraig( Abc_Ntk_t * pNtk, void * pParams, int fAllNodes, int fExdc );
00607 extern void * Abc_NtkToFraig( Abc_Ntk_t * pNtk, void * pParams, int fAllNodes, int fExdc );
00608 extern Abc_Ntk_t * Abc_NtkFraigTrust( Abc_Ntk_t * pNtk );
00609 extern int Abc_NtkFraigStore( Abc_Ntk_t * pNtk );
00610 extern Abc_Ntk_t * Abc_NtkFraigRestore();
00611 extern void Abc_NtkFraigStoreClean();
00612
00613 extern int Abc_NtkSopToBdd( Abc_Ntk_t * pNtk );
00614 extern DdNode * Abc_ConvertSopToBdd( DdManager * dd, char * pSop );
00615 extern char * Abc_ConvertBddToSop( Extra_MmFlex_t * pMan, DdManager * dd, DdNode * bFuncOn, DdNode * bFuncOnDc, int nFanins, int fAllPrimes, Vec_Str_t * vCube, int fMode );
00616 extern int Abc_NtkBddToSop( Abc_Ntk_t * pNtk, int fDirect );
00617 extern void Abc_NodeBddToCnf( Abc_Obj_t * pNode, Extra_MmFlex_t * pMmMan, Vec_Str_t * vCube, int fAllPrimes, char ** ppSop0, char ** ppSop1 );
00618 extern int Abc_CountZddCubes( DdManager * dd, DdNode * zCover );
00619 extern void Abc_NtkLogicMakeDirectSops( Abc_Ntk_t * pNtk );
00620 extern int Abc_NtkSopToAig( Abc_Ntk_t * pNtk );
00621 extern int Abc_NtkAigToBdd( Abc_Ntk_t * pNtk );
00622 extern unsigned * Abc_ConvertAigToTruth( Hop_Man_t * p, Hop_Obj_t * pRoot, int nVars, Vec_Int_t * vTruth, int fMsbFirst );
00623 extern int Abc_NtkMapToSop( Abc_Ntk_t * pNtk );
00624 extern int Abc_NtkToSop( Abc_Ntk_t * pNtk, int fDirect );
00625 extern int Abc_NtkToBdd( Abc_Ntk_t * pNtk );
00626 extern int Abc_NtkToAig( Abc_Ntk_t * pNtk );
00627
00628 extern int Abc_NtkHaigStart( Abc_Ntk_t * pNtk );
00629 extern int Abc_NtkHaigStop( Abc_Ntk_t * pNtk );
00630 extern Abc_Ntk_t * Abc_NtkHaigUse( Abc_Ntk_t * pNtk );
00631
00632 extern Abc_Ntk_t * Abc_NtkFlattenLogicHierarchy( Abc_Ntk_t * pNtk );
00633 extern Abc_Ntk_t * Abc_NtkConvertBlackboxes( Abc_Ntk_t * pNtk );
00634 extern Abc_Ntk_t * Abc_NtkInsertNewLogic( Abc_Ntk_t * pNtkH, Abc_Ntk_t * pNtkL );
00635
00636 extern bool Abc_NtkLatchIsSelfFeed( Abc_Obj_t * pLatch );
00637 extern int Abc_NtkCountSelfFeedLatches( Abc_Ntk_t * pNtk );
00638 extern int Abc_NtkRemoveSelfFeedLatches( Abc_Ntk_t * pNtk );
00639 extern Vec_Int_t * Abc_NtkCollectLatchValues( Abc_Ntk_t * pNtk );
00640 extern void Abc_NtkInsertLatchValues( Abc_Ntk_t * pNtk, Vec_Int_t * vValues );
00641 extern Abc_Obj_t * Abc_NtkAddLatch( Abc_Ntk_t * pNtk, Abc_Obj_t * pDriver, Abc_InitType_t Init );
00642 extern void Abc_NtkConvertDcLatches( Abc_Ntk_t * pNtk );
00643
00644 extern Abc_Lib_t * Abc_LibCreate( char * pName );
00645 extern void Abc_LibFree( Abc_Lib_t * pLib, Abc_Ntk_t * pNtk );
00646 extern void Abc_LibPrint( Abc_Lib_t * pLib );
00647 extern int Abc_LibAddModel( Abc_Lib_t * pLib, Abc_Ntk_t * pNtk );
00648 extern Abc_Ntk_t * Abc_LibFindModelByName( Abc_Lib_t * pLib, char * pName );
00649 extern int Abc_LibFindTopLevelModels( Abc_Lib_t * pLib );
00650 extern Abc_Ntk_t * Abc_LibDeriveRoot( Abc_Lib_t * pLib );
00651
00652 extern int Abc_NtkMinimumBase( Abc_Ntk_t * pNtk );
00653 extern int Abc_NodeMinimumBase( Abc_Obj_t * pNode );
00654 extern int Abc_NtkRemoveDupFanins( Abc_Ntk_t * pNtk );
00655 extern int Abc_NodeRemoveDupFanins( Abc_Obj_t * pNode );
00656
00657 extern Abc_Ntk_t * Abc_NtkMiter( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int fComb, int nPartSize );
00658 extern void Abc_NtkMiterAddCone( Abc_Ntk_t * pNtk, Abc_Ntk_t * pNtkMiter, Abc_Obj_t * pNode );
00659 extern Abc_Ntk_t * Abc_NtkMiterAnd( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int fOr, int fCompl2 );
00660 extern Abc_Ntk_t * Abc_NtkMiterCofactor( Abc_Ntk_t * pNtk, Vec_Int_t * vPiValues );
00661 extern Abc_Ntk_t * Abc_NtkMiterForCofactors( Abc_Ntk_t * pNtk, int Out, int In1, int In2 );
00662 extern Abc_Ntk_t * Abc_NtkMiterQuantify( Abc_Ntk_t * pNtk, int In, int fExist );
00663 extern Abc_Ntk_t * Abc_NtkMiterQuantifyPis( Abc_Ntk_t * pNtk );
00664 extern int Abc_NtkMiterIsConstant( Abc_Ntk_t * pMiter );
00665 extern void Abc_NtkMiterReport( Abc_Ntk_t * pMiter );
00666 extern Abc_Ntk_t * Abc_NtkFrames( Abc_Ntk_t * pNtk, int nFrames, int fInitial );
00667
00668 extern char * Abc_ObjName( Abc_Obj_t * pNode );
00669 extern char * Abc_ObjAssignName( Abc_Obj_t * pObj, char * pName, char * pSuffix );
00670 extern char * Abc_ObjNameSuffix( Abc_Obj_t * pObj, char * pSuffix );
00671 extern char * Abc_ObjNameDummy( char * pPrefix, int Num, int nDigits );
00672 extern void Abc_NtkTrasferNames( Abc_Ntk_t * pNtk, Abc_Ntk_t * pNtkNew );
00673 extern void Abc_NtkTrasferNamesNoLatches( Abc_Ntk_t * pNtk, Abc_Ntk_t * pNtkNew );
00674 extern Vec_Ptr_t * Abc_NodeGetFaninNames( Abc_Obj_t * pNode );
00675 extern Vec_Ptr_t * Abc_NodeGetFakeNames( int nNames );
00676 extern void Abc_NodeFreeNames( Vec_Ptr_t * vNames );
00677 extern char ** Abc_NtkCollectCioNames( Abc_Ntk_t * pNtk, int fCollectCos );
00678 extern int Abc_NodeCompareNames( Abc_Obj_t ** pp1, Abc_Obj_t ** pp2 );
00679 extern void Abc_NtkOrderObjsByName( Abc_Ntk_t * pNtk, int fComb );
00680 extern void Abc_NtkAddDummyPiNames( Abc_Ntk_t * pNtk );
00681 extern void Abc_NtkAddDummyPoNames( Abc_Ntk_t * pNtk );
00682 extern void Abc_NtkAddDummyAssertNames( Abc_Ntk_t * pNtk );
00683 extern void Abc_NtkAddDummyBoxNames( Abc_Ntk_t * pNtk );
00684 extern void Abc_NtkShortNames( Abc_Ntk_t * pNtk );
00685
00686 extern Abc_Ntk_t * Abc_NtkToLogic( Abc_Ntk_t * pNtk );
00687 extern Abc_Ntk_t * Abc_NtkToNetlist( Abc_Ntk_t * pNtk );
00688 extern Abc_Ntk_t * Abc_NtkToNetlistBench( Abc_Ntk_t * pNtk );
00689
00690 extern Abc_Ntk_t * Abc_NtkDeriveFromBdd( DdManager * dd, DdNode * bFunc, char * pNamePo, Vec_Ptr_t * vNamesPi );
00691 extern Abc_Ntk_t * Abc_NtkBddToMuxes( Abc_Ntk_t * pNtk );
00692 extern DdManager * Abc_NtkBuildGlobalBdds( Abc_Ntk_t * pNtk, int fBddSizeMax, int fDropInternal, int fReorder, int fVerbose );
00693 extern DdManager * Abc_NtkFreeGlobalBdds( Abc_Ntk_t * pNtk, int fFreeMan );
00694 extern int Abc_NtkSizeOfGlobalBdds( Abc_Ntk_t * pNtk );
00695
00696 extern Abc_Ntk_t * Abc_NtkAlloc( Abc_NtkType_t Type, Abc_NtkFunc_t Func, int fUseMemMan );
00697 extern Abc_Ntk_t * Abc_NtkStartFrom( Abc_Ntk_t * pNtk, Abc_NtkType_t Type, Abc_NtkFunc_t Func );
00698 extern Abc_Ntk_t * Abc_NtkStartFromNoLatches( Abc_Ntk_t * pNtk, Abc_NtkType_t Type, Abc_NtkFunc_t Func );
00699 extern void Abc_NtkFinalize( Abc_Ntk_t * pNtk, Abc_Ntk_t * pNtkNew );
00700 extern Abc_Ntk_t * Abc_NtkStartRead( char * pName );
00701 extern void Abc_NtkFinalizeRead( Abc_Ntk_t * pNtk );
00702 extern Abc_Ntk_t * Abc_NtkDup( Abc_Ntk_t * pNtk );
00703 extern Abc_Ntk_t * Abc_NtkCreateCone( Abc_Ntk_t * pNtk, Abc_Obj_t * pNode, char * pNodeName, int fUseAllCis );
00704 extern Abc_Ntk_t * Abc_NtkCreateConeArray( Abc_Ntk_t * pNtk, Vec_Ptr_t * vRoots, int fUseAllCis );
00705 extern void Abc_NtkAppendToCone( Abc_Ntk_t * pNtkNew, Abc_Ntk_t * pNtk, Vec_Ptr_t * vRoots );
00706 extern Abc_Ntk_t * Abc_NtkCreateMffc( Abc_Ntk_t * pNtk, Abc_Obj_t * pNode, char * pNodeName );
00707 extern Abc_Ntk_t * Abc_NtkCreateTarget( Abc_Ntk_t * pNtk, Vec_Ptr_t * vRoots, Vec_Int_t * vValues );
00708 extern Abc_Ntk_t * Abc_NtkCreateFromNode( Abc_Ntk_t * pNtk, Abc_Obj_t * pNode );
00709 extern Abc_Ntk_t * Abc_NtkCreateWithNode( char * pSop );
00710 extern void Abc_NtkDelete( Abc_Ntk_t * pNtk );
00711 extern void Abc_NtkFixNonDrivenNets( Abc_Ntk_t * pNtk );
00712 extern void Abc_NtkMakeComb( Abc_Ntk_t * pNtk );
00713
00714 extern Abc_Obj_t * Abc_ObjAlloc( Abc_Ntk_t * pNtk, Abc_ObjType_t Type );
00715 extern void Abc_ObjRecycle( Abc_Obj_t * pObj );
00716 extern Abc_Obj_t * Abc_NtkCreateObj( Abc_Ntk_t * pNtk, Abc_ObjType_t Type );
00717 extern void Abc_NtkDeleteObj( Abc_Obj_t * pObj );
00718 extern void Abc_NtkDeleteObj_rec( Abc_Obj_t * pObj, int fOnlyNodes );
00719 extern void Abc_NtkDeleteAll_rec( Abc_Obj_t * pObj );
00720 extern Abc_Obj_t * Abc_NtkDupObj( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pObj, int fCopyName );
00721 extern Abc_Obj_t * Abc_NtkDupBox( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pBox, int fCopyName );
00722 extern Abc_Obj_t * Abc_NtkCloneObj( Abc_Obj_t * pNode );
00723 extern Abc_Obj_t * Abc_NtkFindNode( Abc_Ntk_t * pNtk, char * pName );
00724 extern Abc_Obj_t * Abc_NtkFindNet( Abc_Ntk_t * pNtk, char * pName );
00725 extern Abc_Obj_t * Abc_NtkFindCi( Abc_Ntk_t * pNtk, char * pName );
00726 extern Abc_Obj_t * Abc_NtkFindCo( Abc_Ntk_t * pNtk, char * pName );
00727 extern Abc_Obj_t * Abc_NtkFindOrCreateNet( Abc_Ntk_t * pNtk, char * pName );
00728 extern Abc_Obj_t * Abc_NtkCreateNodeConst0( Abc_Ntk_t * pNtk );
00729 extern Abc_Obj_t * Abc_NtkCreateNodeConst1( Abc_Ntk_t * pNtk );
00730 extern Abc_Obj_t * Abc_NtkCreateNodeInv( Abc_Ntk_t * pNtk, Abc_Obj_t * pFanin );
00731 extern Abc_Obj_t * Abc_NtkCreateNodeBuf( Abc_Ntk_t * pNtk, Abc_Obj_t * pFanin );
00732 extern Abc_Obj_t * Abc_NtkCreateNodeAnd( Abc_Ntk_t * pNtk, Vec_Ptr_t * vFanins );
00733 extern Abc_Obj_t * Abc_NtkCreateNodeOr( Abc_Ntk_t * pNtk, Vec_Ptr_t * vFanins );
00734 extern Abc_Obj_t * Abc_NtkCreateNodeExor( Abc_Ntk_t * pNtk, Vec_Ptr_t * vFanins );
00735 extern Abc_Obj_t * Abc_NtkCreateNodeMux( Abc_Ntk_t * pNtk, Abc_Obj_t * pNodeC, Abc_Obj_t * pNode1, Abc_Obj_t * pNode0 );
00736 extern bool Abc_NodeIsConst( Abc_Obj_t * pNode );
00737 extern bool Abc_NodeIsConst0( Abc_Obj_t * pNode );
00738 extern bool Abc_NodeIsConst1( Abc_Obj_t * pNode );
00739 extern bool Abc_NodeIsBuf( Abc_Obj_t * pNode );
00740 extern bool Abc_NodeIsInv( Abc_Obj_t * pNode );
00741 extern void Abc_NodeComplement( Abc_Obj_t * pNode );
00742
00743 extern void Abc_NtkPrintStats( FILE * pFile, Abc_Ntk_t * pNtk, int fFactored );
00744 extern void Abc_NtkPrintIo( FILE * pFile, Abc_Ntk_t * pNtk );
00745 extern void Abc_NtkPrintLatch( FILE * pFile, Abc_Ntk_t * pNtk );
00746 extern void Abc_NtkPrintFanio( FILE * pFile, Abc_Ntk_t * pNtk );
00747 extern void Abc_NodePrintFanio( FILE * pFile, Abc_Obj_t * pNode );
00748 extern void Abc_NtkPrintFactor( FILE * pFile, Abc_Ntk_t * pNtk, int fUseRealNames );
00749 extern void Abc_NodePrintFactor( FILE * pFile, Abc_Obj_t * pNode, int fUseRealNames );
00750 extern void Abc_NtkPrintLevel( FILE * pFile, Abc_Ntk_t * pNtk, int fProfile, int fListNodes );
00751 extern void Abc_NodePrintLevel( FILE * pFile, Abc_Obj_t * pNode );
00752 extern void Abc_NtkPrintSkews( FILE * pFile, Abc_Ntk_t * pNtk, int fPrintAll );
00753 extern void Abc_ObjPrint( FILE * pFile, Abc_Obj_t * pObj );
00754
00755 extern int Abc_NtkMiterProve( Abc_Ntk_t ** ppNtk, void * pParams );
00756 extern int Abc_NtkIvyProve( Abc_Ntk_t ** ppNtk, void * pPars );
00757
00758 extern void Abc_NtkRecStart( Abc_Ntk_t * pNtk, int nVars, int nCuts );
00759 extern void Abc_NtkRecStop();
00760 extern void Abc_NtkRecAdd( Abc_Ntk_t * pNtk );
00761 extern void Abc_NtkRecPs();
00762 extern void Abc_NtkRecFilter( int iVar, int iPlus );
00763 extern Abc_Ntk_t * Abc_NtkRecUse();
00764 extern int Abc_NtkRecIsRunning();
00765 extern int Abc_NtkRecVarNum();
00766 extern Vec_Int_t * Abc_NtkRecMemory();
00767 extern int Abc_NtkRecStrashNode( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pObj, unsigned * pTruth, int nVars );
00768
00769 extern Abc_ManCut_t * Abc_NtkManCutStart( int nNodeSizeMax, int nConeSizeMax, int nNodeFanStop, int nConeFanStop );
00770 extern void Abc_NtkManCutStop( Abc_ManCut_t * p );
00771 extern Vec_Ptr_t * Abc_NtkManCutReadCutLarge( Abc_ManCut_t * p );
00772 extern Vec_Ptr_t * Abc_NtkManCutReadCutSmall( Abc_ManCut_t * p );
00773 extern Vec_Ptr_t * Abc_NtkManCutReadVisited( Abc_ManCut_t * p );
00774 extern Vec_Ptr_t * Abc_NodeFindCut( Abc_ManCut_t * p, Abc_Obj_t * pRoot, bool fContain );
00775 extern void Abc_NodeConeCollect( Abc_Obj_t ** ppRoots, int nRoots, Vec_Ptr_t * vFanins, Vec_Ptr_t * vVisited, int fIncludeFanins );
00776 extern DdNode * Abc_NodeConeBdd( DdManager * dd, DdNode ** pbVars, Abc_Obj_t * pNode, Vec_Ptr_t * vFanins, Vec_Ptr_t * vVisited );
00777 extern DdNode * Abc_NodeConeDcs( DdManager * dd, DdNode ** pbVarsX, DdNode ** pbVarsY, Vec_Ptr_t * vLeaves, Vec_Ptr_t * vRoots, Vec_Ptr_t * vVisited );
00778 extern Vec_Ptr_t * Abc_NodeCollectTfoCands( Abc_ManCut_t * p, Abc_Obj_t * pRoot, Vec_Ptr_t * vFanins, int LevelMax );
00779
00780 extern int Abc_NodeMffcSize( Abc_Obj_t * pNode );
00781 extern int Abc_NodeMffcSizeSupp( Abc_Obj_t * pNode );
00782 extern int Abc_NodeMffcSizeStop( Abc_Obj_t * pNode );
00783 extern int Abc_NodeMffcLabelAig( Abc_Obj_t * pNode );
00784 extern int Abc_NodeMffcLabel( Abc_Obj_t * pNode );
00785 extern void Abc_NodeMffsConeSupp( Abc_Obj_t * pNode, Vec_Ptr_t * vCone, Vec_Ptr_t * vSupp );
00786 extern int Abc_NodeDeref_rec( Abc_Obj_t * pNode );
00787 extern int Abc_NodeRef_rec( Abc_Obj_t * pNode );
00788
00789 extern int Abc_NtkRefactor( Abc_Ntk_t * pNtk, int nNodeSizeMax, int nConeSizeMax, bool fUpdateLevel, bool fUseZeros, bool fUseDcs, bool fVerbose );
00790
00791 extern int Abc_NtkRewrite( Abc_Ntk_t * pNtk, int fUpdateLevel, int fUseZeros, int fVerbose, int fVeryVerbose, int fPlaceEnable );
00792
00793 extern int Abc_NtkMiterSat( Abc_Ntk_t * pNtk, sint64 nConfLimit, sint64 nInsLimit, int fVerbose, sint64 * pNumConfs, sint64 * pNumInspects );
00794 extern void * Abc_NtkMiterSatCreate( Abc_Ntk_t * pNtk, int fAllPrimes );
00795
00796 extern char * Abc_SopRegister( Extra_MmFlex_t * pMan, char * pName );
00797 extern char * Abc_SopStart( Extra_MmFlex_t * pMan, int nCubes, int nVars );
00798 extern char * Abc_SopCreateConst0( Extra_MmFlex_t * pMan );
00799 extern char * Abc_SopCreateConst1( Extra_MmFlex_t * pMan );
00800 extern char * Abc_SopCreateAnd2( Extra_MmFlex_t * pMan, int fCompl0, int fCompl1 );
00801 extern char * Abc_SopCreateAnd( Extra_MmFlex_t * pMan, int nVars, int * pfCompl );
00802 extern char * Abc_SopCreateNand( Extra_MmFlex_t * pMan, int nVars );
00803 extern char * Abc_SopCreateOr( Extra_MmFlex_t * pMan, int nVars, int * pfCompl );
00804 extern char * Abc_SopCreateOrMultiCube( Extra_MmFlex_t * pMan, int nVars, int * pfCompl );
00805 extern char * Abc_SopCreateNor( Extra_MmFlex_t * pMan, int nVars );
00806 extern char * Abc_SopCreateXor( Extra_MmFlex_t * pMan, int nVars );
00807 extern char * Abc_SopCreateXorSpecial( Extra_MmFlex_t * pMan, int nVars );
00808 extern char * Abc_SopCreateNxor( Extra_MmFlex_t * pMan, int nVars );
00809 extern char * Abc_SopCreateMux( Extra_MmFlex_t * pMan );
00810 extern char * Abc_SopCreateInv( Extra_MmFlex_t * pMan );
00811 extern char * Abc_SopCreateBuf( Extra_MmFlex_t * pMan );
00812 extern char * Abc_SopCreateFromTruth( Extra_MmFlex_t * pMan, int nVars, unsigned * pTruth );
00813 extern char * Abc_SopCreateFromIsop( Extra_MmFlex_t * pMan, int nVars, Vec_Int_t * vCover );
00814 extern int Abc_SopGetCubeNum( char * pSop );
00815 extern int Abc_SopGetLitNum( char * pSop );
00816 extern int Abc_SopGetVarNum( char * pSop );
00817 extern int Abc_SopGetPhase( char * pSop );
00818 extern int Abc_SopGetIthCareLit( char * pSop, int i );
00819 extern void Abc_SopComplement( char * pSop );
00820 extern bool Abc_SopIsComplement( char * pSop );
00821 extern bool Abc_SopIsConst0( char * pSop );
00822 extern bool Abc_SopIsConst1( char * pSop );
00823 extern bool Abc_SopIsBuf( char * pSop );
00824 extern bool Abc_SopIsInv( char * pSop );
00825 extern bool Abc_SopIsAndType( char * pSop );
00826 extern bool Abc_SopIsOrType( char * pSop );
00827 extern int Abc_SopIsExorType( char * pSop );
00828 extern bool Abc_SopCheck( char * pSop, int nFanins );
00829 extern char * Abc_SopFromTruthBin( char * pTruth );
00830 extern char * Abc_SopFromTruthHex( char * pTruth );
00831 extern char * Abc_SopEncoderPos( Extra_MmFlex_t * pMan, int iValue, int nValues );
00832 extern char * Abc_SopEncoderLog( Extra_MmFlex_t * pMan, int iBit, int nValues );
00833 extern char * Abc_SopDecoderPos( Extra_MmFlex_t * pMan, int nValues );
00834 extern char * Abc_SopDecoderLog( Extra_MmFlex_t * pMan, int nValues );
00835
00836 extern Abc_Ntk_t * Abc_NtkStrash( Abc_Ntk_t * pNtk, int fAllNodes, int fCleanup, int fRecord );
00837 extern Abc_Obj_t * Abc_NodeStrash( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pNode, int fRecord );
00838 extern int Abc_NtkAppend( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int fAddPos );
00839 extern Abc_Ntk_t * Abc_NtkTopmost( Abc_Ntk_t * pNtk, int nLevels );
00840
00841 extern int Abc_NtkSweep( Abc_Ntk_t * pNtk, int fVerbose );
00842 extern int Abc_NtkCleanup( Abc_Ntk_t * pNtk, int fVerbose );
00843 extern int Abc_NtkCleanupSeq( Abc_Ntk_t * pNtk, int fLatchSweep, int fAutoSweep, int fVerbose );
00844
00845 extern Abc_Time_t * Abc_NodeReadArrival( Abc_Obj_t * pNode );
00846 extern Abc_Time_t * Abc_NodeReadRequired( Abc_Obj_t * pNode );
00847 extern Abc_Time_t * Abc_NtkReadDefaultArrival( Abc_Ntk_t * pNtk );
00848 extern Abc_Time_t * Abc_NtkReadDefaultRequired( Abc_Ntk_t * pNtk );
00849 extern void Abc_NtkTimeSetDefaultArrival( Abc_Ntk_t * pNtk, float Rise, float Fall );
00850 extern void Abc_NtkTimeSetDefaultRequired( Abc_Ntk_t * pNtk, float Rise, float Fall );
00851 extern void Abc_NtkTimeSetArrival( Abc_Ntk_t * pNtk, int ObjId, float Rise, float Fall );
00852 extern void Abc_NtkTimeSetRequired( Abc_Ntk_t * pNtk, int ObjId, float Rise, float Fall );
00853 extern void Abc_NtkTimeInitialize( Abc_Ntk_t * pNtk );
00854 extern void Abc_ManTimeStop( Abc_ManTime_t * p );
00855 extern void Abc_ManTimeDup( Abc_Ntk_t * pNtkOld, Abc_Ntk_t * pNtkNew );
00856 extern void Abc_NtkSetNodeLevelsArrival( Abc_Ntk_t * pNtk );
00857 extern float * Abc_NtkGetCiArrivalFloats( Abc_Ntk_t * pNtk );
00858 extern Abc_Time_t * Abc_NtkGetCiArrivalTimes( Abc_Ntk_t * pNtk );
00859 extern float Abc_NtkDelayTrace( Abc_Ntk_t * pNtk );
00860 extern int Abc_ObjLevelNew( Abc_Obj_t * pObj );
00861 extern int Abc_ObjReverseLevelNew( Abc_Obj_t * pObj );
00862 extern int Abc_ObjRequiredLevel( Abc_Obj_t * pObj );
00863 extern int Abc_ObjReverseLevel( Abc_Obj_t * pObj );
00864 extern void Abc_ObjSetReverseLevel( Abc_Obj_t * pObj, int LevelR );
00865 extern void Abc_NtkStartReverseLevels( Abc_Ntk_t * pNtk, int nMaxLevelIncrease );
00866 extern void Abc_NtkStopReverseLevels( Abc_Ntk_t * pNtk );
00867 extern void Abc_NtkUpdateLevel( Abc_Obj_t * pObjNew, Vec_Vec_t * vLevels );
00868 extern void Abc_NtkUpdateReverseLevel( Abc_Obj_t * pObjNew, Vec_Vec_t * vLevels );
00869 extern void Abc_NtkUpdate( Abc_Obj_t * pObj, Abc_Obj_t * pObjNew, Vec_Vec_t * vLevels );
00870
00871 extern void * Abc_NtkAttrFree( Abc_Ntk_t * pNtk, int Attr, int fFreeMan );
00872 extern void Abc_NtkIncrementTravId( Abc_Ntk_t * pNtk );
00873 extern void Abc_NtkOrderCisCos( Abc_Ntk_t * pNtk );
00874 extern int Abc_NtkGetCubeNum( Abc_Ntk_t * pNtk );
00875 extern int Abc_NtkGetCubePairNum( Abc_Ntk_t * pNtk );
00876 extern int Abc_NtkGetLitNum( Abc_Ntk_t * pNtk );
00877 extern int Abc_NtkGetLitFactNum( Abc_Ntk_t * pNtk );
00878 extern int Abc_NtkGetBddNodeNum( Abc_Ntk_t * pNtk );
00879 extern int Abc_NtkGetAigNodeNum( Abc_Ntk_t * pNtk );
00880 extern int Abc_NtkGetClauseNum( Abc_Ntk_t * pNtk );
00881 extern double Abc_NtkGetMappedArea( Abc_Ntk_t * pNtk );
00882 extern int Abc_NtkGetExorNum( Abc_Ntk_t * pNtk );
00883 extern int Abc_NtkGetMuxNum( Abc_Ntk_t * pNtk );
00884 extern int Abc_NtkGetChoiceNum( Abc_Ntk_t * pNtk );
00885 extern int Abc_NtkGetFaninMax( Abc_Ntk_t * pNtk );
00886 extern int Abc_NtkGetTotalFanins( Abc_Ntk_t * pNtk );
00887 extern void Abc_NtkCleanCopy( Abc_Ntk_t * pNtk );
00888 extern void Abc_NtkCleanData( Abc_Ntk_t * pNtk );
00889 extern void Abc_NtkCleanEquiv( Abc_Ntk_t * pNtk );
00890 extern int Abc_NtkCountCopy( Abc_Ntk_t * pNtk );
00891 extern Vec_Ptr_t * Abc_NtkSaveCopy( Abc_Ntk_t * pNtk );
00892 extern void Abc_NtkLoadCopy( Abc_Ntk_t * pNtk, Vec_Ptr_t * vCopies );
00893 extern void Abc_NtkCleanNext( Abc_Ntk_t * pNtk );
00894 extern void Abc_NtkCleanMarkA( Abc_Ntk_t * pNtk );
00895 extern Abc_Obj_t * Abc_NodeFindCoFanout( Abc_Obj_t * pNode );
00896 extern Abc_Obj_t * Abc_NodeFindNonCoFanout( Abc_Obj_t * pNode );
00897 extern Abc_Obj_t * Abc_NodeHasUniqueCoFanout( Abc_Obj_t * pNode );
00898 extern bool Abc_NtkLogicHasSimpleCos( Abc_Ntk_t * pNtk );
00899 extern int Abc_NtkLogicMakeSimpleCos( Abc_Ntk_t * pNtk, bool fDuplicate );
00900 extern void Abc_VecObjPushUniqueOrderByLevel( Vec_Ptr_t * p, Abc_Obj_t * pNode );
00901 extern bool Abc_NodeIsExorType( Abc_Obj_t * pNode );
00902 extern bool Abc_NodeIsMuxType( Abc_Obj_t * pNode );
00903 extern bool Abc_NodeIsMuxControlType( Abc_Obj_t * pNode );
00904 extern Abc_Obj_t * Abc_NodeRecognizeMux( Abc_Obj_t * pNode, Abc_Obj_t ** ppNodeT, Abc_Obj_t ** ppNodeE );
00905 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 );
00906 extern void Abc_NodeCollectFanins( Abc_Obj_t * pNode, Vec_Ptr_t * vNodes );
00907 extern void Abc_NodeCollectFanouts( Abc_Obj_t * pNode, Vec_Ptr_t * vNodes );
00908 extern Vec_Ptr_t * Abc_NtkCollectLatches( Abc_Ntk_t * pNtk );
00909 extern int Abc_NodeCompareLevelsIncrease( Abc_Obj_t ** pp1, Abc_Obj_t ** pp2 );
00910 extern int Abc_NodeCompareLevelsDecrease( Abc_Obj_t ** pp1, Abc_Obj_t ** pp2 );
00911 extern Vec_Int_t * Abc_NtkFanoutCounts( Abc_Ntk_t * pNtk );
00912 extern Vec_Ptr_t * Abc_NtkCollectObjects( Abc_Ntk_t * pNtk );
00913 extern Vec_Int_t * Abc_NtkGetCiIds( Abc_Ntk_t * pNtk );
00914 extern void Abc_NtkReassignIds( Abc_Ntk_t * pNtk );
00915 extern int Abc_ObjPointerCompare( void ** pp1, void ** pp2 );
00916 extern void Abc_NtkTransferCopy( Abc_Ntk_t * pNtk );
00917
00918 extern int * Abc_NtkVerifyGetCleanModel( Abc_Ntk_t * pNtk, int nFrames );
00919 extern int * Abc_NtkVerifySimulatePattern( Abc_Ntk_t * pNtk, int * pModel );
00920
00921 #ifdef __cplusplus
00922 }
00923 #endif
00924
00925 #endif
00926