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

  Synopsis    [Returns the reverse 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 reverse 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 reverse 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_NtkDfsReverse( Abc_Ntk_t * pNtk )
{
    Vec_Ptr_t * vNodes;
    Abc_Obj_t * pObj, * pFanout;
    int i, k;
    Abc_NtkIncrementTravId( pNtk );
    vNodes = Vec_PtrAlloc( 100 );
    Abc_NtkForEachCi( pNtk, pObj, i )
    {
        Abc_NodeSetTravIdCurrent( pObj );
        pObj = Abc_ObjFanout0Ntk(pObj);
        Abc_ObjForEachFanout( pObj, pFanout, k )
            Abc_NtkDfsReverse_rec( pFanout, vNodes );
    }
    if ( !Abc_NtkIsStrash(pNtk) ) {
        Abc_NtkForEachNode( pNtk, pObj, i )
            if ( Abc_NodeIsConst(pObj) )
                Vec_PtrPush( vNodes, pObj );
    }
    return vNodes;
}
Vec_Ptr_t * Abc_NtkDfsReverse ( Abc_Ntk_t * pNtk ) { Vec_Ptr_t * vNodes ; Abc_Obj_t * pObj , * pFanout ; int i , k ; Abc_NtkIncrementTravId ( pNtk ) ; vNodes = Vec_PtrAlloc ( 100 ) ; Abc_NtkForEachCi ( pNtk , pObj , i ) { Abc_NodeSetTravIdCurrent ( pObj ) ; pObj = Abc_ObjFanout0Ntk ( pObj ) ; Abc_ObjForEachFanout ( pObj , pFanout , k ) Abc_NtkDfsReverse_rec ( pFanout , vNodes ) ; } if ( ! Abc_NtkIsStrash ( pNtk ) ) { Abc_NtkForEachNode ( pNtk , pObj , i ) if ( Abc_NodeIsConst ( pObj ) ) Vec_PtrPush ( vNodes , pObj ) ; } return vNodes ; }
Function
Synopsis    [Returns the reverse DFS ordered array of logic nodes.]
Function Synopsis [ Returns the reverse DFS ordered array of logic nodes . ]
// set the traversal ID // start the array of nodes // add constant nodes in the end