47 if ( p->nTravIds >= (1<<30)-1 - 1000 )
152 unsigned * pTruth, * pTruth0, * pTruth1;
158 for ( i = 0; i <
nWords; i++ )
159 pTruth[i] = pTruth0[i] ^ pTruth1[i];
161 for ( i = 0; i <
nWords; i++ )
162 pTruth[i] = pTruth0[i] & pTruth1[i];
164 for ( i = 0; i <
nWords; i++ )
165 pTruth[i] = pTruth0[i] & ~pTruth1[i];
167 for ( i = 0; i <
nWords; i++ )
168 pTruth[i] = ~pTruth0[i] & pTruth1[i];
170 for ( i = 0; i <
nWords; i++ )
171 pTruth[i] = ~pTruth0[i] & ~pTruth1[i];
188 static unsigned uTruths[8][8] = {
189 { 0xAAAAAAAA,0xAAAAAAAA,0xAAAAAAAA,0xAAAAAAAA,0xAAAAAAAA,0xAAAAAAAA,0xAAAAAAAA,0xAAAAAAAA },
190 { 0xCCCCCCCC,0xCCCCCCCC,0xCCCCCCCC,0xCCCCCCCC,0xCCCCCCCC,0xCCCCCCCC,0xCCCCCCCC,0xCCCCCCCC },
191 { 0xF0F0F0F0,0xF0F0F0F0,0xF0F0F0F0,0xF0F0F0F0,0xF0F0F0F0,0xF0F0F0F0,0xF0F0F0F0,0xF0F0F0F0 },
192 { 0xFF00FF00,0xFF00FF00,0xFF00FF00,0xFF00FF00,0xFF00FF00,0xFF00FF00,0xFF00FF00,0xFF00FF00 },
193 { 0xFFFF0000,0xFFFF0000,0xFFFF0000,0xFFFF0000,0xFFFF0000,0xFFFF0000,0xFFFF0000,0xFFFF0000 },
194 { 0x00000000,0xFFFFFFFF,0x00000000,0xFFFFFFFF,0x00000000,0xFFFFFFFF,0x00000000,0xFFFFFFFF },
195 { 0x00000000,0x00000000,0xFFFFFFFF,0xFFFFFFFF,0x00000000,0x00000000,0xFFFFFFFF,0xFFFFFFFF },
196 { 0x00000000,0x00000000,0x00000000,0x00000000,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF }
330 if ( pNode0->
nRefs++ == 0 )
332 if ( pNode1 && pNode1->
nRefs++ == 0 )
339 if ( --pNode0->
nRefs == 0 )
341 if ( pNode1 && --pNode1->
nRefs == 0 )
361 int nConeSize1, nConeSize2;
366 assert( nConeSize1 == nConeSize2 );
398 if ( (
int)pFanout->
Level == LevelNew )
400 pFanout->
Level = LevelNew;
421 int i, Required, LevelNew = 1000000;
422 assert( p->fFanout && p->vRequired );
427 LevelNew =
IVY_MIN( LevelNew, Required );
632 int fShowFanouts = 0;
634 printf(
"Node %5d : ",
Ivy_ObjId(pObj) );
636 printf(
"constant 1" );
646 printf(
"AND( %5d%s, %5d%s )",
656 printf(
"\nFanouts:\n" );
660 printf(
"Node %5d : ",
Ivy_ObjId(pFanout) );
668 printf(
"AND( %5d%s, %5d%s )",
678 if ( pObj->
pEquiv == NULL )
679 printf(
" HAIG node not given" );
684 if ( pObj->
pEquiv == NULL )
690 printf(
" { %5d ", pObj->
Id );
700 printf(
" class of %d", pTemp->
Id );
721 printf(
" %d", pObj->
Id );
725 printf(
" %d", pObj->
Id );
727 printf(
"Latches: " );
752 printf(
"Trying cut : {" );
753 for ( i = 0; i < pCut->
nSize; i++ )
781 printf(
"Trying cut : {" );
782 for ( i = 0; i < pCut->
nSize; i++ )
791 printf(
"Latches = %d. ", nLatches );
795 for ( i = 0; i < pCut->
nSize; i++ )
810 printf(
"Present = %d. ", nPresent );
811 if ( nLatches > nPresent )
812 printf(
"Clauses = %d. ", 2*(nLatches - nPresent) );
815 return ( nLatches > nPresent ) ? 2*(nLatches - nPresent) : 0;
static int Ivy_IsComplement(Ivy_Obj_t *p)
static int * Vec_IntArray(Vec_Int_t *p)
unsigned * Ivy_ObjGetTruthStore(int ObjNum, Vec_Int_t *vTruth)
unsigned * Ivy_ManCutTruth(Ivy_Man_t *p, Ivy_Obj_t *pRoot, Vec_Int_t *vLeaves, Vec_Int_t *vNodes, Vec_Int_t *vTruth)
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Ivy_Obj_t * Ivy_ObjRecognizeMux(Ivy_Obj_t *pNode, Ivy_Obj_t **ppNodeT, Ivy_Obj_t **ppNodeE)
static int Ivy_ObjLevelNew(Ivy_Obj_t *pObj)
void Ivy_ObjPrintVerbose(Ivy_Man_t *p, Ivy_Obj_t *pObj, int fHaig)
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
#define Ivy_ManForEachPi(p, pObj, i)
ITERATORS ///.
int Ivy_ObjMffcLabel(Ivy_Man_t *p, Ivy_Obj_t *pNode)
void Ivy_ManCleanTravId(Ivy_Man_t *p)
#define Ivy_ObjForEachFanout(p, pObj, vArray, pFanout, i)
static int Ivy_ObjFaninId1(Ivy_Obj_t *pObj)
static int Ivy_ObjIsPi(Ivy_Obj_t *pObj)
#define Ivy_ManForEachPo(p, pObj, i)
#define Ivy_ManForEachLatch(p, pObj, i)
static int Ivy_LeafId(int Leaf)
static int Ivy_ManLatchNum(Ivy_Man_t *p)
static int Vec_PtrSize(Vec_Ptr_t *p)
void Ivy_ObjUpdateLevelR_rec(Ivy_Man_t *p, Ivy_Obj_t *pObj, int ReqNew)
static int Ivy_ObjIsLatch(Ivy_Obj_t *pObj)
static Ivy_Obj_t * Ivy_ObjFanin1(Ivy_Obj_t *pObj)
Vec_Int_t * Ivy_ManDfsSeq(Ivy_Man_t *p, Vec_Int_t **pvLatches)
#define IVY_MIN(a, b)
MACRO DEFINITIONS ///.
static void Vec_IntGrow(Vec_Int_t *p, int nCapMin)
static Ivy_Obj_t * Ivy_ObjFanin0(Ivy_Obj_t *pObj)
static void Vec_IntWriteEntry(Vec_Int_t *p, int i, int Entry)
static int Ivy_ObjFaninId0(Ivy_Obj_t *pObj)
void Ivy_ObjUpdateLevel_rec(Ivy_Man_t *p, Ivy_Obj_t *pObj)
#define Ivy_ManForEachCo(p, pObj, i)
void Ivy_ManCutTruthOne(Ivy_Man_t *p, Ivy_Obj_t *pNode, Vec_Int_t *vTruth, int nWords)
int Ivy_ObjRefDeref(Ivy_Man_t *p, Ivy_Obj_t *pNode, int fReference, int fLabel)
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
ABC_NAMESPACE_IMPL_START void Ivy_ManIncrementTravId(Ivy_Man_t *p)
DECLARATIONS ///.
static int Ivy_ObjFaninC1(Ivy_Obj_t *pObj)
static Ivy_Obj_t * Ivy_ManObj(Ivy_Man_t *p, int i)
static int Vec_IntEntry(Vec_Int_t *p, int i)
int Ivy_CutTruthPrint(Ivy_Man_t *p, Ivy_Cut_t *pCut, unsigned uTruth)
static int Ivy_ObjRefs(Ivy_Obj_t *pObj)
#define ABC_NAMESPACE_IMPL_END
void Ivy_ManCollectCut_rec(Ivy_Man_t *p, Ivy_Obj_t *pNode, Vec_Int_t *vNodes)
int pArray[IVY_CUT_INPUT]
Vec_Int_t * Ivy_ManLatches(Ivy_Man_t *p)
static Ivy_Obj_t * Ivy_Regular(Ivy_Obj_t *p)
static void Vec_IntPush(Vec_Int_t *p, int Entry)
static int Ivy_ObjIsCo(Ivy_Obj_t *pObj)
static int Ivy_ObjIsNode(Ivy_Obj_t *pObj)
int Ivy_ObjIsMuxType(Ivy_Obj_t *pNode)
#define Vec_IntForEachEntryStart(vVec, Entry, i, Start)
static Ivy_Obj_t * Ivy_ObjChild0(Ivy_Obj_t *pObj)
void Ivy_ManPrintVerbose(Ivy_Man_t *p, int fHaig)
typedefABC_NAMESPACE_HEADER_START struct Ivy_Man_t_ Ivy_Man_t
INCLUDES ///.
#define ABC_NAMESPACE_IMPL_START
static int Ivy_ObjIsAnd(Ivy_Obj_t *pObj)
static int Ivy_ObjIsExor(Ivy_Obj_t *pObj)
static int Vec_IntSize(Vec_Int_t *p)
static int Ivy_ObjIsConst1(Ivy_Obj_t *pObj)
void Extra_PrintBinary(FILE *pFile, unsigned Sign[], int nBits)
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
void Ivy_ManCollectCut(Ivy_Man_t *p, Ivy_Obj_t *pRoot, Vec_Int_t *vLeaves, Vec_Int_t *vNodes)
static Ivy_Obj_t * Ivy_Not(Ivy_Obj_t *p)
static Ivy_Obj_t * Ivy_NotCond(Ivy_Obj_t *p, int c)
#define Ivy_ManForEachNodeVec(p, vIds, pObj, i)
static int Ivy_ObjIsBuf(Ivy_Obj_t *pObj)
int Ivy_ManResetLevels_rec(Ivy_Obj_t *pObj)
static Ivy_Obj_t * Ivy_ObjChild1(Ivy_Obj_t *pObj)
static int Ivy_ObjIsPo(Ivy_Obj_t *pObj)
int Ivy_ManLevels(Ivy_Man_t *p)
static int Ivy_ObjIsCi(Ivy_Obj_t *pObj)
#define Ivy_ManForEachObj(p, pObj, i)
static void Vec_IntFree(Vec_Int_t *p)
static void Vec_IntClear(Vec_Int_t *p)
int Ivy_CutTruthPrint2(Ivy_Man_t *p, Ivy_Cut_t *pCut, unsigned uTruth)
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
Ivy_Obj_t * Ivy_ObjReal(Ivy_Obj_t *pObj)
void Ivy_ManResetLevels(Ivy_Man_t *p)
static int Ivy_LeafLat(int Leaf)
static int Ivy_ObjFaninC0(Ivy_Obj_t *pObj)
static int Ivy_ObjId(Ivy_Obj_t *pObj)
int Ivy_ObjLevelRNew(Ivy_Man_t *p, Ivy_Obj_t *pObj)
static void Ivy_ObjSetTravIdCurrent(Ivy_Man_t *p, Ivy_Obj_t *pObj)
static void Vec_PtrFree(Vec_Ptr_t *p)