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

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

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

  SeeAlso     []

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

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




Function Synopsis [ Returns the DFS ordered array of logic nodes . ] Description [ Collects only the internal nodes leaving out CIs / COs . However it marks both CIs and COs with the current TravId . ]
Vec_Ptr_t * Abc_AigDfs( Abc_Ntk_t * pNtk, int fCollectAll, int fCollectCos )
{
    Vec_Ptr_t * vNodes;
    Abc_Obj_t * pNode;
    int i;
    assert( Abc_NtkIsStrash(pNtk) );
    Abc_NtkIncrementTravId( pNtk );
    vNodes = Vec_PtrAlloc( 100 );
    Abc_NtkForEachCo( pNtk, pNode, i )
    {
        Abc_AigDfs_rec( Abc_ObjFanin0(pNode), vNodes );
        Abc_NodeSetTravIdCurrent( pNode );
        if ( fCollectCos )
            Vec_PtrPush( vNodes, pNode );
    }
    if ( fCollectAll )
    {
        Abc_NtkForEachNode( pNtk, pNode, i )
            if ( !Abc_NodeIsTravIdCurrent(pNode) )
                Abc_AigDfs_rec( pNode, vNodes );
    }
    return vNodes;
}
Vec_Ptr_t * Abc_AigDfs ( Abc_Ntk_t * pNtk , int fCollectAll , int fCollectCos ) { Vec_Ptr_t * vNodes ; Abc_Obj_t * pNode ; int i ; assert ( Abc_NtkIsStrash ( pNtk ) ) ; Abc_NtkIncrementTravId ( pNtk ) ; vNodes = Vec_PtrAlloc ( 100 ) ; Abc_NtkForEachCo ( pNtk , pNode , i ) { Abc_AigDfs_rec ( Abc_ObjFanin0 ( pNode ) , vNodes ) ; Abc_NodeSetTravIdCurrent ( pNode ) ; if ( fCollectCos ) Vec_PtrPush ( vNodes , pNode ) ; } if ( fCollectAll ) { Abc_NtkForEachNode ( pNtk , pNode , i ) if ( ! Abc_NodeIsTravIdCurrent ( pNode ) ) Abc_AigDfs_rec ( pNode , vNodes ) ; } 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 // go through the PO nodes and call for each of them // collect dangling nodes if asked to