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

  Synopsis    [Returns the levelized array of TFO nodes.]

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

  SeeAlso     []

***********************************************************************/
Function
Synopsis    [Returns the levelized array of TFO nodes.]

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




Function Synopsis [ Returns the levelized array of TFO nodes . ] Description [ Collects the levelized array of internal nodes leaving out CIs / COs . However it marks both CIs and COs with the current TravId . ]
Vec_Ptr_t * Abc_NtkDfsReverseNodes( Abc_Ntk_t * pNtk, Abc_Obj_t ** ppNodes, int nNodes )
{
    Vec_Ptr_t * vNodes;
    Abc_Obj_t * pObj, * pFanout;
    int i, k;
    assert( Abc_NtkIsStrash(pNtk) );
    Abc_NtkIncrementTravId( pNtk );
    vNodes = Vec_PtrStart( Abc_AigLevel(pNtk) + 1 );
    for ( i = 0; i < nNodes; i++ )
    {
        pObj = ppNodes[i];
        assert( Abc_ObjIsCi(pObj) );
        Abc_NodeSetTravIdCurrent( pObj );
        pObj = Abc_ObjFanout0Ntk(pObj);
        Abc_ObjForEachFanout( pObj, pFanout, k )
            Abc_NtkDfsReverseNodes_rec( pFanout, vNodes );
    }
    return vNodes;
}
Vec_Ptr_t * Abc_NtkDfsReverseNodes ( Abc_Ntk_t * pNtk , Abc_Obj_t * * ppNodes , int nNodes ) { Vec_Ptr_t * vNodes ; Abc_Obj_t * pObj , * pFanout ; int i , k ; assert ( Abc_NtkIsStrash ( pNtk ) ) ; Abc_NtkIncrementTravId ( pNtk ) ; vNodes = Vec_PtrStart ( Abc_AigLevel ( pNtk ) + 1 ) ; for ( i = 0 ; i < nNodes ; i ++ ) { pObj = ppNodes [ i ] ; assert ( Abc_ObjIsCi ( pObj ) ) ; Abc_NodeSetTravIdCurrent ( pObj ) ; pObj = Abc_ObjFanout0Ntk ( pObj ) ; Abc_ObjForEachFanout ( pObj , pFanout , k ) Abc_NtkDfsReverseNodes_rec ( pFanout , vNodes ) ; } return vNodes ; }
Function
Synopsis    [Returns the levelized array of TFO nodes.]
Function Synopsis [ Returns the levelized array of TFO nodes . ]
// set the traversal ID // start the array of nodes