50 If_ObjSetCopy( pObj, NULL );
69 If_CutSetData( If_ObjCutBest(pObj), NULL );
110 if ( pObj->
nRefs++ || If_ObjIsCi(pObj) || If_ObjIsConst1(pObj) )
113 assert( If_ObjIsAnd(pObj) );
115 ppStore[pObj->
Level] = pObj;
117 pCutBest = If_ObjCutBest(pObj);
119 aArea = If_CutLutArea(
p, pCutBest );
121 aArea += If_ManScanMapping_rec(
p, pLeaf, ppStore );
142 assert( !
p->pPars->fLiftLeaves );
157 aArea += If_ManScanMapping_rec(
p, If_ObjFanin0(pObj), ppStore );
159 Vec_PtrClear(
p->vMapped );
160 for ( i =
p->nLevelMax; i >= 0; i-- )
161 for ( pObj = ppStore[i]; pObj; pObj = pObj->
pCopy )
162 Vec_PtrPush(
p->vMapped, pObj );
184 assert( !
p->pPars->fLiftLeaves );
198 aArea += If_ManScanMapping_rec(
p, If_ObjFanin0(pObj), ppStore );
200 Vec_PtrClear(
p->vMapped );
202 for ( i = 0; i <=
p->nLevelMax; i++ )
203 for ( pObj = ppStore[i]; pObj; pObj = pObj->
pCopy )
204 Vec_PtrPush(
p->vMapped, pObj );
227 if ( If_ObjIsLatch(pObj) )
228 return If_ManScanMappingSeq_rec(
p, If_ObjFanin0(pObj), vMapped );
230 if ( pObj->
nRefs++ || If_ObjIsPi(pObj) || If_ObjIsConst1(pObj) )
233 assert( If_ObjIsAnd(pObj) );
235 pCutBest = If_ObjCutBest(pObj);
236 aArea = If_ObjIsAnd(pObj)? If_CutLutArea(
p, pCutBest) : (float)0.0;
238 aArea += If_ManScanMappingSeq_rec(
p, pLeaf, vMapped );
240 Vec_PtrPush( vMapped, pObj );
261 assert(
p->pPars->fLiftLeaves );
267 Vec_PtrClear(
p->vMapped );
269 aArea += If_ManScanMappingSeq_rec(
p, If_ObjFanin0(pObj),
p->vMapped );
295 if ( If_ObjIsAnd(pObj) )
300 else if ( If_ObjIsCo(pObj) )
319 int i, nCutSize = 0, nCutSizeMax = 0;
322 if ( !If_ObjIsAnd(pObj) )
325 if ( nCutSizeMax < ++nCutSize )
326 nCutSizeMax = nCutSize;
330 pFanin = If_ObjFanin0(pObj);
331 if ( !If_ObjIsCi(pFanin) && --pFanin->
nVisits == 0 )
333 pFanin = If_ObjFanin1(pObj);
334 if ( !If_ObjIsCi(pFanin) && --pFanin->
nVisits == 0 )
338 for ( pFanin = pObj; pFanin; pFanin = pFanin->
pEquiv )
339 if ( !If_ObjIsCi(pFanin) && --pFanin->
nVisits == 0 )
376 ppStore[pObj->
Level] = pObj;
378 vOrder = Vec_PtrAlloc( If_ManObjNum(
p) );
379 for ( i =
p->nLevelMax; i >= 0; i-- )
380 for ( pObj = ppStore[i]; pObj; pObj = (
If_Obj_t *)pObj->
pCopy )
381 Vec_PtrPush( vOrder, pObj );
404 float * pSwitching =
p->vSwitching? (
float*)
p->vSwitching->pArray : NULL;
407 if ( pObj->
nRefs++ || If_ObjIsCi(pObj) || If_ObjIsConst1(pObj) )
410 assert( If_ObjIsAnd(pObj) );
412 pCutBest = If_ObjCutBest(pObj);
414 aArea = If_CutLutArea(
p, pCutBest );
417 p->dPower += pSwitching? pSwitching[pLeaf->
Id] : 0.0;
468 vOrder = Vec_PtrAlloc( If_ManObjNum(
p) );
470 if ( If_ObjIsAnd(pObj) && pObj->
nRefs )
471 Vec_PtrPush( vOrder, pObj );
491 int i, k, nLeaves, * ppLeaves;
493 vOrder = Vec_IntAlloc( If_ManObjNum(
p) );
495 if ( If_ObjIsAnd(pObj) && pObj->
nRefs )
497 pCutBest = If_ObjCutBest( pObj );
498 nLeaves = If_CutLeaveNum( pCutBest );
499 ppLeaves = If_CutLeaves( pCutBest );
501 Vec_IntPush( vOrder, nLeaves );
502 for ( k = 0; k < nLeaves; k++ )
503 Vec_IntPush( vOrder, ppLeaves[k] );
504 Vec_IntPush( vOrder, pObj->
Id );
526 If_ObjFanin0(pObj)->
fMark = 0;
529 if ( !If_ObjFaninC0(pObj) )
530 If_ObjFanin0(pObj)->fMark = 1;
533 if ( If_ObjFaninC0(pObj) )
534 Counter += If_ObjFanin0(pObj)->fMark;
537 If_ObjFanin0(pObj)->fMark = 0;
559 if ( If_ObjIsAnd(pNode) )
560 If_CutTraverse_rec( If_ObjFanin0(pNode), vNodes );
561 if ( If_ObjIsAnd(pNode) )
562 If_CutTraverse_rec( If_ObjFanin1(pNode), vNodes );
563 Vec_PtrPush( vNodes, pNode );
570 Vec_PtrClear( vNodes );
573 Vec_PtrPush( vNodes, pLeaf );
578 If_CutTraverse_rec( pRoot, vNodes );
586 vNodes = Vec_PtrAlloc( 1000 );
590 Vec_PtrFree( vNodes );
608 printf(
"Object is NULL." );
611 printf(
"Obj %4d : ", If_ObjId(pObj) );
612 if ( If_ObjIsConst1(pObj) )
613 printf(
"constant 1" );
614 else if ( If_ObjIsCi(pObj) )
616 else if ( If_ObjIsCo(pObj) )
617 printf(
"PO( %4d%s )", If_ObjId(If_ObjFanin0(pObj)), (If_ObjFaninC0(pObj)?
"\'" :
" ") );
619 printf(
"AND( %4d%s, %4d%s )",
620 If_ObjId(If_ObjFanin0(pObj)), (If_ObjFaninC0(pObj)?
"\'" :
" "),
621 If_ObjId(If_ObjFanin1(pObj)), (If_ObjFaninC1(pObj)?
"\'" :
" ") );
#define ABC_ALLOC(type, num)
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
void If_ObjPrint(If_Obj_t *pObj)
void If_ManCleanCutData(If_Man_t *p)
void If_ManCleanMarkV(If_Man_t *p)
Vec_Ptr_t * If_ManCollectMappingDirect(If_Man_t *p)
void If_ManResetOriginalRefs(If_Man_t *p)
Vec_Ptr_t * If_ManReverseOrder(If_Man_t *p)
void If_CutTraverse(If_Man_t *p, If_Obj_t *pRoot, If_Cut_t *pCut, Vec_Ptr_t *vNodes)
ABC_NAMESPACE_IMPL_START void If_ManCleanNodeCopy(If_Man_t *p)
DECLARATIONS ///.
void If_ManMarkMapping(If_Man_t *p)
int If_ManCountSpecialPos(If_Man_t *p)
void If_CutTraverseTest(If_Man_t *p, If_Obj_t *pRoot, If_Cut_t *pCut)
Vec_Int_t * If_ManCollectMappingInt(If_Man_t *p)
float If_ManMarkMapping_rec(If_Man_t *p, If_Obj_t *pObj)
int If_ManCrossCut(If_Man_t *p)
#define If_ManForEachObj(p, pObj, i)
float If_ManScanMapping(If_Man_t *p)
struct If_Cut_t_ If_Cut_t
#define If_ManForEachCo(p, pObj, i)
float If_ManScanMappingSeq(If_Man_t *p)
#define If_CutForEachLeaf(p, pCut, pLeaf, i)
#define If_CutForEachLeafSeq(p, pCut, pLeaf, Shift, i)
struct If_Man_t_ If_Man_t
BASIC TYPES ///.
#define If_ManForEachPo(p, pObj, i)
struct If_Obj_t_ If_Obj_t
float If_ManScanMappingDirect(If_Man_t *p)
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.