ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
abcRefs.c File Reference
#include "abc.h"
Include dependency graph for abcRefs.c:

Go to the source code of this file.

Functions

int Abc_NodeMffcSize (Abc_Obj_t *pNode)
 FUNCTION DEFINITIONS ///.
 
int Abc_NodeMffcSizeStop (Abc_Obj_t *pNode)
 
int Abc_NodeMffcLabelAig (Abc_Obj_t *pNode)
 
int Abc_NodeDeref_rec (Abc_Obj_t *pNode)
 
int Abc_NodeRef_rec (Abc_Obj_t *pNode)
 
void Abc_NodeMffcConeSupp_rec (Abc_Obj_t *pNode, Vec_Ptr_t *vCone, Vec_Ptr_t *vSupp, int fTopmost)
 
void Abc_NodeMffcConeSupp (Abc_Obj_t *pNode, Vec_Ptr_t *vCone, Vec_Ptr_t *vSupp)
 
void Abc_NodeMffcConeSuppPrint (Abc_Obj_t *pNode)
 
int Abc_NodeMffcInside (Abc_Obj_t *pNode, Vec_Ptr_t *vLeaves, Vec_Ptr_t *vInside)
 
Vec_Ptr_tAbc_NodeMffcInsideCollect (Abc_Obj_t *pNode)
 
void Abc_NodeMffcLabel_rec (Abc_Obj_t *pNode, int fTopmost, Vec_Ptr_t *vNodes)
 
int Abc_NodeMffcLabel (Abc_Obj_t *pNode, Vec_Ptr_t *vNodes)
 

Function Documentation

◆ Abc_NodeDeref_rec()

int Abc_NodeDeref_rec ( Abc_Obj_t * pNode)

Function*************************************************************

Synopsis [Dereferences the node's MFFC.]

Description []

SideEffects []

SeeAlso []

Definition at line 215 of file abcRefs.c.

216{
217 Abc_Obj_t * pFanin;
218 int i, Counter = 1;
219 if ( Abc_ObjIsCi(pNode) )
220 return 0;
221 Abc_ObjForEachFanin( pNode, pFanin, i )
222 {
223 assert( pFanin->vFanouts.nSize > 0 );
224 if ( --pFanin->vFanouts.nSize == 0 )
225 Counter += Abc_NodeDeref_rec( pFanin );
226 }
227 return Counter;
228}
int Abc_NodeDeref_rec(Abc_Obj_t *pNode)
Definition abcRefs.c:215
struct Abc_Obj_t_ Abc_Obj_t
Definition abc.h:116
#define Abc_ObjForEachFanin(pObj, pFanin, i)
Definition abc.h:527
Vec_Int_t vFanouts
Definition abc.h:144
#define assert(ex)
Definition util_old.h:213
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NodeMffcConeSupp()

void Abc_NodeMffcConeSupp ( Abc_Obj_t * pNode,
Vec_Ptr_t * vCone,
Vec_Ptr_t * vSupp )

Function*************************************************************

Synopsis [Collects the support of the derefed MFFC.]

Description []

SideEffects []

SeeAlso []

Definition at line 299 of file abcRefs.c.

300{
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 );
306 Abc_NodeMffcConeSupp_rec( pNode, vCone, vSupp, 1 );
307// printf( "\n" );
308}
void Abc_NodeMffcConeSupp_rec(Abc_Obj_t *pNode, Vec_Ptr_t *vCone, Vec_Ptr_t *vSupp, int fTopmost)
Definition abcRefs.c:266
Abc_Ntk_t * pNtk
Definition abc.h:130
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NodeMffcConeSupp_rec()

void Abc_NodeMffcConeSupp_rec ( Abc_Obj_t * pNode,
Vec_Ptr_t * vCone,
Vec_Ptr_t * vSupp,
int fTopmost )

Function*************************************************************

Synopsis [Collects the internal and boundary nodes in the derefed MFFC.]

Description []

SideEffects []

SeeAlso []

Definition at line 266 of file abcRefs.c.

267{
268 Abc_Obj_t * pFanin;
269 int i;
270 // skip visited nodes
271 if ( Abc_NodeIsTravIdCurrent(pNode) )
272 return;
273 Abc_NodeSetTravIdCurrent(pNode);
274 // add to the new support nodes
275 if ( !fTopmost && (Abc_ObjIsCi(pNode) || pNode->vFanouts.nSize > 0) )
276 {
277 if ( vSupp ) Vec_PtrPush( vSupp, pNode );
278 return;
279 }
280 // recur on the children
281 Abc_ObjForEachFanin( pNode, pFanin, i )
282 Abc_NodeMffcConeSupp_rec( pFanin, vCone, vSupp, 0 );
283 // collect the internal node
284 if ( vCone ) Vec_PtrPush( vCone, pNode );
285// printf( "%d ", pNode->Id );
286}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NodeMffcConeSuppPrint()

void Abc_NodeMffcConeSuppPrint ( Abc_Obj_t * pNode)

Function*************************************************************

Synopsis [Collects the support of the derefed MFFC.]

Description []

SideEffects []

SeeAlso []

Definition at line 321 of file abcRefs.c.

322{
323 Vec_Ptr_t * vCone, * vSupp;
324 Abc_Obj_t * pObj;
325 int i;
326 vCone = Vec_PtrAlloc( 100 );
327 vSupp = Vec_PtrAlloc( 100 );
328 Abc_NodeDeref_rec( pNode );
329 Abc_NodeMffcConeSupp( pNode, vCone, vSupp );
330 Abc_NodeRef_rec( pNode );
331 printf( "Node = %6s : Supp = %3d Cone = %3d (",
332 Abc_ObjName(pNode), Vec_PtrSize(vSupp), Vec_PtrSize(vCone) );
333 Vec_PtrForEachEntry( Abc_Obj_t *, vCone, pObj, i )
334 printf( " %s", Abc_ObjName(pObj) );
335 printf( " )\n" );
336 Vec_PtrFree( vCone );
337 Vec_PtrFree( vSupp );
338}
int Abc_NodeRef_rec(Abc_Obj_t *pNode)
Definition abcRefs.c:241
void Abc_NodeMffcConeSupp(Abc_Obj_t *pNode, Vec_Ptr_t *vCone, Vec_Ptr_t *vSupp)
Definition abcRefs.c:299
ABC_DLL char * Abc_ObjName(Abc_Obj_t *pNode)
DECLARATIONS ///.
Definition abcNames.c:49
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition vecPtr.h:42
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition vecPtr.h:55
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NodeMffcInside()

int Abc_NodeMffcInside ( Abc_Obj_t * pNode,
Vec_Ptr_t * vLeaves,
Vec_Ptr_t * vInside )

Function*************************************************************

Synopsis [Collects the internal nodes of the MFFC limited by cut.]

Description []

SideEffects [Increments the trav ID and marks visited nodes.]

SeeAlso []

Definition at line 351 of file abcRefs.c.

352{
353 Abc_Obj_t * pObj;
354 int i, Count1, Count2;
355 // increment the fanout counters for the leaves
356 Vec_PtrForEachEntry( Abc_Obj_t *, vLeaves, pObj, i )
357 pObj->vFanouts.nSize++;
358 // dereference the node
359 Count1 = Abc_NodeDeref_rec( pNode );
360 // collect the nodes inside the MFFC
361 Abc_NodeMffcConeSupp( pNode, vInside, NULL );
362 // reference it back
363 Count2 = Abc_NodeRef_rec( pNode );
364 assert( Count1 == Count2 );
365 // remove the extra counters
366 Vec_PtrForEachEntry( Abc_Obj_t *, vLeaves, pObj, i )
367 pObj->vFanouts.nSize--;
368 return Count1;
369}
Here is the call graph for this function:

◆ Abc_NodeMffcInsideCollect()

Vec_Ptr_t * Abc_NodeMffcInsideCollect ( Abc_Obj_t * pNode)

Function*************************************************************

Synopsis [Collects the internal nodes of the MFFC limited by cut.]

Description []

SideEffects [Increments the trav ID and marks visited nodes.]

SeeAlso []

Definition at line 382 of file abcRefs.c.

383{
384 Vec_Ptr_t * vInside;
385 int Count1, Count2;
386 // dereference the node
387 Count1 = Abc_NodeDeref_rec( pNode );
388 // collect the nodes inside the MFFC
389 vInside = Vec_PtrAlloc( 10 );
390 Abc_NodeMffcConeSupp( pNode, vInside, NULL );
391 // reference it back
392 Count2 = Abc_NodeRef_rec( pNode );
393 assert( Count1 == Count2 );
394 return vInside;
395}
Here is the call graph for this function:

◆ Abc_NodeMffcLabel()

int Abc_NodeMffcLabel ( Abc_Obj_t * pNode,
Vec_Ptr_t * vNodes )

Function*************************************************************

Synopsis [Collects the internal nodes of the MFFC limited by cut.]

Description []

SideEffects [Increments the trav ID and marks visited nodes.]

SeeAlso []

Definition at line 439 of file abcRefs.c.

440{
441 int Count1, Count2;
442 // dereference the node
443 Count1 = Abc_NodeDeref_rec( pNode );
444 // collect the nodes inside the MFFC
445 Abc_NtkIncrementTravId( pNode->pNtk );
446 Abc_NodeMffcLabel_rec( pNode, 1, vNodes );
447 // reference it back
448 Count2 = Abc_NodeRef_rec( pNode );
449 assert( Count1 == Count2 );
450 return Count1;
451}
void Abc_NodeMffcLabel_rec(Abc_Obj_t *pNode, int fTopmost, Vec_Ptr_t *vNodes)
Definition abcRefs.c:408
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NodeMffcLabel_rec()

void Abc_NodeMffcLabel_rec ( Abc_Obj_t * pNode,
int fTopmost,
Vec_Ptr_t * vNodes )

Function*************************************************************

Synopsis [Collects the internal and boundary nodes in the derefed MFFC.]

Description []

SideEffects []

SeeAlso []

Definition at line 408 of file abcRefs.c.

409{
410 Abc_Obj_t * pFanin;
411 int i;
412 // add to the new support nodes
413 if ( !fTopmost && (Abc_ObjIsCi(pNode) || pNode->vFanouts.nSize > 0) )
414 return;
415 // skip visited nodes
416 if ( Abc_NodeIsTravIdCurrent(pNode) )
417 return;
418 Abc_NodeSetTravIdCurrent(pNode);
419 // recur on the children
420 Abc_ObjForEachFanin( pNode, pFanin, i )
421 Abc_NodeMffcLabel_rec( pFanin, 0, vNodes );
422 // collect the internal node
423// printf( "%d ", pNode->Id );
424 if ( vNodes )
425 Vec_PtrPush( vNodes, pNode );
426}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NodeMffcLabelAig()

int Abc_NodeMffcLabelAig ( Abc_Obj_t * pNode)

Function*************************************************************

Synopsis [Labels MFFC with the current traversal ID.]

Description []

SideEffects []

SeeAlso []

Definition at line 100 of file abcRefs.c.

101{
102 int nConeSize1, nConeSize2;
103 assert( Abc_NtkIsStrash(pNode->pNtk) );
104 assert( !Abc_ObjIsComplement( pNode ) );
105 assert( Abc_ObjIsNode( pNode ) );
106 if ( Abc_ObjFaninNum(pNode) == 0 )
107 return 0;
108 nConeSize1 = Abc_NodeRefDeref( pNode, 0, 1 ); // dereference
109 nConeSize2 = Abc_NodeRefDeref( pNode, 1, 0 ); // reference
110 assert( nConeSize1 == nConeSize2 );
111 assert( nConeSize1 > 0 );
112 return nConeSize1;
113}
Here is the caller graph for this function:

◆ Abc_NodeMffcSize()

int Abc_NodeMffcSize ( Abc_Obj_t * pNode)

FUNCTION DEFINITIONS ///.

Function*************************************************************

Synopsis [Returns the MFFC size.]

Description []

SideEffects []

SeeAlso []

Definition at line 48 of file abcRefs.c.

49{
50 int nConeSize1, nConeSize2;
51// assert( Abc_NtkIsStrash(pNode->pNtk) );
52// assert( !Abc_ObjIsComplement( pNode ) );
53 assert( Abc_ObjIsNode( pNode ) );
54 if ( Abc_ObjFaninNum(pNode) == 0 )
55 return 0;
56 nConeSize1 = Abc_NodeRefDeref( pNode, 0, 0 ); // dereference
57 nConeSize2 = Abc_NodeRefDeref( pNode, 1, 0 ); // reference
58 assert( nConeSize1 == nConeSize2 );
59 assert( nConeSize1 > 0 );
60 return nConeSize1;
61}
Here is the caller graph for this function:

◆ Abc_NodeMffcSizeStop()

int Abc_NodeMffcSizeStop ( Abc_Obj_t * pNode)

Function*************************************************************

Synopsis [Returns the MFFC size while stopping at the complemented edges.]

Description []

SideEffects []

SeeAlso []

Definition at line 74 of file abcRefs.c.

75{
76 int nConeSize1, nConeSize2;
77 assert( Abc_NtkIsStrash(pNode->pNtk) );
78 assert( !Abc_ObjIsComplement( pNode ) );
79 assert( Abc_ObjIsNode( pNode ) );
80 if ( Abc_ObjFaninNum(pNode) == 0 )
81 return 0;
82 nConeSize1 = Abc_NodeRefDerefStop( pNode, 0 ); // dereference
83 nConeSize2 = Abc_NodeRefDerefStop( pNode, 1 ); // reference
84 assert( nConeSize1 == nConeSize2 );
85 assert( nConeSize1 > 0 );
86 return nConeSize1;
87}

◆ Abc_NodeRef_rec()

int Abc_NodeRef_rec ( Abc_Obj_t * pNode)

Function*************************************************************

Synopsis [References the node's MFFC.]

Description []

SideEffects []

SeeAlso []

Definition at line 241 of file abcRefs.c.

242{
243 Abc_Obj_t * pFanin;
244 int i, Counter = 1;
245 if ( Abc_ObjIsCi(pNode) )
246 return 0;
247 Abc_ObjForEachFanin( pNode, pFanin, i )
248 {
249 if ( pFanin->vFanouts.nSize++ == 0 )
250 Counter += Abc_NodeRef_rec( pFanin );
251 }
252 return Counter;
253}
Here is the call graph for this function:
Here is the caller graph for this function: