30 #define IVY_INFINITY 10000
216 printf(
"%s : Delay = %3d. Area = %6d. ", pStr, Delay, Area );
242 if ( DelayMax < pSupp->Delay )
243 DelayMax = pSupp->
Delay;
270 for ( i = 0; i < pSupp->
nSize; i++ )
353 for ( i = k = 1; i < nSize; i++ )
354 if ( pArray[i] != pArray[i-1] )
355 pArray[k++] = pArray[i];
372 static int Store[32], StoreSize;
373 static char Supp0[16], Supp1[16];
378 int RetValue, DelayOld;
391 assert( DelayOld <= pSupp->DelayR );
394 StoreSize = pSupp->
nSize;
424 pSupp->
nSize = StoreSize;
426 pSupp->
Delay = DelayOld;
443 static int Store[32], StoreSize;
444 static char Supp0[16], Supp1[16];
449 int RetValue, DelayOld, RefsOld;
450 int AreaBef, AreaAft;
463 if ( pSupp->
nRefs == 0 )
471 if ( pSupp->
nRefs != 0 )
476 assert( DelayOld <= pSupp->DelayR );
479 StoreSize = pSupp->
nSize;
513 pSupp->
nRefs = RefsOld;
515 if ( AreaAft > AreaBef || pSupp->
Delay > pSupp->
DelayR )
518 pSupp->
nSize = StoreSize;
520 pSupp->
Delay = DelayOld;
526 if ( pSupp->
nRefs != 0 )
575 if ( fFaninParam == 2 )
581 else if ( fFaninParam == 3 )
583 Ivy_Obj_t * pFanin0, * pFanin1, * pFaninA, * pFaninB;
622 else if ( fFaninParam == 4 )
624 Ivy_Obj_t * pFanin0, * pFanin1, * pFaninA, * pFaninB;
712 if ( pSupp0->
nSize == nLimit && pSupp1->
nSize == nLimit )
714 for ( i = 0; i < pSupp0->
nSize; i++ )
717 for ( i = 0; i < pSupp0->
nSize; i++ )
723 if ( pSupp0->
nSize == nLimit )
725 for ( i = 0; i < pSupp1->
nSize; i++ )
727 for ( k = pSupp0->
nSize - 1; k >= 0; k-- )
733 for ( i = 0; i < pSupp0->
nSize; i++ )
741 for ( c = 0; c < nLimit; c++ )
743 if ( k == pSupp1->
nSize )
745 if ( i == pSupp0->
nSize )
753 if ( i == pSupp0->
nSize )
755 if ( k == pSupp1->
nSize )
776 if ( i < pSupp0->nSize || k < pSupp1->nSize )
798 vLeaves->nSize = pSupp->
nSize;
799 vLeaves->pArray = pSupp->
pArray;
871 for ( c = 0; c < pSupp->
nSize; c++ )
948 for ( c = 0; c < pSupp->
nSize; c++ )
978 for ( i = 0; i < pSupp->
nSize; i++ )
983 if ( pSuppF->
nRefs++ > 0 )
985 if ( pSuppF->
nSize == 1 )
1013 for ( i = 0; i < pSupp->
nSize; i++ )
1018 if ( --pSuppF->
nRefs > 0 )
1020 if ( pSuppF->
nSize == 1 )
1041 int aResult, aResult2;
1049 assert( aResult == aResult2 );
1067 int aResult, aResult2;
1075 assert( aResult == aResult2 );
1101 if ( pSuppF->
nRefs == 0 )
1167 if ( pSuppF->
nRefs == 0 )
1358 for ( i = 0; i < pSupp->
nSize; i++ )
1410 int CostBef, CostAft;
1411 int AreaBef, AreaAft;
1415 if ( pSupp->
nRefs == 0 )
1423 if ( pSupp->
nRefs == 0 )
1425 pSupp->
nRefs = 1000000;
1434 assert( CostBef >= CostAft );
1439 if ( AreaAft > AreaBef )
1443 assert( AreaAft == AreaBef );
1445 if ( pSupp->
nRefs == 1000000 )
1466 int CostBef, CostAft;
1467 int AreaBef, AreaAft;
1472 if ( pSupp->
nRefs == 0 )
1486 assert( CostBef >= CostAft );
1492 if ( AreaAft > AreaBef || pSupp->
Delay > pSupp->
DelayR )
1496 assert( AreaAft == AreaBef );
1497 pSupp->
Delay = DelayOld;
1515 int CostBef, CostAft;
1516 int AreaBef, AreaAft;
1525 if ( pSupp->
nRefs == 0 )
1532 if ( pSupp->
nRefs == 0 )
1534 pSupp->
nRefs = 1000000;
1543 assert( CostBef >= CostAft );
1549 if ( AreaAft > AreaBef || pSupp->
Delay > pSupp->
DelayR )
1553 assert( AreaAft == AreaBef );
1554 pSupp->
Delay = DelayOld;
1556 if ( pSupp->
nRefs == 1000000 )
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
static int Ivy_ObjIsNodeInt1(Ivy_Obj_t *pObj)
static void Vec_VecPush(Vec_Vec_t *p, int Level, void *Entry)
static Vec_Vec_t * Vec_VecAlloc(int nCap)
FUNCTION DEFINITIONS ///.
static Ivy_Obj_t * Ivy_ManConst1(Ivy_Man_t *p)
void Ivy_FastMapNodeFaninCompact(Ivy_Man_t *pAig, Ivy_Obj_t *pObj, int nLimit, Vec_Ptr_t *vFront)
static int Ivy_FastMapNodeAreaRefed(Ivy_Man_t *pAig, Ivy_Obj_t *pObj)
typedefABC_NAMESPACE_HEADER_START struct Vec_Vec_t_ Vec_Vec_t
INCLUDES ///.
int Ivy_FastMapNodeFaninCost(Ivy_Man_t *pAig, Ivy_Obj_t *pObj)
static int Vec_IntRemoveDup(int *pArray, int nSize)
#define IVY_INFINITY
DECLARATIONS ///.
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
#define Ivy_ManForEachPi(p, pObj, i)
ITERATORS ///.
static int Ivy_ObjFaninId1(Ivy_Obj_t *pObj)
static int Ivy_FastMapNodeDeref(Ivy_Man_t *pAig, Ivy_Obj_t *pObj)
int Ivy_FastMapNodeWillGrow(Ivy_Man_t *pAig, Ivy_Obj_t *pObj)
abctime s_MappingTime
DECLARATIONS ///.
#define Ivy_ManForEachPo(p, pObj, i)
void Ivy_FastMapStop(Ivy_Man_t *pAig)
static int Ivy_FastMapDelay(Ivy_Man_t *pAig)
void Ivy_FastMapNodeRecover4(Ivy_Man_t *pAig, Ivy_Obj_t *pObj, int nLimit, Vec_Ptr_t *vFront, Vec_Ptr_t *vFrontOld)
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
void Ivy_FastMapNodePrepare(Ivy_Man_t *pAig, Ivy_Obj_t *pObj, int nLimit, Vec_Ptr_t *vFront, Vec_Ptr_t *vFrontOld)
void Ivy_FastMapNodeFaninUpdate(Ivy_Man_t *pAig, Ivy_Obj_t *pObj, Vec_Ptr_t *vFront)
#define ABC_ALLOC(type, num)
#define Ivy_ManForEachNode(p, pObj, i)
static abctime Abc_Clock()
static Ivy_Supp_t * Ivy_ObjSuppStart(Ivy_Man_t *pAig, Ivy_Obj_t *pObj)
static int Vec_PtrSize(Vec_Ptr_t *p)
static void Vec_VecFree(Vec_Vec_t *p)
void Ivy_FastMapMark_rec(Ivy_Man_t *pAig, Ivy_Obj_t *pObj)
static Ivy_Obj_t * Ivy_ObjFanin1(Ivy_Obj_t *pObj)
static int Ivy_ObjIsNodeInt2(Ivy_Obj_t *pObj)
static void Vec_PtrRemove(Vec_Ptr_t *p, void *Entry)
static void Vec_VecClear(Vec_Vec_t *p)
static void Ivy_FastMapRecover(Ivy_Man_t *pAig, int nLimit)
int Ivy_FastMapCutCost(Ivy_Man_t *pAig, Vec_Ptr_t *vFront)
void Ivy_FastMapNodeRecover2(Ivy_Man_t *pAig, Ivy_Obj_t *pObj, int nLimit, Vec_Ptr_t *vFront, Vec_Ptr_t *vFrontOld)
#define IVY_MIN(a, b)
MACRO DEFINITIONS ///.
static Ivy_Obj_t * Ivy_ObjFanin0(Ivy_Obj_t *pObj)
static int Ivy_ManObjIdMax(Ivy_Man_t *p)
static int Ivy_ObjFaninId0(Ivy_Obj_t *pObj)
static void Vec_IntSelectSort(int *pArray, int nSize)
void Ivy_FastMapPerform(Ivy_Man_t *pAig, int nLimit, int fRecovery, int fVerbose)
FUNCTION DEFINITIONS ///.
void Ivy_ManIncrementTravId(Ivy_Man_t *p)
DECLARATIONS ///.
struct Ivy_Supp_t_ Ivy_Supp_t
static void Ivy_FastMapNode(Ivy_Man_t *pAig, Ivy_Obj_t *pObj, int nLimit)
void Ivy_FastMapReadSupp(Ivy_Man_t *pAig, Ivy_Obj_t *pObj, Vec_Int_t *vLeaves)
int Ivy_FastMapNodeFaninCompact_int(Ivy_Man_t *pAig, Ivy_Obj_t *pObj, int nLimit, Vec_Ptr_t *vFront)
static Ivy_Obj_t * Ivy_ManObj(Ivy_Man_t *p, int i)
static int Ivy_FastMapArea(Ivy_Man_t *pAig)
static int Ivy_ObjRefs(Ivy_Obj_t *pObj)
#define ABC_NAMESPACE_IMPL_END
void Ivy_FastMapRequired_rec(Ivy_Man_t *pAig, Ivy_Obj_t *pObj, Ivy_Obj_t *pRoot, int DelayR)
static int Ivy_FastMapNodeDelay(Ivy_Man_t *pAig, Ivy_Obj_t *pObj)
static int Ivy_ObjIsTravIdCurrent(Ivy_Man_t *p, Ivy_Obj_t *pObj)
static int Ivy_ObjIsNode(Ivy_Obj_t *pObj)
typedefABC_NAMESPACE_HEADER_START struct Ivy_Man_t_ Ivy_Man_t
INCLUDES ///.
#define Vec_VecForEachLevelReverse(vGlob, vVec, i)
#define ABC_NAMESPACE_IMPL_START
int Ivy_FastMapNodeFaninCompact1(Ivy_Man_t *pAig, Ivy_Obj_t *pObj, int nLimit, Vec_Ptr_t *vFront)
void Ivy_ManCleanTravId(Ivy_Man_t *p)
static int Ivy_FastMapNodeRef(Ivy_Man_t *pAig, Ivy_Obj_t *pObj)
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
static int Ivy_FastMapNodeAreaDerefed(Ivy_Man_t *pAig, Ivy_Obj_t *pObj)
static void Ivy_FastMapNodeArea(Ivy_Man_t *pAig, Ivy_Obj_t *pObj, int nLimit)
static Ivy_Supp_t * Ivy_ObjSupp(Ivy_Man_t *pAig, Ivy_Obj_t *pObj)
static void Vec_PtrClear(Vec_Ptr_t *p)
void Ivy_FastMapNodeUpdate(Ivy_Man_t *pAig, Ivy_Obj_t *pObj, Vec_Ptr_t *vFront)
static int Ivy_ObjIsCi(Ivy_Obj_t *pObj)
int Ivy_FastMapNodeFaninCompact0(Ivy_Man_t *pAig, Ivy_Obj_t *pObj, int nLimit, Vec_Ptr_t *vFront)
int Ivy_FastMapNodeFaninCompact2(Ivy_Man_t *pAig, Ivy_Obj_t *pObj, int nLimit, Vec_Ptr_t *vFront)
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
static void Ivy_FastMapRequired(Ivy_Man_t *pAig, int Delay, int fSetInter)
static void Ivy_FastMapNodeRecover(Ivy_Man_t *pAig, Ivy_Obj_t *pObj, int nLimit, Vec_Ptr_t *vFront, Vec_Ptr_t *vFrontOld)
void Ivy_FastMapNodeArea2(Ivy_Man_t *pAig, Ivy_Obj_t *pObj, int nLimit)
int Ivy_FastMapArea_rec(Ivy_Man_t *pAig, Ivy_Obj_t *pObj, Vec_Vec_t *vLuts)
static int Ivy_FastMapMerge(Ivy_Supp_t *pSupp0, Ivy_Supp_t *pSupp1, Ivy_Supp_t *pSupp, int nLimit)
static int Ivy_ObjId(Ivy_Obj_t *pObj)
static void Ivy_FastMapPrint(Ivy_Man_t *pAig, int Delay, int Area, abctime Time, char *pStr)
static void Ivy_ObjSetTravIdCurrent(Ivy_Man_t *p, Ivy_Obj_t *pObj)
static void Vec_PtrFree(Vec_Ptr_t *p)