79 printf(
"Hop_ManBalance(): The check has failed.\n" );
101 if ( pObjOld->
pData )
107 if ( vSuper->nSize == 0 )
138 int RetValue1, RetValue2, i;
143 for ( i = 0; i < vSuper->nSize; i++ )
144 if ( vSuper->pArray[i] == pObj )
147 for ( i = 0; i < vSuper->nSize; i++ )
148 if ( vSuper->pArray[i] ==
Hop_Not(pObj) )
165 if ( RetValue1 == -1 || RetValue2 == -1 )
168 return RetValue1 || RetValue2;
195 assert( vNodes->nSize > 1 );
201 if ( RetValue == -1 )
247 assert( vSuper->nSize > 1 );
251 while ( vSuper->nSize > 1 )
291 for ( Current--; Current >= 0; Current-- )
320 Hop_Obj_t * pObj1, * pObj2, * pObj3, * pGhost;
324 assert( LeftBound <= RightBound );
325 if ( LeftBound == RightBound )
333 for ( i = RightBound; i >= LeftBound; i-- )
345 if ( pObj3 == pObj2 )
383 for ( i = vStore->nSize-1; i > 0; i-- )
386 pObj2 = (
Hop_Obj_t *)vStore->pArray[i-1];
389 vStore->pArray[i ] = pObj2;
390 vStore->pArray[i-1] = pObj1;
int Hop_ManCheck(Hop_Man_t *p)
DECLARATIONS ///.
static Hop_Obj_t * Hop_ObjChild0(Hop_Obj_t *pObj)
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
static void Vec_VecPush(Vec_Vec_t *p, int Level, void *Entry)
static Vec_Vec_t * Vec_VecAlloc(int nCap)
FUNCTION DEFINITIONS ///.
static int Hop_ObjRefs(Hop_Obj_t *pObj)
typedefABC_NAMESPACE_HEADER_START struct Vec_Vec_t_ Vec_Vec_t
INCLUDES ///.
static Hop_Obj_t * Hop_ManConst1(Hop_Man_t *p)
static int Vec_PtrPushUnique(Vec_Ptr_t *p, void *Entry)
static void Hop_NodeBalancePermute(Hop_Man_t *p, Vec_Ptr_t *vSuper, int LeftBound, int fExor)
static ABC_NAMESPACE_IMPL_START Hop_Obj_t * Hop_NodeBalance_rec(Hop_Man_t *pNew, Hop_Obj_t *pObj, Vec_Vec_t *vStore, int Level, int fUpdateLevel)
DECLARATIONS ///.
static int Hop_ObjIsNode(Hop_Obj_t *pObj)
static Hop_Type_t Hop_ObjType(Hop_Obj_t *pObj)
#define Hop_ManForEachPi(p, pObj, i)
ITERATORS ///.
static int Hop_NodeBalanceFindLeft(Vec_Ptr_t *vSuper)
#define Hop_ManForEachPo(p, pObj, i)
static void Vec_PtrSort(Vec_Ptr_t *p, int(*Vec_PtrSortCompare)()) ___unused
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
int Hop_NodeBalanceCone_rec(Hop_Obj_t *pRoot, Hop_Obj_t *pObj, Vec_Ptr_t *vSuper)
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 Hop_Obj_t * Hop_Not(Hop_Obj_t *p)
Hop_Obj_t * Hop_Oper(Hop_Man_t *p, Hop_Obj_t *p0, Hop_Obj_t *p1, Hop_Type_t Type)
Hop_Man_t * Hop_ManBalance(Hop_Man_t *p, int fUpdateLevel)
FUNCTION DEFINITIONS ///.
Hop_Obj_t * Hop_NodeBalanceBuildSuper(Hop_Man_t *p, Vec_Ptr_t *vSuper, Hop_Type_t Type, int fUpdateLevel)
#define ABC_NAMESPACE_IMPL_END
static Hop_Obj_t * Hop_ObjChild1(Hop_Obj_t *pObj)
Hop_Man_t * Hop_ManStart()
DECLARATIONS ///.
static int Hop_IsComplement(Hop_Obj_t *p)
static Hop_Obj_t * Hop_ObjFanin0(Hop_Obj_t *pObj)
static void Vec_PtrWriteEntry(Vec_Ptr_t *p, int i, void *Entry)
#define ABC_NAMESPACE_IMPL_START
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
static int Hop_ObjLevel(Hop_Obj_t *pObj)
static Vec_Ptr_t * Hop_NodeBalanceCone(Hop_Obj_t *pObj, Vec_Vec_t *vStore, int Level)
static int Hop_ObjFaninC0(Hop_Obj_t *pObj)
static Hop_Obj_t * Hop_NotCond(Hop_Obj_t *p, int c)
void Hop_ManCleanData(Hop_Man_t *p)
static int Vec_VecSize(Vec_Vec_t *p)
static void Vec_PtrClear(Vec_Ptr_t *p)
static Hop_Obj_t * Hop_ManConst0(Hop_Man_t *p)
static Vec_Ptr_t * Vec_VecEntry(Vec_Vec_t *p, int i)
Hop_Obj_t * Hop_ObjCreatePo(Hop_Man_t *p, Hop_Obj_t *pDriver)
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
int Hop_NodeCompareLevelsDecrease(Hop_Obj_t **pp1, Hop_Obj_t **pp2)
static Hop_Obj_t * Hop_Regular(Hop_Obj_t *p)
static Hop_Obj_t * Hop_ObjCreateGhost(Hop_Man_t *p, Hop_Obj_t *p0, Hop_Obj_t *p1, Hop_Type_t Type)
Hop_Obj_t * Hop_ObjCreatePi(Hop_Man_t *p)
DECLARATIONS ///.
static void Hop_NodeBalancePushUniqueOrderByLevel(Vec_Ptr_t *vStore, Hop_Obj_t *pObj)
typedefABC_NAMESPACE_HEADER_START struct Hop_Man_t_ Hop_Man_t
INCLUDES ///.
Hop_Obj_t * Hop_TableLookup(Hop_Man_t *p, Hop_Obj_t *pGhost)
FUNCTION DEFINITIONS ///.