/**Function************************************************************* Synopsis [Collects nodes in the DFS order.] Description [] SideEffects [] SeeAlso [] ***********************************************************************/ void Ivy_ManDfs_rec( Ivy_Man_t * p, Ivy_Obj_t * pObj, Vec_Int_t * vNodes ) { if ( Ivy_ObjIsMarkA(pObj) ) return; Ivy_ObjSetMarkA(pObj); if ( Ivy_ObjIsConst1(pObj) || Ivy_ObjIsCi(pObj) ) { if ( p->pHaig == NULL && pObj->pEquiv ) Ivy_ManDfs_rec( p, Ivy_Regular(pObj->pEquiv), vNodes ); return; } //printf( "visiting node %d\n", pObj->Id ); /* if ( pObj->Id == 87 || pObj->Id == 90 ) { int y = 0; } */ assert( Ivy_ObjIsBuf(pObj) || Ivy_ObjIsAnd(pObj) || Ivy_ObjIsExor(pObj) ); Ivy_ManDfs_rec( p, Ivy_ObjFanin0(pObj), vNodes ); if ( !Ivy_ObjIsBuf(pObj) ) Ivy_ManDfs_rec( p, Ivy_ObjFanin1(pObj), vNodes ); if ( p->pHaig == NULL && pObj->pEquiv ) Ivy_ManDfs_rec( p, Ivy_Regular(pObj->pEquiv), vNodes ); Vec_IntPush( vNodes, pObj->Id ); //printf( "adding node %d with fanins %d and %d and equiv %d (refs = %d)\n", // pObj->Id, Ivy_ObjFanin0(pObj)->Id, Ivy_ObjFanin1(pObj)->Id, // pObj->pEquiv? Ivy_Regular(pObj->pEquiv)->Id: -1, Ivy_ObjRefs(pObj) ); }
ABC_NAMESPACE_IMPL_START //////////////////////////////////////////////////////////////////////// /// DECLARATIONS /// //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// /// FUNCTION DEFINITIONS /// //////////////////////////////////////////////////////////////////////// /**Function************************************************************* Synopsis [Collects nodes in the DFS order.] Description [] SideEffects [] SeeAlso [] ***********************************************************************/ void Ivy_ManDfs_rec( Ivy_Man_t * p, Ivy_Obj_t * pObj, Vec_Int_t * vNodes ) { if ( Ivy_ObjIsMarkA(pObj) ) return; Ivy_ObjSetMarkA(pObj); if ( Ivy_ObjIsConst1(pObj) || Ivy_ObjIsCi(pObj) ) { if ( p->pHaig == NULL && pObj->pEquiv ) Ivy_ManDfs_rec( p, Ivy_Regular(pObj->pEquiv), vNodes ); return; } //printf( "visiting node %d\n", pObj->Id ); /* if ( pObj->Id == 87 || pObj->Id == 90 ) { int y = 0; } */ assert( Ivy_ObjIsBuf(pObj) || Ivy_ObjIsAnd(pObj) || Ivy_ObjIsExor(pObj) ); Ivy_ManDfs_rec( p, Ivy_ObjFanin0(pObj), vNodes ); if ( !Ivy_ObjIsBuf(pObj) ) Ivy_ManDfs_rec( p, Ivy_ObjFanin1(pObj), vNodes ); if ( p->pHaig == NULL && pObj->pEquiv ) Ivy_ManDfs_rec( p, Ivy_Regular(pObj->pEquiv), vNodes ); Vec_IntPush( vNodes, pObj->Id ); //printf( "adding node %d with fanins %d and %d and equiv %d (refs = %d)\n", // pObj->Id, Ivy_ObjFanin0(pObj)->Id, Ivy_ObjFanin1(pObj)->Id, // pObj->pEquiv? Ivy_Regular(pObj->pEquiv)->Id: -1, Ivy_ObjRefs(pObj) ); }