114 return p0 == p->pConst1 ? p1 :
Aig_Not(p->pConst1);
116 return p1 == p->pConst1 ? p0 :
Aig_Not(p->pConst1);
120 Aig_Obj_t * pFanA, * pFanB, * pFanC, * pFanD;
138 if ( pFanA == p1 || pFanB == p1 )
154 if ( pFanC == p0 || pFanD == p0 )
161 if ( pFanA == pFanC || pFanB == pFanC )
162 return Aig_And( p, p0, pFanD );
163 if ( pFanB == pFanC || pFanB == pFanD )
164 return Aig_And( p, pFanA, p1 );
165 if ( pFanA == pFanD || pFanB == pFanD )
166 return Aig_And( p, p0, pFanC );
167 if ( pFanA == pFanC || pFanA == pFanD )
168 return Aig_And( p, pFanB, p1 );
174 if ( pFanB == pFanC || pFanB == pFanD )
176 if ( pFanA == pFanC || pFanA == pFanD )
183 if ( pFanD == pFanA || pFanD == pFanB )
185 if ( pFanC == pFanA || pFanC == pFanB )
190 if ( pFanA == pFanD && pFanB ==
Aig_Not(pFanC) )
192 if ( pFanB == pFanC && pFanA ==
Aig_Not(pFanD) )
194 if ( pFanA == pFanC && pFanB ==
Aig_Not(pFanD) )
196 if ( pFanB == pFanD && pFanA ==
Aig_Not(pFanC) )
234 if ( !p->fCatchExor )
319 int fUseMuxCanon = 0;
320 Aig_Obj_t * pTempA1, * pTempA2, * pTempB1, * pTempB2, * pTemp;
339 return Aig_Or( p, pC, p0 );
343 if ( pTempA1 && pTempA2 )
346 if ( pTemp )
return Aig_Not(pTemp);
348 Count0 = (pTempA1 != NULL) + (pTempA2 != NULL);
352 if ( pTempB1 && pTempB2 )
355 if ( pTemp )
return pTemp;
357 Count1 = (pTempB1 != NULL) + (pTempB2 != NULL);
359 if ( Count0 >= Count1 )
378 return Aig_Or( p,
Aig_Or(p,
Aig_And(p, pA, pB),
Aig_And(p, pA, pC)),
Aig_And(p, pB, pC) );
398 pObj2 =
Aig_Multi_rec( p, ppObjs + nObjs/2, nObjs - nObjs/2, Type );
399 return Aig_Oper( p, pObj1, pObj2, Type );
434 assert( vPairs->nSize > 0 );
435 assert( vPairs->nSize % 2 == 0 );
436 for ( i = 0; i < vPairs->nSize; i += 2 )
438 vPairs->nSize = vPairs->nSize/2;
456 assert( vNodes1->nSize > 0 && vNodes1->nSize > 0 );
457 assert( vNodes1->nSize == vNodes2->nSize );
458 for ( i = 0; i < vNodes1->nSize; i++ )
479 for ( i = 0; i < nVars; i++ )
500 for ( i = 0; i < nVars; i++ )
521 for ( i = 0; i < nVars; i++ )
541 Aig_Obj_t * pObj, * pFanin0, * pFanin1, * pCtrl;
549 for ( i = 0; i < nPIs; i++ )
551 for ( i = 0; i < nNodes; i++ )
553 if ( rand() % 10 == 0 )
555 else if ( rand() % 10 == 0 )
557 else if ( rand() % 3 == 0 || i < nPIs )
561 if ( rand() % 2 == 0 )
564 if ( rand() % 10 == 0 )
566 else if ( rand() % 10 == 0 )
568 else if ( rand() % 3 == 0 || i < nPIs )
572 if ( rand() % 2 == 0 )
575 if ( rand() % 10 == 0 )
577 else if ( rand() % 10 == 0 )
579 else if ( rand() % 3 == 0 || i < nPIs )
583 if ( rand() % 2 == 0 )
586 pObj =
Aig_Mux( p, pCtrl, pFanin1, pFanin0 );
Aig_Obj_t * Aig_ObjCreateCo(Aig_Man_t *p, Aig_Obj_t *pDriver)
static ABC_NAMESPACE_IMPL_START int Aig_ObjIsExorType(Aig_Obj_t *p0, Aig_Obj_t *p1, Aig_Obj_t **ppFan0, Aig_Obj_t **ppFan1)
DECLARATIONS ///.
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
static Aig_Obj_t * Aig_ObjChild0(Aig_Obj_t *pObj)
Aig_Obj_t * Aig_TableLookup(Aig_Man_t *p, Aig_Obj_t *pGhost)
void Aig_ManStop(Aig_Man_t *p)
Aig_Obj_t * Aig_Exor(Aig_Man_t *p, Aig_Obj_t *p0, Aig_Obj_t *p1)
static int Aig_ManObjNum(Aig_Man_t *p)
Aig_Obj_t * Aig_Maj(Aig_Man_t *p, Aig_Obj_t *pA, Aig_Obj_t *pB, Aig_Obj_t *pC)
static Aig_Obj_t * Aig_ObjFanin0(Aig_Obj_t *pObj)
Aig_Obj_t * Aig_CreateExor(Aig_Man_t *p, int nVars)
Aig_Man_t * Aig_ManStart(int nNodesMax)
DECLARATIONS ///.
static int Aig_IsComplement(Aig_Obj_t *p)
static Aig_Obj_t * Aig_Regular(Aig_Obj_t *p)
Aig_Obj_t * Aig_ObjCreateCi(Aig_Man_t *p)
DECLARATIONS ///.
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
static Aig_Obj_t * Aig_ManConst0(Aig_Man_t *p)
static Aig_Obj_t * Aig_Not(Aig_Obj_t *p)
Aig_Obj_t * Aig_Oper(Aig_Man_t *p, Aig_Obj_t *p0, Aig_Obj_t *p1, Aig_Type_t Type)
static Aig_Obj_t * Aig_ObjFanin1(Aig_Obj_t *pObj)
static int Vec_PtrSize(Vec_Ptr_t *p)
Aig_Obj_t * Aig_IthVar(Aig_Man_t *p, int i)
FUNCTION DEFINITIONS ///.
Aig_Obj_t * Aig_CreateOr(Aig_Man_t *p, int nVars)
Aig_Obj_t * Aig_ObjCreate(Aig_Man_t *p, Aig_Obj_t *pGhost)
Aig_Obj_t * Aig_And(Aig_Man_t *p, Aig_Obj_t *p0, Aig_Obj_t *p1)
static int Aig_ObjIsNode(Aig_Obj_t *pObj)
Aig_Obj_t * Aig_Mux2(Aig_Man_t *p, Aig_Obj_t *pC, Aig_Obj_t *p1, Aig_Obj_t *p0)
Aig_Obj_t * Aig_Multi_rec(Aig_Man_t *p, Aig_Obj_t **ppObjs, int nObjs, Aig_Type_t Type)
Aig_Obj_t * Aig_TableLookupInt(Aig_Man_t *p, Aig_Obj_t *p0, Aig_Obj_t *p1)
static Aig_Obj_t * Aig_ManCi(Aig_Man_t *p, int i)
Aig_Obj_t * Aig_Multi(Aig_Man_t *p, Aig_Obj_t **pArgs, int nArgs, Aig_Type_t Type)
static int Aig_ManCiNum(Aig_Man_t *p)
#define ABC_NAMESPACE_IMPL_END
static Aig_Obj_t * Aig_ObjChild1(Aig_Obj_t *pObj)
Aig_Obj_t * Aig_Miter(Aig_Man_t *p, Vec_Ptr_t *vPairs)
static Aig_Obj_t * Aig_ObjCreateGhost(Aig_Man_t *p, Aig_Obj_t *p0, Aig_Obj_t *p1, Aig_Type_t Type)
void Aig_ManDumpBlif(Aig_Man_t *p, char *pFileName, Vec_Ptr_t *vPiNames, Vec_Ptr_t *vPoNames)
Aig_Obj_t * Aig_Mux(Aig_Man_t *p, Aig_Obj_t *pC, Aig_Obj_t *p1, Aig_Obj_t *p0)
static int Aig_ObjFaninC0(Aig_Obj_t *pObj)
static Aig_Obj_t * Aig_ManConst1(Aig_Man_t *p)
Aig_Obj_t * Aig_Or(Aig_Man_t *p, Aig_Obj_t *p0, Aig_Obj_t *p1)
#define ABC_NAMESPACE_IMPL_START
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
Aig_Obj_t * Aig_MiterTwo(Aig_Man_t *p, Vec_Ptr_t *vNodes1, Vec_Ptr_t *vNodes2)
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
static int Aig_ObjFaninC1(Aig_Obj_t *pObj)
Aig_Obj_t * Aig_CreateAnd(Aig_Man_t *p, int nVars)
static Aig_Obj_t * Aig_NotCond(Aig_Obj_t *p, int c)
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
int Aig_ManCleanup(Aig_Man_t *p)
static int Aig_ObjIsAnd(Aig_Obj_t *pObj)
static void Vec_PtrFree(Vec_Ptr_t *p)