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

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START int Aig_ManVerifyTopoOrder (Aig_Man_t *p)
 DECLARATIONS ///.
 
void Aig_ManDfs_rec (Aig_Man_t *p, Aig_Obj_t *pObj, Vec_Ptr_t *vNodes)
 
Vec_Ptr_tAig_ManDfs (Aig_Man_t *p, int fNodesOnly)
 
void Aig_ManDfsAll_rec (Aig_Man_t *p, Aig_Obj_t *pObj, Vec_Ptr_t *vNodes)
 
Vec_Ptr_tAig_ManDfsArray (Aig_Man_t *p, Aig_Obj_t **pNodes, int nNodes)
 
Vec_Ptr_tAig_ManDfsAll (Aig_Man_t *p)
 
void Aig_ManDfsPreorder_rec (Aig_Man_t *p, Aig_Obj_t *pObj, Vec_Ptr_t *vNodes)
 
Vec_Ptr_tAig_ManDfsPreorder (Aig_Man_t *p, int fNodesOnly)
 
Vec_Vec_tAig_ManLevelize (Aig_Man_t *p)
 
Vec_Ptr_tAig_ManDfsNodes (Aig_Man_t *p, Aig_Obj_t **ppNodes, int nNodes)
 
void Aig_ManDfsChoices_rec (Aig_Man_t *p, Aig_Obj_t *pObj, Vec_Ptr_t *vNodes)
 
Vec_Ptr_tAig_ManDfsChoices (Aig_Man_t *p)
 
void Aig_ManDfsReverse_rec (Aig_Man_t *p, Aig_Obj_t *pObj, Vec_Ptr_t *vNodes)
 
Vec_Ptr_tAig_ManDfsReverse (Aig_Man_t *p)
 
int Aig_ManLevelNum (Aig_Man_t *p)
 
void Aig_ManChoiceLevel_rec (Aig_Man_t *p, Aig_Obj_t *pObj)
 
int Aig_ManChoiceLevel (Aig_Man_t *p)
 
void Aig_ConeMark_rec (Aig_Obj_t *pObj)
 
void Aig_ConeCleanAndMark_rec (Aig_Obj_t *pObj)
 
int Aig_ConeCountAndMark_rec (Aig_Obj_t *pObj)
 
void Aig_ConeUnmark_rec (Aig_Obj_t *pObj)
 
int Aig_DagSize (Aig_Obj_t *pObj)
 
void Aig_SupportSize_rec (Aig_Man_t *p, Aig_Obj_t *pObj, int *pCounter)
 
int Aig_SupportSize (Aig_Man_t *p, Aig_Obj_t *pObj)
 
int Aig_SupportSizeTest (Aig_Man_t *p)
 
void Aig_Support_rec (Aig_Man_t *p, Aig_Obj_t *pObj, Vec_Ptr_t *vSupp)
 
Vec_Ptr_tAig_Support (Aig_Man_t *p, Aig_Obj_t *pObj)
 
void Aig_SupportNodes (Aig_Man_t *p, Aig_Obj_t **ppObjs, int nObjs, Vec_Ptr_t *vSupp)
 
void Aig_Transfer_rec (Aig_Man_t *pDest, Aig_Obj_t *pObj)
 
Aig_Obj_tAig_Transfer (Aig_Man_t *pSour, Aig_Man_t *pDest, Aig_Obj_t *pRoot, int nVars)
 
void Aig_Compose_rec (Aig_Man_t *p, Aig_Obj_t *pObj, Aig_Obj_t *pFunc, Aig_Obj_t *pVar)
 
Aig_Obj_tAig_Compose (Aig_Man_t *p, Aig_Obj_t *pRoot, Aig_Obj_t *pFunc, int iVar)
 
void Aig_ObjCollectCut_rec (Aig_Obj_t *pNode, Vec_Ptr_t *vNodes)
 
void Aig_ObjCollectCut (Aig_Obj_t *pRoot, Vec_Ptr_t *vLeaves, Vec_Ptr_t *vNodes)
 
int Aig_ObjCollectSuper_rec (Aig_Obj_t *pRoot, Aig_Obj_t *pObj, Vec_Ptr_t *vSuper)
 
int Aig_ObjCollectSuper (Aig_Obj_t *pObj, Vec_Ptr_t *vSuper)
 

Function Documentation

◆ Aig_Compose()

Aig_Obj_t * Aig_Compose ( Aig_Man_t * p,
Aig_Obj_t * pRoot,
Aig_Obj_t * pFunc,
int iVar )

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

Synopsis [Composes the AIG (pRoot) with the function (pFunc) using PI var (iVar).]

Description []

SideEffects []

SeeAlso []

Definition at line 980 of file aigDfs.c.

981{
982 // quit if the PI variable is not defined
983 if ( iVar >= Aig_ManCiNum(p) )
984 {
985 printf( "Aig_Compose(): The PI variable %d is not defined.\n", iVar );
986 return NULL;
987 }
988 // recursively perform composition
989 Aig_Compose_rec( p, Aig_Regular(pRoot), pFunc, Aig_ManCi(p, iVar) );
990 // clear the markings
991 Aig_ConeUnmark_rec( Aig_Regular(pRoot) );
992 return Aig_NotCond( (Aig_Obj_t *)Aig_Regular(pRoot)->pData, Aig_IsComplement(pRoot) );
993}
void Aig_ConeUnmark_rec(Aig_Obj_t *pObj)
Definition aigDfs.c:704
void Aig_Compose_rec(Aig_Man_t *p, Aig_Obj_t *pObj, Aig_Obj_t *pFunc, Aig_Obj_t *pVar)
Definition aigDfs.c:952
struct Aig_Obj_t_ Aig_Obj_t
Definition aig.h:51
Cube * p
Definition exorList.c:222
Here is the call graph for this function:

◆ Aig_Compose_rec()

void Aig_Compose_rec ( Aig_Man_t * p,
Aig_Obj_t * pObj,
Aig_Obj_t * pFunc,
Aig_Obj_t * pVar )

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

Synopsis [Composes the AIG (pRoot) with the function (pFunc) using PI var (iVar).]

Description []

SideEffects []

SeeAlso []

Definition at line 952 of file aigDfs.c.

953{
954 assert( !Aig_IsComplement(pObj) );
955 if ( Aig_ObjIsMarkA(pObj) )
956 return;
957 if ( Aig_ObjIsConst1(pObj) || Aig_ObjIsCi(pObj) )
958 {
959 pObj->pData = pObj == pVar ? pFunc : pObj;
960 return;
961 }
962 Aig_Compose_rec( p, Aig_ObjFanin0(pObj), pFunc, pVar );
963 Aig_Compose_rec( p, Aig_ObjFanin1(pObj), pFunc, pVar );
964 pObj->pData = Aig_And( p, Aig_ObjChild0Copy(pObj), Aig_ObjChild1Copy(pObj) );
965 assert( !Aig_ObjIsMarkA(pObj) ); // loop detection
966 Aig_ObjSetMarkA( pObj );
967}
Aig_Obj_t * Aig_And(Aig_Man_t *p, Aig_Obj_t *p0, Aig_Obj_t *p1)
Definition aigOper.c:104
void * pData
Definition aig.h:87
#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_ConeCleanAndMark_rec()

void Aig_ConeCleanAndMark_rec ( Aig_Obj_t * pObj)

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

Synopsis [Counts the number of AIG nodes rooted at this cone.]

Description []

SideEffects []

SeeAlso []

Definition at line 657 of file aigDfs.c.

658{
659 assert( !Aig_IsComplement(pObj) );
660 if ( !Aig_ObjIsNode(pObj) || Aig_ObjIsMarkA(pObj) )
661 return;
662 Aig_ConeCleanAndMark_rec( Aig_ObjFanin0(pObj) );
663 Aig_ConeCleanAndMark_rec( Aig_ObjFanin1(pObj) );
664 assert( !Aig_ObjIsMarkA(pObj) ); // loop detection
665 Aig_ObjSetMarkA( pObj );
666 pObj->pData = NULL;
667}
void Aig_ConeCleanAndMark_rec(Aig_Obj_t *pObj)
Definition aigDfs.c:657
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Aig_ConeCountAndMark_rec()

int Aig_ConeCountAndMark_rec ( Aig_Obj_t * pObj)

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

Synopsis [Counts the number of AIG nodes rooted at this cone.]

Description []

SideEffects []

SeeAlso []

Definition at line 680 of file aigDfs.c.

681{
682 int Counter;
683 assert( !Aig_IsComplement(pObj) );
684 if ( !Aig_ObjIsNode(pObj) || Aig_ObjIsMarkA(pObj) )
685 return 0;
686 Counter = 1 + Aig_ConeCountAndMark_rec( Aig_ObjFanin0(pObj) ) +
687 Aig_ConeCountAndMark_rec( Aig_ObjFanin1(pObj) );
688 assert( !Aig_ObjIsMarkA(pObj) ); // loop detection
689 Aig_ObjSetMarkA( pObj );
690 return Counter;
691}
int Aig_ConeCountAndMark_rec(Aig_Obj_t *pObj)
Definition aigDfs.c:680
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Aig_ConeMark_rec()

void Aig_ConeMark_rec ( Aig_Obj_t * pObj)

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

Synopsis [Counts the number of AIG nodes rooted at this cone.]

Description []

SideEffects []

SeeAlso []

Definition at line 635 of file aigDfs.c.

636{
637 assert( !Aig_IsComplement(pObj) );
638 if ( !Aig_ObjIsNode(pObj) || Aig_ObjIsMarkA(pObj) )
639 return;
640 Aig_ConeMark_rec( Aig_ObjFanin0(pObj) );
641 Aig_ConeMark_rec( Aig_ObjFanin1(pObj) );
642 assert( !Aig_ObjIsMarkA(pObj) ); // loop detection
643 Aig_ObjSetMarkA( pObj );
644}
void Aig_ConeMark_rec(Aig_Obj_t *pObj)
Definition aigDfs.c:635
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Aig_ConeUnmark_rec()

void Aig_ConeUnmark_rec ( Aig_Obj_t * pObj)

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

Synopsis [Counts the number of AIG nodes rooted at this cone.]

Description []

SideEffects []

SeeAlso []

Definition at line 704 of file aigDfs.c.

705{
706 assert( !Aig_IsComplement(pObj) );
707 if ( !Aig_ObjIsNode(pObj) || !Aig_ObjIsMarkA(pObj) )
708 return;
709 Aig_ConeUnmark_rec( Aig_ObjFanin0(pObj) );
710 Aig_ConeUnmark_rec( Aig_ObjFanin1(pObj) );
711 assert( Aig_ObjIsMarkA(pObj) ); // loop detection
712 Aig_ObjClearMarkA( pObj );
713}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Aig_DagSize()

int Aig_DagSize ( Aig_Obj_t * pObj)

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

Synopsis [Counts the number of AIG nodes rooted at this cone.]

Description []

SideEffects []

SeeAlso []

Definition at line 726 of file aigDfs.c.

727{
728 int Counter;
729 Counter = Aig_ConeCountAndMark_rec( Aig_Regular(pObj) );
730 Aig_ConeUnmark_rec( Aig_Regular(pObj) );
731 return Counter;
732}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Aig_ManChoiceLevel()

int Aig_ManChoiceLevel ( Aig_Man_t * p)

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

Synopsis [Computes levels for AIG with choices and white boxes.]

Description []

SideEffects []

SeeAlso []

Definition at line 595 of file aigDfs.c.

596{
597 Aig_Obj_t * pObj;
598 int i, LevelMax = 0;
599 Aig_ManForEachObj( p, pObj, i )
600 Aig_ObjSetLevel( pObj, 0 );
603 Aig_ManForEachCo( p, pObj, i )
604 {
605 Aig_ManChoiceLevel_rec( p, pObj );
606 if ( LevelMax < Aig_ObjLevel(pObj) )
607 LevelMax = Aig_ObjLevel(pObj);
608 }
609 // account for dangling boxes
610 Aig_ManForEachCi( p, pObj, i )
611 {
612 Aig_ManChoiceLevel_rec( p, pObj );
613 if ( LevelMax < Aig_ObjLevel(pObj) )
614 LevelMax = Aig_ObjLevel(pObj);
615 }
617// Aig_ManForEachNode( p, pObj, i )
618// assert( Aig_ObjLevel(pObj) > 0 );
619 return LevelMax;
620}
void Aig_ManChoiceLevel_rec(Aig_Man_t *p, Aig_Obj_t *pObj)
Definition aigDfs.c:523
void Aig_ManSetCioIds(Aig_Man_t *p)
Definition aigUtil.c:978
#define Aig_ManForEachObj(p, pObj, i)
Definition aig.h:403
void Aig_ManIncrementTravId(Aig_Man_t *p)
DECLARATIONS ///.
Definition aigUtil.c:44
#define Aig_ManForEachCi(p, pObj, i)
ITERATORS ///.
Definition aig.h:393
void Aig_ManCleanCioIds(Aig_Man_t *p)
Definition aigUtil.c:999
#define Aig_ManForEachCo(p, pObj, i)
Definition aig.h:398
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Aig_ManChoiceLevel_rec()

void Aig_ManChoiceLevel_rec ( Aig_Man_t * p,
Aig_Obj_t * pObj )

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

Synopsis [Computes levels for AIG with choices and white boxes.]

Description []

SideEffects []

SeeAlso []

Definition at line 523 of file aigDfs.c.

524{
525 Aig_Obj_t * pNext;
526 int i, iBox, iTerm1, nTerms, LevelMax = 0;
527 if ( Aig_ObjIsTravIdCurrent( p, pObj ) )
528 return;
529 Aig_ObjSetTravIdCurrent( p, pObj );
530 if ( Aig_ObjIsCi(pObj) )
531 {
532 if ( p->pManTime )
533 {
534 iBox = Tim_ManBoxForCi( (Tim_Man_t *)p->pManTime, Aig_ObjCioId(pObj) );
535 if ( iBox >= 0 ) // this is not a true PI
536 {
537 iTerm1 = Tim_ManBoxInputFirst( (Tim_Man_t *)p->pManTime, iBox );
538 nTerms = Tim_ManBoxInputNum( (Tim_Man_t *)p->pManTime, iBox );
539 for ( i = 0; i < nTerms; i++ )
540 {
541 pNext = Aig_ManCo(p, iTerm1 + i);
542 Aig_ManChoiceLevel_rec( p, pNext );
543 if ( LevelMax < Aig_ObjLevel(pNext) )
544 LevelMax = Aig_ObjLevel(pNext);
545 }
546 LevelMax++;
547 }
548 }
549// printf( "%d ", pObj->Level );
550 }
551 else if ( Aig_ObjIsCo(pObj) )
552 {
553 pNext = Aig_ObjFanin0(pObj);
554 Aig_ManChoiceLevel_rec( p, pNext );
555 if ( LevelMax < Aig_ObjLevel(pNext) )
556 LevelMax = Aig_ObjLevel(pNext);
557 }
558 else if ( Aig_ObjIsNode(pObj) )
559 {
560 // get the maximum level of the two fanins
561 pNext = Aig_ObjFanin0(pObj);
562 Aig_ManChoiceLevel_rec( p, pNext );
563 if ( LevelMax < Aig_ObjLevel(pNext) )
564 LevelMax = Aig_ObjLevel(pNext);
565 pNext = Aig_ObjFanin1(pObj);
566 Aig_ManChoiceLevel_rec( p, pNext );
567 if ( LevelMax < Aig_ObjLevel(pNext) )
568 LevelMax = Aig_ObjLevel(pNext);
569 LevelMax++;
570
571 // get the level of the nodes in the choice node
572 if ( p->pEquivs && (pNext = Aig_ObjEquiv(p, pObj)) )
573 {
574 Aig_ManChoiceLevel_rec( p, pNext );
575 if ( LevelMax < Aig_ObjLevel(pNext) )
576 LevelMax = Aig_ObjLevel(pNext);
577 }
578 }
579 else if ( !Aig_ObjIsConst1(pObj) )
580 assert( 0 );
581 Aig_ObjSetLevel( pObj, LevelMax );
582}
typedefABC_NAMESPACE_HEADER_START struct Tim_Man_t_ Tim_Man_t
INCLUDES ///.
Definition tim.h:92
int Tim_ManBoxForCi(Tim_Man_t *p, int iCo)
Definition timBox.c:87
int Tim_ManBoxInputFirst(Tim_Man_t *p, int iBox)
Definition timBox.c:123
int Tim_ManBoxInputNum(Tim_Man_t *p, int iBox)
Definition timBox.c:187
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Aig_ManDfs()

Vec_Ptr_t * Aig_ManDfs ( Aig_Man_t * p,
int fNodesOnly )

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

Synopsis [Collects objects of the AIG in the DFS order.]

Description [Works with choice nodes.]

SideEffects []

SeeAlso []

Definition at line 145 of file aigDfs.c.

146{
147 Vec_Ptr_t * vNodes;
148 Aig_Obj_t * pObj;
149 int i;
151 Aig_ObjSetTravIdCurrent( p, Aig_ManConst1(p) );
152 // start the array of nodes
153 vNodes = Vec_PtrAlloc( Aig_ManObjNumMax(p) );
154 // mark PIs if they should not be collected
155 if ( fNodesOnly )
156 Aig_ManForEachCi( p, pObj, i )
157 Aig_ObjSetTravIdCurrent( p, pObj );
158 else
159 Vec_PtrPush( vNodes, Aig_ManConst1(p) );
160 // collect nodes reachable in the DFS order
161 Aig_ManForEachCo( p, pObj, i )
162 Aig_ManDfs_rec( p, fNodesOnly? Aig_ObjFanin0(pObj): pObj, vNodes );
163 if ( fNodesOnly )
164 assert( Vec_PtrSize(vNodes) == Aig_ManNodeNum(p) );
165 else
166 assert( Vec_PtrSize(vNodes) == Aig_ManObjNum(p) );
167 return vNodes;
168}
void Aig_ManDfs_rec(Aig_Man_t *p, Aig_Obj_t *pObj, Vec_Ptr_t *vNodes)
Definition aigDfs.c:119
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition vecPtr.h:42
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Aig_ManDfs_rec()

void Aig_ManDfs_rec ( Aig_Man_t * p,
Aig_Obj_t * pObj,
Vec_Ptr_t * vNodes )

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

Synopsis [Collects internal nodes in the DFS order.]

Description []

SideEffects []

SeeAlso []

Definition at line 119 of file aigDfs.c.

120{
121 if ( pObj == NULL )
122 return;
123 assert( !Aig_IsComplement(pObj) );
124 if ( Aig_ObjIsTravIdCurrent(p, pObj) )
125 return;
126 Aig_ObjSetTravIdCurrent(p, pObj);
127 if ( p->pEquivs && Aig_ObjEquiv(p, pObj) )
128 Aig_ManDfs_rec( p, Aig_ObjEquiv(p, pObj), vNodes );
129 Aig_ManDfs_rec( p, Aig_ObjFanin0(pObj), vNodes );
130 Aig_ManDfs_rec( p, Aig_ObjFanin1(pObj), vNodes );
131 Vec_PtrPush( vNodes, pObj );
132}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Aig_ManDfsAll()

Vec_Ptr_t * Aig_ManDfsAll ( Aig_Man_t * p)

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

Synopsis [Collects objects of the AIG in the DFS order.]

Description []

SideEffects []

SeeAlso []

Definition at line 228 of file aigDfs.c.

229{
230 Vec_Ptr_t * vNodes;
231 Aig_Obj_t * pObj;
232 int i;
234 vNodes = Vec_PtrAlloc( Aig_ManObjNumMax(p) );
235 // add constant
236 Aig_ObjSetTravIdCurrent( p, Aig_ManConst1(p) );
237 Vec_PtrPush( vNodes, Aig_ManConst1(p) );
238 // collect nodes reachable in the DFS order
239 Aig_ManForEachCo( p, pObj, i )
240 Aig_ManDfsAll_rec( p, pObj, vNodes );
241 Aig_ManForEachCi( p, pObj, i )
242 if ( !Aig_ObjIsTravIdCurrent(p, pObj) )
243 Vec_PtrPush( vNodes, pObj );
244 assert( Vec_PtrSize(vNodes) == Aig_ManObjNum(p) );
245 return vNodes;
246}
void Aig_ManDfsAll_rec(Aig_Man_t *p, Aig_Obj_t *pObj, Vec_Ptr_t *vNodes)
Definition aigDfs.c:181
Here is the call graph for this function:

◆ Aig_ManDfsAll_rec()

void Aig_ManDfsAll_rec ( Aig_Man_t * p,
Aig_Obj_t * pObj,
Vec_Ptr_t * vNodes )

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

Synopsis [Collects internal nodes in the DFS order.]

Description []

SideEffects []

SeeAlso []

Definition at line 181 of file aigDfs.c.

182{
183 if ( Aig_ObjIsTravIdCurrent(p, pObj) )
184 return;
185 Aig_ObjSetTravIdCurrent(p, pObj);
186 if ( Aig_ObjIsCi(pObj) )
187 {
188 Vec_PtrPush( vNodes, pObj );
189 return;
190 }
191 if ( Aig_ObjIsCo(pObj) )
192 {
193 Aig_ManDfsAll_rec( p, Aig_ObjFanin0(pObj), vNodes );
194 Vec_PtrPush( vNodes, pObj );
195 return;
196 }
197 assert( Aig_ObjIsNode(pObj) );
198 Aig_ManDfsAll_rec( p, Aig_ObjFanin0(pObj), vNodes );
199 Aig_ManDfsAll_rec( p, Aig_ObjFanin1(pObj), vNodes );
200 Vec_PtrPush( vNodes, pObj );
201}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Aig_ManDfsArray()

Vec_Ptr_t * Aig_ManDfsArray ( Aig_Man_t * p,
Aig_Obj_t ** pNodes,
int nNodes )

Definition at line 202 of file aigDfs.c.

203{
204 Vec_Ptr_t * vNodes;
205 int i;
207 vNodes = Vec_PtrAlloc( Aig_ManObjNumMax(p) );
208 // add constant
209 Aig_ObjSetTravIdCurrent( p, Aig_ManConst1(p) );
210 Vec_PtrPush( vNodes, Aig_ManConst1(p) );
211 // collect nodes reachable in the DFS order
212 for ( i = 0; i < nNodes; i++ )
213 Aig_ManDfsAll_rec( p, pNodes[i], vNodes );
214 return vNodes;
215}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Aig_ManDfsChoices()

Vec_Ptr_t * Aig_ManDfsChoices ( Aig_Man_t * p)

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

Synopsis [Collects internal nodes in the DFS order.]

Description []

SideEffects []

SeeAlso []

Definition at line 405 of file aigDfs.c.

406{
407 Vec_Ptr_t * vNodes;
408 Aig_Obj_t * pObj;
409 int i, Counter = 0;
410
411 Aig_ManForEachNode( p, pObj, i )
412 {
413 if ( Aig_ObjEquiv(p, pObj) == NULL )
414 continue;
415 Counter = 0;
416 for ( pObj = Aig_ObjEquiv(p, pObj) ; pObj; pObj = Aig_ObjEquiv(p, pObj) )
417 Counter++;
418// printf( "%d ", Counter );
419 }
420// printf( "\n" );
421
422 assert( p->pEquivs != NULL );
424 // mark constant and PIs
425 Aig_ObjSetTravIdCurrent( p, Aig_ManConst1(p) );
426 Aig_ManForEachCi( p, pObj, i )
427 Aig_ObjSetTravIdCurrent( p, pObj );
428 // go through the nodes
429 vNodes = Vec_PtrAlloc( Aig_ManNodeNum(p) );
430 Aig_ManForEachCo( p, pObj, i )
431 Aig_ManDfsChoices_rec( p, Aig_ObjFanin0(pObj), vNodes );
432 return vNodes;
433}
void Aig_ManDfsChoices_rec(Aig_Man_t *p, Aig_Obj_t *pObj, Vec_Ptr_t *vNodes)
Definition aigDfs.c:378
#define Aig_ManForEachNode(p, pObj, i)
Definition aig.h:413
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Aig_ManDfsChoices_rec()

void Aig_ManDfsChoices_rec ( Aig_Man_t * p,
Aig_Obj_t * pObj,
Vec_Ptr_t * vNodes )

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

Synopsis [Collects internal nodes in the DFS order.]

Description []

SideEffects []

SeeAlso []

Definition at line 378 of file aigDfs.c.

379{
380 if ( pObj == NULL )
381 return;
382 assert( !Aig_IsComplement(pObj) );
383 if ( Aig_ObjIsTravIdCurrent(p, pObj) )
384 return;
385 assert( Aig_ObjIsNode(pObj) );
386 Aig_ManDfsChoices_rec( p, Aig_ObjFanin0(pObj), vNodes );
387 Aig_ManDfsChoices_rec( p, Aig_ObjFanin1(pObj), vNodes );
388 Aig_ManDfsChoices_rec( p, Aig_ObjEquiv(p, pObj), vNodes );
389 assert( !Aig_ObjIsTravIdCurrent(p, pObj) ); // loop detection
390 Aig_ObjSetTravIdCurrent(p, pObj);
391 Vec_PtrPush( vNodes, pObj );
392}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Aig_ManDfsNodes()

Vec_Ptr_t * Aig_ManDfsNodes ( Aig_Man_t * p,
Aig_Obj_t ** ppNodes,
int nNodes )

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

Synopsis [Collects internal nodes and PIs in the DFS order.]

Description []

SideEffects []

SeeAlso []

Definition at line 347 of file aigDfs.c.

348{
349 Vec_Ptr_t * vNodes;
350// Aig_Obj_t * pObj;
351 int i;
353 // mark constant and PIs
354 Aig_ObjSetTravIdCurrent( p, Aig_ManConst1(p) );
355// Aig_ManForEachCi( p, pObj, i )
356// Aig_ObjSetTravIdCurrent( p, pObj );
357 // go through the nodes
358 vNodes = Vec_PtrAlloc( Aig_ManNodeNum(p) );
359 for ( i = 0; i < nNodes; i++ )
360 if ( Aig_ObjIsCo(ppNodes[i]) )
361 Aig_ManDfs_rec( p, Aig_ObjFanin0(ppNodes[i]), vNodes );
362 else
363 Aig_ManDfs_rec( p, ppNodes[i], vNodes );
364 return vNodes;
365}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Aig_ManDfsPreorder()

Vec_Ptr_t * Aig_ManDfsPreorder ( Aig_Man_t * p,
int fNodesOnly )

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

Synopsis [Collects objects of the AIG in the DFS order.]

Description [Works with choice nodes.]

SideEffects []

SeeAlso []

Definition at line 285 of file aigDfs.c.

286{
287 Vec_Ptr_t * vNodes;
288 Aig_Obj_t * pObj;
289 int i;
291 Aig_ObjSetTravIdCurrent( p, Aig_ManConst1(p) );
292 // start the array of nodes
293 vNodes = Vec_PtrAlloc( Aig_ManObjNumMax(p) );
294 // mark PIs if they should not be collected
295 if ( fNodesOnly )
296 Aig_ManForEachCi( p, pObj, i )
297 Aig_ObjSetTravIdCurrent( p, pObj );
298 else
299 Vec_PtrPush( vNodes, Aig_ManConst1(p) );
300 // collect nodes reachable in the DFS order
301 Aig_ManForEachCo( p, pObj, i )
302 Aig_ManDfsPreorder_rec( p, fNodesOnly? Aig_ObjFanin0(pObj): pObj, vNodes );
303 if ( fNodesOnly )
304 assert( Vec_PtrSize(vNodes) == Aig_ManNodeNum(p) );
305 else
306 assert( Vec_PtrSize(vNodes) == Aig_ManObjNum(p) );
307 return vNodes;
308}
void Aig_ManDfsPreorder_rec(Aig_Man_t *p, Aig_Obj_t *pObj, Vec_Ptr_t *vNodes)
Definition aigDfs.c:259
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Aig_ManDfsPreorder_rec()

void Aig_ManDfsPreorder_rec ( Aig_Man_t * p,
Aig_Obj_t * pObj,
Vec_Ptr_t * vNodes )

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

Synopsis [Collects internal nodes in the DFS order.]

Description []

SideEffects []

SeeAlso []

Definition at line 259 of file aigDfs.c.

260{
261 if ( pObj == NULL )
262 return;
263 assert( !Aig_IsComplement(pObj) );
264 if ( Aig_ObjIsTravIdCurrent(p, pObj) )
265 return;
266 Aig_ObjSetTravIdCurrent(p, pObj);
267 Vec_PtrPush( vNodes, pObj );
268 if ( p->pEquivs && Aig_ObjEquiv(p, pObj) )
269 Aig_ManDfs_rec( p, Aig_ObjEquiv(p, pObj), vNodes );
270 Aig_ManDfsPreorder_rec( p, Aig_ObjFanin0(pObj), vNodes );
271 Aig_ManDfsPreorder_rec( p, Aig_ObjFanin1(pObj), vNodes );
272}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Aig_ManDfsReverse()

Vec_Ptr_t * Aig_ManDfsReverse ( Aig_Man_t * p)

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

Synopsis [Collects internal nodes in the reverse DFS order.]

Description []

SideEffects []

SeeAlso []

Definition at line 472 of file aigDfs.c.

473{
474 Vec_Ptr_t * vNodes;
475 Aig_Obj_t * pObj;
476 int i;
478 // mark POs
479 Aig_ManForEachCo( p, pObj, i )
480 Aig_ObjSetTravIdCurrent( p, pObj );
481 // go through the nodes
482 vNodes = Vec_PtrAlloc( Aig_ManNodeNum(p) );
483 Aig_ManForEachObj( p, pObj, i )
484 if ( Aig_ObjIsNode(pObj) || Aig_ObjIsBuf(pObj) )
485 Aig_ManDfsReverse_rec( p, pObj, vNodes );
486 return vNodes;
487}
void Aig_ManDfsReverse_rec(Aig_Man_t *p, Aig_Obj_t *pObj, Vec_Ptr_t *vNodes)
Definition aigDfs.c:446
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Aig_ManDfsReverse_rec()

void Aig_ManDfsReverse_rec ( Aig_Man_t * p,
Aig_Obj_t * pObj,
Vec_Ptr_t * vNodes )

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

Synopsis [Collects internal nodes in the reverse DFS order.]

Description []

SideEffects []

SeeAlso []

Definition at line 446 of file aigDfs.c.

447{
448 Aig_Obj_t * pFanout;
449 int iFanout = -1, i;
450 assert( !Aig_IsComplement(pObj) );
451 if ( Aig_ObjIsTravIdCurrent(p, pObj) )
452 return;
453 assert( Aig_ObjIsNode(pObj) || Aig_ObjIsBuf(pObj) );
454 Aig_ObjForEachFanout( p, pObj, pFanout, iFanout, i )
455 Aig_ManDfsReverse_rec( p, pFanout, vNodes );
456 assert( !Aig_ObjIsTravIdCurrent(p, pObj) ); // loop detection
457 Aig_ObjSetTravIdCurrent(p, pObj);
458 Vec_PtrPush( vNodes, pObj );
459}
#define Aig_ObjForEachFanout(p, pObj, pFanout, iFan, i)
Definition aig.h:427
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Aig_ManLevelize()

Vec_Vec_t * Aig_ManLevelize ( Aig_Man_t * p)

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

Synopsis [Levelizes the nodes.]

Description []

SideEffects []

SeeAlso []

Definition at line 321 of file aigDfs.c.

322{
323 Aig_Obj_t * pObj;
324 Vec_Vec_t * vLevels;
325 int nLevels, i;
326 nLevels = Aig_ManLevelNum( p );
327 vLevels = Vec_VecStart( nLevels + 1 );
328 Aig_ManForEachObj( p, pObj, i )
329 {
330 assert( (int)pObj->Level <= nLevels );
331 Vec_VecPush( vLevels, pObj->Level, pObj );
332 }
333 return vLevels;
334}
int Aig_ManLevelNum(Aig_Man_t *p)
Definition aigDfs.c:500
unsigned Level
Definition aig.h:82
typedefABC_NAMESPACE_HEADER_START struct Vec_Vec_t_ Vec_Vec_t
INCLUDES ///.
Definition vecVec.h:42
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Aig_ManLevelNum()

int Aig_ManLevelNum ( Aig_Man_t * p)

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

Synopsis [Computes the max number of levels in the manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 500 of file aigDfs.c.

501{
502 Aig_Obj_t * pObj;
503 int i, LevelsMax;
504 LevelsMax = 0;
505 Aig_ManForEachCo( p, pObj, i )
506 LevelsMax = Abc_MaxInt( LevelsMax, (int)Aig_ObjFanin0(pObj)->Level );
507 return LevelsMax;
508}
Here is the caller graph for this function:

◆ Aig_ManVerifyTopoOrder()

ABC_NAMESPACE_IMPL_START int Aig_ManVerifyTopoOrder ( Aig_Man_t * p)

DECLARATIONS ///.

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

FileName [aigDfs.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [AIG package.]

Synopsis [DFS traversal procedures.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

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

Revision [

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

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

Synopsis [Verifies that the objects are in a topo order.]

Description []

SideEffects []

SeeAlso []

Definition at line 46 of file aigDfs.c.

47{
48 Aig_Obj_t * pObj, * pNext;
49 int i, k, iBox, iTerm1, nTerms;
52 Aig_ManForEachObj( p, pObj, i )
53 {
54 if ( Aig_ObjIsNode(pObj) )
55 {
56 pNext = Aig_ObjFanin0(pObj);
57 if ( !Aig_ObjIsTravIdCurrent(p,pNext) )
58 {
59 printf( "Node %d has fanin %d that is not in a topological order.\n", pObj->Id, pNext->Id );
60 return 0;
61 }
62 pNext = Aig_ObjFanin1(pObj);
63 if ( !Aig_ObjIsTravIdCurrent(p,pNext) )
64 {
65 printf( "Node %d has fanin %d that is not in a topological order.\n", pObj->Id, pNext->Id );
66 return 0;
67 }
68 }
69 else if ( Aig_ObjIsCo(pObj) || Aig_ObjIsBuf(pObj) )
70 {
71 pNext = Aig_ObjFanin0(pObj);
72 if ( !Aig_ObjIsTravIdCurrent(p,pNext) )
73 {
74 printf( "Node %d has fanin %d that is not in a topological order.\n", pObj->Id, pNext->Id );
75 return 0;
76 }
77 }
78 else if ( Aig_ObjIsCi(pObj) )
79 {
80 if ( p->pManTime )
81 {
82 iBox = Tim_ManBoxForCi( (Tim_Man_t *)p->pManTime, Aig_ObjCioId(pObj) );
83 if ( iBox >= 0 ) // this is not a true PI
84 {
85 iTerm1 = Tim_ManBoxInputFirst( (Tim_Man_t *)p->pManTime, iBox );
86 nTerms = Tim_ManBoxInputNum( (Tim_Man_t *)p->pManTime, iBox );
87 for ( k = 0; k < nTerms; k++ )
88 {
89 pNext = Aig_ManCo( p, iTerm1 + k );
90 assert( Tim_ManBoxForCo( (Tim_Man_t *)p->pManTime, Aig_ObjCioId(pNext) ) == iBox );
91 if ( !Aig_ObjIsTravIdCurrent(p,pNext) )
92 {
93 printf( "Box %d has input %d that is not in a topological order.\n", iBox, pNext->Id );
94 return 0;
95 }
96 }
97 }
98 }
99 }
100 else if ( !Aig_ObjIsConst1(pObj) )
101 assert( 0 );
102 Aig_ObjSetTravIdCurrent( p, pObj );
103 }
105 return 1;
106}
int Id
Definition aig.h:85
int Tim_ManBoxForCo(Tim_Man_t *p, int iCi)
Definition timBox.c:105
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Aig_ObjCollectCut()

void Aig_ObjCollectCut ( Aig_Obj_t * pRoot,
Vec_Ptr_t * vLeaves,
Vec_Ptr_t * vNodes )

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

Synopsis [Computes the internal nodes of the cut.]

Description [Does not include the leaves of the cut.]

SideEffects []

SeeAlso []

Definition at line 1031 of file aigDfs.c.

1032{
1033 Aig_Obj_t * pObj;
1034 int i;
1035 // collect and mark the leaves
1036 Vec_PtrClear( vNodes );
1037 Vec_PtrForEachEntry( Aig_Obj_t *, vLeaves, pObj, i )
1038 {
1039 assert( pObj->fMarkA == 0 );
1040 pObj->fMarkA = 1;
1041// printf( "%d " , pObj->Id );
1042 }
1043//printf( "\n" );
1044 // collect and mark the nodes
1045 Aig_ObjCollectCut_rec( pRoot, vNodes );
1046 // clean the nodes
1047 Vec_PtrForEachEntry( Aig_Obj_t *, vNodes, pObj, i )
1048 pObj->fMarkA = 0;
1049 Vec_PtrForEachEntry( Aig_Obj_t *, vLeaves, pObj, i )
1050 pObj->fMarkA = 0;
1051}
void Aig_ObjCollectCut_rec(Aig_Obj_t *pNode, Vec_Ptr_t *vNodes)
Definition aigDfs.c:1006
unsigned int fMarkA
Definition aig.h:79
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition vecPtr.h:55
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Aig_ObjCollectCut_rec()

void Aig_ObjCollectCut_rec ( Aig_Obj_t * pNode,
Vec_Ptr_t * vNodes )

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

Synopsis [Computes the internal nodes of the cut.]

Description []

SideEffects []

SeeAlso []

Definition at line 1006 of file aigDfs.c.

1007{
1008// Aig_Obj_t * pFan0 = Aig_ObjFanin0(pNode);
1009// Aig_Obj_t * pFan1 = Aig_ObjFanin1(pNode);
1010 if ( pNode->fMarkA )
1011 return;
1012 pNode->fMarkA = 1;
1013 assert( Aig_ObjIsNode(pNode) );
1014 Aig_ObjCollectCut_rec( Aig_ObjFanin0(pNode), vNodes );
1015 Aig_ObjCollectCut_rec( Aig_ObjFanin1(pNode), vNodes );
1016 Vec_PtrPush( vNodes, pNode );
1017//printf( "added %d ", pNode->Id );
1018}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Aig_ObjCollectSuper()

int Aig_ObjCollectSuper ( Aig_Obj_t * pObj,
Vec_Ptr_t * vSuper )

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

Synopsis [Collects the nodes of the supergate.]

Description []

SideEffects []

SeeAlso []

Definition at line 1111 of file aigDfs.c.

1112{
1113 int RetValue, i;
1114 assert( !Aig_IsComplement(pObj) );
1115 assert( Aig_ObjIsNode(pObj) );
1116 // collect the nodes in the implication supergate
1117 Vec_PtrClear( vSuper );
1118 RetValue = Aig_ObjCollectSuper_rec( pObj, pObj, vSuper );
1119 assert( Vec_PtrSize(vSuper) > 1 );
1120 // unmark the visited nodes
1121 Vec_PtrForEachEntry( Aig_Obj_t *, vSuper, pObj, i )
1122 Aig_Regular(pObj)->fMarkA = 0;
1123 // if we found the node and its complement in the same implication supergate,
1124 // return empty set of nodes (meaning that we should use constant-0 node)
1125 if ( RetValue == -1 )
1126 vSuper->nSize = 0;
1127 return RetValue;
1128}
int Aig_ObjCollectSuper_rec(Aig_Obj_t *pRoot, Aig_Obj_t *pObj, Vec_Ptr_t *vSuper)
Definition aigDfs.c:1065
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Aig_ObjCollectSuper_rec()

int Aig_ObjCollectSuper_rec ( Aig_Obj_t * pRoot,
Aig_Obj_t * pObj,
Vec_Ptr_t * vSuper )

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

Synopsis [Collects the nodes of the supergate.]

Description []

SideEffects []

SeeAlso []

Definition at line 1065 of file aigDfs.c.

1066{
1067 int RetValue1, RetValue2, i;
1068 // check if the node is visited
1069 if ( Aig_Regular(pObj)->fMarkA )
1070 {
1071 // check if the node occurs in the same polarity
1072 for ( i = 0; i < vSuper->nSize; i++ )
1073 if ( vSuper->pArray[i] == pObj )
1074 return 1;
1075 // check if the node is present in the opposite polarity
1076 for ( i = 0; i < vSuper->nSize; i++ )
1077 if ( vSuper->pArray[i] == Aig_Not(pObj) )
1078 return -1;
1079 assert( 0 );
1080 return 0;
1081 }
1082 // if the new node is complemented or a PI, another gate begins
1083 if ( pObj != pRoot && (Aig_IsComplement(pObj) || Aig_ObjType(pObj) != Aig_ObjType(pRoot) || Aig_ObjRefs(pObj) > 1) )
1084 {
1085 Vec_PtrPush( vSuper, pObj );
1086 Aig_Regular(pObj)->fMarkA = 1;
1087 return 0;
1088 }
1089 assert( !Aig_IsComplement(pObj) );
1090 assert( Aig_ObjIsNode(pObj) );
1091 // go through the branches
1092 RetValue1 = Aig_ObjCollectSuper_rec( pRoot, Aig_ObjReal_rec( Aig_ObjChild0(pObj) ), vSuper );
1093 RetValue2 = Aig_ObjCollectSuper_rec( pRoot, Aig_ObjReal_rec( Aig_ObjChild1(pObj) ), vSuper );
1094 if ( RetValue1 == -1 || RetValue2 == -1 )
1095 return -1;
1096 // return 1 if at least one branch has a duplicate
1097 return RetValue1 || RetValue2;
1098}
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_Support()

Vec_Ptr_t * Aig_Support ( Aig_Man_t * p,
Aig_Obj_t * pObj )

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

Synopsis [Counts the support size of the node.]

Description []

SideEffects []

SeeAlso []

Definition at line 846 of file aigDfs.c.

847{
848 Vec_Ptr_t * vSupp;
849 assert( !Aig_IsComplement(pObj) );
850 assert( !Aig_ObjIsCo(pObj) );
852 vSupp = Vec_PtrAlloc( 100 );
853 Aig_Support_rec( p, pObj, vSupp );
854 return vSupp;
855}
void Aig_Support_rec(Aig_Man_t *p, Aig_Obj_t *pObj, Vec_Ptr_t *vSupp)
Definition aigDfs.c:817
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Aig_Support_rec()

void Aig_Support_rec ( Aig_Man_t * p,
Aig_Obj_t * pObj,
Vec_Ptr_t * vSupp )

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

Synopsis [Counts the support size of the node.]

Description []

SideEffects []

SeeAlso []

Definition at line 817 of file aigDfs.c.

818{
819 if ( Aig_ObjIsTravIdCurrent(p, pObj) )
820 return;
821 Aig_ObjSetTravIdCurrent(p, pObj);
822 if ( Aig_ObjIsConst1(pObj) )
823 return;
824 if ( Aig_ObjIsCi(pObj) )
825 {
826 Vec_PtrPush( vSupp, pObj );
827 return;
828 }
829 assert( Aig_ObjIsNode(pObj) || Aig_ObjIsBuf(pObj) );
830 Aig_Support_rec( p, Aig_ObjFanin0(pObj), vSupp );
831 if ( Aig_ObjFanin1(pObj) )
832 Aig_Support_rec( p, Aig_ObjFanin1(pObj), vSupp );
833}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Aig_SupportNodes()

void Aig_SupportNodes ( Aig_Man_t * p,
Aig_Obj_t ** ppObjs,
int nObjs,
Vec_Ptr_t * vSupp )

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

Synopsis [Counts the support size of the node.]

Description []

SideEffects []

SeeAlso []

Definition at line 868 of file aigDfs.c.

869{
870 int i;
871 Vec_PtrClear( vSupp );
873 Aig_ObjSetTravIdCurrent( p, Aig_ManConst1(p) );
874 for ( i = 0; i < nObjs; i++ )
875 {
876 assert( !Aig_IsComplement(ppObjs[i]) );
877 if ( Aig_ObjIsCo(ppObjs[i]) )
878 Aig_Support_rec( p, Aig_ObjFanin0(ppObjs[i]), vSupp );
879 else
880 Aig_Support_rec( p, ppObjs[i], vSupp );
881 }
882}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Aig_SupportSize()

int Aig_SupportSize ( Aig_Man_t * p,
Aig_Obj_t * pObj )

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

Synopsis [Counts the support size of the node.]

Description []

SideEffects []

SeeAlso []

Definition at line 772 of file aigDfs.c.

773{
774 int Counter = 0;
775 assert( !Aig_IsComplement(pObj) );
776 assert( !Aig_ObjIsCo(pObj) );
778 Aig_SupportSize_rec( p, pObj, &Counter );
779 return Counter;
780}
void Aig_SupportSize_rec(Aig_Man_t *p, Aig_Obj_t *pObj, int *pCounter)
Definition aigDfs.c:745
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Aig_SupportSize_rec()

void Aig_SupportSize_rec ( Aig_Man_t * p,
Aig_Obj_t * pObj,
int * pCounter )

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

Synopsis [Counts the support size of the node.]

Description []

SideEffects []

SeeAlso []

Definition at line 745 of file aigDfs.c.

746{
747 if ( Aig_ObjIsTravIdCurrent(p, pObj) )
748 return;
749 Aig_ObjSetTravIdCurrent(p, pObj);
750 if ( Aig_ObjIsCi(pObj) )
751 {
752 (*pCounter)++;
753 return;
754 }
755 assert( Aig_ObjIsNode(pObj) || Aig_ObjIsBuf(pObj) );
756 Aig_SupportSize_rec( p, Aig_ObjFanin0(pObj), pCounter );
757 if ( Aig_ObjFanin1(pObj) )
758 Aig_SupportSize_rec( p, Aig_ObjFanin1(pObj), pCounter );
759}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Aig_SupportSizeTest()

int Aig_SupportSizeTest ( Aig_Man_t * p)

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

Synopsis [Counts the support size of the node.]

Description []

SideEffects []

SeeAlso []

Definition at line 793 of file aigDfs.c.

794{
795 Aig_Obj_t * pObj;
796 int i, Counter = 0;
797 abctime clk = Abc_Clock();
798 Aig_ManForEachObj( p, pObj, i )
799 if ( Aig_ObjIsNode(pObj) )
800 Counter += (Aig_SupportSize(p, pObj) <= 16);
801 printf( "Nodes with small support %d (out of %d)\n", Counter, Aig_ManNodeNum(p) );
802 Abc_PrintTime( 1, "Time", Abc_Clock() - clk );
803 return Counter;
804}
ABC_INT64_T abctime
Definition abc_global.h:332
int Aig_SupportSize(Aig_Man_t *p, Aig_Obj_t *pObj)
Definition aigDfs.c:772
Here is the call graph for this function:

◆ Aig_Transfer()

Aig_Obj_t * Aig_Transfer ( Aig_Man_t * pSour,
Aig_Man_t * pDest,
Aig_Obj_t * pRoot,
int nVars )

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

Synopsis [Transfers the AIG from one manager into another.]

Description []

SideEffects []

SeeAlso []

Definition at line 918 of file aigDfs.c.

919{
920 Aig_Obj_t * pObj;
921 int i;
922 // solve simple cases
923 if ( pSour == pDest )
924 return pRoot;
925 if ( Aig_ObjIsConst1( Aig_Regular(pRoot) ) )
926 return Aig_NotCond( Aig_ManConst1(pDest), Aig_IsComplement(pRoot) );
927 // set the PI mapping
928 Aig_ManForEachCi( pSour, pObj, i )
929 {
930 if ( i == nVars )
931 break;
932 pObj->pData = Aig_IthVar(pDest, i);
933 }
934 // transfer and set markings
935 Aig_Transfer_rec( pDest, Aig_Regular(pRoot) );
936 // clear the markings
937 Aig_ConeUnmark_rec( Aig_Regular(pRoot) );
938 return Aig_NotCond( (Aig_Obj_t *)Aig_Regular(pRoot)->pData, Aig_IsComplement(pRoot) );
939}
void Aig_Transfer_rec(Aig_Man_t *pDest, Aig_Obj_t *pObj)
Definition aigDfs.c:895
Aig_Obj_t * Aig_IthVar(Aig_Man_t *p, int i)
FUNCTION DEFINITIONS ///.
Definition aigOper.c:63
Here is the call graph for this function:

◆ Aig_Transfer_rec()

void Aig_Transfer_rec ( Aig_Man_t * pDest,
Aig_Obj_t * pObj )

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

Synopsis [Transfers the AIG from one manager into another.]

Description []

SideEffects []

SeeAlso []

Definition at line 895 of file aigDfs.c.

896{
897 assert( !Aig_IsComplement(pObj) );
898 if ( !Aig_ObjIsNode(pObj) || Aig_ObjIsMarkA(pObj) )
899 return;
900 Aig_Transfer_rec( pDest, Aig_ObjFanin0(pObj) );
901 Aig_Transfer_rec( pDest, Aig_ObjFanin1(pObj) );
902 pObj->pData = Aig_And( pDest, Aig_ObjChild0Copy(pObj), Aig_ObjChild1Copy(pObj) );
903 assert( !Aig_ObjIsMarkA(pObj) ); // loop detection
904 Aig_ObjSetMarkA( pObj );
905}
Here is the call graph for this function:
Here is the caller graph for this function: