Go to the source code of this file.
|
| void | Abc_ObjAddFanin (Abc_Obj_t *pObj, Abc_Obj_t *pFanin) |
| |
| void | Abc_ObjDeleteFanin (Abc_Obj_t *pObj, Abc_Obj_t *pFanin) |
| |
| void | Abc_ObjRemoveFanins (Abc_Obj_t *pObj) |
| |
| void | Abc_ObjPatchFanin (Abc_Obj_t *pObj, Abc_Obj_t *pFaninOld, Abc_Obj_t *pFaninNew) |
| |
| void | Abc_ObjPatchFanoutFanin (Abc_Obj_t *pObj, int iObjNew) |
| |
| Abc_Obj_t * | Abc_ObjInsertBetween (Abc_Obj_t *pNodeIn, Abc_Obj_t *pNodeOut, Abc_ObjType_t Type) |
| |
| void | Abc_ObjTransferFanout (Abc_Obj_t *pNodeFrom, Abc_Obj_t *pNodeTo) |
| |
| void | Abc_ObjReplace (Abc_Obj_t *pNodeOld, Abc_Obj_t *pNodeNew) |
| |
| void | Abc_ObjReplaceByConstant (Abc_Obj_t *pNode, int fConst1) |
| |
| int | Abc_ObjFanoutFaninNum (Abc_Obj_t *pFanout, Abc_Obj_t *pFanin) |
| |
◆ Abc_ObjAddFanin()
Function*************************************************************
Synopsis [Creates fanout/fanin relationship between the nodes.]
Description []
SideEffects []
SeeAlso []
Definition at line 84 of file abcFanio.c.
85{
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 );
97}
struct Abc_Obj_t_ Abc_Obj_t
◆ Abc_ObjDeleteFanin()
Function*************************************************************
Synopsis [Destroys fanout/fanin relationship between the nodes.]
Description []
SideEffects []
SeeAlso []
Definition at line 111 of file abcFanio.c.
112{
113 assert( !Abc_ObjIsComplement(pObj) );
114 assert( !Abc_ObjIsComplement(pFanin) );
117 if ( !Vec_IntRemove( &pObj->
vFanins, pFanin->
Id ) )
118 {
119 printf(
"The obj %d is not found among the fanins of obj %d ...\n", pFanin->
Id, pObj->
Id );
120 return;
121 }
122 if ( !Vec_IntRemove( &pFanin->
vFanouts, pObj->
Id ) )
123 {
124 printf(
"The obj %d is not found among the fanouts of obj %d ...\n", pObj->
Id, pFanin->
Id );
125 return;
126 }
127}
◆ Abc_ObjFanoutFaninNum()
Function*************************************************************
Synopsis [Returns the index of the fanin in the fanin list of the fanout.]
Description []
SideEffects []
SeeAlso []
Definition at line 373 of file abcFanio.c.
374{
376 int i;
378 if ( pObj == pFanin )
379 return i;
380 return -1;
381}
#define Abc_ObjForEachFanin(pObj, pFanin, i)
◆ Abc_ObjInsertBetween()
Function*************************************************************
Synopsis [Inserts one-input node of the type specified between the nodes.]
Description []
SideEffects []
SeeAlso []
Definition at line 251 of file abcFanio.c.
252{
254 int iFanoutIndex, iFaninIndex;
255
256 if ( (iFanoutIndex = Vec_IntFind( &pNodeIn->
vFanouts, pNodeOut->
Id )) == -1 )
257 {
258 printf(
"Node %s is not among",
Abc_ObjName(pNodeOut) );
259 printf(
" the fanouts of node %s...\n",
Abc_ObjName(pNodeIn) );
260 return NULL;
261 }
262
263 if ( (iFaninIndex = Vec_IntFind( &pNodeOut->
vFanins, pNodeIn->
Id )) == -1 )
264 {
265 printf(
"Node %s is not among",
Abc_ObjName(pNodeIn) );
266 printf(
" the fanins of node %s...\n",
Abc_ObjName(pNodeOut) );
267 return NULL;
268 }
269
271
274
275 Vec_IntWriteEntry( &pNodeIn->
vFanouts, iFanoutIndex, pNodeNew->
Id );
276
277 Vec_IntWriteEntry( &pNodeOut->
vFanins, iFaninIndex, pNodeNew->
Id );
278 return pNodeNew;
279}
ABC_DLL char * Abc_ObjName(Abc_Obj_t *pNode)
DECLARATIONS ///.
ABC_DLL Abc_Obj_t * Abc_NtkCreateObj(Abc_Ntk_t *pNtk, Abc_ObjType_t Type)
◆ Abc_ObjPatchFanin()
Function*************************************************************
Synopsis [Replaces a fanin of the node.]
Description [The node is pObj. An old fanin of this node (pFaninOld) has to be replaced by a new fanin (pFaninNew). Assumes that the node and the old fanin are not complemented. The new fanin can be complemented. In this case, the polarity of the new fanin will change, compared to the polarity of the old fanin.]
SideEffects []
SeeAlso []
Definition at line 172 of file abcFanio.c.
173{
174 Abc_Obj_t * pFaninNewR = Abc_ObjRegular(pFaninNew);
175 int iFanin;
176 assert( !Abc_ObjIsComplement(pObj) );
177 assert( !Abc_ObjIsComplement(pFaninOld) );
178 assert( pFaninOld != pFaninNewR );
179
180
183 if ( (iFanin = Vec_IntFind( &pObj->
vFanins, pFaninOld->
Id )) == -1 )
184 {
185 printf(
"Node %s is not among",
Abc_ObjName(pFaninOld) );
186 printf(
" the fanins of node %s...\n",
Abc_ObjName(pObj) );
187 return;
188 }
189
190
191
192
193 Vec_IntWriteEntry( &pObj->
vFanins, iFanin, pFaninNewR->
Id );
194
195
196
197 if ( Abc_ObjIsComplement(pFaninNew) )
198 Abc_ObjXorFaninC( pObj, iFanin );
199
200
201
202
203 if ( !Vec_IntRemove( &pFaninOld->
vFanouts, pObj->
Id ) )
204 {
205 printf(
"Node %s is not among",
Abc_ObjName(pObj) );
206 printf(
" the fanouts of its old fanin %s...\n",
Abc_ObjName(pFaninOld) );
207
208 }
210}
◆ Abc_ObjPatchFanoutFanin()
| void Abc_ObjPatchFanoutFanin |
( |
Abc_Obj_t * | pObj, |
|
|
int | iObjNew ) |
Function*************************************************************
Synopsis [Replaces pObj by iObjNew in the fanin arrays of the fanouts.]
Description []
SideEffects []
SeeAlso []
Definition at line 223 of file abcFanio.c.
224{
226 int i, k, Entry;
227
229 {
231 if ( Entry == (int)Abc_ObjId(pObj) )
232 {
233 Vec_IntWriteEntry( &pFanout->
vFanins, k, iObjNew );
234 break;
235 }
237 }
238}
#define Abc_ObjForEachFanout(pObj, pFanout, i)
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
◆ Abc_ObjRemoveFanins()
Function*************************************************************
Synopsis [Destroys fanout/fanin relationship between the nodes.]
Description []
SideEffects []
SeeAlso []
Definition at line 141 of file abcFanio.c.
142{
145 int k;
146
148 for ( k = vFaninsOld->nSize - 1; k >= 0; k-- )
149 {
150 pFanin = Abc_NtkObj( pObj->
pNtk, vFaninsOld->pArray[k] );
152 }
155 assert( vFaninsOld->nSize == 0 );
156}
void Abc_ObjDeleteFanin(Abc_Obj_t *pObj, Abc_Obj_t *pFanin)
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
◆ Abc_ObjReplace()
Function*************************************************************
Synopsis [Replaces the node by a new node.]
Description []
SideEffects []
SeeAlso []
Definition at line 325 of file abcFanio.c.
326{
327 assert( !Abc_ObjIsComplement(pNodeOld) );
328 assert( !Abc_ObjIsComplement(pNodeNew) );
330 assert( pNodeOld != pNodeNew );
331 assert( Abc_ObjFanoutNum(pNodeOld) > 0 );
332
334
336}
void Abc_ObjTransferFanout(Abc_Obj_t *pNodeFrom, Abc_Obj_t *pNodeTo)
ABC_DLL void Abc_NtkDeleteObj_rec(Abc_Obj_t *pObj, int fOnlyNodes)
◆ Abc_ObjReplaceByConstant()
| void Abc_ObjReplaceByConstant |
( |
Abc_Obj_t * | pNode, |
|
|
int | fConst1 ) |
Function*************************************************************
Synopsis [Replaces a node by a constant.]
Description []
SideEffects []
SeeAlso []
Definition at line 349 of file abcFanio.c.
350{
353 assert( !Abc_ObjIsCo(pNode) );
355
357
358 if ( Abc_ObjIsNode(pNode) )
360}
ABC_DLL Abc_Obj_t * Abc_NtkCreateNodeConst1(Abc_Ntk_t *pNtk)
ABC_DLL Abc_Obj_t * Abc_NtkCreateNodeConst0(Abc_Ntk_t *pNtk)
◆ Abc_ObjTransferFanout()
Function*************************************************************
Synopsis [Transfers fanout from the old node to the new node.]
Description []
SideEffects []
SeeAlso []
Definition at line 292 of file abcFanio.c.
293{
295 int nFanoutsOld, i;
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 );
302
303 nFanoutsOld = Abc_ObjFanoutNum(pNodeTo);
304 vFanouts = Vec_PtrAlloc( nFanoutsOld );
306
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 );
312}
void Abc_ObjPatchFanin(Abc_Obj_t *pObj, Abc_Obj_t *pFaninOld, Abc_Obj_t *pFaninNew)
ABC_DLL void Abc_NodeCollectFanouts(Abc_Obj_t *pNode, Vec_Ptr_t *vNodes)
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.