52 Vec_Ptr_t * vFront, * vLeaves, * vCone, * vSol;
54 int i, RetValue, LevelR, nNodesOld;
55 int CountUsed, CountUndo;
62 CountUsed = CountUndo = 0;
63 nNodesOld = Ivy_ManObjIdNext(p);
74 if ( pObj->
Id == 297 )
93 pResult =
Ivy_NodeRewriteAlg( pObj, vFront, vLeaves, vCone, vSol, LevelR, fUseZeroCost );
94 if ( pResult == NULL || pResult == pObj )
102 printf(
"Used = %d. Undo = %d.\n", CountUsed, CountUndo );
108 printf(
"Cleanup after rewriting removed %d dangling nodes.\n", i );
110 printf(
"Ivy_ManRewriteAlg(): The check has failed.\n" );
129 int k,
Counter, nMffc, RetValue;
172 printf(
"%5d : Leaves = %2d. Cone = %2d. ConeRef = %2d. Mffc = %d. Lev = %d. LevR = %d.\n",
281 int RetValue0, RetValue1;
317 if ( RetValue0 == -1 || RetValue1 == -1 )
321 if ( RetValue0 && RetValue1 )
365 if ( RetValue == -1 )
static int Ivy_IsComplement(Ivy_Obj_t *p)
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
void Ivy_ObjReplace(Ivy_Man_t *p, Ivy_Obj_t *pObjOld, Ivy_Obj_t *pObjNew, int fDeleteOld, int fFreeTop, int fUpdateLevel)
int Ivy_ManFindAlgCutCompare(Ivy_Obj_t **pp1, Ivy_Obj_t **pp2)
#define Vec_PtrForEachEntryStart(Type, vVec, pEntry, i, Start)
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
int Ivy_ObjIsMuxType(Ivy_Obj_t *pObj)
static Ivy_Obj_t * Ivy_NodeRewriteAlg(Ivy_Obj_t *pObj, Vec_Ptr_t *vFront, Vec_Ptr_t *vLeaves, Vec_Ptr_t *vCone, Vec_Ptr_t *vSols, int LevelR, int fUseZeroCost)
static Ivy_Obj_t * Ivy_ManConst0(Ivy_Man_t *p)
static int Ivy_NodeCountMffc(Ivy_Obj_t *pNode)
int Ivy_ManRewriteAlg(Ivy_Man_t *p, int fUpdateLevel, int fUseZeroCost)
FUNCTION DEFINITIONS ///.
static void Vec_PtrSort(Vec_Ptr_t *p, int(*Vec_PtrSortCompare)()) ___unused
int Ivy_NodeCountMffc_rec(Ivy_Obj_t *pNode)
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
static ABC_NAMESPACE_IMPL_START int Ivy_ManFindAlgCut(Ivy_Obj_t *pRoot, Vec_Ptr_t *vFront, Vec_Ptr_t *vLeaves, Vec_Ptr_t *vCone)
DECLARATIONS ///.
static void Ivy_ObjRefsInc(Ivy_Obj_t *pObj)
static int Vec_PtrSize(Vec_Ptr_t *p)
static void * Vec_PtrPop(Vec_Ptr_t *p)
static Ivy_Obj_t * Ivy_ObjFanin1(Ivy_Obj_t *pObj)
static int Ivy_ObjLevel(Ivy_Obj_t *pObj)
static Ivy_Obj_t * Ivy_ObjFanin0(Ivy_Obj_t *pObj)
Ivy_Obj_t * Ivy_ObjReal(Ivy_Obj_t *pObj)
int Ivy_MultiPlus(Ivy_Man_t *p, Vec_Ptr_t *vLeaves, Vec_Ptr_t *vCone, Ivy_Type_t Type, int nLimit, Vec_Ptr_t *vSol)
FUNCTION DEFINITIONS ///.
static void * Vec_PtrEntryLast(Vec_Ptr_t *p)
static int Vec_IntEntry(Vec_Int_t *p, int i)
static int Ivy_ObjRefs(Ivy_Obj_t *pObj)
static void Ivy_ObjRefsDec(Ivy_Obj_t *pObj)
#define ABC_NAMESPACE_IMPL_END
static Ivy_Obj_t * Ivy_Regular(Ivy_Obj_t *p)
static Ivy_Type_t Ivy_ObjType(Ivy_Obj_t *pObj)
int Ivy_ManFindAlgCut_rec(Ivy_Obj_t *pObj, Ivy_Type_t Type, Vec_Ptr_t *vFront, Vec_Ptr_t *vCone)
static int Ivy_ObjIsNode(Ivy_Obj_t *pObj)
static Ivy_Obj_t * Ivy_ObjChild0(Ivy_Obj_t *pObj)
Ivy_Obj_t * Ivy_NodeBalanceBuildSuper(Ivy_Man_t *p, Vec_Ptr_t *vSuper, Ivy_Type_t Type, int fUpdateLevel)
Vec_Int_t * Ivy_ManRequiredLevels(Ivy_Man_t *p)
typedefABC_NAMESPACE_HEADER_START struct Ivy_Man_t_ Ivy_Man_t
INCLUDES ///.
#define ABC_NAMESPACE_IMPL_START
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
void Ivy_ObjDelete_rec(Ivy_Man_t *p, Ivy_Obj_t *pObj, int fFreeTop)
static int Ivy_ObjIsAnd(Ivy_Obj_t *pObj)
static int Ivy_ObjIsExor(Ivy_Obj_t *pObj)
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
static Ivy_Obj_t * Ivy_Not(Ivy_Obj_t *p)
static int Ivy_ObjIsBuf(Ivy_Obj_t *pObj)
static Ivy_Obj_t * Ivy_ObjChild1(Ivy_Obj_t *pObj)
static void Vec_PtrClear(Vec_Ptr_t *p)
static int Ivy_ObjIsCi(Ivy_Obj_t *pObj)
#define Ivy_ManForEachObj(p, pObj, i)
static void Vec_IntFree(Vec_Int_t *p)
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
int Ivy_ManCheck(Ivy_Man_t *p)
DECLARATIONS ///.
int Ivy_ManCleanup(Ivy_Man_t *p)
static void Vec_PtrFree(Vec_Ptr_t *p)
void Ivy_ManCollectCone(Ivy_Obj_t *pObj, Vec_Ptr_t *vFront, Vec_Ptr_t *vCone)