74 #define Abc_AigBinForEachEntry( pBin, pEnt ) \
78 #define Abc_AigBinForEachEntrySafe( pBin, pEnt, pEnt2 ) \
80 pEnt2 = pEnt? pEnt->pNext: NULL; \
83 pEnt2 = pEnt? pEnt->pNext: NULL )
97 return Key % TableSize;
204 for ( i = 0; i < pMan->
nBins; i++ )
237 printf(
"Abc_AigCheck: The AIG has non-standard constant nodes.\n" );
244 printf(
"Abc_AigCheck: The AIG has single input nodes.\n" );
249 printf(
"Abc_AigCheck: The AIG has non-standard nodes.\n" );
253 printf(
"Abc_AigCheck: Node \"%s\" has level that does not agree with the fanin levels.\n",
Abc_ObjName(pObj) );
256 printf(
"Abc_AigCheck: Node \"%s\" is not in the structural hashing table.\n",
Abc_ObjName(pObj) );
260 for ( i = 0; i < pMan->
nBins; i++ )
265 printf(
"Abc_AigCheck: The number of nodes in the structural hashing table is wrong.\n" );
274 printf(
"Abc_AigCheck: Representative %s",
Abc_ObjName(pAnd) );
328 pAnd = p0, p0 = p1, p1 = pAnd;
340 pMan->
pBins[Key] = pAnd;
370 pTemp = p0, p0 = p1, p1 = pTemp;
380 pMan->
pBins[Key] = pAnd;
444 if ( nFans0 == 0 || nFans1 == 0 )
450 pAnd = p0, p0 = p1, p1 = pAnd;
478 if ( pType ) *pType = 0;
484 if ( pNode && pType ) *pType = 1;
512 if ( pType ) *pType = 0;
518 if ( pNode && pType ) *pType = 1;
544 Abc_Obj_t * pAnd, * pAnd0, * pAnd1, ** ppPlace;
555 ppPlace = pMan->
pBins + Key;
560 ppPlace = &pAnd->
pNext;
563 *ppPlace = pAnd->
pNext;
600 for ( i = 0; i < pMan->
nBins; i++ )
604 pEnt->
pNext = pBinsNew[Key];
605 pBinsNew[Key] = pEnt;
613 pMan->
pBins = pBinsNew;
614 pMan->
nBins = nBinsNew;
641 for ( i = 0; i < pMan->
nBins; i++ )
646 if ( pArray[0] > pArray[1] )
649 pArray[0] = pArray[1];
657 pEnt->
pNext = pBinsNew[Key];
658 pBinsNew[Key] = pEnt;
664 pMan->
pBins = pBinsNew;
792 if ( vPairs->nSize == 0 )
794 assert( vPairs->nSize % 2 == 0 );
798 for ( i = 0; i < vPairs->nSize; i += 2 )
803 for ( i = 0; i < vPairs->nSize; i += 2 )
806 vPairs->nSize = vPairs->nSize/2;
825 assert( vPairs->nSize % 2 == 0 );
828 for ( i = 0; i < vPairs->nSize; i += 2 )
831 pMiter =
Abc_AigOr( pMan, pMiter, pXor );
885 Abc_Obj_t * pFanin1, * pFanin2, * pFanout, * pFanoutNew, * pFanoutFanout;
902 assert( iFanin == 0 || iFanin == 1 );
985 if ( pNode == pTemp )
1050 int LevelNew, i, k, v;
1059 if ( pNode == NULL )
1074 if ( (
int)pFanout->
Level == LevelNew )
1080 pFanout->
Level = LevelNew;
1106 int LevelNew, i, k, v, j;
1115 if ( pNode == NULL )
1171 if ( pTemp != pNode )
1200 if ( pTemp != pNode )
1322 if ( pRoot == pFanin0 || pRoot == pFanin1 )
1333 if ( pRoot == pChild00 || pRoot == pChild01 )
1345 if ( pRoot == pChild10 || pRoot == pChild11 )
1366 for ( i = 0; i < pMan->
nBins; i++ )
1373 printf(
"Node %d has incorrect ordering of fanins.\n", pEnt->
Id );
1481 int i,
Counter = 0, CounterTotal = 0;
1483 for ( i = 0; i < pMan->
nBins; i++ )
1486 Counter += (pAnd->
pNext != NULL);
1489 printf(
"Counter = %d. Nodes = %d. Ave = %6.2f\n", Counter, CounterTotal, 1.0 * CounterTotal/pMan->
nBins );
1500 printf(
"Hello, World!\n" );
#define Vec_VecForEachLevel(vGlob, vVec, i)
MACRO DEFINITIONS ///.
Abc_Obj_t * Abc_AigOr(Abc_Aig_t *pMan, Abc_Obj_t *p0, Abc_Obj_t *p1)
void Abc_AigUpdateStop(Abc_Aig_t *pMan)
int nObjCounts[ABC_OBJ_NUMBER]
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
static void Abc_AigResize(Abc_Aig_t *pMan)
Abc_Obj_t * Abc_AigAnd(Abc_Aig_t *pMan, Abc_Obj_t *p0, Abc_Obj_t *p1)
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
static int Abc_PrimeCudd(unsigned int p)
static Abc_Obj_t * Abc_ObjFanin1(Abc_Obj_t *pObj)
static void Vec_VecPush(Vec_Vec_t *p, int Level, void *Entry)
void Abc_AigFree(Abc_Aig_t *pMan)
static Vec_Vec_t * Vec_VecAlloc(int nCap)
FUNCTION DEFINITIONS ///.
static int Abc_ObjIsCi(Abc_Obj_t *pObj)
typedefABC_NAMESPACE_HEADER_START struct Vec_Vec_t_ Vec_Vec_t
INCLUDES ///.
static int Abc_ObjFaninC1(Abc_Obj_t *pObj)
static int Vec_PtrPushUnique(Vec_Ptr_t *p, void *Entry)
Vec_Ptr_t * vStackReplaceOld
void Abc_AigDeleteNode(Abc_Aig_t *pMan, Abc_Obj_t *pNode)
int Abc_AigNodeIsAcyclic(Abc_Obj_t *pNode, Abc_Obj_t *pRoot)
static int Abc_ObjFanoutNum(Abc_Obj_t *pObj)
#define Abc_NtkForEachLatchOutput(pNtk, pObj, i)
int Abc_AigCountNext(Abc_Aig_t *pMan)
Abc_Obj_t * Abc_AigAndLookup(Abc_Aig_t *pMan, Abc_Obj_t *p0, Abc_Obj_t *p1)
void Abc_AigSetNodePhases(Abc_Ntk_t *pNtk)
static int Abc_ObjFaninNum(Abc_Obj_t *pObj)
Abc_Obj_t * Abc_AigMiter(Abc_Aig_t *pMan, Vec_Ptr_t *vPairs, int fImplic)
static int Abc_ObjFaninC0(Abc_Obj_t *pObj)
static int Vec_IntFind(Vec_Int_t *p, int Entry)
static int Abc_AigNodeIsConst(Abc_Obj_t *pNode)
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
#define ABC_ALLOC(type, num)
static void Abc_AigUpdateLevel_int(Abc_Aig_t *pMan)
#define Abc_NtkForEachCo(pNtk, pCo, i)
int Abc_AigCheck(Abc_Aig_t *pMan)
Vec_Ptr_t * Abc_AigUpdateStart(Abc_Aig_t *pMan, Vec_Ptr_t **pvUpdatedNets)
static abctime Abc_Clock()
ABC_DLL Abc_Obj_t * Abc_NtkCreateObj(Abc_Ntk_t *pNtk, Abc_ObjType_t Type)
static int Abc_MaxInt(int a, int b)
static int Vec_PtrSize(Vec_Ptr_t *p)
static void Vec_VecFree(Vec_Vec_t *p)
static void * Vec_PtrPop(Vec_Ptr_t *p)
static Abc_Obj_t * Abc_ObjFanin0(Abc_Obj_t *pObj)
Vec_Ptr_t * vStackReplaceNew
static void Abc_AigAndDelete(Abc_Aig_t *pMan, Abc_Obj_t *pThis)
static int Abc_ObjIsCo(Abc_Obj_t *pObj)
#define Abc_AigBinForEachEntrySafe(pBin, pEnt, pEnt2)
void Abc_AigCheckFaninOrder(Abc_Aig_t *pMan)
ABC_DLL void Abc_ObjAddFanin(Abc_Obj_t *pObj, Abc_Obj_t *pFanin)
static Abc_Obj_t * Abc_AigAndCreateFrom(Abc_Aig_t *pMan, Abc_Obj_t *p0, Abc_Obj_t *p1, Abc_Obj_t *pAnd)
#define Abc_AigForEachAnd(pNtk, pNode, i)
Abc_Obj_t * Abc_AigMiter2(Abc_Aig_t *pMan, Vec_Ptr_t *vPairs)
static Abc_Obj_t * Abc_ObjChild0(Abc_Obj_t *pObj)
ABC_DLL void Abc_ObjPatchFanin(Abc_Obj_t *pObj, Abc_Obj_t *pFaninOld, Abc_Obj_t *pFaninNew)
Abc_Obj_t * Abc_AigMuxLookup(Abc_Aig_t *pMan, Abc_Obj_t *pC, Abc_Obj_t *pT, Abc_Obj_t *pE, int *pType)
static int Abc_ObjIsNode(Abc_Obj_t *pObj)
static int Abc_NtkNodeNum(Abc_Ntk_t *pNtk)
Abc_Obj_t * Abc_AigMux(Abc_Aig_t *pMan, Abc_Obj_t *pC, Abc_Obj_t *p1, Abc_Obj_t *p0)
ABC_DLL void Abc_NtkDeleteObj(Abc_Obj_t *pObj)
ABC_DLL void Abc_NodeFreeCuts(void *p, Abc_Obj_t *pObj)
void Abc_NtkHelloWorld(Abc_Ntk_t *pNtk)
END OF FILE ///.
void Abc_AigUpdateReset(Abc_Aig_t *pMan)
Abc_Obj_t * Abc_AigConst1(Abc_Ntk_t *pNtk)
#define Abc_AigBinForEachEntry(pBin, pEnt)
void Abc_AigPrintNode(Abc_Obj_t *pNode)
#define ABC_NAMESPACE_IMPL_END
Abc_Obj_t * Abc_AigXorLookup(Abc_Aig_t *pMan, Abc_Obj_t *p0, Abc_Obj_t *p1, int *pType)
static int Abc_AigNodeIsAnd(Abc_Obj_t *pNode)
int Abc_AigCleanup(Abc_Aig_t *pMan)
static int Abc_LatchIsInit1(Abc_Obj_t *pLatch)
static void Vec_PtrWriteEntry(Vec_Ptr_t *p, int i, void *Entry)
ABC_DLL void Abc_ObjRemoveFanins(Abc_Obj_t *pObj)
int Abc_AigNodeHasComplFanoutEdgeTrav(Abc_Obj_t *pNode)
#define Abc_NtkForEachNode(pNtk, pNode, i)
static void Abc_AigRemoveFromLevelStructure(Vec_Vec_t *vStruct, Abc_Obj_t *pNode)
#define ABC_NAMESPACE_IMPL_START
static int Abc_NodeIsTravIdCurrent(Abc_Obj_t *p)
static int Abc_AigNodeIsChoice(Abc_Obj_t *pNode)
static int Abc_ObjFaninC(Abc_Obj_t *pObj, int i)
static Abc_Obj_t * Abc_ObjChild(Abc_Obj_t *pObj, int i)
static Abc_Obj_t * Abc_ObjRegular(Abc_Obj_t *p)
#define Abc_ObjForEachFanout(pObj, pFanout, i)
void Abc_AigReplace(Abc_Aig_t *pMan, Abc_Obj_t *pOld, Abc_Obj_t *pNew, int fUpdateLevel)
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
ABC_DLL int Abc_ObjReverseLevel(Abc_Obj_t *pObj)
static Abc_Obj_t * Abc_AigAndCreate(Abc_Aig_t *pMan, Abc_Obj_t *p0, Abc_Obj_t *p1)
#define Abc_ObjForEachFanin(pObj, pFanin, i)
static void Abc_AigRemoveFromLevelStructureR(Vec_Vec_t *vStruct, Abc_Obj_t *pNode)
ABC_DLL char * Abc_ObjName(Abc_Obj_t *pNode)
DECLARATIONS ///.
void Abc_AigRehash(Abc_Aig_t *pMan)
ABC_DLL void Abc_ObjSetReverseLevel(Abc_Obj_t *pObj, int LevelR)
#define Abc_NtkForEachLatchInput(pNtk, pObj, i)
static Abc_Obj_t * Abc_NtkCreateNode(Abc_Ntk_t *pNtk)
Abc_Aig_t * Abc_AigAlloc(Abc_Ntk_t *pNtkAig)
FUNCTION DEFINITIONS ///.
ABC_DLL int Abc_NtkIsDfsOrdered(Abc_Ntk_t *pNtk)
static Abc_Obj_t * Abc_ObjNotCond(Abc_Obj_t *p, int c)
static void Vec_PtrClear(Vec_Ptr_t *p)
static void Abc_AigUpdateLevelR_int(Abc_Aig_t *pMan)
static Abc_Obj_t * Abc_ObjNot(Abc_Obj_t *p)
int Abc_AigNodeHasComplFanoutEdge(Abc_Obj_t *pNode)
static Vec_Ptr_t * Vec_VecEntry(Vec_Vec_t *p, int i)
Abc_Obj_t * Abc_AigMiter_rec(Abc_Aig_t *pMan, Abc_Obj_t **ppObjs, int nObjs)
#define Abc_NtkForEachPo(pNtk, pPo, i)
ABC_DLL void Abc_NodeCollectFanouts(Abc_Obj_t *pNode, Vec_Ptr_t *vNodes)
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
static unsigned Abc_HashKey2(Abc_Obj_t *p0, Abc_Obj_t *p1, int TableSize)
static int Abc_ObjIsComplement(Abc_Obj_t *p)
int Abc_AigLevel(Abc_Ntk_t *pNtk)
ABC_DLL int Abc_NtkLevel(Abc_Ntk_t *pNtk)
static Abc_Obj_t * Abc_ObjChild1(Abc_Obj_t *pObj)
Abc_Obj_t * Abc_AigXor(Abc_Aig_t *pMan, Abc_Obj_t *p0, Abc_Obj_t *p1)
ABC_DLL int Abc_NodeIsExorType(Abc_Obj_t *pNode)
static void Abc_AigReplace_int(Abc_Aig_t *pMan, Abc_Obj_t *pOld, Abc_Obj_t *pNew, int fUpdateLevel)
#define Abc_NtkForEachPi(pNtk, pPi, i)
static void Vec_PtrFree(Vec_Ptr_t *p)