55 word * pData1, * pData0;
60 pData1 = pData0 + p->
iData;
62 for ( i = 0; i < p->
iData; i++ )
63 pData0[i] = ~(
word)0, pData1[i] = 0;
65 for ( i = 0; i < p->
iData; i++ )
66 pData0[i] = 0, pData1[i] = ~(
word)0;
68 for ( i = 0; i < p->
iData; i++ )
69 pData0[i] = pData1[i] = 0;
75 word * pData0, * pDataA0, * pDataB0;
76 word * pData1, * pDataA1, * pDataB1;
81 pData1 = pData0 + p->
iData;
85 pDataA0 = pDataA1 + p->
iData;
89 pDataB0 = pDataB1 + p->
iData;
94 pDataB1 = pDataB0 + p->
iData;
100 pDataA1 = pDataA0 + p->
iData;
104 pDataB0 = pDataB1 + p->
iData;
109 pDataB1 = pDataB0 + p->
iData;
112 for ( i = 0; i < p->
iData; i++ )
113 pData0[i] = pDataA0[i] | pDataB0[i], pData1[i] = pDataA1[i] & pDataB1[i];
118 pData1 = pData0 + p->
iData;
122 pDataA0 = pDataA1 + p->
iData;
127 pDataA1 = pDataA0 + p->
iData;
129 for ( i = 0; i < p->
iData; i++ )
130 pData0[i] = pDataA0[i], pData1[i] = pDataA1[i];
137 pData1 = pData0 + p->
iData;
138 for ( i = 0; i < p->
iData; i++ )
145 pData1 = pData0 + p->
iData;
147 pDataA1 = pDataA0 + p->
iData;
148 for ( i = 0; i < p->
iData; i++ )
149 pData0[i] = pDataA0[i], pData1[i] = pDataA1[i];
155 pData1 = pData0 + p->
iData;
156 for ( i = 0; i < p->
iData; i++ )
157 pData0[i] = ~(
word)0, pData1[i] = 0;
176 word * pData0, * pData1;
177 int * pCounts, CountBest;
178 int i, k, b, nPats, iPat;
179 nPats = 64 * p->
iData;
184 pData1 = pData0 + p->
iData;
185 for ( i = 0; i < p->
iData; i++ )
186 for ( b = 0; b < 64; b++ )
187 pCounts[64*i+b] += (((pData0[i] >> b) & 1) || ((pData1[i] >> b) & 1));
190 CountBest = pCounts[0];
191 for ( k = 1; k < nPats; k++ )
192 if ( CountBest < pCounts[k] )
193 CountBest = pCounts[k], iPat = k;
201 word * pData0, * pData1;
207 pData1 = pData0 + p->
iData;
208 for ( i = 0; i < p->
iData; i++ )
209 assert( (pData0[i] & pData1[i]) == 0 );
220 pData1 = pData0 + p->
iData;
221 for ( i = 0; i < p->
iData; i++ )
222 assert( (pData0[i] & pData1[i]) == 0 );
243 for ( f = 0; f < nFrames; f++ )
281 int i, f, iPat, Cost, Cost0;
285 printf(
"Running with %d frames, %d words, and %sgiven init state.\n", nFrames, nWords, vInit0 ?
"":
"no " );
292 Cost0 += ((iPat >> 1) & 1);
294 printf(
"Frame =%6d : Values =%6d (out of %6d)\n", 0, Cost0, Cost0 );
295 for ( f = 0; f < nFrames; f++ )
304 printf(
"Frame =%6d : Values =%6d (out of %6d) ", f+1, Cost, Cost0 );
312 printf(
"After %d frames, found a sequence to produce %d x-values (out of %d). ", f, Cost,
Gia_ManRegNum(p) );
333 if ( vInit != vInit0 )
static int Gia_ObjFaninC1(Gia_Obj_t *pObj)
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Vec_Int_t * Gia_ManInseSimulate(Gia_Man_t *p, Vec_Int_t *vInit0, Vec_Int_t *vInputs, Vec_Int_t *vInit)
static int Abc_InfoHasBit(unsigned *p, int i)
static int Gia_ObjIsConst0(Gia_Obj_t *pObj)
static ABC_NAMESPACE_IMPL_START void Gia_ParTestAlloc(Gia_Man_t *p, int nWords)
DECLARATIONS ///.
#define ABC_ALLOC(type, num)
static abctime Abc_Clock()
void Gia_ManInseFindStarting(Gia_Man_t *p, int iPat, Vec_Int_t *vInit, Vec_Int_t *vInputs)
static Gia_Obj_t * Gia_ManObj(Gia_Man_t *p, int v)
static word * Gia_ParTestObj(Gia_Man_t *p, int Id)
#define Gia_ManForEachRiRo(p, pObjRi, pObjRo, i)
static void Abc_PrintTime(int level, const char *pStr, abctime time)
static Vec_Int_t * Vec_IntStart(int nSize)
void Gia_ManInseSimulateObj(Gia_Man_t *p, int Id)
static Gia_Obj_t * Gia_ObjFanin0(Gia_Obj_t *pObj)
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
static Gia_Obj_t * Gia_ObjRoToRi(Gia_Man_t *p, Gia_Obj_t *pObj)
static int Vec_IntEntry(Vec_Int_t *p, int i)
unsigned __int64 word
DECLARATIONS ///.
#define ABC_NAMESPACE_IMPL_END
static void Vec_IntFill(Vec_Int_t *p, int nSize, int Fill)
int Gia_ManInseHighestScore(Gia_Man_t *p, int *pCost)
void Gia_ManInseInit(Gia_Man_t *p, Vec_Int_t *vInit)
FUNCTION DEFINITIONS ///.
static void Gia_ParTestFree(Gia_Man_t *p)
#define Gia_ManForEachAnd(p, pObj, i)
static void Vec_IntPush(Vec_Int_t *p, int Entry)
static int Gia_ObjId(Gia_Man_t *p, Gia_Obj_t *pObj)
static void Vec_IntFreeP(Vec_Int_t **p)
#define Gia_ManForEachPi(p, pObj, i)
word Gia_ManRandomW(int fReset)
static int Gia_ObjIsCo(Gia_Obj_t *pObj)
#define ABC_NAMESPACE_IMPL_START
static int Vec_IntSize(Vec_Int_t *p)
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)
Vec_Int_t * Gia_ManInsePerform(Gia_Man_t *p, Vec_Int_t *vInit0, int nFrames, int nWords, int fVerbose)
static Gia_Obj_t * Gia_ObjFanin1(Gia_Obj_t *pObj)
#define Gia_ManForEachRo(p, pObj, i)
#define Gia_ManForEachRi(p, pObj, i)
Vec_Int_t * Gia_ManInseTest(Gia_Man_t *p, Vec_Int_t *vInit0, int nFrames, int nWords, int nTimeOut, int fSim, int fVerbose)
static int Gia_ObjFaninC0(Gia_Obj_t *pObj)
static void Vec_IntFree(Vec_Int_t *p)
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)
static int Gia_ManObjNum(Gia_Man_t *p)
static int Gia_ObjFaninId0(Gia_Obj_t *pObj, int ObjId)
static int Gia_ObjIsPi(Gia_Man_t *p, Gia_Obj_t *pObj)
static int Gia_ManRegNum(Gia_Man_t *p)