67 printf(
"Miter computation has failed.\n" );
73 printf(
"Networks are NOT EQUIVALENT after structural hashing.\n" );
84 printf(
"Networks are equivalent after structural hashing.\n" );
93 printf(
"Renoding for CNF has failed.\n" );
98 RetValue =
Abc_NtkMiterSat( pCnf, (ABC_INT64_T)nConfLimit, (ABC_INT64_T)nInsLimit, 0, NULL, NULL );
100 printf(
"Networks are undecided (SAT solver timed out).\n" );
101 else if ( RetValue == 0 )
102 printf(
"Networks are NOT EQUIVALENT after SAT.\n" );
104 printf(
"Networks are equivalent after SAT.\n" );
132 if ( pNtk1->
pExdc != NULL || pNtk2->
pExdc != NULL )
134 if ( pNtk1->
pExdc != NULL && pNtk2->
pExdc != NULL )
136 printf(
"Comparing EXDC of the two networks:\n" );
138 printf(
"Comparing networks under EXDC of the first network.\n" );
139 pExdc = pNtk1->
pExdc;
141 else if ( pNtk1->
pExdc != NULL )
143 printf(
"Second network has no EXDC. Comparing main networks under EXDC of the first network.\n" );
144 pExdc = pNtk1->
pExdc;
146 else if ( pNtk2->
pExdc != NULL )
148 printf(
"First network has no EXDC. Comparing main networks under EXDC of the second network.\n" );
149 pExdc = pNtk2->
pExdc;
156 if ( pMiter == NULL )
158 printf(
"Miter computation has failed.\n" );
166 pMiter =
Abc_NtkMiter( pTemp = pMiter, pExdc, 1, 0, 1, 0 );
173 printf(
"Networks are NOT EQUIVALENT after structural hashing.\n" );
183 printf(
"Networks are equivalent after structural hashing.\n" );
222 if ( RetValue == -1 )
223 printf(
"Networks are undecided (resource limits is reached).\n" );
224 else if ( RetValue == 0 )
227 if ( pSimInfo[0] != 1 )
228 printf(
"ERROR in Abc_NtkMiterProve(): Generated counter-example is invalid.\n" );
230 printf(
"Networks are NOT EQUIVALENT.\n" );
234 printf(
"Networks are equivalent.\n" );
256 int i, RetValue, Status, nOutputs;
266 pMiter =
Abc_NtkMiter( pNtk1, pNtk2, 1, nPartSize, 0, 0 );
267 if ( pMiter == NULL )
269 printf(
"Miter computation has failed.\n" );
275 printf(
"Networks are NOT EQUIVALENT after structural hashing.\n" );
285 printf(
"Networks are equivalent after structural hashing.\n" );
316 if ( RetValue == -1 )
318 printf(
"Networks are undecided (resource limits is reached).\r" );
321 else if ( RetValue == 0 )
324 if ( pSimInfo[0] != 1 )
325 printf(
"ERROR in Abc_NtkMiterProve(): Generated counter-example is invalid.\n" );
327 printf(
"Networks are NOT EQUIVALENT. \n" );
334 printf(
"Finished part %5d (out of %5d)\r", i+1,
Abc_NtkPoNum(pMiter) );
335 nOutputs += nPartSize;
346 printf(
"Networks are equivalent. \n" );
347 else if ( Status == -1 )
348 printf(
"Timed out after verifying %d outputs (out of %d).\n", nOutputs,
Abc_NtkCoNum(pNtk1) );
372 int i, RetValue, Status, nOutputs;
381 if ( pMiter == NULL )
383 printf(
"Miter computation has failed.\n" );
389 printf(
"Networks are NOT EQUIVALENT after structural hashing.\n" );
399 printf(
"Networks are equivalent after structural hashing.\n" );
423 printf(
"Networks are NOT EQUIVALENT after partitioning.\n" );
432 printf(
"Verifying part %4d (out of %4d) PI = %5d. PO = %5d. And = %6d. Lev = %4d.\r",
438 if ( RetValue == -1 )
440 printf(
"Networks are undecided (resource limits is reached).\r" );
443 else if ( RetValue == 0 )
446 if ( pSimInfo[0] != 1 )
447 printf(
"ERROR in Abc_NtkMiterProve(): Generated counter-example is invalid.\n" );
449 printf(
"Networks are NOT EQUIVALENT. \n" );
469 printf(
"Networks are equivalent. \n" );
470 else if ( Status == -1 )
471 printf(
"Timed out after verifying %d outputs (out of %d).\n", nOutputs,
Abc_NtkCoNum(pNtk1) );
496 if ( pMiter == NULL )
498 printf(
"Miter computation has failed.\n" );
505 printf(
"Networks are NOT EQUIVALENT after structural hashing.\n" );
511 printf(
"Networks are equivalent after structural hashing.\n" );
518 if ( pFrames == NULL )
520 printf(
"Frames computation has failed.\n" );
527 printf(
"Networks are NOT EQUIVALENT after framing.\n" );
533 printf(
"Networks are equivalent after framing.\n" );
542 printf(
"Renoding for CNF has failed.\n" );
547 RetValue =
Abc_NtkMiterSat( pCnf, (ABC_INT64_T)nConfLimit, (ABC_INT64_T)nInsLimit, 0, NULL, NULL );
548 if ( RetValue == -1 )
549 printf(
"Networks are undecided (SAT solver timed out).\n" );
550 else if ( RetValue == 0 )
551 printf(
"Networks are NOT EQUIVALENT after SAT.\n" );
553 printf(
"Networks are equivalent after SAT.\n" );
578 if ( pMiter == NULL )
580 printf(
"Miter computation has failed.\n" );
586 printf(
"Networks are NOT EQUIVALENT after structural hashing.\n" );
597 printf(
"Networks are equivalent after structural hashing.\n" );
604 if ( pFrames == NULL )
606 printf(
"Frames computation has failed.\n" );
612 printf(
"Networks are NOT EQUIVALENT after framing.\n" );
623 printf(
"Networks are equivalent after framing.\n" );
640 if ( RetValue == -1 )
641 printf(
"Networks are undecided (SAT solver timed out on the final miter).\n" );
642 else if ( RetValue == 1 )
643 printf(
"Networks are equivalent after fraiging.\n" );
644 else if ( RetValue == 0 )
646 printf(
"Networks are NOT EQUIVALENT after fraiging.\n" );
654 return RetValue == 1;
689 int * pValues, Value0, Value1, i;
740 int * pValues1, * pValues2;
741 int nErrors, nPrinted, i, iNode = -1;
751 nErrors += (
int)( pValues1[i] != pValues2[i] );
752 printf(
"Verification failed for at least %d outputs: ", nErrors );
756 if ( pValues1[i] != pValues2[i] )
761 if ( ++nPrinted == 3 )
764 if ( nPrinted != nErrors )
770 printf(
"Output %s: Value in Network1 = %d. Value in Network2 = %d.\n",
772 printf(
"Input pattern: " );
786 printf(
" %s=%d",
Abc_ObjName(pNode), pModel[(
int)(ABC_PTRINT_T)pNode->
pCopy] );
834 for ( k = 0; k <= iFrame; k++ )
856 Abc_Obj_t * pObj, * pObjError, * pObj1, * pObj2;
857 int ValueError1 = -1, ValueError2 = -1;
858 unsigned * pPats1, * pPats2;
859 int i, o, k, nErrors, iFrameError = -1, iNodePo = -1, nPrinted;
860 int fRemove1 = 0, fRemove2 = 0;
874 for ( i = 0; i < nFrames; i++ )
883 if ( pPats1[i] == pPats2[i] )
886 if ( pObjError == NULL )
891 ValueError1 = (pPats1[i] > 0);
892 ValueError2 = (pPats2[i] > 0);
897 if ( pObjError == NULL )
899 printf(
"No output mismatches detected.\n" );
907 printf(
"Verification failed for at least %d output%s of frame %d: ", nErrors, (nErrors>1?
"s":
""), iFrameError+1 );
915 if ( pPats1[iFrameError] == pPats2[iFrameError] )
918 if ( ++nPrinted == 3 )
921 if ( nPrinted != nErrors )
930 printf(
"Output %s: Value in Network1 = %d. Value in Network2 = %d.\n",
931 Abc_ObjName(pObjError), ValueError1, ValueError2 );
933 printf(
"The cone of influence of output %s in Network1:\n",
Abc_ObjName(pObjError) );
939 printf(
"Latches: " );
945 printf(
"The cone of influence of output %s in Network2:\n",
Abc_ObjName(pObjError) );
951 printf(
"Latches: " );
958 for ( i = 0; i <= iFrameError; i++ )
960 printf(
"Frame %d: ", i+1 );
1018 int * pModel1, * pModel2, * pResult1, * pResult2;
1019 char * vPiValues1 =
"01001011100000000011010110101000000";
1020 char * vPiValues2 =
"11001101011101011111110100100010001";
1027 pModel1[i] = vPiValues1[i] -
'0';
1032 printf(
"Value = %d\n", pResult1[0] );
1036 pModel2[i] = vPiValues2[i] -
'0';
1041 printf(
"Value = %d\n", pResult2[0] );
1065 int status = 0, fStrashed = 0;
ABC_DLL Abc_Ntk_t * Abc_NtkFrames(Abc_Ntk_t *pNtk, int nFrames, int fInitial, int fVerbose)
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
void Abc_NtkCecFraigPartAuto(Abc_Ntk_t *pNtk1, Abc_Ntk_t *pNtk2, int nSeconds, int fVerbose)
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
static Abc_Obj_t * Abc_ObjFanin1(Abc_Obj_t *pObj)
static int Abc_ObjIsCi(Abc_Obj_t *pObj)
int Abc_NtkIsTrueCex(Abc_Ntk_t *pNtk, Abc_Cex_t *pCex)
typedefABC_NAMESPACE_HEADER_START struct Fraig_ManStruct_t_ Fraig_Man_t
INCLUDES ///.
void Abc_NtkSecSat(Abc_Ntk_t *pNtk1, Abc_Ntk_t *pNtk2, int nConfLimit, int nInsLimit, int nFrames)
typedefABC_NAMESPACE_HEADER_START struct Vec_Vec_t_ Vec_Vec_t
INCLUDES ///.
#define Sim_SimInfoGet(vInfo, pNode)
ABC_DLL Abc_Obj_t * Abc_AigConst1(Abc_Ntk_t *pNtk)
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
static int Abc_ObjFaninC1(Abc_Obj_t *pObj)
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
void Aig_ManStop(Aig_Man_t *p)
int Cmd_CommandExecute(void *pAbc, char *pCommandLine)
int Saig_ManVerifyCex(Aig_Man_t *pAig, Abc_Cex_t *p)
ABC_DLL Abc_Ntk_t * Abc_NtkCreateConeArray(Abc_Ntk_t *pNtk, Vec_Ptr_t *vRoots, int fUseAllCis)
Abc_Ntk_t * Abc_NtkMulti(Abc_Ntk_t *pNtk, int nThresh, int nFaninMax, int fCnf, int fMulti, int fSimple, int fFactor)
FUNCTION DEFINITIONS ///.
void Fraig_ManFree(Fraig_Man_t *pMan)
ABC_DLL Abc_Ntk_t * Abc_NtkStrash(Abc_Ntk_t *pNtk, int fAllNodes, int fCleanup, int fRecord)
static int Abc_ObjFaninC0(Abc_Obj_t *pObj)
static int Abc_NtkCiNum(Abc_Ntk_t *pNtk)
#define ABC_ALLOC(type, num)
#define Abc_NtkForEachCo(pNtk, pCo, i)
void Prove_ParamsSetDefault(Prove_Params_t *pParams)
FUNCTION DEFINITIONS ///.
int * Abc_NtkVerifyGetCleanModel(Abc_Ntk_t *pNtk, int nFrames)
Vec_Ptr_t * Abc_NtkPartitionSmart(Abc_Ntk_t *pNtk, int nSuppSizeLimit, int fVerbose)
static int Vec_PtrSize(Vec_Ptr_t *p)
static void Vec_VecFree(Vec_Vec_t *p)
static Abc_Obj_t * Abc_ObjFanin0(Abc_Obj_t *pObj)
static int Abc_NtkCoNum(Abc_Ntk_t *pNtk)
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
static Abc_Obj_t * Abc_NtkCo(Abc_Ntk_t *pNtk, int i)
void Sim_UtilInfoFree(Vec_Ptr_t *p)
static int Abc_NtkNodeNum(Abc_Ntk_t *pNtk)
int Abc_NtkSecFraig(Abc_Ntk_t *pNtk1, Abc_Ntk_t *pNtk2, int nSeconds, int nFrames, int fVerbose)
Aig_Man_t * Abc_NtkToDar(Abc_Ntk_t *pNtk, int fExors, int fRegisters)
ABC_DLL Abc_Ntk_t * Abc_NtkMiter(Abc_Ntk_t *pNtk1, Abc_Ntk_t *pNtk2, int fComb, int nPartSize, int fImplic, int fMulti)
FUNCTION DEFINITIONS ///.
ABC_DLL int Abc_AigLevel(Abc_Ntk_t *pNtk)
ABC_DLL int Abc_NtkIvyProve(Abc_Ntk_t **ppNtk, void *pPars)
#define ABC_NAMESPACE_IMPL_END
void * Abc_FrameGetGlobalFrame()
ABC_DLL Vec_Ptr_t * Abc_NtkNodeSupport(Abc_Ntk_t *pNtk, Abc_Obj_t **ppNodes, int nNodes)
void Fraig_ParamsSetDefault(Fraig_Params_t *pParams)
ABC_DLL int Abc_NtkMiterSat(Abc_Ntk_t *pNtk, ABC_INT64_T nConfLimit, ABC_INT64_T nInsLimit, int fVerbose, ABC_INT64_T *pNumConfs, ABC_INT64_T *pNumInspects)
FUNCTION DEFINITIONS ///.
ABC_DLL Abc_Ntk_t * Abc_NtkCreateCone(Abc_Ntk_t *pNtk, Abc_Obj_t *pNode, char *pNodeName, int fUseAllCis)
void Abc_NtkConvertCos(Abc_Ntk_t *pNtk, Vec_Int_t *vOuts, Vec_Ptr_t *vOutsPtr)
Vec_Ptr_t * Sim_SimulateSeqModel(Abc_Ntk_t *pNtk, int nFrames, int *pModel)
#define Abc_NtkForEachLatch(pNtk, pObj, i)
int Abc_NtkIsValidCex(Abc_Ntk_t *pNtk, Abc_Cex_t *pCex)
int * Abc_NtkVerifySimulatePattern(Abc_Ntk_t *pNtk, int *pModel)
void Abc_NtkGetSeqPoSupp(Abc_Ntk_t *pNtk, int iFrame, int iNumPo)
#define Abc_NtkForEachNode(pNtk, pNode, i)
static Abc_Obj_t * Abc_NtkBox(Abc_Ntk_t *pNtk, int i)
#define ABC_NAMESPACE_IMPL_START
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
void Abc_NtkCecFraig(Abc_Ntk_t *pNtk1, Abc_Ntk_t *pNtk2, int nSeconds, int fVerbose)
static int Vec_IntSize(Vec_Int_t *p)
ABC_DLL int Abc_NtkCombinePos(Abc_Ntk_t *pNtk, int fAnd, int fXor)
ABC_DLL int Abc_NtkMiterIsConstant(Abc_Ntk_t *pMiter)
static Abc_Obj_t * Abc_NtkPo(Abc_Ntk_t *pNtk, int i)
#define Abc_NtkForEachCi(pNtk, pCi, i)
static int Abc_NtkPoNum(Abc_Ntk_t *pNtk)
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
static ABC_NAMESPACE_IMPL_START void Abc_NtkVerifyReportError(Abc_Ntk_t *pNtk1, Abc_Ntk_t *pNtk2, int *pModel)
DECLARATIONS ///.
static int Abc_NtkPiNum(Abc_Ntk_t *pNtk)
ABC_DLL char * Abc_ObjName(Abc_Obj_t *pNode)
DECLARATIONS ///.
void Abc_NtkCecSat(Abc_Ntk_t *pNtk1, Abc_Ntk_t *pNtk2, int nConfLimit, int nInsLimit)
FUNCTION DEFINITIONS ///.
static void Abc_NtkIncrementTravId(Abc_Ntk_t *p)
void Abc_NtkCecFraigPart(Abc_Ntk_t *pNtk1, Abc_Ntk_t *pNtk2, int nSeconds, int nPartSize, int fVerbose)
static void Abc_ObjXorFaninC(Abc_Obj_t *pObj, int i)
typedefABC_NAMESPACE_HEADER_START struct Abc_Cex_t_ Abc_Cex_t
INCLUDES ///.
static Abc_Obj_t * Abc_NtkPi(Abc_Ntk_t *pNtk, int i)
#define Abc_NtkForEachPo(pNtk, pPo, i)
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
int Fraig_ManCheckMiter(Fraig_Man_t *p)
void Abc_NtkVerifyReportErrorSeq(Abc_Ntk_t *pNtk1, Abc_Ntk_t *pNtk2, int *pModel, int nFrames)
void Abc_NtkSimulteBuggyMiter(Abc_Ntk_t *pNtk)
#define Abc_NtkForEachPi(pNtk, pPi, i)
ABC_DLL void * Abc_NtkToFraig(Abc_Ntk_t *pNtk, void *pParams, int fAllNodes, int fExdc)
static void Vec_PtrFree(Vec_Ptr_t *p)
void Fraig_ManProveMiter(Fraig_Man_t *p)