diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2007-08-22 08:01:00 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2007-08-22 08:01:00 -0700 |
commit | 28467823812f63a40f9a322b1fefc7decce4b766 (patch) | |
tree | 8e7d9849119d106ebafd58e02e640338ffddacf3 /src/aig/aig/aigDfs.c | |
parent | c8a25de8e411409b60f3677f70eab0860070b462 (diff) | |
download | abc-28467823812f63a40f9a322b1fefc7decce4b766.tar.gz abc-28467823812f63a40f9a322b1fefc7decce4b766.tar.bz2 abc-28467823812f63a40f9a322b1fefc7decce4b766.zip |
Version abc70822
Diffstat (limited to 'src/aig/aig/aigDfs.c')
-rw-r--r-- | src/aig/aig/aigDfs.c | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/aig/aig/aigDfs.c b/src/aig/aig/aigDfs.c index 5a18c4ac..86509322 100644 --- a/src/aig/aig/aigDfs.c +++ b/src/aig/aig/aigDfs.c @@ -380,6 +380,54 @@ int Aig_DagSize( Aig_Obj_t * pObj ) /**Function************************************************************* + Synopsis [Counts the support size of the node.] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ +void Aig_SupportSize_rec( Aig_Man_t * p, Aig_Obj_t * pObj, int * pCounter ) +{ + if ( Aig_ObjIsTravIdCurrent(p, pObj) ) + return; + Aig_ObjSetTravIdCurrent(p, pObj); + if ( Aig_ObjIsPi(pObj) ) + { + (*pCounter)++; + return; + } + assert( Aig_ObjIsNode(pObj) || Aig_ObjIsBuf(pObj) ); + Aig_SupportSize_rec( p, Aig_ObjFanin0(pObj), pCounter ); + if ( Aig_ObjFanin1(pObj) ) + Aig_SupportSize_rec( p, Aig_ObjFanin1(pObj), pCounter ); +} + +/**Function************************************************************* + + Synopsis [Counts the support size of the node.] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ +int Aig_SupportSize( Aig_Man_t * p, Aig_Obj_t * pObj ) +{ + int Counter = 0; + assert( !Aig_IsComplement(pObj) ); + assert( !Aig_ObjIsPo(pObj) ); + Aig_ManIncrementTravId( p ); + Aig_SupportSize_rec( p, pObj, &Counter ); + return Counter; +} + +/**Function************************************************************* + Synopsis [Transfers the AIG from one manager into another.] Description [] |