diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2008-03-27 08:01:00 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2008-03-27 08:01:00 -0700 |
commit | 416ffc117ab7d0ea2ec3b8aaeb4724f25031db7a (patch) | |
tree | 0d9c55c15e42c128a10a4da9be6140fa736a3249 /src/map/if/ifUtil.c | |
parent | e258fcb2cd0cb0bca2bb077b2e5954b7be02b1c3 (diff) | |
download | abc-416ffc117ab7d0ea2ec3b8aaeb4724f25031db7a.tar.gz abc-416ffc117ab7d0ea2ec3b8aaeb4724f25031db7a.tar.bz2 abc-416ffc117ab7d0ea2ec3b8aaeb4724f25031db7a.zip |
Version abc80327
Diffstat (limited to 'src/map/if/ifUtil.c')
-rw-r--r-- | src/map/if/ifUtil.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/map/if/ifUtil.c b/src/map/if/ifUtil.c index c114236d..74880409 100644 --- a/src/map/if/ifUtil.c +++ b/src/map/if/ifUtil.c @@ -653,6 +653,40 @@ Vec_Ptr_t * If_ManCollectMappingDirect( If_Man_t * p ) /**Function************************************************************* + Synopsis [Collects nodes used in the mapping in the topological order.] + + Description [Represents mapping as an array of integers.] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ +Vec_Int_t * If_ManCollectMappingInt( If_Man_t * p ) +{ + Vec_Int_t * vOrder; + If_Cut_t * pCutBest; + If_Obj_t * pObj; + int i, k, nLeaves, * ppLeaves; + If_ManMarkMapping( p ); + vOrder = Vec_IntAlloc( If_ManObjNum(p) ); + If_ManForEachObj( p, pObj, i ) + if ( If_ObjIsAnd(pObj) && pObj->nRefs ) + { + pCutBest = If_ObjCutBest( pObj ); + nLeaves = If_CutLeaveNum( pCutBest ); + ppLeaves = If_CutLeaves( pCutBest ); + // save the number of leaves, the leaves, and finally, the root + Vec_IntPush( vOrder, nLeaves ); + for ( k = 0; k < nLeaves; k++ ) + Vec_IntPush( vOrder, ppLeaves[k] ); + Vec_IntPush( vOrder, pObj->Id ); + } + return vOrder; +} + +/**Function************************************************************* + Synopsis [Returns the number of POs pointing to the same internal nodes.] Description [] |