diff options
Diffstat (limited to 'src/aig/dar')
-rw-r--r-- | src/aig/dar/dar.h | 1 | ||||
-rw-r--r-- | src/aig/dar/darDfs.c | 29 |
2 files changed, 30 insertions, 0 deletions
diff --git a/src/aig/dar/dar.h b/src/aig/dar/dar.h index 9744da88..8e82cdf4 100644 --- a/src/aig/dar/dar.h +++ b/src/aig/dar/dar.h @@ -382,6 +382,7 @@ extern Vec_Int_t * Dar_LibReadOuts(); extern void Dar_LibReadMsops( char ** ppSopSizes, char *** ppSops ); /*=== darDfs.c ==========================================================*/ extern Vec_Ptr_t * Dar_ManDfs( Dar_Man_t * p ); +extern Vec_Ptr_t * Dar_ManDfsNodes( Dar_Man_t * p, Dar_Obj_t ** ppNodes, int nNodes ); extern int Dar_ManCountLevels( Dar_Man_t * p ); extern void Dar_ManCreateRefs( Dar_Man_t * p ); extern int Dar_DagSize( Dar_Obj_t * pObj ); diff --git a/src/aig/dar/darDfs.c b/src/aig/dar/darDfs.c index bdb23c9d..116f428c 100644 --- a/src/aig/dar/darDfs.c +++ b/src/aig/dar/darDfs.c @@ -90,6 +90,35 @@ Vec_Ptr_t * Dar_ManDfs( Dar_Man_t * p ) /**Function************************************************************* + Synopsis [Collects internal nodes in the DFS order.] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ +Vec_Ptr_t * Dar_ManDfsNodes( Dar_Man_t * p, Dar_Obj_t ** ppNodes, int nNodes ) +{ + Vec_Ptr_t * vNodes; + Dar_Obj_t * pObj; + int i; + assert( Dar_ManLatchNum(p) == 0 ); + Dar_ManIncrementTravId( p ); + // mark constant and PIs + Dar_ObjSetTravIdCurrent( p, Dar_ManConst1(p) ); + Dar_ManForEachPi( p, pObj, i ) + Dar_ObjSetTravIdCurrent( p, pObj ); + // go through the nodes + vNodes = Vec_PtrAlloc( Dar_ManNodeNum(p) ); + for ( i = 0; i < nNodes; i++ ) + Dar_ManDfs_rec( p, ppNodes[i], vNodes ); + return vNodes; +} + +/**Function************************************************************* + Synopsis [Computes the max number of levels in the manager.] Description [] |