ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
aigObj.c File Reference
#include "aig.h"
Include dependency graph for aigObj.c:

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START Aig_Obj_tAig_ObjCreateCi (Aig_Man_t *p)
 DECLARATIONS ///.
 
Aig_Obj_tAig_ObjCreateCo (Aig_Man_t *p, Aig_Obj_t *pDriver)
 
Aig_Obj_tAig_ObjCreate (Aig_Man_t *p, Aig_Obj_t *pGhost)
 
void Aig_ObjConnect (Aig_Man_t *p, Aig_Obj_t *pObj, Aig_Obj_t *pFan0, Aig_Obj_t *pFan1)
 
void Aig_ObjDisconnect (Aig_Man_t *p, Aig_Obj_t *pObj)
 
void Aig_ObjDelete (Aig_Man_t *p, Aig_Obj_t *pObj)
 
void Aig_ObjDelete_rec (Aig_Man_t *p, Aig_Obj_t *pObj, int fFreeTop)
 
void Aig_ObjDeletePo (Aig_Man_t *p, Aig_Obj_t *pObj)
 
void Aig_ObjPatchFanin0 (Aig_Man_t *p, Aig_Obj_t *pObj, Aig_Obj_t *pFaninNew)
 
void Aig_ObjPrint (Aig_Man_t *p, Aig_Obj_t *pObj)
 
void Aig_NodeFixBufferFanins (Aig_Man_t *p, Aig_Obj_t *pObj, int fUpdateLevel)
 
int Aig_ManPropagateBuffers (Aig_Man_t *p, int fUpdateLevel)
 
void Aig_ObjReplace (Aig_Man_t *p, Aig_Obj_t *pObjOld, Aig_Obj_t *pObjNew, int fUpdateLevel)
 

Function Documentation

◆ Aig_ManPropagateBuffers()

int Aig_ManPropagateBuffers ( Aig_Man_t * p,
int fUpdateLevel )

Function*************************************************************

Synopsis [Returns the number of dangling nodes removed.]

Description []

SideEffects []

SeeAlso []

Definition at line 432 of file aigObj.c.

433{
434 Aig_Obj_t * pObj;
435 int nSteps;
436 assert( p->pFanData );
437 for ( nSteps = 0; Vec_PtrSize(p->vBufs) > 0; nSteps++ )
438 {
439 // get the node with a buffer fanin
440 for ( pObj = (Aig_Obj_t *)Vec_PtrEntryLast(p->vBufs); Aig_ObjIsBuf(pObj); pObj = Aig_ObjFanout0(p, pObj) );
441 // replace this node by a node without buffer
442 Aig_NodeFixBufferFanins( p, pObj, fUpdateLevel );
443 // stop if a cycle occured
444 if ( nSteps > 1000000 )
445 {
446 printf( "Error: A cycle is encountered while propagating buffers.\n" );
447 break;
448 }
449 }
450 return nSteps;
451}
void Aig_NodeFixBufferFanins(Aig_Man_t *p, Aig_Obj_t *pObj, int fUpdateLevel)
Definition aigObj.c:393
struct Aig_Obj_t_ Aig_Obj_t
Definition aig.h:51
Cube * p
Definition exorList.c:222
#define assert(ex)
Definition util_old.h:213
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Aig_NodeFixBufferFanins()

void Aig_NodeFixBufferFanins ( Aig_Man_t * p,
Aig_Obj_t * pObj,
int fUpdateLevel )

Function*************************************************************

Synopsis [Replaces node with a buffer fanin by a node without them.]

Description []

SideEffects []

SeeAlso []

Definition at line 393 of file aigObj.c.

394{
395 Aig_Obj_t * pFanReal0, * pFanReal1, * pResult = NULL;
396 p->nBufFixes++;
397 if ( Aig_ObjIsCo(pObj) )
398 {
399 assert( Aig_ObjIsBuf(Aig_ObjFanin0(pObj)) );
400 pFanReal0 = Aig_ObjReal_rec( Aig_ObjChild0(pObj) );
401 assert( Aig_ObjPhaseReal(Aig_ObjChild0(pObj)) == Aig_ObjPhaseReal(pFanReal0) );
402 Aig_ObjPatchFanin0( p, pObj, pFanReal0 );
403 return;
404 }
405 assert( Aig_ObjIsNode(pObj) );
406 assert( Aig_ObjIsBuf(Aig_ObjFanin0(pObj)) || Aig_ObjIsBuf(Aig_ObjFanin1(pObj)) );
407 // get the real fanins
408 pFanReal0 = Aig_ObjReal_rec( Aig_ObjChild0(pObj) );
409 pFanReal1 = Aig_ObjReal_rec( Aig_ObjChild1(pObj) );
410 // get the new node
411 if ( Aig_ObjIsNode(pObj) )
412 pResult = Aig_Oper( p, pFanReal0, pFanReal1, Aig_ObjType(pObj) );
413// else if ( Aig_ObjIsLatch(pObj) )
414// pResult = Aig_Latch( p, pFanReal0, Aig_ObjInit(pObj) );
415 else
416 assert( 0 );
417 // replace the node with buffer by the node without buffer
418 Aig_ObjReplace( p, pObj, pResult, fUpdateLevel );
419}
void Aig_ObjPatchFanin0(Aig_Man_t *p, Aig_Obj_t *pObj, Aig_Obj_t *pFaninNew)
Definition aigObj.c:282
void Aig_ObjReplace(Aig_Man_t *p, Aig_Obj_t *pObjOld, Aig_Obj_t *pObjNew, int fUpdateLevel)
Definition aigObj.c:467
Aig_Obj_t * Aig_Oper(Aig_Man_t *p, Aig_Obj_t *p0, Aig_Obj_t *p1, Aig_Type_t Type)
Definition aigOper.c:83
Aig_Obj_t * Aig_ObjReal_rec(Aig_Obj_t *pObj)
Definition aigUtil.c:476
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Aig_ObjConnect()

void Aig_ObjConnect ( Aig_Man_t * p,
Aig_Obj_t * pObj,
Aig_Obj_t * pFan0,
Aig_Obj_t * pFan1 )

Function*************************************************************

Synopsis [Connect the object to the fanin.]

Description []

SideEffects []

SeeAlso []

Definition at line 126 of file aigObj.c.

127{
128 assert( !Aig_IsComplement(pObj) );
129 assert( !Aig_ObjIsCi(pObj) );
130 // add the first fanin
131 pObj->pFanin0 = pFan0;
132 pObj->pFanin1 = pFan1;
133 // increment references of the fanins and add their fanouts
134 if ( pFan0 != NULL )
135 {
136 assert( Aig_ObjFanin0(pObj)->Type > 0 );
137 Aig_ObjRef( Aig_ObjFanin0(pObj) );
138 if ( p->pFanData )
139 Aig_ObjAddFanout( p, Aig_ObjFanin0(pObj), pObj );
140 }
141 if ( pFan1 != NULL )
142 {
143 assert( Aig_ObjFanin1(pObj)->Type > 0 );
144 Aig_ObjRef( Aig_ObjFanin1(pObj) );
145 if ( p->pFanData )
146 Aig_ObjAddFanout( p, Aig_ObjFanin1(pObj), pObj );
147 }
148 // set level and phase
149 pObj->Level = Aig_ObjLevelNew( pObj );
150 pObj->fPhase = Aig_ObjPhaseReal(pFan0) & Aig_ObjPhaseReal(pFan1);
151 // add the node to the structural hash table
152 if ( p->pTable && Aig_ObjIsHash(pObj) )
153 Aig_TableInsert( p, pObj );
154 // add the node to the dynamically updated topological order
155// if ( p->pOrderData && Aig_ObjIsNode(pObj) )
156// Aig_ObjOrderInsert( p, pObj->Id );
157 assert( !Aig_ObjIsNode(pObj) || pObj->Level > 0 );
158}
void Aig_TableInsert(Aig_Man_t *p, Aig_Obj_t *pObj)
Definition aigTable.c:173
void Aig_ObjAddFanout(Aig_Man_t *p, Aig_Obj_t *pObj, Aig_Obj_t *pFanout)
Definition aigFanout.c:107
Aig_Obj_t * pFanin1
Definition aig.h:76
Aig_Obj_t * pFanin0
Definition aig.h:75
unsigned Level
Definition aig.h:82
unsigned int fPhase
Definition aig.h:78
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Aig_ObjCreate()

Aig_Obj_t * Aig_ObjCreate ( Aig_Man_t * p,
Aig_Obj_t * pGhost )

Function*************************************************************

Synopsis [Create the new node assuming it does not exist.]

Description []

SideEffects []

SeeAlso []

Definition at line 89 of file aigObj.c.

90{
91 Aig_Obj_t * pObj;
92 assert( !Aig_IsComplement(pGhost) );
93 assert( Aig_ObjIsHash(pGhost) );
94// assert( pGhost == &p->Ghost );
95 // get memory for the new object
96 pObj = Aig_ManFetchMemory( p );
97 pObj->Type = pGhost->Type;
98 // add connections
99 Aig_ObjConnect( p, pObj, pGhost->pFanin0, pGhost->pFanin1 );
100 // update node counters of the manager
101 p->nObjs[Aig_ObjType(pObj)]++;
102 assert( pObj->pData == NULL );
103 // create the power counter
104 if ( p->vProbs )
105 {
106 float Prob0 = Abc_Int2Float( Vec_IntEntry( p->vProbs, Aig_ObjFaninId0(pObj) ) );
107 float Prob1 = Abc_Int2Float( Vec_IntEntry( p->vProbs, Aig_ObjFaninId1(pObj) ) );
108 Prob0 = Aig_ObjFaninC0(pObj)? 1.0 - Prob0 : Prob0;
109 Prob1 = Aig_ObjFaninC1(pObj)? 1.0 - Prob1 : Prob1;
110 Vec_IntSetEntry( p->vProbs, pObj->Id, Abc_Float2Int(Prob0 * Prob1) );
111 }
112 return pObj;
113}
void Aig_ObjConnect(Aig_Man_t *p, Aig_Obj_t *pObj, Aig_Obj_t *pFan0, Aig_Obj_t *pFan1)
Definition aigObj.c:126
int Id
Definition aig.h:85
void * pData
Definition aig.h:87
unsigned int Type
Definition aig.h:77
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Aig_ObjCreateCi()

ABC_NAMESPACE_IMPL_START Aig_Obj_t * Aig_ObjCreateCi ( Aig_Man_t * p)

DECLARATIONS ///.

CFile****************************************************************

FileName [aigObj.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [AIG package.]

Synopsis [Adding/removing objects.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - April 28, 2007.]

Revision [

Id
aigObj.c,v 1.00 2007/04/28 00:00:00 alanmi Exp

] FUNCTION DEFINITIONS /// Function*************************************************************

Synopsis [Creates primary input.]

Description []

SideEffects []

SeeAlso []

Definition at line 45 of file aigObj.c.

46{
47 Aig_Obj_t * pObj;
48 pObj = Aig_ManFetchMemory( p );
49 pObj->Type = AIG_OBJ_CI;
50 Vec_PtrPush( p->vCis, pObj );
51 p->nObjs[AIG_OBJ_CI]++;
52 return pObj;
53}
@ AIG_OBJ_CI
Definition aig.h:60

◆ Aig_ObjCreateCo()

Aig_Obj_t * Aig_ObjCreateCo ( Aig_Man_t * p,
Aig_Obj_t * pDriver )

Function*************************************************************

Synopsis [Creates primary output with the given driver.]

Description []

SideEffects []

SeeAlso []

Definition at line 66 of file aigObj.c.

67{
68 Aig_Obj_t * pObj;
69 pObj = Aig_ManFetchMemory( p );
70 pObj->Type = AIG_OBJ_CO;
71 Vec_PtrPush( p->vCos, pObj );
72 Aig_ObjConnect( p, pObj, pDriver, NULL );
73 p->nObjs[AIG_OBJ_CO]++;
74 return pObj;
75}
@ AIG_OBJ_CO
Definition aig.h:61
Here is the call graph for this function:

◆ Aig_ObjDelete()

void Aig_ObjDelete ( Aig_Man_t * p,
Aig_Obj_t * pObj )

Function*************************************************************

Synopsis [Deletes the node.]

Description []

SideEffects []

SeeAlso []

Definition at line 209 of file aigObj.c.

210{
211 assert( !Aig_IsComplement(pObj) );
212 assert( !Aig_ObjIsTerm(pObj) );
213 assert( Aig_ObjRefs(pObj) == 0 );
214 if ( p->pFanData && Aig_ObjIsBuf(pObj) )
215 Vec_PtrRemove( p->vBufs, pObj );
216 p->nObjs[pObj->Type]--;
217 Vec_PtrWriteEntry( p->vObjs, pObj->Id, NULL );
218 Aig_ManRecycleMemory( p, pObj );
219}
Here is the caller graph for this function:

◆ Aig_ObjDelete_rec()

void Aig_ObjDelete_rec ( Aig_Man_t * p,
Aig_Obj_t * pObj,
int fFreeTop )

Function*************************************************************

Synopsis [Deletes the MFFC of the node.]

Description []

SideEffects []

SeeAlso []

Definition at line 232 of file aigObj.c.

233{
234 Aig_Obj_t * pFanin0, * pFanin1;
235 assert( !Aig_IsComplement(pObj) );
236 if ( Aig_ObjIsConst1(pObj) || Aig_ObjIsCi(pObj) )
237 return;
238 assert( !Aig_ObjIsCo(pObj) );
239 pFanin0 = Aig_ObjFanin0(pObj);
240 pFanin1 = Aig_ObjFanin1(pObj);
241 Aig_ObjDisconnect( p, pObj );
242 if ( fFreeTop )
243 Aig_ObjDelete( p, pObj );
244 if ( pFanin0 && !Aig_ObjIsNone(pFanin0) && Aig_ObjRefs(pFanin0) == 0 )
245 Aig_ObjDelete_rec( p, pFanin0, 1 );
246 if ( pFanin1 && !Aig_ObjIsNone(pFanin1) && Aig_ObjRefs(pFanin1) == 0 )
247 Aig_ObjDelete_rec( p, pFanin1, 1 );
248}
void Aig_ObjDisconnect(Aig_Man_t *p, Aig_Obj_t *pObj)
Definition aigObj.c:171
void Aig_ObjDelete_rec(Aig_Man_t *p, Aig_Obj_t *pObj, int fFreeTop)
Definition aigObj.c:232
void Aig_ObjDelete(Aig_Man_t *p, Aig_Obj_t *pObj)
Definition aigObj.c:209
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Aig_ObjDeletePo()

void Aig_ObjDeletePo ( Aig_Man_t * p,
Aig_Obj_t * pObj )

Function*************************************************************

Synopsis [Deletes the node.]

Description []

SideEffects []

SeeAlso []

Definition at line 261 of file aigObj.c.

262{
263 assert( Aig_ObjIsCo(pObj) );
264 Aig_ObjDeref(Aig_ObjFanin0(pObj));
265 pObj->pFanin0 = NULL;
266 p->nObjs[pObj->Type]--;
267 Vec_PtrWriteEntry( p->vObjs, pObj->Id, NULL );
268 Aig_ManRecycleMemory( p, pObj );
269}
Here is the caller graph for this function:

◆ Aig_ObjDisconnect()

void Aig_ObjDisconnect ( Aig_Man_t * p,
Aig_Obj_t * pObj )

Function*************************************************************

Synopsis [Disconnects the object from the fanins.]

Description []

SideEffects []

SeeAlso []

Definition at line 171 of file aigObj.c.

172{
173 assert( !Aig_IsComplement(pObj) );
174 // remove connections
175 if ( pObj->pFanin0 != NULL )
176 {
177 if ( p->pFanData )
178 Aig_ObjRemoveFanout( p, Aig_ObjFanin0(pObj), pObj );
179 Aig_ObjDeref(Aig_ObjFanin0(pObj));
180 }
181 if ( pObj->pFanin1 != NULL )
182 {
183 if ( p->pFanData )
184 Aig_ObjRemoveFanout( p, Aig_ObjFanin1(pObj), pObj );
185 Aig_ObjDeref(Aig_ObjFanin1(pObj));
186 }
187 // remove the node from the structural hash table
188 if ( p->pTable && Aig_ObjIsHash(pObj) )
189 Aig_TableDelete( p, pObj );
190 // add the first fanin
191 pObj->pFanin0 = NULL;
192 pObj->pFanin1 = NULL;
193 // remove the node from the dynamically updated topological order
194// if ( p->pOrderData && Aig_ObjIsNode(pObj) )
195// Aig_ObjOrderRemove( p, pObj->Id );
196}
void Aig_ObjRemoveFanout(Aig_Man_t *p, Aig_Obj_t *pObj, Aig_Obj_t *pFanout)
Definition aigFanout.c:154
void Aig_TableDelete(Aig_Man_t *p, Aig_Obj_t *pObj)
Definition aigTable.c:196
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Aig_ObjPatchFanin0()

void Aig_ObjPatchFanin0 ( Aig_Man_t * p,
Aig_Obj_t * pObj,
Aig_Obj_t * pFaninNew )

Function*************************************************************

Synopsis [Replaces the first fanin of the node by the new fanin.]

Description []

SideEffects []

SeeAlso []

Definition at line 282 of file aigObj.c.

283{
284 Aig_Obj_t * pFaninOld;
285 assert( !Aig_IsComplement(pObj) );
286 assert( Aig_ObjIsCo(pObj) );
287 pFaninOld = Aig_ObjFanin0(pObj);
288 // decrement ref and remove fanout
289 if ( p->pFanData )
290 Aig_ObjRemoveFanout( p, pFaninOld, pObj );
291 Aig_ObjDeref( pFaninOld );
292 // update the fanin
293 pObj->pFanin0 = pFaninNew;
294 pObj->Level = Aig_ObjLevelNew( pObj );
295 pObj->fPhase = Aig_ObjPhaseReal(pObj->pFanin0);
296 // increment ref and add fanout
297 if ( p->pFanData )
298 Aig_ObjAddFanout( p, Aig_ObjFanin0(pObj), pObj );
299 Aig_ObjRef( Aig_ObjFanin0(pObj) );
300 // get rid of old fanin
301 if ( !Aig_ObjIsCi(pFaninOld) && !Aig_ObjIsConst1(pFaninOld) && Aig_ObjRefs(pFaninOld) == 0 )
302 Aig_ObjDelete_rec( p, pFaninOld, 1 );
303}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Aig_ObjPrint()

void Aig_ObjPrint ( Aig_Man_t * p,
Aig_Obj_t * pObj )

Function*************************************************************

Synopsis [Verbose printing of the AIG node.]

Description []

SideEffects []

SeeAlso []

Definition at line 316 of file aigObj.c.

317{
318 int fShowFanouts = 0;
319 Aig_Obj_t * pTemp;
320 if ( pObj == NULL )
321 {
322 printf( "Object is NULL." );
323 return;
324 }
325 if ( Aig_IsComplement(pObj) )
326 {
327 printf( "Compl " );
328 pObj = Aig_Not(pObj);
329 }
330 assert( !Aig_IsComplement(pObj) );
331 printf( "Node %4d : ", Aig_ObjId(pObj) );
332 if ( Aig_ObjIsConst1(pObj) )
333 printf( "constant 1" );
334 else if ( Aig_ObjIsCi(pObj) )
335 printf( "PI" );
336 else if ( Aig_ObjIsCo(pObj) )
337 printf( "PO( %4d%s )", Aig_ObjFanin0(pObj)->Id, (Aig_ObjFaninC0(pObj)? "\'" : " ") );
338 else if ( Aig_ObjIsBuf(pObj) )
339 printf( "BUF( %d%s )", Aig_ObjFanin0(pObj)->Id, (Aig_ObjFaninC0(pObj)? "\'" : " ") );
340 else
341 printf( "AND( %4d%s, %4d%s )",
342 Aig_ObjFanin0(pObj)->Id, (Aig_ObjFaninC0(pObj)? "\'" : " "),
343 Aig_ObjFanin1(pObj)->Id, (Aig_ObjFaninC1(pObj)? "\'" : " ") );
344 printf( " (refs = %3d)", Aig_ObjRefs(pObj) );
345 if ( fShowFanouts && p->pFanData )
346 {
347 Aig_Obj_t * pFanout;
348 int i;
349 int iFan = -1; // Suppress "might be used uninitialized"
350 printf( "\nFanouts:\n" );
351 Aig_ObjForEachFanout( p, pObj, pFanout, iFan, i )
352 {
353 printf( " " );
354 printf( "Node %4d : ", Aig_ObjId(pFanout) );
355 if ( Aig_ObjIsCo(pFanout) )
356 printf( "PO( %4d%s )", Aig_ObjFanin0(pFanout)->Id, (Aig_ObjFaninC0(pFanout)? "\'" : " ") );
357 else if ( Aig_ObjIsBuf(pFanout) )
358 printf( "BUF( %d%s )", Aig_ObjFanin0(pFanout)->Id, (Aig_ObjFaninC0(pFanout)? "\'" : " ") );
359 else
360 printf( "AND( %4d%s, %4d%s )",
361 Aig_ObjFanin0(pFanout)->Id, (Aig_ObjFaninC0(pFanout)? "\'" : " "),
362 Aig_ObjFanin1(pFanout)->Id, (Aig_ObjFaninC1(pFanout)? "\'" : " ") );
363 printf( "\n" );
364 }
365 return;
366 }
367 // there are choices
368 if ( p->pEquivs && p->pEquivs[pObj->Id] )
369 {
370 // print equivalence class
371 printf( " { %4d ", pObj->Id );
372 for ( pTemp = p->pEquivs[pObj->Id]; pTemp; pTemp = p->pEquivs[pTemp->Id] )
373 printf( " %4d%s", pTemp->Id, (pTemp->fPhase != pObj->fPhase)? "\'" : " " );
374 printf( " }" );
375 return;
376 }
377 // this is a secondary node
378 if ( p->pReprs && p->pReprs[pObj->Id] )
379 printf( " class of %d", pObj->Id );
380}
#define Aig_ObjForEachFanout(p, pObj, pFanout, iFan, i)
Definition aig.h:427
Here is the caller graph for this function:

◆ Aig_ObjReplace()

void Aig_ObjReplace ( Aig_Man_t * p,
Aig_Obj_t * pObjOld,
Aig_Obj_t * pObjNew,
int fUpdateLevel )

Function*************************************************************

Synopsis [Replaces one object by another.]

Description [The new object (pObjNew) should be used instead of the old object (pObjOld). If the new object is complemented or used, the buffer is added and the new object remains in the manager; otherwise, the new object is deleted.]

SideEffects []

SeeAlso []

Definition at line 467 of file aigObj.c.

468{
469 Aig_Obj_t * pObjNewR = Aig_Regular(pObjNew);
470 // the object to be replaced cannot be complemented
471 assert( !Aig_IsComplement(pObjOld) );
472 // the object to be replaced cannot be a terminal
473 assert( !Aig_ObjIsCi(pObjOld) && !Aig_ObjIsCo(pObjOld) );
474 // the object to be used cannot be a buffer or a PO
475 assert( !Aig_ObjIsBuf(pObjNewR) && !Aig_ObjIsCo(pObjNewR) );
476 // the object cannot be the same
477 assert( pObjOld != pObjNewR );
478 // make sure object is not pointing to itself
479 assert( pObjOld != Aig_ObjFanin0(pObjNewR) );
480 assert( pObjOld != Aig_ObjFanin1(pObjNewR) );
481 if ( pObjOld == Aig_ObjFanin0(pObjNewR) || pObjOld == Aig_ObjFanin1(pObjNewR) )
482 {
483 printf( "Aig_ObjReplace(): Internal error!\n" );
484 exit(1);
485 }
486 // recursively delete the old node - but leave the object there
487 pObjNewR->nRefs++;
488 Aig_ObjDelete_rec( p, pObjOld, 0 );
489 pObjNewR->nRefs--;
490 // if the new object is complemented or already used, create a buffer
491 p->nObjs[pObjOld->Type]--;
492 if ( Aig_IsComplement(pObjNew) || Aig_ObjRefs(pObjNew) > 0 || !Aig_ObjIsNode(pObjNew) )
493 {
494 pObjOld->Type = AIG_OBJ_BUF;
495 Aig_ObjConnect( p, pObjOld, pObjNew, NULL );
496 p->nBufReplaces++;
497 }
498 else
499 {
500 Aig_Obj_t * pFanin0 = pObjNew->pFanin0;
501 Aig_Obj_t * pFanin1 = pObjNew->pFanin1;
502 int LevelOld = pObjOld->Level;
503 pObjOld->Type = pObjNew->Type;
504 Aig_ObjDisconnect( p, pObjNew );
505 Aig_ObjConnect( p, pObjOld, pFanin0, pFanin1 );
506 // delete the new object
507 Aig_ObjDelete( p, pObjNew );
508 // update levels
509 if ( p->pFanData )
510 {
511 pObjOld->Level = LevelOld;
512 Aig_ManUpdateLevel( p, pObjOld );
513 }
514 if ( fUpdateLevel )
515 {
516 Aig_ObjClearReverseLevel( p, pObjOld );
517 Aig_ManUpdateReverseLevel( p, pObjOld );
518 }
519 }
520 p->nObjs[pObjOld->Type]++;
521 // store buffers if fanout is allocated
522 if ( p->pFanData && Aig_ObjIsBuf(pObjOld) )
523 {
524 Vec_PtrPush( p->vBufs, pObjOld );
525 p->nBufMax = Abc_MaxInt( p->nBufMax, Vec_PtrSize(p->vBufs) );
526 Aig_ManPropagateBuffers( p, fUpdateLevel );
527 }
528}
int Aig_ManPropagateBuffers(Aig_Man_t *p, int fUpdateLevel)
Definition aigObj.c:432
void Aig_ObjClearReverseLevel(Aig_Man_t *p, Aig_Obj_t *pObj)
Definition aigTiming.c:83
@ AIG_OBJ_BUF
Definition aig.h:62
void Aig_ManUpdateReverseLevel(Aig_Man_t *p, Aig_Obj_t *pObjNew)
Definition aigTiming.c:247
void Aig_ManUpdateLevel(Aig_Man_t *p, Aig_Obj_t *pObjNew)
Definition aigTiming.c:195
unsigned int nRefs
Definition aig.h:81
VOID_HACK exit()
Here is the call graph for this function:
Here is the caller graph for this function: