summaryrefslogtreecommitdiffstats
path: root/src/map/if/ifUtil.c
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2007-12-26 08:01:00 -0800
committerAlan Mishchenko <alanmi@berkeley.edu>2007-12-26 08:01:00 -0800
commit676ba9ee213ea716fd154abbf983aaabf960db65 (patch)
tree02e3b39653c9f842c84d57631ced8a214c1d58c5 /src/map/if/ifUtil.c
parent00e9c3d06b590b0aac04bafddfd14115d14760f8 (diff)
downloadabc-676ba9ee213ea716fd154abbf983aaabf960db65.tar.gz
abc-676ba9ee213ea716fd154abbf983aaabf960db65.tar.bz2
abc-676ba9ee213ea716fd154abbf983aaabf960db65.zip
Version abc71226
Diffstat (limited to 'src/map/if/ifUtil.c')
-rw-r--r--src/map/if/ifUtil.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/map/if/ifUtil.c b/src/map/if/ifUtil.c
index f3fa049e..f4fcf94a 100644
--- a/src/map/if/ifUtil.c
+++ b/src/map/if/ifUtil.c
@@ -290,6 +290,48 @@ float If_ManScanMapping( If_Man_t * p )
Synopsis [Computes area, references, and nodes used in the mapping.]
+ Description [Collects the nodes in reverse topological order in array
+ p->vMapping.]
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+float If_ManScanMappingDirect( If_Man_t * p )
+{
+ If_Obj_t * pObj, ** ppStore;
+ float aArea;
+ int i;
+ assert( !p->pPars->fLiftLeaves );
+ // clean all references
+ If_ManForEachObj( p, pObj, i )
+ {
+ pObj->Required = IF_FLOAT_LARGE;
+ pObj->nVisits = pObj->nVisitsCopy;
+ pObj->nRefs = 0;
+ }
+ // allocate place to store the nodes
+ ppStore = ALLOC( If_Obj_t *, p->nLevelMax + 1 );
+ memset( ppStore, 0, sizeof(If_Obj_t *) * (p->nLevelMax + 1) );
+ // collect nodes reachable from POs in the DFS order through the best cuts
+ aArea = 0;
+ If_ManForEachCo( p, pObj, i )
+ aArea += If_ManScanMapping_rec( p, If_ObjFanin0(pObj), ppStore );
+ // reconnect the nodes in reverse topological order
+ Vec_PtrClear( p->vMapped );
+// for ( i = p->nLevelMax; i >= 0; i-- )
+ for ( i = 0; i <= p->nLevelMax; i++ )
+ for ( pObj = ppStore[i]; pObj; pObj = pObj->pCopy )
+ Vec_PtrPush( p->vMapped, pObj );
+ free( ppStore );
+ return aArea;
+}
+
+/**Function*************************************************************
+
+ Synopsis [Computes area, references, and nodes used in the mapping.]
+
Description []
SideEffects []