53 static int s_SPrimes[128] = {
54 1009, 1049, 1093, 1151, 1201, 1249, 1297, 1361, 1427, 1459,
55 1499, 1559, 1607, 1657, 1709, 1759, 1823, 1877, 1933, 1997,
56 2039, 2089, 2141, 2213, 2269, 2311, 2371, 2411, 2467, 2543,
57 2609, 2663, 2699, 2741, 2797, 2851, 2909, 2969, 3037, 3089,
58 3169, 3221, 3299, 3331, 3389, 3461, 3517, 3557, 3613, 3671,
59 3719, 3779, 3847, 3907, 3943, 4013, 4073, 4129, 4201, 4243,
60 4289, 4363, 4441, 4493, 4549, 4621, 4663, 4729, 4793, 4871,
61 4933, 4973, 5021, 5087, 5153, 5227, 5281, 5351, 5417, 5471,
62 5519, 5573, 5651, 5693, 5749, 5821, 5861, 5923, 6011, 6073,
63 6131, 6199, 6257, 6301, 6353, 6397, 6481, 6563, 6619, 6689,
64 6737, 6803, 6863, 6917, 6977, 7027, 7109, 7187, 7237, 7309,
65 7393, 7477, 7523, 7561, 7607, 7681, 7727, 7817, 7877, 7933,
66 8011, 8039, 8059, 8081, 8093, 8111, 8123, 8147
72 pSims = (
unsigned *)pObj->
pData;
74 uHash ^= pSims[i] * s_SPrimes[i & 0x7F];
91 unsigned * pSims0 = (
unsigned *)pObj0->
pData;
92 unsigned * pSims1 = (
unsigned *)pObj1->
pData;
95 if ( pSims0[i] != pSims1[i] )
113 unsigned * pSims = (
unsigned *)pObj->
pData;
134 unsigned * pSims = (
unsigned *)pObj->
pData;
137 if ( pSims[i] != ~0 )
155 unsigned * pSims = (
unsigned *)pObj->
pData;
174 unsigned * pSims = (
unsigned *)pObj->
pData;
193 unsigned * pSims = (
unsigned *)pObj->
pData;
210 unsigned * pSims = (
unsigned *)pObj->
pData;
214 pSims[i] = ~(pSims0[i] | pSims1[i]);
216 pSims[i] = (~pSims0[i] & pSims1[i]);
218 pSims[i] = (pSims0[i] & ~pSims1[i]);
220 pSims[i] = (pSims0[i] & pSims1[i]);
236 unsigned * pSims = (
unsigned *)pObj->
pData;
239 pSims[i] = ~pSims0[i];
241 pSims[i] = pSims0[i];
257 unsigned * pSims0 = (
unsigned *)pObj0->
pData;
258 unsigned * pSims1 = (
unsigned *)pObj1->
pData;
261 pSims1[i] = pSims0[i];
277 unsigned * pSims0 = (
unsigned *)pObj0->
pData;
278 unsigned * pSims1 = (
unsigned *)pObj1->
pData;
280 pSims1[i+1] = pSims0[i];
319 if ( f < SAIG_WORDS - 1 )
328 if ( f < SAIG_WORDS - 1 )
352 for ( pEntry = ppTable[iEntry]; pEntry; pEntry =
Saig_ObjNext(ppNexts,pEntry) )
374 if ( ppTable[iEntry] == NULL )
375 ppTable[iEntry] = pObj;
396 Aig_Obj_t ** ppTable, ** ppNexts, ** ppCands;
417 if ( pEntry == NULL )
434 if ( pEntry == NULL )
445 for ( i = 0; i < nTableSize; i++ )
446 for ( pEntry = ppTable[i]; pEntry; pEntry =
Saig_ObjNext(ppNexts,pEntry) )
576 int i, CountAll = 0, CountNot = 0;
624 Abc_Print( 1,
"Total matches = %6d. Wrong matches = %6d. Ratio = %5.2f %%\n",
625 CountAll, CountNot, 100.0*CountNot/CountAll );
681 int i, CountAll = 0, CountNot = 0;
702 Abc_Print( 1,
"Total matches = %6d. Wrong matches = %6d. Ratio = %5.2f %%\n",
703 CountAll, CountNot, 100.0*CountNot/CountAll );
818 Abc_Print( 1,
"Extending islands by %d steps:\n", nDist );
819 Abc_Print( 1,
"%2d : Total = %6d. Unmatched = %6d. Ratio = %6.2f %%\n",
823 for ( d = 0; d < nDist; d++ )
830 if ( pNext1 == NULL )
841 if ( pNext0 == NULL )
852 Abc_Print( 1,
"%2d : Total = %6d. Unmatched = %6d. Ratio = %6.2f %%\n",
893 Abc_Print( 1,
"Demitering has failed.\n" );
913 Abc_Print( 1,
"Allocated %6.2f MB to simulate the first AIG.\n",
915 Abc_Print( 1,
"Allocated %6.2f MB to simulate the second AIG.\n",
920 for ( i = 0; nMatches > 0; i++ )
929 Abc_Print( 1,
"%3d : Match =%6d. FF =%6d. (%6.2f %%) Node =%6d. (%6.2f %%) ",
void Ssw_StrSimMatchingExtend(Aig_Man_t *p0, Aig_Man_t *p1, int nDist, int fVerbose)
#define Aig_ObjForEachFanout(p, pObj, pFanout, iFan, i)
void Saig_StrSimSetFinalMatching(Aig_Man_t *p0, Aig_Man_t *p1)
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
static int Abc_PrimeCudd(unsigned int p)
Aig_Obj_t * Saig_StrSimTableLookup(Aig_Obj_t **ppTable, Aig_Obj_t **ppNexts, int nTableSize, Aig_Obj_t *pObj)
#define SAIG_WORDS
DECLARATIONS ///.
static Aig_Obj_t * Aig_ObjRepr(Aig_Man_t *p, Aig_Obj_t *pObj)
static Aig_Type_t Aig_ObjType(Aig_Obj_t *pObj)
void Saig_StrSimSaveOutput(Aig_Obj_t *pObj, int i)
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 ///.
void Saig_StrSimSetInitMatching(Aig_Man_t *p0, Aig_Man_t *p1)
void Aig_ManStop(Aig_Man_t *p)
static int Aig_ObjIsTravIdCurrent(Aig_Man_t *p, Aig_Obj_t *pObj)
static int Aig_ManObjNum(Aig_Man_t *p)
#define Saig_ManForEachLiLo(p, pObjLi, pObjLo, i)
static Aig_Obj_t * Saig_ObjLoToLi(Aig_Man_t *p, Aig_Obj_t *pObj)
static void Saig_ObjSetNext(Aig_Obj_t **ppNexts, Aig_Obj_t *pObj, Aig_Obj_t *pNext)
void Saig_StrSimTableInsert(Aig_Obj_t **ppTable, Aig_Obj_t **ppNexts, int nTableSize, Aig_Obj_t *pObj)
static Aig_Obj_t * Aig_ObjFanin0(Aig_Obj_t *pObj)
void Aig_ManPrintStats(Aig_Man_t *p)
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
unsigned Aig_ManRandom(int fReset)
void Saig_StrSimSetContiguousMatching_rec(Aig_Man_t *p, Aig_Obj_t *pObj)
Aig_Man_t * Saig_ManWindowExtractMiter(Aig_Man_t *p0, Aig_Man_t *p1)
static abctime Abc_Clock()
static Aig_Obj_t * Aig_ObjFanin1(Aig_Obj_t *pObj)
static void Aig_ObjSetTravIdCurrent(Aig_Man_t *p, Aig_Obj_t *pObj)
for(p=first;p->value< newval;p=p->next)
static int Aig_ManNodeNum(Aig_Man_t *p)
static int Saig_ObjIsLi(Aig_Man_t *p, Aig_Obj_t *pObj)
void Aig_ManFanoutStart(Aig_Man_t *p)
FUNCTION DEFINITIONS ///.
void Saig_StrSimPrepareAig(Aig_Man_t *p)
int Saig_StrSimIsOne(Aig_Obj_t *pObj)
void Aig_ManFanoutStop(Aig_Man_t *p)
int Saig_ManDemiterSimpleDiff(Aig_Man_t *p, Aig_Man_t **ppAig0, Aig_Man_t **ppAig1)
void Aig_ManIncrementTravId(Aig_Man_t *p)
DECLARATIONS ///.
void Ssw_StrSimMatchingExtendOne(Aig_Man_t *p, Vec_Ptr_t *vNodes)
static int Aig_ObjIsNode(Aig_Obj_t *pObj)
void Saig_StrSimulateNode(Aig_Obj_t *pObj, int i)
void Saig_StrSimTransferNext(Aig_Obj_t *pObj0, Aig_Obj_t *pObj1, int i)
#define Aig_ManForEachNode(p, pObj, i)
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 ///.
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
#define Saig_ManForEachLi(p, pObj, i)
static Aig_Obj_t * Aig_ManCi(Aig_Man_t *p, int i)
static int Aig_ManCiNum(Aig_Man_t *p)
static int Saig_ObjIsPo(Aig_Man_t *p, Aig_Obj_t *pObj)
static Aig_Obj_t * Saig_ObjLiToLo(Aig_Man_t *p, Aig_Obj_t *pObj)
#define ABC_NAMESPACE_IMPL_END
static int Aig_ObjIsConst1(Aig_Obj_t *pObj)
int Saig_StrSimCountMatchedFlops(Aig_Man_t *p)
void Saig_StrSimAssignZeroInit(Aig_Obj_t *pObj)
int Saig_StrSimIsZero(Aig_Obj_t *pObj)
static void Vec_IntPush(Vec_Int_t *p, int Entry)
#define Saig_ManForEachLo(p, pObj, i)
static void Abc_Print(int level, const char *format,...)
static int Aig_ObjFaninC0(Aig_Obj_t *pObj)
static int Aig_ManObjNumMax(Aig_Man_t *p)
static Aig_Obj_t * Aig_ManConst1(Aig_Man_t *p)
#define ABC_NAMESPACE_IMPL_START
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
void Saig_StrSimTransfer(Aig_Obj_t *pObj0, Aig_Obj_t *pObj1)
static int Aig_ManRegNum(Aig_Man_t *p)
#define Aig_ManForEachObj(p, pObj, i)
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
int Saig_StrSimDetectUnique(Aig_Man_t *p0, Aig_Man_t *p1)
int Saig_StrSimIsEqual(Aig_Obj_t *pObj0, Aig_Obj_t *pObj1)
void Saig_StrSimulateRound(Aig_Man_t *p0, Aig_Man_t *p1)
void Aig_ManCleanMarkA(Aig_Man_t *p)
#define ABC_CALLOC(type, num)
static int Aig_ObjFaninC1(Aig_Obj_t *pObj)
int Saig_StrSimCountMatchedNodes(Aig_Man_t *p)
void Saig_StrSimAssignRandom(Aig_Obj_t *pObj)
static void Vec_PtrClear(Vec_Ptr_t *p)
void Saig_StrSimAssignOne(Aig_Obj_t *pObj)
int Ssw_StrSimMatchingCountUnmached(Aig_Man_t *p)
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
static int Aig_ObjIsCi(Aig_Obj_t *pObj)
unsigned Saig_StrSimHash(Aig_Obj_t *pObj)
FUNCTION DEFINITIONS ///.
static int Saig_ObjIsPi(Aig_Man_t *p, Aig_Obj_t *pObj)
Aig_Man_t * Aig_ManDupSimple(Aig_Man_t *p)
DECLARATIONS ///.
static Vec_Ptr_t * Vec_PtrAllocSimInfo(int nEntries, int nWords)
static Aig_Obj_t * Saig_ObjNext(Aig_Obj_t **ppNexts, Aig_Obj_t *pObj)
void Saig_StrSimSetContiguousMatching(Aig_Man_t *p0, Aig_Man_t *p1)
static void Vec_PtrFree(Vec_Ptr_t *p)
#define Saig_ManForEachPi(p, pObj, i)
Vec_Int_t * Saig_StrSimPerformMatching(Aig_Man_t *p0, Aig_Man_t *p1, int nDist, int fVerbose, Aig_Man_t **ppMiter)