47 if (
p->nSize ==
p->nCap )
60 for ( i = 0; i <
p->nSize; i++ )
61 pArray[i] =
p->pArray[i];
70 p->pArray[
p->nSize++] = Entry;
86 Abc_Obj_t * pFaninR = Abc_ObjRegular(pFanin);
87 assert( !Abc_ObjIsComplement(pObj) );
90 assert( !Abc_ObjIsPi(pObj) && !Abc_ObjIsPo(pFaninR) );
91 assert( !Abc_ObjIsCo(pObj) || !Abc_ObjFaninNum(pObj) );
92 assert( !Abc_ObjIsNet(pObj) || !Abc_ObjFaninNum(pObj) );
95 if ( Abc_ObjIsComplement(pFanin) )
96 Abc_ObjSetFaninC( pObj, Abc_ObjFaninNum(pObj)-1 );
113 assert( !Abc_ObjIsComplement(pObj) );
114 assert( !Abc_ObjIsComplement(pFanin) );
117 if ( !Vec_IntRemove( &pObj->
vFanins, pFanin->
Id ) )
119 printf(
"The obj %d is not found among the fanins of obj %d ...\n", pFanin->
Id, pObj->
Id );
122 if ( !Vec_IntRemove( &pFanin->
vFanouts, pObj->
Id ) )
124 printf(
"The obj %d is not found among the fanouts of obj %d ...\n", pObj->
Id, pFanin->
Id );
148 for ( k = vFaninsOld->nSize - 1; k >= 0; k-- )
150 pFanin = Abc_NtkObj( pObj->
pNtk, vFaninsOld->pArray[k] );
155 assert( vFaninsOld->nSize == 0 );
174 Abc_Obj_t * pFaninNewR = Abc_ObjRegular(pFaninNew);
176 assert( !Abc_ObjIsComplement(pObj) );
177 assert( !Abc_ObjIsComplement(pFaninOld) );
178 assert( pFaninOld != pFaninNewR );
183 if ( (iFanin = Vec_IntFind( &pObj->
vFanins, pFaninOld->
Id )) == -1 )
185 printf(
"Node %s is not among",
Abc_ObjName(pFaninOld) );
186 printf(
" the fanins of node %s...\n",
Abc_ObjName(pObj) );
193 Vec_IntWriteEntry( &pObj->
vFanins, iFanin, pFaninNewR->
Id );
197 if ( Abc_ObjIsComplement(pFaninNew) )
198 Abc_ObjXorFaninC( pObj, iFanin );
203 if ( !Vec_IntRemove( &pFaninOld->
vFanouts, pObj->
Id ) )
205 printf(
"Node %s is not among",
Abc_ObjName(pObj) );
206 printf(
" the fanouts of its old fanin %s...\n",
Abc_ObjName(pFaninOld) );
231 if ( Entry == (
int)Abc_ObjId(pObj) )
233 Vec_IntWriteEntry( &pFanout->
vFanins, k, iObjNew );
254 int iFanoutIndex, iFaninIndex;
256 if ( (iFanoutIndex = Vec_IntFind( &pNodeIn->
vFanouts, pNodeOut->
Id )) == -1 )
258 printf(
"Node %s is not among",
Abc_ObjName(pNodeOut) );
259 printf(
" the fanouts of node %s...\n",
Abc_ObjName(pNodeIn) );
263 if ( (iFaninIndex = Vec_IntFind( &pNodeOut->
vFanins, pNodeIn->
Id )) == -1 )
265 printf(
"Node %s is not among",
Abc_ObjName(pNodeIn) );
266 printf(
" the fanins of node %s...\n",
Abc_ObjName(pNodeOut) );
275 Vec_IntWriteEntry( &pNodeIn->
vFanouts, iFanoutIndex, pNodeNew->
Id );
277 Vec_IntWriteEntry( &pNodeOut->
vFanins, iFaninIndex, pNodeNew->
Id );
296 assert( !Abc_ObjIsComplement(pNodeFrom) );
297 assert( !Abc_ObjIsComplement(pNodeTo) );
298 assert( !Abc_ObjIsPo(pNodeFrom) && !Abc_ObjIsPo(pNodeTo) );
300 assert( pNodeFrom != pNodeTo );
301 assert( !Abc_ObjIsNode(pNodeFrom) || Abc_ObjFanoutNum(pNodeFrom) > 0 );
303 nFanoutsOld = Abc_ObjFanoutNum(pNodeTo);
304 vFanouts = Vec_PtrAlloc( nFanoutsOld );
307 for ( i = 0; i < vFanouts->nSize; i++ )
309 assert( Abc_ObjFanoutNum(pNodeFrom) == 0 );
310 assert( Abc_ObjFanoutNum(pNodeTo) == nFanoutsOld + vFanouts->nSize );
311 Vec_PtrFree( vFanouts );
327 assert( !Abc_ObjIsComplement(pNodeOld) );
328 assert( !Abc_ObjIsComplement(pNodeNew) );
330 assert( pNodeOld != pNodeNew );
331 assert( Abc_ObjFanoutNum(pNodeOld) > 0 );
353 assert( !Abc_ObjIsCo(pNode) );
358 if ( Abc_ObjIsNode(pNode) )
378 if ( pObj == pFanin )
void Abc_ObjTransferFanout(Abc_Obj_t *pNodeFrom, Abc_Obj_t *pNodeTo)
void Abc_ObjRemoveFanins(Abc_Obj_t *pObj)
void Abc_ObjPatchFanoutFanin(Abc_Obj_t *pObj, int iObjNew)
void Abc_ObjDeleteFanin(Abc_Obj_t *pObj, Abc_Obj_t *pFanin)
void Abc_ObjAddFanin(Abc_Obj_t *pObj, Abc_Obj_t *pFanin)
void Abc_ObjPatchFanin(Abc_Obj_t *pObj, Abc_Obj_t *pFaninOld, Abc_Obj_t *pFaninNew)
int Abc_ObjFanoutFaninNum(Abc_Obj_t *pFanout, Abc_Obj_t *pFanin)
Abc_Obj_t * Abc_ObjInsertBetween(Abc_Obj_t *pNodeIn, Abc_Obj_t *pNodeOut, Abc_ObjType_t Type)
void Abc_ObjReplaceByConstant(Abc_Obj_t *pNode, int fConst1)
void Abc_ObjReplace(Abc_Obj_t *pNodeOld, Abc_Obj_t *pNodeNew)
struct Abc_Obj_t_ Abc_Obj_t
ABC_DLL Abc_Obj_t * Abc_NtkCreateNodeConst1(Abc_Ntk_t *pNtk)
ABC_DLL Abc_Obj_t * Abc_NtkCreateNodeConst0(Abc_Ntk_t *pNtk)
#define Abc_ObjForEachFanin(pObj, pFanin, i)
#define Abc_ObjForEachFanout(pObj, pFanout, i)
ABC_DLL char * Abc_ObjName(Abc_Obj_t *pNode)
DECLARATIONS ///.
ABC_DLL void Abc_NtkDeleteObj_rec(Abc_Obj_t *pObj, int fOnlyNodes)
ABC_DLL void Abc_NodeCollectFanouts(Abc_Obj_t *pNode, Vec_Ptr_t *vNodes)
ABC_DLL Abc_Obj_t * Abc_NtkCreateObj(Abc_Ntk_t *pNtk, Abc_ObjType_t Type)
#define ABC_ALLOC(type, num)
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
char * Mem_StepEntryFetch(Mem_Step_t *p, int nBytes)
void Mem_StepEntryRecycle(Mem_Step_t *p, char *pEntry, int nBytes)
struct Mem_Step_t_ Mem_Step_t
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.