55 for ( w = 0; w <
nWords; w++ )
62 for ( w = 0; w <
nWords; w++ )
83 if ( (p0[0] & 1) == (p1[0] & 1) )
85 for ( w = 0; w <
nWords; w++ )
92 for ( w = 0; w <
nWords; w++ )
93 if ( p0[w] != ~p1[w] )
115 for ( w = 0; w <
nWords; w++ )
122 for ( w = 0; w <
nWords; w++ )
143 if ( (p0[0] & 1) == (p1[0] & 1) )
145 for ( w = 0; w <
nWords; w++ )
146 if ( p0[w] != p1[w] )
152 for ( w = 0; w <
nWords; w++ )
153 if ( p0[w] != ~p1[w] )
175 for ( w = 0; w <
nWords; w++ )
177 for ( b = 0; b < 32; b++ )
178 if ( ((~p[w]) >> b ) & 1 )
183 for ( w = 0; w <
nWords; w++ )
185 for ( b = 0; b < 32; b++ )
186 if ( ((p[w]) >> b ) & 1 )
205 if ( (p0[0] & 1) == (p1[0] & 1) )
207 for ( w = 0; w <
nWords; w++ )
208 if ( p0[w] != p1[w] )
209 for ( b = 0; b < 32; b++ )
210 if ( ((p0[w] ^ p1[w]) >> b ) & 1 )
215 for ( w = 0; w <
nWords; w++ )
216 if ( p0[w] != ~p1[w] )
217 for ( b = 0; b < 32; b++ )
218 if ( ((p0[w] ^ ~p1[w]) >> b ) & 1 )
236 int Repr =
GIA_VOID, EntPrev = -1, Ent, i;
270 unsigned * pSim0, * pSim1;
353 1291, 1699, 1999, 2357, 2953, 3313, 3907, 4177,
354 4831, 5147, 5647, 6343, 6899, 7103, 7873, 8147 };
358 for ( i = 0; i <
nWords; i++ )
359 uHash ^= ~pSim[i] * s_Primes[i & 0xf];
361 for ( i = 0; i <
nWords; i++ )
362 uHash ^= pSim[i] * s_Primes[i & 0xf];
363 return (
int)(uHash % nTableSize);
380 unsigned * pPlace, Ent;
381 pPlace = (
unsigned *)&p->
MemFree;
387 pPlace = p->
pMems + Ent;
446 if ( --pSim[0] == 0 )
470 int * pTable, nTableSize, i, k, Key;
480 if ( pTable[Key] == 0 )
551 int i, ScoreBest = 0, iPatBest = 1;
553 for ( i = 0; i < 32 * p->
nWords; i++ )
554 if ( ScoreBest < p->pScores[i] )
586 unsigned * pInfo, * pInfo2;
608 if ( p->
pCexes[i/2] == NULL )
611 p->
pCexes[i/2] = (
void *)1;
630 if ( p->
pCexes[i] == NULL )
655 unsigned * pRes0, * pRes1, * pRes;
656 int i, k, w, Ent, iCiId = 0, iCoId = 0;
670 for ( w = 1; w <= p->
nWords; w++ )
686 for ( w = 1; w <= p->
nWords; w++ )
687 pRes[w] = pRes0[w-1];
691 for ( w = 1; w <= p->
nWords; w++ )
695 pRes[1] ^= (pRes[1] & 1);
705 for ( w = 1; w <= p->
nWords; w++ )
706 pRes[w-1] = ~pRes0[w];
708 for ( w = 1; w <= p->
nWords; w++ )
709 pRes[w-1] = pRes0[w];
723 for ( w = 1; w <= p->
nWords; w++ )
724 pRes[w] = ~(pRes0[w] | pRes1[w]);
726 for ( w = 1; w <= p->
nWords; w++ )
727 pRes[w] = ~pRes0[w] & pRes1[w];
732 for ( w = 1; w <= p->
nWords; w++ )
733 pRes[w] = pRes0[w] & ~pRes1[w];
735 for ( w = 1; w <= p->
nWords; w++ )
736 pRes[w] = pRes0[w] & pRes1[w];
779 Abc_Print( 1,
"Cec_ManSimSimulateRound(): Memory management error!\n" );
810 unsigned * pRes0, * pRes1;
814 assert( vInfoCis && vInfoCos );
818 for ( w = 0; w < p->
nWords; w++ )
825 for ( w = 0; w < p->
nWords; w++ )
834 for ( w = 0; w < p->
nWords; w++ )
865 else if ( LevelMax == -1 )
885 for ( i = 0; i < 4; i++ )
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
static int Abc_PrimeCudd(unsigned int p)
int Cec_ManSimClassesPrepare(Cec_ManSim_t *p, int LevelMax)
static int Gia_ObjIsClass(Gia_Man_t *p, int Id)
void Cec_ManSimCompareEqualScore(unsigned *p0, unsigned *p1, int nWords, int *pScores)
unsigned * Cec_ManSimSimRef(Cec_ManSim_t *p, int i)
static int Gia_ManPoNum(Gia_Man_t *p)
static int Gia_ObjFaninC1(Gia_Obj_t *pObj)
unsigned * Cec_ManSimSimDeref(Cec_ManSim_t *p, int i)
void Cec_ManSimCreateInfo(Cec_ManSim_t *p, Vec_Ptr_t *vInfoCis, Vec_Ptr_t *vInfoCos)
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
static int Abc_InfoHasBit(unsigned *p, int i)
void Cec_ManSimMemRelink(Cec_ManSim_t *p)
#define ABC_REALLOC(type, obj, num)
static void Abc_InfoXorBit(unsigned *p, int i)
int Cec_ManSimSimulateRound(Cec_ManSim_t *p, Vec_Ptr_t *vInfoCis, Vec_Ptr_t *vInfoCos)
static int Gia_WordFindFirstBit(unsigned uWord)
static int Gia_ObjValue(Gia_Obj_t *pObj)
static int Gia_ObjIsHead(Gia_Man_t *p, int Id)
static Gia_Obj_t * Gia_ManObj(Gia_Man_t *p, int v)
for(p=first;p->value< newval;p=p->next)
void Gia_ManEquivPrintClasses(Gia_Man_t *p, int fVerbose, float Mem)
unsigned Gia_ManRandom(int fReset)
FUNCTION DEFINITIONS ///.
static void Cec_ObjSetSim(Cec_ManSim_t *p, int Id, int n)
static void Gia_ObjSetRepr(Gia_Man_t *p, int Id, int Num)
void Gia_ManCreateValueRefs(Gia_Man_t *p)
static int s_Primes[MAX_PRIMES]
static int Gia_ObjLevel(Gia_Man_t *p, Gia_Obj_t *pObj)
int Cec_ManSimClassRefineOne(Cec_ManSim_t *p, int i)
int Cec_ManSimCompareConstFirstBit(unsigned *p, int nWords)
static int Vec_IntEntry(Vec_Int_t *p, int i)
static int Gia_ObjIsConst(Gia_Man_t *p, int Id)
#define ABC_NAMESPACE_IMPL_END
#define Gia_ClassForEachObj1(p, i, iObj)
static void Vec_IntPush(Vec_Int_t *p, int Entry)
static int Gia_ObjId(Gia_Man_t *p, Gia_Obj_t *pObj)
void Cec_ManSimFindBestPattern(Cec_ManSim_t *p)
static void Vec_IntFreeP(Vec_Int_t **p)
static void Abc_Print(int level, const char *format,...)
void Cec_ManSimClassCreate(Gia_Man_t *p, Vec_Int_t *vClass)
#define Gia_ClassForEachObj(p, i, iObj)
int Cec_ManSimAnalyzeOutputs(Cec_ManSim_t *p)
static int Gia_ObjIsCo(Gia_Obj_t *pObj)
static int Gia_ObjNext(Gia_Man_t *p, int Id)
void Cec_ManSimSavePattern(Cec_ManSim_t *p, int iPat)
#define ABC_NAMESPACE_IMPL_START
static void Gia_ObjSetNext(Gia_Man_t *p, int Id, int Num)
int Cec_ManSimHashKey(unsigned *pSim, int nWords, int nTableSize)
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
static void Abc_InfoSetBit(unsigned *p, int i)
int Cec_ManSimCompareConst(unsigned *p, int nWords)
FUNCTION DEFINITIONS ///.
static int Gia_ManCiNum(Gia_Man_t *p)
static ABC_NAMESPACE_IMPL_START unsigned * Cec_ObjSim(Cec_ManSim_t *p, int Id)
DECLARATIONS ///.
int Cec_ManSimClassesRefine(Cec_ManSim_t *p)
static int Gia_ObjIsTail(Gia_Man_t *p, int Id)
static int Vec_IntSize(Vec_Int_t *p)
static float Cec_MemUsage(Cec_ManSim_t *p)
void Cec_ManSimCompareConstScore(unsigned *p, int nWords, int *pScores)
int Cec_ManSimCompareEqualFirstBit(unsigned *p0, unsigned *p1, int nWords)
static int Gia_ObjIsAnd(Gia_Obj_t *pObj)
#define Gia_ManForEachObj(p, pObj, i)
MACRO DEFINITIONS ///.
static Gia_Obj_t * Gia_ManConst0(Gia_Man_t *p)
#define ABC_CALLOC(type, num)
#define Gia_ManForEachRo(p, pObj, i)
static int Abc_BitWordNum(int nBits)
int Gia_ManLevelNum(Gia_Man_t *p)
typedefABC_NAMESPACE_HEADER_START struct Abc_Cex_t_ Abc_Cex_t
INCLUDES ///.
int Cec_ManSimCompareEqual(unsigned *p0, unsigned *p1, int nWords)
#define Gia_ManForEachObj1(p, pObj, i)
static int Gia_ObjFaninC0(Gia_Obj_t *pObj)
static int Gia_ManPiNum(Gia_Man_t *p)
static void Vec_IntClear(Vec_Int_t *p)
static int Gia_ObjIsCi(Gia_Obj_t *pObj)
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
static int Gia_ObjFaninId1(Gia_Obj_t *pObj, int ObjId)
int Cec_ManSimClassRemoveOne(Cec_ManSim_t *p, int i)
static int Gia_ManObjNum(Gia_Man_t *p)
static int Gia_ObjRepr(Gia_Man_t *p, int Id)
void Cec_ManSimProcessRefined(Cec_ManSim_t *p, Vec_Int_t *vRefined)
static int Gia_ObjFaninId0(Gia_Obj_t *pObj, int ObjId)
static int Gia_ManCoNum(Gia_Man_t *p)
static int Gia_ManRegNum(Gia_Man_t *p)