61 static inline int Raig_Var2Lit(
int Var,
int fCompl ) {
return Var + Var + fCompl; }
65 static inline int Raig_LitNotCond(
int Lit,
int c ) {
return Lit ^ (int)(c > 0); }
88 if ( pObj->
iData == iNode )
129 p->pFans0[p->nObjs] = iFan0;
130 p->pFans1[p->nObjs] = iFan1;
132 return pObj->
iData = p->nObjs++;
160 nObjs = p->nCis + p->nCos + p->nNodes + 2;
176 assert( p->nObjs == nObjs );
187 p->pRefs[ pObj->
iData ]++;
231 assert( p->pSims[i] == 0 );
232 if ( p->MemFree == 0 )
234 unsigned * pPlace, Ent;
235 if ( p->nWordsAlloc == 0 )
237 assert( p->pMems == NULL );
238 p->nWordsAlloc = (1<<17);
242 p->pMems =
ABC_REALLOC(
unsigned, p->pMems, p->nWordsAlloc );
243 memset( p->pMems, 0xff,
sizeof(
unsigned) * (p->nWords + 1) );
244 pPlace = (
unsigned *)&p->MemFree;
245 for ( Ent = p->nMems * (p->nWords + 1);
246 Ent + p->nWords + 1 < (unsigned)p->nWordsAlloc;
247 Ent += p->nWords + 1 )
250 pPlace = p->pMems + Ent;
254 p->pSims[i] = p->MemFree;
255 pSim = p->pMems + p->MemFree;
256 p->MemFree = pSim[0];
257 pSim[0] = p->pRefs[i];
259 if ( p->nMemsMax < p->nMems )
260 p->nMemsMax = p->nMems;
281 assert( p->pSims[i] > 0 );
282 pSim = p->pMems + p->pSims[i];
283 if ( --pSim[0] == 0 )
285 pSim[0] = p->MemFree;
286 p->MemFree = p->pSims[i];
306 unsigned * pRes0, * pRes1, * pRes;
307 int i, w, nCis, nCos, iFan0, iFan1, iPioNum;
311 if ( iPioNum < p->nPis )
315 memset( pRes + 1, 0,
sizeof(
unsigned) * p->nWords );
319 for ( w = 1; w <= p->nWords; w++ )
331 for ( i = 2; i < p->nObjs; i++ )
333 if ( p->pFans0[i] == 0 )
336 if ( iPioNum < p->nPis )
339 for ( w = 1; w <= p->nWords; w++ )
353 if ( p->pFans1[i] == 0 )
356 if ( nCos < p->nPos && fMiter )
359 for ( w = 1; w <= p->nWords; w++ )
360 if ( pRes0[w] != Const )
371 for ( w = 1; w <= p->nWords; w++ )
374 for ( w = 1; w <= p->nWords; w++ )
382 iFan0 = p->pFans0[i];
383 iFan1 = p->pFans1[i];
387 for ( w = 1; w <= p->nWords; w++ )
388 pRes[w] = ~(pRes0[w] | pRes1[w]);
390 for ( w = 1; w <= p->nWords; w++ )
391 pRes[w] = ~pRes0[w] & pRes1[w];
393 for ( w = 1; w <= p->nWords; w++ )
394 pRes[w] = pRes0[w] & ~pRes1[w];
396 for ( w = 1; w <= p->nWords; w++ )
397 pRes[w] = pRes0[w] & pRes1[w];
399 assert( nCis == p->nCis );
400 assert( nCos == p->nCos );
428 for ( f = 0; f <= iFrame; f++, Counter += p->nPis )
432 if ( iPioId >= p->nPis )
434 for ( w = 0; w <
nWords; w++ )
458 int i, iPat, RetValue = 0;
462 if ( Status.nSat > 0 )
464 printf(
"Miter is trivially satisfiable (output %d).\n", Status.iOut );
467 if ( Status.nUndec == 0 )
469 printf(
"Miter is trivially unsatisfiable.\n" );
476 for ( i = 0; i < nIters; i++ )
482 printf(
"Frame %4d out of %4d and timeout %3d sec. ", i+1, nIters, TimeLimit );
483 printf(
"Time = %7.2f sec\r", (1.0*
Abc_Clock()-clkTotal)/CLOCKS_PER_SEC);
488 assert( pAig->pSeqModel == NULL );
491 printf(
"Miter is satisfiable after simulation (output %d).\n", iOut );
494 if ( (
Abc_Clock() - clk)/CLOCKS_PER_SEC >= TimeLimit )
496 printf(
"No bug detected after %d frames with time limit %d seconds.\n", i+1, TimeLimit );
502 printf(
"Maxcut = %8d. AigMem = %7.2f MB. SimMem = %7.2f MB. ",
504 1.0*(p->nObjs * 16)/(1<<20),
505 1.0*(p->nMemsMax * 4 * (nWords+1))/(1<<20) );
static int Saig_ManPoNum(Aig_Man_t *p)
static int Raig_Var2Lit(int Var, int fCompl)
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
static int Abc_InfoHasBit(unsigned *p, int i)
ABC_NAMESPACE_IMPL_START Abc_Cex_t * Abc_CexAlloc(int nRegs, int nRealPis, int nFrames)
DECLARATIONS ///.
#define ABC_REALLOC(type, obj, num)
static int Raig_LitRegular(int Lit)
static Aig_Obj_t * Aig_ObjFanin0(Aig_Obj_t *pObj)
static int Raig_LitIsCompl(int Lit)
static int Aig_IsComplement(Aig_Obj_t *p)
#define Aig_ManForEachCi(p, pObj, i)
ITERATORS ///.
static int Raig_Lit2Var(int Lit)
#define Aig_ManForEachCo(p, pObj, i)
#define ABC_ALLOC(type, num)
unsigned Aig_ManRandom(int fReset)
static abctime Abc_Clock()
static Aig_Obj_t * Aig_ObjFanin1(Aig_Obj_t *pObj)
for(p=first;p->value< newval;p=p->next)
static int Aig_ManNodeNum(Aig_Man_t *p)
int Raig_ManSimulate(Aig_Man_t *pAig, int nWords, int nIters, int TimeLimit, int fMiter, int fVerbose)
typedefABC_NAMESPACE_IMPL_START struct Raig_Man_t_ Raig_Man_t
DECLARATIONS ///.
static int Aig_ObjIsNode(Aig_Obj_t *pObj)
static int Aig_ManCoNum(Aig_Man_t *p)
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
#define Saig_ManForEachLi(p, pObj, i)
int Raig_ManFindPo(Aig_Man_t *pAig, int iNode)
FUNCTION DEFINITIONS ///.
static int Vec_IntEntry(Vec_Int_t *p, int i)
static int Aig_WordFindFirstBit(unsigned uWord)
static int Aig_ManCiNum(Aig_Man_t *p)
#define ABC_NAMESPACE_IMPL_END
static int Aig_ObjIsConst1(Aig_Obj_t *pObj)
static void Vec_IntPush(Vec_Int_t *p, int Entry)
#define Saig_ManForEachLo(p, pObj, i)
Sec_MtrStatus_t Sec_MiterStatus(Aig_Man_t *p)
DECLARATIONS ///.
static int Aig_ObjFaninC0(Aig_Obj_t *pObj)
int Raig_ManCreate_rec(Raig_Man_t *p, Aig_Obj_t *pObj)
static Aig_Obj_t * Aig_ManConst1(Aig_Man_t *p)
#define ABC_NAMESPACE_IMPL_START
void Raig_ManDelete(Raig_Man_t *p)
static void Abc_InfoSetBit(unsigned *p, int i)
int Raig_ManSimulateRound(Raig_Man_t *p, int fMiter, int fFirst, int *piPat)
unsigned * Raig_ManSimDeref(Raig_Man_t *p, int i)
static int Aig_ManRegNum(Aig_Man_t *p)
static int Vec_IntSize(Vec_Int_t *p)
static int Raig_LitNot(int Lit)
static int Saig_ManPiNum(Aig_Man_t *p)
MACRO DEFINITIONS ///.
Raig_Man_t * Raig_ManCreate(Aig_Man_t *pAig)
#define ABC_CALLOC(type, num)
static int Aig_ObjFaninC1(Aig_Obj_t *pObj)
typedefABC_NAMESPACE_HEADER_START struct Sec_MtrStatus_t_ Sec_MtrStatus_t
INCLUDES ///.
#define Saig_ManForEachPo(p, pObj, i)
static int Raig_LitNotCond(int Lit, int c)
typedefABC_NAMESPACE_HEADER_START struct Abc_Cex_t_ Abc_Cex_t
INCLUDES ///.
unsigned * Raig_ManSimRef(Raig_Man_t *p, int i)
static int Aig_ObjRefs(Aig_Obj_t *pObj)
static void Vec_IntFree(Vec_Int_t *p)
Abc_Cex_t * Raig_ManGenerateCounter(Aig_Man_t *pAig, int iFrame, int iOut, int nWords, int iPat, Vec_Int_t *vCis2Ids)
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
void Aig_ManCleanData(Aig_Man_t *p)
static int Aig_ObjIsCo(Aig_Obj_t *pObj)
static int Aig_ObjCioId(Aig_Obj_t *pObj)