56 assert( iPat >= 0 && iPat < (1 << p->nBinSize) );
57 return p->pRarity[iBin * (1 << p->nBinSize) + iPat];
62 assert( iPat >= 0 && iPat < (1 << p->nBinSize) );
63 p->pRarity[iBin * (1 << p->nBinSize) + iPat] = Value;
68 assert( iPat >= 0 && iPat < (1 << p->nBinSize) );
69 p->pRarity[iBin * (1 << p->nBinSize) + iPat]++;
96 p->nBinSize = nBinSize;
97 p->fVerbose = fVerbose;
99 p->pRarity =
ABC_CALLOC(
int, (1 << nBinSize) * p->nGroups );
100 p->pGroupValues =
ABC_CALLOC(
int, p->nGroups );
101 p->pPatCosts =
ABC_CALLOC(
double, p->nWords * 32 );
154 for ( k = 0; k < p->nWords * 32; k++ )
156 for ( i = 0; i < p->nGroups; i++ )
157 p->pGroupValues[i] = 0;
162 p->pGroupValues[i / p->nBinSize] |= (1 << (i % p->nBinSize));
164 for ( i = 0; i < p->nGroups; i++ )
195 for ( k = 0; k < p->nWords * 32; k++ )
197 for ( i = 0; i < p->nGroups; i++ )
198 p->pGroupValues[i] = 0;
204 p->pGroupValues[i / p->nBinSize] |= (1 << (i % p->nBinSize));
207 p->pPatCosts[k] = 0.0;
208 for ( i = 0; i < p->nGroups; i++ )
212 p->pPatCosts[k] += 1.0/(Value*Value);
220 for ( i = 0; i < p->nWords; i++ )
225 for ( k = 0; k < p->nWords * 32; k++ )
226 if ( iCostBest < p->pPatCosts[k] )
228 iCostBest = p->pPatCosts[k];
267 for ( f = 0; f <= pCex->iFrame; f++ )
283 assert( iBit == pCex->nBits );
321 Abc_Print( 1,
"Simulating %d words through %d frames with %d binsize, %d rounds, and %d sec timeout.\n",
322 nWords, nFrames, nBinSize, nRounds, TimeOut );
332 for ( r = 0; r < nRounds; r++ )
340 Abc_Print( 1,
"Simulation asserted a PO in frame f: %d <= f < %d.\n", r * nFrames, (r+1) * nFrames );
356 if ( TimeOut &&
Abc_Clock() > nTimeToStop )
359 Abc_Print( 1,
"Reached timeout (%d seconds).\n", TimeOut );
366 Abc_Print( 1,
"Simulation did not assert POs in the first %d frames. ", nRounds * nFrames );
400 Abc_Print( 1,
"Filtering equivs with %d words through %d frames with %d binsize, %d rounds, and %d sec timeout.\n",
401 nWords, nFrames, nBinSize, nRounds, TimeOut );
408 assert( p->vInits == NULL );
414 for ( i = 1; i <
nWords; i++ )
422 if ( pAig->pReprs == NULL )
434 for ( r = 0; r < nRounds; r++ )
439 Abc_Print( 1,
"All equivalences are refined away.\n" );
447 Abc_Print( 1,
"Simulation asserted a PO in frame f: %d <= f < %d.\n", r * nFrames, (r+1) * nFrames );
465 if ( TimeOut &&
Abc_Clock() > nTimeToStop )
468 Abc_Print( 1,
"Reached timeout (%d seconds).\n", TimeOut );
474 Abc_Print( 1,
"Simulation did not assert POs in the first %d frames. ", nRounds * nFrames );
504 RetValue =
Ssw_RarSignalFilter2( pAig, nFrames, nWords, nBinSize, nRounds, TimeOut, pCex, fLatchOnly, fVerbose );
int Ssw_SmlCheckNonConstOutputs(Ssw_Sml_t *p)
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
int Ssw_ClassesClassNum(Ssw_Cla_t *p)
Aig_Man_t * Gia_ManToAigSimple(Gia_Man_t *p)
static int Aig_ManConstrNum(Aig_Man_t *p)
void Gia_ManReprFromAigRepr(Aig_Man_t *pAig, Gia_Man_t *pGia)
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
void Aig_ManStop(Aig_Man_t *p)
static int Abc_InfoHasBit(unsigned *p, int i)
int Ssw_ClassesCand1Num(Ssw_Cla_t *p)
#define Saig_ManForEachLiLo(p, pObjLi, pObjLo, i)
static Aig_Obj_t * Aig_ObjFanin0(Aig_Obj_t *pObj)
void Ssw_ClassesStop(Ssw_Cla_t *p)
#define Aig_ManForEachCo(p, pObj, i)
unsigned Aig_ManRandom(int fReset)
int Ssw_ClassesRefine(Ssw_Cla_t *p, int fRecursive)
static void Ssw_RarSetBinPat(Ssw_RarMan_t *p, int iBin, int iPat, int Value)
static abctime Abc_Clock()
static Aig_Obj_t * Aig_ObjFanin1(Aig_Obj_t *pObj)
int Ssw_SmlObjIsConstWord(Ssw_Sml_t *p, Aig_Obj_t *pObj)
static int Aig_ManNodeNum(Aig_Man_t *p)
static int Ssw_RarGetBinPat(Ssw_RarMan_t *p, int iBin, int iPat)
int Ssw_RarSimulate2(Aig_Man_t *pAig, int nFrames, int nWords, int nBinSize, int nRounds, int TimeOut, int fVerbose)
int Ssw_RarSignalFilterGia2(Gia_Man_t *p, int nFrames, int nWords, int nBinSize, int nRounds, int TimeOut, Abc_Cex_t *pCex, int fLatchOnly, int fVerbose)
static void Abc_PrintTime(int level, const char *pStr, abctime time)
static void Ssw_RarManStop(Ssw_RarMan_t *p)
static Vec_Int_t * Vec_IntStart(int nSize)
#define Aig_ManForEachNode(p, pObj, i)
void Gia_ManReprToAigRepr2(Aig_Man_t *pAig, Gia_Man_t *pGia)
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
#define Saig_ManForEachLi(p, pObj, i)
int Ssw_SmlObjsAreEqualWord(Ssw_Sml_t *p, Aig_Obj_t *pObj0, Aig_Obj_t *pObj1)
void Ssw_ClassesSetData(Ssw_Cla_t *p, void *pManData, unsigned(*pFuncNodeHash)(void *, Aig_Obj_t *), int(*pFuncNodeIsConst)(void *, Aig_Obj_t *), int(*pFuncNodesAreEqual)(void *, Aig_Obj_t *, Aig_Obj_t *))
static void Ssw_RarAddToBinPat(Ssw_RarMan_t *p, int iBin, int iPat)
void Ssw_ClassesPrint(Ssw_Cla_t *p, int fVeryVerbose)
static int Vec_IntEntry(Vec_Int_t *p, int i)
#define ABC_NAMESPACE_IMPL_END
static void Vec_IntPush(Vec_Int_t *p, int Entry)
#define Saig_ManForEachLo(p, pObj, i)
typedefABC_NAMESPACE_IMPL_START struct Ssw_RarMan_t_ Ssw_RarMan_t
DECLARATIONS ///.
static void Vec_IntFreeP(Vec_Int_t **p)
static void Abc_Print(int level, const char *format,...)
void Ssw_SmlInitializeSpecial(Ssw_Sml_t *p, Vec_Int_t *vInit)
static int Aig_ObjFaninC0(Aig_Obj_t *pObj)
static int Saig_ManRegNum(Aig_Man_t *p)
void Ssw_SmlStop(Ssw_Sml_t *p)
static Aig_Obj_t * Aig_ManConst1(Aig_Man_t *p)
Ssw_Cla_t * Ssw_ClassesPrepareFromReprs(Aig_Man_t *pAig)
#define ABC_NAMESPACE_IMPL_START
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
int Ssw_RarSignalFilter2(Aig_Man_t *pAig, int nFrames, int nWords, int nBinSize, int nRounds, int TimeOut, Abc_Cex_t *pCex, int fLatchOnly, int fVerbose)
Ssw_Cla_t * Ssw_ClassesPrepareSimple(Aig_Man_t *pAig, int fLatchCorr, int nMaxLevs)
static void Ssw_RarUpdateCounters(Ssw_RarMan_t *p)
static int Aig_ManRegNum(Aig_Man_t *p)
void Ssw_SmlSimulateOne(Ssw_Sml_t *p)
static int Vec_IntSize(Vec_Int_t *p)
static Vec_Int_t * Ssw_RarFindStartingState(Aig_Man_t *pAig, Abc_Cex_t *pCex)
#define ABC_CALLOC(type, num)
static void Vec_PtrFreeP(Vec_Ptr_t **p)
static int Aig_ObjFaninC1(Aig_Obj_t *pObj)
static Ssw_RarMan_t * Ssw_RarManStart(Aig_Man_t *pAig, int nWords, int nFrames, int nBinSize, int fVerbose)
FUNCTION DEFINITIONS ///.
#define ABC_INFINITY
MACRO DEFINITIONS ///.
static int Aig_ObjId(Aig_Obj_t *pObj)
typedefABC_NAMESPACE_HEADER_START struct Abc_Cex_t_ Abc_Cex_t
INCLUDES ///.
static void Vec_IntClear(Vec_Int_t *p)
static void Ssw_RarTransferPatterns(Ssw_RarMan_t *p, Vec_Int_t *vInits)
int Ssw_ClassesRefineConst1(Ssw_Cla_t *p, int fRecursive)
Ssw_Sml_t * Ssw_SmlStart(Aig_Man_t *pAig, int nPref, int nFrames, int nWordsFrame)
Vec_Ptr_t * Ssw_SmlSimDataPointers(Ssw_Sml_t *p)
#define Saig_ManForEachPi(p, pObj, i)