83 printf(
"Abc_NtkBalance: The network check has failed.\n" );
131 if ( i < pNtk->nBarBufs )
165 for ( Current--; Current >= 0; Current-- )
198 assert( LeftBound <= RightBound );
199 if ( LeftBound == RightBound )
205 for ( i = RightBound; i >= LeftBound; i-- )
210 if ( pNode3 == pNode2 )
244 Abc_Obj_t * pNodeNew, * pNode1, * pNode2;
249 if ( pNodeOld->
pCopy )
250 return pNodeOld->
pCopy;
255 if ( vSuper->nSize == 0 )
258 return pNodeOld->
pCopy;
261 for ( i = 0; i < vSuper->nSize; i++ )
266 if ( vSuper->nSize < 2 )
271 assert( vSuper->nSize > 1 );
272 while ( vSuper->nSize > 1 )
291 return pNodeOld->
pCopy;
320 assert( vNodes->nSize > 1 );
322 for ( i = 0; i < vNodes->nSize; i++ )
326 if ( RetValue == -1 )
347 int RetValue1, RetValue2, i;
352 for ( i = 0; i < vSuper->nSize; i++ )
353 if ( vSuper->pArray[i] == pNode )
356 for ( i = 0; i < vSuper->nSize; i++ )
374 if ( RetValue1 == -1 || RetValue2 == -1 )
377 return RetValue1 || RetValue2;
394 int RetValue1, RetValue2, i;
396 for ( i = 0; i < vSuper->nSize; i++ )
397 if ( vSuper->pArray[i] == pNode )
411 if ( RetValue1 == -1 || RetValue2 == -1 )
414 return RetValue1 || RetValue2;
475 assert( vNodes->nSize > 1 );
481 if ( RetValue == -1 )
560 if ( pNode->
Level > 0 )
571 if ( LevelMax < (
int)pFanin->
Level )
572 LevelMax = pFanin->
Level;
574 pNode->
Level = LevelMax + 1;
618 pNode->
fMarkA = 1, Counter++;
619 printf(
"The number of nodes on the critical paths = %6d (%5.2f %%)\n", Counter, 100.0 * Counter /
Abc_NtkNodeNum(pNtk) );
int Abc_NodeBalanceConeExor_rec(Abc_Obj_t *pNode, Vec_Ptr_t *vSuper, int fFirst)
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
void Abc_NtkBalanceAttach(Abc_Ntk_t *pNtk)
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
static Abc_Obj_t * Abc_ObjFanin1(Abc_Obj_t *pObj)
static void Vec_VecPush(Vec_Vec_t *p, int Level, void *Entry)
ABC_DLL Abc_Obj_t * Abc_AigAndLookup(Abc_Aig_t *pMan, Abc_Obj_t *p0, Abc_Obj_t *p1)
static int Abc_ObjIsCi(Abc_Obj_t *pObj)
typedefABC_NAMESPACE_HEADER_START struct Vec_Vec_t_ Vec_Vec_t
INCLUDES ///.
ABC_DLL Abc_Obj_t * Abc_AigConst1(Abc_Ntk_t *pNtk)
static int Vec_PtrPushUnique(Vec_Ptr_t *p, void *Entry)
static int Abc_ObjFanoutNum(Abc_Obj_t *pObj)
static Vec_Ptr_t * Abc_NodeBalanceConeExor(Abc_Obj_t *pNode)
void Abc_NtkBalanceLevel(Abc_Ntk_t *pNtk)
static void Vec_PtrSort(Vec_Ptr_t *p, int(*Vec_PtrSortCompare)()) ___unused
ABC_DLL Abc_Ntk_t * Abc_NtkDup(Abc_Ntk_t *pNtk)
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
#define Abc_NtkForEachCo(pNtk, pCo, i)
ABC_DLL int Abc_NtkCheck(Abc_Ntk_t *pNtk)
FUNCTION DEFINITIONS ///.
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)
static int Abc_NtkCoNum(Abc_Ntk_t *pNtk)
static Abc_Obj_t * Abc_NodeBalance_rec(Abc_Ntk_t *pNtkNew, Abc_Obj_t *pNode, Vec_Vec_t *vStorage, int Level, int fDuplicate, int fSelective, int fUpdateLevel)
static ABC_NAMESPACE_IMPL_START void Abc_NtkBalancePerform(Abc_Ntk_t *pNtk, Abc_Ntk_t *pNtkAig, int fDuplicate, int fSelective, int fUpdateLevel)
DECLARATIONS ///.
ABC_DLL void Abc_NtkStopReverseLevels(Abc_Ntk_t *pNtk)
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
static Abc_Obj_t * Abc_ObjChild0(Abc_Obj_t *pObj)
static int Abc_ObjIsNode(Abc_Obj_t *pObj)
Vec_Ptr_t * Abc_NodeFindCone_rec(Abc_Obj_t *pNode)
static int Abc_NtkNodeNum(Abc_Ntk_t *pNtk)
int Abc_NodeBalanceFindLeft(Vec_Ptr_t *vSuper)
ABC_DLL void Abc_NtkCleanMarkA(Abc_Ntk_t *pNtk)
ABC_DLL Abc_Obj_t * Abc_AigAnd(Abc_Aig_t *pMan, Abc_Obj_t *p0, Abc_Obj_t *p1)
ABC_DLL Abc_Ntk_t * Abc_NtkStartFrom(Abc_Ntk_t *pNtk, Abc_NtkType_t Type, Abc_NtkFunc_t Func)
ABC_DLL int Abc_NodeIsMuxType(Abc_Obj_t *pNode)
ABC_DLL int Abc_ObjRequiredLevel(Abc_Obj_t *pObj)
ABC_DLL int Abc_AigCleanup(Abc_Aig_t *pMan)
static void Abc_NtkMarkCriticalNodes(Abc_Ntk_t *pNtk)
#define ABC_NAMESPACE_IMPL_END
ABC_DLL void Abc_NtkFinalize(Abc_Ntk_t *pNtk, Abc_Ntk_t *pNtkNew)
ABC_DLL void Abc_VecObjPushUniqueOrderByLevel(Vec_Ptr_t *p, Abc_Obj_t *pNode)
static Vec_Vec_t * Vec_VecStart(int nSize)
ABC_DLL void Abc_NtkStartReverseLevels(Abc_Ntk_t *pNtk, int nMaxLevelIncrease)
static int Abc_NodeBalanceCone_rec(Abc_Obj_t *pNode, Vec_Ptr_t *vSuper, int fFirst, int fDuplicate, int fSelective)
static void Vec_PtrWriteEntry(Vec_Ptr_t *p, int i, void *Entry)
static Vec_Ptr_t * Abc_NodeBalanceCone(Abc_Obj_t *pNode, Vec_Vec_t *vSuper, int Level, int fDuplicate, int fSelective)
Abc_Ntk_t * Abc_NtkBalance(Abc_Ntk_t *pNtk, int fDuplicate, int fSelective, int fUpdateLevel)
FUNCTION DEFINITIONS ///.
#define Abc_NtkForEachNode(pNtk, pNode, i)
#define ABC_NAMESPACE_IMPL_START
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
#define Abc_NtkForEachLiPo(pNtk, pCo, i)
static Abc_Obj_t * Abc_ObjRegular(Abc_Obj_t *p)
#define Abc_NtkForEachCi(pNtk, pCi, i)
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
ABC_DLL int Abc_NodeCompareLevelsDecrease(Abc_Obj_t **pp1, Abc_Obj_t **pp2)
static int Vec_VecSize(Vec_Vec_t *p)
ABC_DLL void Abc_NtkSetNodeLevelsArrival(Abc_Ntk_t *pNtk)
ABC_DLL void Abc_NtkCleanCopy(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 Abc_Obj_t * Abc_ObjNot(Abc_Obj_t *p)
void Abc_NtkBalanceDetach(Abc_Ntk_t *pNtk)
static Vec_Ptr_t * Vec_VecEntry(Vec_Vec_t *p, int i)
void Abc_NodeBalancePermute(Abc_Ntk_t *pNtkNew, Vec_Ptr_t *vSuper, int LeftBound)
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
static int Abc_ObjIsComplement(Abc_Obj_t *p)
#define Abc_NtkForEachObj(pNtk, pObj, i)
ITERATORS ///.
static Abc_Obj_t * Abc_ObjChild1(Abc_Obj_t *pObj)
int Abc_NtkBalanceLevel_rec(Abc_Obj_t *pNode)
ABC_DLL Abc_Obj_t * Abc_NodeRecognizeMux(Abc_Obj_t *pNode, Abc_Obj_t **ppNodeT, Abc_Obj_t **ppNodeE)
static Abc_Obj_t * Abc_ObjFanout0(Abc_Obj_t *pObj)
static void Vec_PtrFree(Vec_Ptr_t *p)