diff options
Diffstat (limited to 'src/base')
-rw-r--r-- | src/base/abc/abc.h | 1 | ||||
-rw-r--r-- | src/base/abc/abcFanio.c | 28 |
2 files changed, 29 insertions, 0 deletions
diff --git a/src/base/abc/abc.h b/src/base/abc/abc.h index 09d12e0b..23da283d 100644 --- a/src/base/abc/abc.h +++ b/src/base/abc/abc.h @@ -646,6 +646,7 @@ extern ABC_DLL void Abc_ObjAddFanin( Abc_Obj_t * pObj, Abc_Obj_t * extern ABC_DLL void Abc_ObjDeleteFanin( Abc_Obj_t * pObj, Abc_Obj_t * pFanin ); extern ABC_DLL void Abc_ObjRemoveFanins( Abc_Obj_t * pObj ); extern ABC_DLL void Abc_ObjPatchFanin( Abc_Obj_t * pObj, Abc_Obj_t * pFaninOld, Abc_Obj_t * pFaninNew ); +extern ABC_DLL void Abc_ObjPatchFanoutFanin( Abc_Obj_t * pObj, int iObjNew ); extern ABC_DLL Abc_Obj_t * Abc_ObjInsertBetween( Abc_Obj_t * pNodeIn, Abc_Obj_t * pNodeOut, Abc_ObjType_t Type ); extern ABC_DLL void Abc_ObjTransferFanout( Abc_Obj_t * pObjOld, Abc_Obj_t * pObjNew ); extern ABC_DLL void Abc_ObjReplace( Abc_Obj_t * pObjOld, Abc_Obj_t * pObjNew ); diff --git a/src/base/abc/abcFanio.c b/src/base/abc/abcFanio.c index d7998780..caa57a4e 100644 --- a/src/base/abc/abcFanio.c +++ b/src/base/abc/abcFanio.c @@ -211,6 +211,34 @@ void Abc_ObjPatchFanin( Abc_Obj_t * pObj, Abc_Obj_t * pFaninOld, Abc_Obj_t * pFa /**Function************************************************************* + Synopsis [Replaces pObj by iObjNew in the fanin arrays of the fanouts.] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ +void Abc_ObjPatchFanoutFanin( Abc_Obj_t * pObj, int iObjNew ) +{ + Abc_Obj_t * pFanout; + int i, k, Entry; + // update fanouts of the node to point to this one + Abc_ObjForEachFanout( pObj, pFanout, i ) + { + Vec_IntForEachEntry( &pFanout->vFanins, Entry, k ) + if ( Entry == (int)Abc_ObjId(pObj) ) + { + Vec_IntWriteEntry( &pFanout->vFanins, k, iObjNew ); + break; + } + assert( k < Vec_IntSize(&pFanout->vFanins) ); + } +} + +/**Function************************************************************* + Synopsis [Inserts one-input node of the type specified between the nodes.] Description [] |