abc/src/base/abc/abcDfs.c
/**Function*************************************************************

  Synopsis    [Returns the DFS ordered array of logic nodes.]

  Description [Collects only the internal nodes, leaving CIs and CO.
  However it marks with the current TravId both CIs and COs.]
               
  SideEffects []

  SeeAlso     []

***********************************************************************/
Function
Synopsis    [Returns the DFS ordered array of logic nodes.]

Description [Collects only the internal nodes, leaving CIs and CO.
However it marks with the current TravId both CIs and COs.]




Function Synopsis [ Returns the DFS ordered array of logic nodes . ] Description [ Collects only the internal nodes leaving CIs and CO . However it marks with the current TravId both CIs and COs . ]
Vec_Ptr_t * Abc_NtkDfsIter( Abc_Ntk_t * pNtk, int fCollectAll )
{
    Vec_Ptr_t * vNodes, * vStack;
    Abc_Obj_t * pObj;
    int i;
    Abc_NtkIncrementTravId( pNtk );
    vNodes = Vec_PtrAlloc( 1000 );
    vStack = Vec_PtrAlloc( 1000 );
    Abc_NtkForEachCo( pNtk, pObj, i )
    {
        Abc_NodeSetTravIdCurrent( pObj );
        Abc_NtkDfs_iter( vStack, Abc_ObjFanin0Ntk(Abc_ObjFanin0(pObj)), vNodes );
    }
    if ( fCollectAll )
    { 
        Abc_NtkForEachNode( pNtk, pObj, i )
            if ( !Abc_NodeIsTravIdCurrent(pObj) )
                Abc_NtkDfs_iter( vStack, pObj, vNodes );
    }
    Vec_PtrFree( vStack );
    return vNodes;
}
Vec_Ptr_t * Abc_NtkDfsIter ( Abc_Ntk_t * pNtk , int fCollectAll ) { Vec_Ptr_t * vNodes , * vStack ; Abc_Obj_t * pObj ; int i ; Abc_NtkIncrementTravId ( pNtk ) ; vNodes = Vec_PtrAlloc ( 1000 ) ; vStack = Vec_PtrAlloc ( 1000 ) ; Abc_NtkForEachCo ( pNtk , pObj , i ) { Abc_NodeSetTravIdCurrent ( pObj ) ; Abc_NtkDfs_iter ( vStack , Abc_ObjFanin0Ntk ( Abc_ObjFanin0 ( pObj ) ) , vNodes ) ; } if ( fCollectAll ) { Abc_NtkForEachNode ( pNtk , pObj , i ) if ( ! Abc_NodeIsTravIdCurrent ( pObj ) ) Abc_NtkDfs_iter ( vStack , pObj , vNodes ) ; } Vec_PtrFree ( vStack ) ; return vNodes ; }
Function
Synopsis    [Returns the DFS ordered array of logic nodes.]
Function Synopsis [ Returns the DFS ordered array of logic nodes . ]
// set the traversal ID // start the array of nodes // collect dangling nodes if asked to