100 int Counter0 = 0, Counter1 = 0;
101 int CounterPi0 = 0, CounterPi1 = 0;
124 if ( Count < nImpLimit )
147 printf(
"Logic0 = %d (%d). Logic1 = %d (%d). ", Counter0, CounterPi0, Counter1, CounterPi1 );
228 Abc_Print( 1,
"Simulator could not allocate %.2f GB for simulation info.\n",
237 Abc_Print( 1,
"AIG = %7.2f MB. Front mem = %7.2f MB. Other mem = %7.2f MB.\n",
259 for ( w = p->
nWords-1; w >= 0; w-- )
277 for ( w = p->
nWords-1; w >= 0; w-- )
295 for ( w = 0; w < p->
nWords; w++ )
315 for ( w = p->
nWords-1; w >= 0; w-- )
333 for ( w = p->
nWords-1; w >= 0; w-- )
334 pInfo[w] = pInfo0[w];
353 for ( w = p->
nWords-1; w >= 0; w-- )
354 pInfo[w] = pInfo0[w];
374 for ( w = p->
nWords-1; w >= 0; w-- )
375 pInfo[w] = ~pInfo0[w];
377 for ( w = p->
nWords-1; w >= 0; w-- )
378 pInfo[w] = pInfo0[w];
401 for ( w = p->
nWords-1; w >= 0; w-- )
402 pInfo[w] = ~(pInfo0[w] | pInfo1[w]);
404 for ( w = p->
nWords-1; w >= 0; w-- )
405 pInfo[w] = ~pInfo0[w] & pInfo1[w];
410 for ( w = p->
nWords-1; w >= 0; w-- )
411 pInfo[w] = pInfo0[w] & ~pInfo1[w];
413 for ( w = p->
nWords-1; w >= 0; w-- )
414 pInfo[w] = pInfo0[w] & pInfo1[w];
478 int i, iCis = 0, iCos = 0;
553 for ( f = 0; f <= iFrame; f++, Counter += p->nPis )
557 if ( iPioId >= p->nPis )
559 for ( w = nWords-1; w >= 0; w-- )
583 for ( i = 0; i < pPars->
RandSeed; i++ )
603 int i, iOut, iPat, RetValue = 0;
611 for ( i = 0; i < pPars->
nIters; i++ )
624 Abc_Print( 1,
"Output %d of miter \"%s\" was asserted in frame %d. ", iOut, pAig->
pName, i );
628 Abc_Print( 1,
"\nGenerated counter-example is INVALID. " );
646 if ( i < pPars->nIters - 1 )
651 Abc_Print( 1,
"No bug detected after simulating %d frames with %d words. ", i, pPars->
nWords );
671 FILE * pFile = fopen( pFileIn,
"rb" );
674 printf(
"Cannot open input file.\n" );
678 while ( (c = fgetc(pFile)) != EOF )
679 if ( c ==
'0' || c ==
'1' )
687 FILE * pFile = fopen( pFileOut,
"wb" );
690 printf(
"Cannot open output file.\n" );
696 fputc(
'0' + c, pFile );
697 if ( i % nOuts == nOuts - 1 )
698 fputc(
'\n', pFile );
739 printf(
"The number of 0s and 1s in the input file (%d) does not evenly divide by the number of primary inputs (%d).\n",
746 printf(
"Output patterns are written into file \"%s\".\n", pFileOut );
static int Gia_ObjToLit(Gia_Man_t *p, Gia_Obj_t *pObj)
static Gia_Obj_t * Gia_ObjChild0(Gia_Obj_t *pObj)
static void Gia_ManSimulateNode(Gia_ManSim_t *p, Gia_Obj_t *pObj)
#define Gia_ManForEachCo(p, pObj, i)
int Gia_ManVerifyCex(Gia_Man_t *pAig, Abc_Cex_t *p, int fDualOut)
DECLARATIONS ///.
static int Gia_ManPoNum(Gia_Man_t *p)
static int Gia_ObjFaninC1(Gia_Obj_t *pObj)
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 ///.
void Gia_ManSimSimulatePattern(Gia_Man_t *p, char *pFileIn, char *pFileOut)
static int Gia_ObjDiff1(Gia_Obj_t *pObj)
static void Gia_ManSimInfoOne(Gia_ManSim_t *p, unsigned *pInfo)
static int Gia_WordFindFirstBit(unsigned uWord)
static int Gia_ObjValue(Gia_Obj_t *pObj)
#define ABC_ALLOC(type, num)
static void Gia_ManSimulateCi(Gia_ManSim_t *p, Gia_Obj_t *pObj, int iCi)
static abctime Abc_Clock()
Vec_Int_t * Gia_ManSimSimulateOne(Gia_Man_t *p, Vec_Int_t *vPat)
void Gia_ManSimInfoInit(Gia_ManSim_t *p)
void Gia_ManSimSetDefaultParams(Gia_ParSim_t *p)
static Vec_Int_t * Vec_IntStartFull(int nSize)
static Gia_Obj_t * Gia_ManObj(Gia_Man_t *p, int v)
static int Gia_ManCheckPos(Gia_ManSim_t *p, int *piPo, int *piPat)
void Gia_ManStopP(Gia_Man_t **p)
void Gia_ManSimCollect_rec(Gia_Man_t *pGia, Gia_Obj_t *pObj, Vec_Int_t *vVec)
FUNCTION DEFINITIONS ///.
static int Gia_ManSimInfoIsZero(Gia_ManSim_t *p, unsigned *pInfo)
void Gia_ManSimDelete(Gia_ManSim_t *p)
unsigned Gia_ManRandom(int fReset)
FUNCTION DEFINITIONS ///.
static Gia_Obj_t * Gia_ObjChild1(Gia_Obj_t *pObj)
#define Gia_ManForEachRiRo(p, pObjRi, pObjRo, i)
static void Abc_PrintTime(int level, const char *pStr, abctime time)
static unsigned * Gia_SimDataCo(Gia_ManSim_t *p, int i)
static void Vec_IntWriteEntry(Vec_Int_t *p, int i, int Entry)
void Gia_ManSimInfoTransfer(Gia_ManSim_t *p)
static Vec_Int_t * Vec_IntStart(int nSize)
static int Abc_LitIsCompl(int Lit)
static void Gia_ManSimulateCo(Gia_ManSim_t *p, int iCo, Gia_Obj_t *pObj)
Abc_Cex_t * Gia_ManGenerateCounter(Gia_Man_t *pAig, int iFrame, int iOut, int nWords, int iPat, Vec_Int_t *vCis2Ids)
static Gia_Obj_t * Gia_ObjFanin0(Gia_Obj_t *pObj)
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
static void Vec_IntAddToEntry(Vec_Int_t *p, int i, int Addition)
Gia_ManSim_t * Gia_ManSimCreate(Gia_Man_t *pAig, Gia_ParSim_t *pPars)
static int Vec_IntEntry(Vec_Int_t *p, int i)
unsigned * Gia_SimDataCiExt(Gia_ManSim_t *p, int i)
void Gia_ManSimCollect(Gia_Man_t *pGia, Gia_Obj_t *pObj, Vec_Int_t *vVec)
Gia_Man_t * Gia_ManFront(Gia_Man_t *p)
#define ABC_NAMESPACE_IMPL_END
static void Gia_ManSimInfoRandom(Gia_ManSim_t *p, unsigned *pInfo)
static void Gia_ManSimInfoZero(Gia_ManSim_t *p, unsigned *pInfo)
static int Gia_ObjIsAndOrConst0(Gia_Obj_t *pObj)
#define Gia_ManForEachAnd(p, pObj, i)
static int Vec_IntUniqify(Vec_Int_t *p)
static void Vec_IntPush(Vec_Int_t *p, int Entry)
static void Vec_IntFreeP(Vec_Int_t **p)
#define Gia_ManForEachPi(p, pObj, i)
static void Abc_Print(int level, const char *format,...)
static int Gia_ObjDiff0(Gia_Obj_t *pObj)
static int Gia_ObjIsCo(Gia_Obj_t *pObj)
#define ABC_NAMESPACE_IMPL_START
static void Abc_InfoSetBit(unsigned *p, int i)
static int Gia_ManCiNum(Gia_Man_t *p)
static int Vec_IntSize(Vec_Int_t *p)
int Gia_ManSimWriteFile(char *pFileOut, Vec_Int_t *vPat, int nOuts)
static int Gia_IsComplement(Gia_Obj_t *p)
static int Gia_ObjIsAnd(Gia_Obj_t *pObj)
#define Gia_ManForEachObj(p, pObj, i)
MACRO DEFINITIONS ///.
unsigned * Gia_SimDataExt(Gia_ManSim_t *p, int i)
static Gia_Obj_t * Gia_ManConst0(Gia_Man_t *p)
#define GIA_NONE
INCLUDES ///.
void Gia_ManResetRandom(Gia_ParSim_t *pPars)
static int Abc_Lit2Var(int Lit)
void Gia_ManSimulateRound(Gia_ManSim_t *p)
static int Gia_ObjFaninId0p(Gia_Man_t *p, Gia_Obj_t *pObj)
static void Gia_ManSimInfoCopy(Gia_ManSim_t *p, unsigned *pInfo, unsigned *pInfo0)
static Gia_Obj_t * Gia_ObjFanin1(Gia_Obj_t *pObj)
static ABC_NAMESPACE_IMPL_START unsigned * Gia_SimData(Gia_ManSim_t *p, int i)
DECLARATIONS ///.
#define Gia_ManForEachRo(p, pObj, i)
typedefABC_NAMESPACE_HEADER_START struct Abc_Cex_t_ Abc_Cex_t
INCLUDES ///.
#define Gia_ManForEachRi(p, pObj, i)
#define Gia_ManForEachObj1(p, pObj, i)
Vec_Int_t * Gia_ManSimDeriveResets(Gia_Man_t *pGia)
static int Gia_ObjFaninC0(Gia_Obj_t *pObj)
static void Vec_IntFree(Vec_Int_t *p)
static unsigned * Gia_SimDataCi(Gia_ManSim_t *p, int i)
static int Gia_ManPiNum(Gia_Man_t *p)
static void Vec_IntClear(Vec_Int_t *p)
int Gia_ManSimSimulateEquiv(Gia_Man_t *pAig, Gia_ParSim_t *pPars)
static int Gia_ObjIsCi(Gia_Obj_t *pObj)
#define Gia_ManForEachPo(p, pObj, i)
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
unsigned * Gia_SimDataCoExt(Gia_ManSim_t *p, int i)
int Gia_ManSimSimulate(Gia_Man_t *pAig, Gia_ParSim_t *pPars)
static int Gia_ManObjNum(Gia_Man_t *p)
static int Gia_ObjIsPi(Gia_Man_t *p, Gia_Obj_t *pObj)
static int Gia_ManCoNum(Gia_Man_t *p)
Vec_Int_t * Gia_ManSimReadFile(char *pFileIn)
static int Gia_ManRegNum(Gia_Man_t *p)