48 int i, CountConst0 = 0, CountNonConst0 = 0, CountUndecided = 0;
53 pChild = Aig_ObjChild0(pObj);
55 if ( pChild == Aig_ManConst0(
p) )
61 if ( pChild == Aig_ManConst1(
p) )
67 if (
p->nRegs == 0 && Aig_ObjIsCi(Aig_Regular(pChild)) )
73 if ( Aig_Regular(pChild)->fPhase != (
unsigned)Aig_IsComplement(pChild) )
83 Abc_Print( 1,
"Miter has %d outputs. ", Saig_ManPoNum(
p) );
84 Abc_Print( 1,
"Const0 = %d. ", CountConst0 );
85 Abc_Print( 1,
"NonConst0 = %d. ", CountNonConst0 );
86 Abc_Print( 1,
"Undecided = %d. ", CountUndecided );
114 vIds = Vec_IntAlloc( 2 * Vec_IntSize(vIds1) );
115 for ( i = 0; i < Vec_IntSize(vIds1); i++ )
117 pObj1 = Aig_ManObj( pAig1, Vec_IntEntry(vIds1, i) );
118 pObj2 = Aig_ManObj( pAig2, Vec_IntEntry(vIds2, i) );
121 assert( pObj1m && pObj2m );
122 if ( pObj1m == pObj2m )
124 if ( pObj1m->
Id < pObj2m->
Id )
126 Vec_IntPush( vIds, pObj1m->
Id );
127 Vec_IntPush( vIds, pObj2m->
Id );
131 Vec_IntPush( vIds, pObj2m->
Id );
132 Vec_IntPush( vIds, pObj1m->
Id );
153 int Entry, idObj, idRepr, idReprObj, idReprRepr, i;
157 for ( i = 0; i < nObjNumMax; i++ )
160 for ( i = 0; i < Vec_IntSize(vPairs); i += 2 )
163 idRepr = Vec_IntEntry( vPairs, i );
164 idObj = Vec_IntEntry( vPairs, i+1 );
166 assert( (pReprs[idRepr] == -1) || (pvClasses[pReprs[idRepr]] != NULL) );
167 assert( (pReprs[idObj] == -1) || (pvClasses[pReprs[idObj] ] != NULL) );
169 idReprRepr = pReprs[idRepr];
170 idReprObj = pReprs[idObj];
172 if ( idReprRepr == -1 && idReprObj == -1 )
175 pvClasses[idRepr] = Vec_IntAlloc( 4 );
176 Vec_IntPush( pvClasses[idRepr], idRepr );
177 Vec_IntPush( pvClasses[idRepr], idObj );
178 pReprs[ idRepr ] = idRepr;
179 pReprs[ idObj ] = idRepr;
181 else if ( idReprRepr >= 0 && idReprObj == -1 )
184 Vec_IntPushUniqueOrder( pvClasses[idReprRepr], idObj );
185 pReprs[ idObj ] = idReprRepr;
187 else if ( idReprRepr == -1 && idReprObj >= 0 )
189 assert( idReprObj != idRepr );
190 if ( idReprObj < idRepr )
192 Vec_IntPushUniqueOrder( pvClasses[idReprObj], idRepr );
193 pReprs[ idRepr ] = idReprObj;
197 Vec_IntPushFirst( pvClasses[idReprObj], idRepr );
198 pvClasses[idRepr] = pvClasses[idReprObj];
199 pvClasses[idReprObj] = NULL;
202 pReprs[ Entry ] = idRepr;
207 if ( idReprRepr == idReprObj )
214 if ( idReprRepr < idReprObj )
218 Vec_IntPushUniqueOrder( pvClasses[idReprRepr], Entry );
219 pReprs[ Entry ] = idReprRepr;
221 Vec_IntFree( pvClasses[idReprObj] );
222 pvClasses[idReprObj] = NULL;
228 Vec_IntPushUniqueOrder( pvClasses[idReprObj], Entry );
229 pReprs[ Entry ] = idReprObj;
231 Vec_IntFree( pvClasses[idReprRepr] );
232 pvClasses[idReprRepr] = NULL;
255 for ( i = 0; i < nObjNumMax; i++ )
257 Vec_IntFree( pvClasses[i] );
279 assert( Vec_IntSize(vIds1) == Vec_IntSize(vIds2) );
287 Vec_IntFree( vPairs );
295 p->pSml =
Ssw_SmlStart( pMiter, 0,
p->nFrames +
p->pPars->nFramesAddSim, 1 );
329 vIds1 = Vec_IntAlloc( Aig_ManObjNumMax(pAig) );
330 vIds2 = Vec_IntAlloc( Aig_ManObjNumMax(pAig) );
336 if ( Aig_ManObj(pAigNew, pRepr->
Id) == NULL )
346 Vec_IntPush( vIds1, Aig_ObjId(pObj) );
347 Vec_IntPush( vIds2, Aig_ObjId(pRepr) );
349 Abc_Print( 1,
"Recorded %d pairs (before: %d after: %d).\n", Vec_IntSize(vIds1), Aig_ManObjNumMax(pAig), Aig_ManObjNumMax(pAigNew) );
352 Vec_IntFree( vIds1 );
353 Vec_IntFree( vIds2 );
357 Abc_Print( 1,
"Verification successful. " );
358 else if ( RetValue == 0 )
359 Abc_Print( 1,
"Verification failed with the counter-example. " );
361 Abc_Print( 1,
"Verification UNDECIDED. Remaining registers %d (total %d). ",
362 Aig_ManRegNum(pAigRes), Aig_ManRegNum(pAig) + Aig_ManRegNum(pAigNew) );
363 ABC_PRT(
"Time", Abc_Clock() - clk );
385 assert( vIds1 != NULL && vIds2 != NULL );
387 Abc_Print( 1,
"Performing specialized verification with node pairs.\n" );
392 Abc_Print( 1,
"Verification successful. " );
393 else if ( RetValue == 0 )
394 Abc_Print( 1,
"Verification failed with a counter-example. " );
396 Abc_Print( 1,
"Verification UNDECIDED. The number of remaining regs = %d (total = %d). ",
397 Aig_ManRegNum(pAigRes), Aig_ManRegNum(pAig1) + Aig_ManRegNum(pAig2) );
398 ABC_PRT(
"Time", Abc_Clock() - clk );
421 Abc_Print( 1,
"Performing general verification without node pairs.\n" );
429 Abc_Print( 1,
"Verification successful. " );
430 else if ( RetValue == 0 )
431 Abc_Print( 1,
"Verification failed with a counter-example. " );
433 Abc_Print( 1,
"Verification UNDECIDED. The number of remaining regs = %d (total = %d). ",
434 Aig_ManRegNum(pAigRes), Aig_ManRegNum(pAig1) + Aig_ManRegNum(pAig2) );
435 ABC_PRT(
"Time", Abc_Clock() - clk );
463 Abc_Print( 1,
"Verification successful. " );
464 else if ( RetValue == 0 )
465 Abc_Print( 1,
"Verification failed with a counter-example. " );
467 Abc_Print( 1,
"Verification UNDECIDED. The number of remaining regs = %d (total = %d). ",
468 Aig_ManRegNum(pAigRes), Aig_ManRegNum(pMiter) );
469 ABC_PRT(
"Time", Abc_Clock() - clk );
#define ABC_ALLOC(type, num)
#define ABC_CALLOC(type, num)
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
#define Aig_ManForEachObj(p, pObj, i)
void Aig_ManStop(Aig_Man_t *p)
struct Aig_Obj_t_ Aig_Obj_t
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
int Aig_ManCleanup(Aig_Man_t *p)
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
#define Saig_ManForEachPo(p, pObj, i)
Aig_Man_t * Saig_ManCreateMiter(Aig_Man_t *p1, Aig_Man_t *p2, int Oper)
Ssw_Cla_t * Ssw_ClassesPreparePairs(Aig_Man_t *pAig, Vec_Int_t **pvClasses)
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 *))
Aig_Man_t * Ssw_SignalCorrespondenceRefine(Ssw_Man_t *p)
typedefABC_NAMESPACE_HEADER_START struct Ssw_Man_t_ Ssw_Man_t
INCLUDES ///.
Ssw_Sml_t * Ssw_SmlStart(Aig_Man_t *pAig, int nPref, int nFrames, int nWordsFrame)
void Ssw_ManStop(Ssw_Man_t *p)
Ssw_Man_t * Ssw_ManCreate(Aig_Man_t *pAig, Ssw_Pars_t *pPars)
DECLARATIONS ///.
unsigned Ssw_SmlObjHashWord(Ssw_Sml_t *p, Aig_Obj_t *pObj)
FUNCTION DEFINITIONS ///.
int Ssw_SmlObjIsConstWord(Ssw_Sml_t *p, Aig_Obj_t *pObj)
Vec_Int_t ** Ssw_TransformPairsIntoTempClasses(Vec_Int_t *vPairs, int nObjNumMax)
ABC_NAMESPACE_IMPL_START int Ssw_MiterStatus(Aig_Man_t *p, int fVerbose)
DECLARATIONS ///.
void Ssw_FreeTempClasses(Vec_Int_t **pvClasses, int nObjNumMax)
int Ssw_SecWithPairs(Aig_Man_t *pAig1, Aig_Man_t *pAig2, Vec_Int_t *vIds1, Vec_Int_t *vIds2, Ssw_Pars_t *pPars)
Aig_Man_t * Ssw_SignalCorrespondeceTestPairs(Aig_Man_t *pAig)
Vec_Int_t * Ssw_TransferSignalPairs(Aig_Man_t *pMiter, Aig_Man_t *pAig1, Aig_Man_t *pAig2, Vec_Int_t *vIds1, Vec_Int_t *vIds2)
int Ssw_SecGeneralMiter(Aig_Man_t *pMiter, Ssw_Pars_t *pPars)
Aig_Man_t * Ssw_SignalCorrespondenceWithPairs(Aig_Man_t *pAig1, Aig_Man_t *pAig2, Vec_Int_t *vIds1, Vec_Int_t *vIds2, Ssw_Pars_t *pPars)
int Ssw_SecGeneral(Aig_Man_t *pAig1, Aig_Man_t *pAig2, Ssw_Pars_t *pPars)
void Ssw_ManSetDefaultParams(Ssw_Pars_t *p)
DECLARATIONS ///.
int Ssw_SmlObjsAreEqualWord(Ssw_Sml_t *p, Aig_Obj_t *pObj0, Aig_Obj_t *pObj1)
typedefABC_NAMESPACE_HEADER_START struct Ssw_Pars_t_ Ssw_Pars_t
INCLUDES ///.
Aig_Man_t * Ssw_SignalCorrespondence(Aig_Man_t *pAig, Ssw_Pars_t *pPars)
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.