30static int Abc_NodeRefDeref(
Abc_Obj_t * pNode,
int fReference,
int fLabel );
31static int Abc_NodeRefDerefStop(
Abc_Obj_t * pNode,
int fReference );
50 int nConeSize1, nConeSize2;
53 assert( Abc_ObjIsNode( pNode ) );
54 if ( Abc_ObjFaninNum(pNode) == 0 )
56 nConeSize1 = Abc_NodeRefDeref( pNode, 0, 0 );
57 nConeSize2 = Abc_NodeRefDeref( pNode, 1, 0 );
58 assert( nConeSize1 == nConeSize2 );
76 int nConeSize1, nConeSize2;
78 assert( !Abc_ObjIsComplement( pNode ) );
79 assert( Abc_ObjIsNode( pNode ) );
80 if ( Abc_ObjFaninNum(pNode) == 0 )
82 nConeSize1 = Abc_NodeRefDerefStop( pNode, 0 );
83 nConeSize2 = Abc_NodeRefDerefStop( pNode, 1 );
84 assert( nConeSize1 == nConeSize2 );
102 int nConeSize1, nConeSize2;
104 assert( !Abc_ObjIsComplement( pNode ) );
105 assert( Abc_ObjIsNode( pNode ) );
106 if ( Abc_ObjFaninNum(pNode) == 0 )
108 nConeSize1 = Abc_NodeRefDeref( pNode, 0, 1 );
109 nConeSize2 = Abc_NodeRefDeref( pNode, 1, 0 );
110 assert( nConeSize1 == nConeSize2 );
126int Abc_NodeRefDeref(
Abc_Obj_t * pNode,
int fReference,
int fLabel )
132 Abc_NodeSetTravIdCurrent( pNode );
134 if ( Abc_ObjIsCi(pNode) )
137 pNode0 = Abc_ObjFanin0(pNode);
138 pNode1 = Abc_ObjFanin1(pNode);
142 if ( pNode0->
vFanouts.nSize++ == 0 )
143 Counter += Abc_NodeRefDeref( pNode0, fReference, fLabel );
144 if ( pNode1->
vFanouts.nSize++ == 0 )
145 Counter += Abc_NodeRefDeref( pNode1, fReference, fLabel );
151 if ( --pNode0->
vFanouts.nSize == 0 )
152 Counter += Abc_NodeRefDeref( pNode0, fReference, fLabel );
153 if ( --pNode1->
vFanouts.nSize == 0 )
154 Counter += Abc_NodeRefDeref( pNode1, fReference, fLabel );
171int Abc_NodeRefDerefStop(
Abc_Obj_t * pNode,
int fReference )
176 if ( Abc_ObjIsCi(pNode) )
179 pNode0 = Abc_ObjFanin0(pNode);
180 pNode1 = Abc_ObjFanin1(pNode);
184 if ( !Abc_ObjFaninC0(pNode) && pNode0->
vFanouts.nSize++ == 0 )
185 Counter += Abc_NodeRefDerefStop( pNode0, fReference );
186 if ( !Abc_ObjFaninC1(pNode) && pNode1->
vFanouts.nSize++ == 0 )
187 Counter += Abc_NodeRefDerefStop( pNode1, fReference );
193 if ( !Abc_ObjFaninC0(pNode) && --pNode0->
vFanouts.nSize == 0 )
194 Counter += Abc_NodeRefDerefStop( pNode0, fReference );
195 if ( !Abc_ObjFaninC1(pNode) && --pNode1->
vFanouts.nSize == 0 )
196 Counter += Abc_NodeRefDerefStop( pNode1, fReference );
219 if ( Abc_ObjIsCi(pNode) )
224 if ( --pFanin->
vFanouts.nSize == 0 )
245 if ( Abc_ObjIsCi(pNode) )
249 if ( pFanin->
vFanouts.nSize++ == 0 )
271 if ( Abc_NodeIsTravIdCurrent(pNode) )
273 Abc_NodeSetTravIdCurrent(pNode);
275 if ( !fTopmost && (Abc_ObjIsCi(pNode) || pNode->
vFanouts.nSize > 0) )
277 if ( vSupp ) Vec_PtrPush( vSupp, pNode );
284 if ( vCone ) Vec_PtrPush( vCone, pNode );
301 assert( Abc_ObjIsNode(pNode) );
302 assert( !Abc_ObjIsComplement(pNode) );
303 if ( vCone ) Vec_PtrClear( vCone );
304 if ( vSupp ) Vec_PtrClear( vSupp );
305 Abc_NtkIncrementTravId( pNode->
pNtk );
326 vCone = Vec_PtrAlloc( 100 );
327 vSupp = Vec_PtrAlloc( 100 );
331 printf(
"Node = %6s : Supp = %3d Cone = %3d (",
332 Abc_ObjName(pNode), Vec_PtrSize(vSupp), Vec_PtrSize(vCone) );
336 Vec_PtrFree( vCone );
337 Vec_PtrFree( vSupp );
354 int i, Count1, Count2;
364 assert( Count1 == Count2 );
389 vInside = Vec_PtrAlloc( 10 );
393 assert( Count1 == Count2 );
413 if ( !fTopmost && (Abc_ObjIsCi(pNode) || pNode->
vFanouts.nSize > 0) )
416 if ( Abc_NodeIsTravIdCurrent(pNode) )
418 Abc_NodeSetTravIdCurrent(pNode);
425 Vec_PtrPush( vNodes, pNode );
445 Abc_NtkIncrementTravId( pNode->
pNtk );
449 assert( Count1 == Count2 );
int Abc_NodeRef_rec(Abc_Obj_t *pNode)
int Abc_NodeDeref_rec(Abc_Obj_t *pNode)
void Abc_NodeMffcLabel_rec(Abc_Obj_t *pNode, int fTopmost, Vec_Ptr_t *vNodes)
void Abc_NodeMffcConeSuppPrint(Abc_Obj_t *pNode)
int Abc_NodeMffcInside(Abc_Obj_t *pNode, Vec_Ptr_t *vLeaves, Vec_Ptr_t *vInside)
void Abc_NodeMffcConeSupp(Abc_Obj_t *pNode, Vec_Ptr_t *vCone, Vec_Ptr_t *vSupp)
int Abc_NodeMffcSizeStop(Abc_Obj_t *pNode)
int Abc_NodeMffcSize(Abc_Obj_t *pNode)
FUNCTION DEFINITIONS ///.
Vec_Ptr_t * Abc_NodeMffcInsideCollect(Abc_Obj_t *pNode)
void Abc_NodeMffcConeSupp_rec(Abc_Obj_t *pNode, Vec_Ptr_t *vCone, Vec_Ptr_t *vSupp, int fTopmost)
int Abc_NodeMffcLabelAig(Abc_Obj_t *pNode)
int Abc_NodeMffcLabel(Abc_Obj_t *pNode, Vec_Ptr_t *vNodes)
struct Abc_Obj_t_ Abc_Obj_t
#define Abc_ObjForEachFanin(pObj, pFanin, i)
ABC_DLL char * Abc_ObjName(Abc_Obj_t *pNode)
DECLARATIONS ///.
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.