69 #define Ssw_ManForEachClass( p, ppClass, i ) \
70 for ( i = 0; i < Aig_ManObjNumMax(p->pAig); i++ ) \
71 if ( ((ppClass) = p->pId2Class[i]) == NULL ) {} else
73 #define Ssw_ClassForEachNode( p, pRepr, pNode, i ) \
74 for ( i = 0; i < p->pClassSizes[pRepr->Id]; i++ ) \
75 if ( ((pNode) = p->pId2Class[pRepr->Id][i]) == NULL ) {} else
95 assert( pClass[0] == pRepr );
101 p->
nLits += nSize - 1;
124 p->
nLits -= nSize - 1;
151 if ( pAig->pReprs == NULL )
168 unsigned (*pFuncNodeHash)(
void *,
Aig_Obj_t *),
169 int (*pFuncNodeIsConst)(
void *,
Aig_Obj_t *),
353 int i, k, nLits, nClasses, nCands1;
354 nClasses = nLits = 0;
419 Abc_Print( 1,
"Equiv classes: Const1 = %5d. Class = %5d. Lit = %5d.\n",
503 Aig_Obj_t ** ppTable, ** ppNexts, ** ppClassNew;
505 int i, k, nTableSize, nNodes, iEntry, nEntries, nEntries2;
531 if ( ppTable[iEntry] == NULL )
533 ppTable[iEntry] = pObj;
538 pRepr = ppTable[iEntry];
565 ppClassNew[0] = pObj;
566 for ( pTemp =
Ssw_ObjNext(ppNexts, pObj), k = 1; pTemp;
569 ppClassNew[nNodes-k] = pTemp;
578 assert( nEntries == nEntries2 );
625 Abc_Print( 1,
"Allocated %.2f MB to store simulation information.\n",
626 1.0*(
sizeof(
unsigned) *
Aig_ManObjNumMax(pAig) * nFrames * nWords)/(1<<20) );
627 Abc_Print( 1,
"Initial simulation of %d frames with %d words. ", nFrames, nWords );
649 if ( nMaxLevs && (
int)pObj->
Level > nMaxLevs )
679 Abc_Print( 1,
"Collecting candidate equivalence classes. " );
685 for ( i = 1; i < nIters; i++ )
704 Abc_Print( 1,
"Simulation of %d frames with %d words (%2d rounds). ",
705 nFrames, nWords, i-1 );
745 if ( nMaxLevs && (
int)pObj->
Level > nMaxLevs )
772 int * pClassSizes, nEntries, i;
802 p->
pId2Class[i][pClassSizes[i]++] = pObj;
867 int i, k, nTotalObjs, nEntries, Entry;
873 nTotalObjs += pvClasses[i] ?
Vec_IntSize(pvClasses[i]) : 0;
880 assert( (i == 0) == (Entry == 0) );
891 if ( pvClasses[i] == NULL )
898 ppClassNew[0] = pRepr;
904 ppClassNew[k] = pObj;
947 ppClassNew[0] = pRepr;
948 ppClassNew[1] = pObj;
1000 pClassOld[i] = pObj;
1004 pClassNew = pClassOld + i;
1007 pClassNew[i] = pObj;
1076 Aig_Obj_t * pObj, * pReprNew, ** ppClassNew;
1098 ppClassNew[i] = pObj;
1121 Aig_Obj_t * pObj, * pReprNew, ** ppClassNew;
1154 ppClassNew[i] = pObj;
unsigned Ssw_SmlObjHashWord(Ssw_Sml_t *p, Aig_Obj_t *pObj)
FUNCTION DEFINITIONS ///.
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
static int Abc_PrimeCudd(unsigned int p)
int Ssw_ClassesRefineGroup(Ssw_Cla_t *p, Vec_Ptr_t *vReprs, int fRecursive)
int Ssw_ClassesClassNum(Ssw_Cla_t *p)
static Aig_Obj_t * Aig_ObjRepr(Aig_Man_t *p, Aig_Obj_t *pObj)
Ssw_Sml_t * Ssw_SmlSimulateSeq(Aig_Man_t *pAig, int nPref, int nFrames, int nWords)
static int Saig_ObjIsLo(Aig_Man_t *p, Aig_Obj_t *pObj)
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
int Ssw_ClassesCand1Num(Ssw_Cla_t *p)
unsigned(* pFuncNodeHash)(void *, Aig_Obj_t *)
static void Ssw_ObjAddClass(Ssw_Cla_t *p, Aig_Obj_t *pRepr, Aig_Obj_t **pClass, int nSize)
FUNCTION DEFINITIONS ///.
static Aig_Obj_t * Aig_ObjFanin0(Aig_Obj_t *pObj)
int(* pFuncNodesAreEqual)(void *, Aig_Obj_t *, Aig_Obj_t *)
int Ssw_ClassesRefineConst1Group(Ssw_Cla_t *p, Vec_Ptr_t *vRoots, int fRecursive)
static void Ssw_ObjSetConst1Cand(Aig_Man_t *pAig, Aig_Obj_t *pObj)
void Ssw_ClassesStop(Ssw_Cla_t *p)
int Ssw_ClassesPrepareRehash(Ssw_Cla_t *p, Vec_Ptr_t *vCands, int fConstCorr)
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
#define ABC_ALLOC(type, num)
static Aig_Obj_t * Aig_ManObj(Aig_Man_t *p, int i)
#define Ssw_ManForEachClass(p, ppClass, i)
int Ssw_ClassesRefine(Ssw_Cla_t *p, int fRecursive)
Ssw_Cla_t * Ssw_ClassesPreparePairsSimple(Aig_Man_t *pMiter, Vec_Int_t *vPairs)
Ssw_Cla_t * Ssw_ClassesPrepareTargets(Aig_Man_t *pAig)
static abctime Abc_Clock()
static int Abc_MaxInt(int a, int b)
Aig_Obj_t ** pMemClassesFree
static int Vec_PtrSize(Vec_Ptr_t *p)
Ssw_Cla_t * Ssw_ClassesPreparePairs(Aig_Man_t *pAig, Vec_Int_t **pvClasses)
int Ssw_SmlObjIsConstWord(Ssw_Sml_t *p, Aig_Obj_t *pObj)
int Aig_SupportSize(Aig_Man_t *p, Aig_Obj_t *pObj)
void Ssw_ClassesRemoveNode(Ssw_Cla_t *p, Aig_Obj_t *pObj)
int Aig_NodeMffcSupp(Aig_Man_t *p, Aig_Obj_t *pNode, int LevelMin, Vec_Ptr_t *vSupp)
static int Aig_ObjIsNode(Aig_Obj_t *pObj)
void Ssw_ClassesPrintOne(Ssw_Cla_t *p, Aig_Obj_t *pRepr)
void Ssw_ClassesClearRefined(Ssw_Cla_t *p)
static void Aig_ObjSetRepr(Aig_Man_t *p, Aig_Obj_t *pObj, Aig_Obj_t *pRepr)
void Aig_ManReprStart(Aig_Man_t *p, int nIdMax)
DECLARATIONS ///.
Ssw_Cla_t * Ssw_ClassesPrepare(Aig_Man_t *pAig, int nFramesK, int fLatchCorr, int fConstCorr, int fOutputCorr, int nMaxLevs, int fVerbose)
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 *))
void Ssw_ClassesPrint(Ssw_Cla_t *p, int fVeryVerbose)
int Ssw_ClassesRefineOneClass(Ssw_Cla_t *p, Aig_Obj_t *pReprOld, int fRecursive)
static int Vec_IntEntry(Vec_Int_t *p, int i)
#define ABC_NAMESPACE_IMPL_END
void Ssw_ClassesCheck(Ssw_Cla_t *p)
#define Vec_IntForEachEntryStart(vVec, Entry, i, Start)
static void Abc_Print(int level, const char *format,...)
int(* pFuncNodeIsConst)(void *, Aig_Obj_t *)
static int Aig_ManObjNumMax(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)
Ssw_Cla_t * Ssw_ClassesPrepareSimple(Aig_Man_t *pAig, int fLatchCorr, int nMaxLevs)
Aig_Obj_t ** Ssw_ClassesReadClass(Ssw_Cla_t *p, Aig_Obj_t *pRepr, int *pnSize)
static void Ssw_ObjSetNext(Aig_Obj_t **ppNexts, Aig_Obj_t *pObj, Aig_Obj_t *pNext)
static int Vec_IntSize(Vec_Int_t *p)
#define Aig_ManForEachObj(p, pObj, i)
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Ssw_Cla_t * Ssw_ClassesStart(Aig_Man_t *pAig)
void Ssw_ClassesCollectClass(Ssw_Cla_t *p, Aig_Obj_t *pRepr, Vec_Ptr_t *vClass)
#define Ssw_ClassForEachNode(p, pRepr, pNode, i)
static int Aig_ObjIsCand(Aig_Obj_t *pObj)
static int Ssw_ObjIsConst1Cand(Aig_Man_t *pAig, Aig_Obj_t *pObj)
#define ABC_CALLOC(type, num)
#define Saig_ManForEachPo(p, pObj, i)
static int Aig_ObjId(Aig_Obj_t *pObj)
static Aig_Obj_t * Ssw_ObjNext(Aig_Obj_t **ppNexts, Aig_Obj_t *pObj)
DECLARATIONS ///.
static void Vec_PtrClear(Vec_Ptr_t *p)
void Ssw_SmlResimulateSeq(Ssw_Sml_t *p)
static Aig_Obj_t ** Ssw_ObjRemoveClass(Ssw_Cla_t *p, Aig_Obj_t *pRepr)
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
static int Aig_ObjIsCi(Aig_Obj_t *pObj)
Vec_Ptr_t * Ssw_ClassesGetRefined(Ssw_Cla_t *p)
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
int Ssw_ClassesRefineConst1(Ssw_Cla_t *p, int fRecursive)
int Ssw_ClassesLitNum(Ssw_Cla_t *p)
Aig_Man_t * Ssw_ClassesReadAig(Ssw_Cla_t *p)
static void Vec_PtrFree(Vec_Ptr_t *p)