ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
cecCec.c File Reference
#include "cecInt.h"
#include "proof/fra/fra.h"
#include "aig/gia/giaAig.h"
#include "misc/extra/extra.h"
#include "sat/cnf/cnf.h"
Include dependency graph for cecCec.c:

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START void Cec_ManTransformPattern (Gia_Man_t *p, int iOut, int *pValues)
 DECLARATIONS ///.
 
int Cec_ManVerifyOld (Gia_Man_t *pMiter, int fVerbose, int *piOutFail, abctime clkTotal, int fSilent)
 
int Cec_ManHandleSpecialCases (Gia_Man_t *p, Cec_ParCec_t *pPars)
 
int Cec_ManVerifyNaive (Gia_Man_t *p, Cec_ParCec_t *pPars)
 
int Cec_ManVerify (Gia_Man_t *pInit, Cec_ParCec_t *pPars)
 MACRO DEFINITIONS ///.
 
int Cec_ManVerifySimple (Gia_Man_t *p)
 
int Cec_ManVerifyTwo (Gia_Man_t *p0, Gia_Man_t *p1, int fVerbose)
 
int Cec_ManVerifyTwoInv (Gia_Man_t *p0, Gia_Man_t *p1, int fVerbose)
 
int Cec_ManVerifyTwoAigs (Aig_Man_t *pAig0, Aig_Man_t *pAig1, int fVerbose)
 
Aig_Man_tCec_LatchCorrespondence (Aig_Man_t *pAig, int nConfs, int fUseCSat)
 
Aig_Man_tCec_SignalCorrespondence (Aig_Man_t *pAig, int nConfs, int fUseCSat)
 
Aig_Man_tCec_FraigCombinational (Aig_Man_t *pAig, int nConfs, int fVerbose)
 

Function Documentation

◆ Cec_FraigCombinational()

Aig_Man_t * Cec_FraigCombinational ( Aig_Man_t * pAig,
int nConfs,
int fVerbose )

Function*************************************************************

Synopsis [Implementation of fraiging.]

Description []

SideEffects []

SeeAlso []

Definition at line 579 of file cecCec.c.

580{
581 Gia_Man_t * pGia;
582 Cec_ParFra_t FraPars, * pFraPars = &FraPars;
583 Cec_ManFraSetDefaultParams( pFraPars );
584 pFraPars->fSatSweeping = 1;
585 pFraPars->nBTLimit = nConfs;
586 pFraPars->nItersMax = 20;
587 pFraPars->fVerbose = fVerbose;
588 pGia = Gia_ManFromAigSimple( pAig );
589 Cec_ManSatSweeping( pGia, pFraPars, 0 );
590 Gia_ManReprToAigRepr( pAig, pGia );
591 Gia_ManStop( pGia );
592 return Aig_ManDupSimple( pAig );
593}
Aig_Man_t * Aig_ManDupSimple(Aig_Man_t *p)
DECLARATIONS ///.
Definition aigDup.c:46
struct Cec_ParFra_t_ Cec_ParFra_t
Definition cec.h:96
void Cec_ManFraSetDefaultParams(Cec_ParFra_t *p)
Definition cecCore.c:126
Gia_Man_t * Cec_ManSatSweeping(Gia_Man_t *pAig, Cec_ParFra_t *pPars, int fSilent)
Definition cecCore.c:344
void Gia_ManReprToAigRepr(Aig_Man_t *pAig, Gia_Man_t *pGia)
Definition giaAig.c:476
Gia_Man_t * Gia_ManFromAigSimple(Aig_Man_t *p)
Definition giaAig.c:212
void Gia_ManStop(Gia_Man_t *p)
Definition giaMan.c:82
struct Gia_Man_t_ Gia_Man_t
Definition gia.h:96
int nBTLimit
Definition cec.h:103
int nItersMax
Definition cec.h:102
int fVerbose
Definition cec.h:121
int fSatSweeping
Definition cec.h:116
Here is the call graph for this function:

◆ Cec_LatchCorrespondence()

Aig_Man_t * Cec_LatchCorrespondence ( Aig_Man_t * pAig,
int nConfs,
int fUseCSat )

Function*************************************************************

Synopsis [Implementation of new signal correspodence.]

Description []

SideEffects []

SeeAlso []

Definition at line 528 of file cecCec.c.

529{
530 Gia_Man_t * pGia;
531 Cec_ParCor_t CorPars, * pCorPars = &CorPars;
532 Cec_ManCorSetDefaultParams( pCorPars );
533 pCorPars->fLatchCorr = 1;
534 pCorPars->fUseCSat = fUseCSat;
535 pCorPars->nBTLimit = nConfs;
536 pGia = Gia_ManFromAigSimple( pAig );
537 Cec_ManLSCorrespondenceClasses( pGia, pCorPars );
538 Gia_ManReprToAigRepr( pAig, pGia );
539 Gia_ManStop( pGia );
540 return Aig_ManDupSimple( pAig );
541}
void Cec_ManCorSetDefaultParams(Cec_ParCor_t *p)
Definition cecCore.c:183
int Cec_ManLSCorrespondenceClasses(Gia_Man_t *pAig, Cec_ParCor_t *pPars)
Definition cecCorr.c:924
struct Cec_ParCor_t_ Cec_ParCor_t
Definition cec.h:145
int fUseCSat
Definition cec.h:162
int fLatchCorr
Definition cec.h:158
int nBTLimit
Definition cec.h:152
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Cec_ManHandleSpecialCases()

int Cec_ManHandleSpecialCases ( Gia_Man_t * p,
Cec_ParCec_t * pPars )

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 142 of file cecCec.c.

143{
144 Gia_Obj_t * pObj1, * pObj2;
145 Gia_Obj_t * pDri1, * pDri2;
146 int i;
147 abctime clk = Abc_Clock();
149 Gia_ManForEachPo( p, pObj1, i )
150 {
151 pObj2 = Gia_ManPo( p, ++i );
152 // check if they different on all-0 pattern
153 // (for example, when they have the same driver but complemented)
154 if ( Gia_ObjPhase(pObj1) != Gia_ObjPhase(pObj2) )
155 {
156 if ( !pPars->fSilent )
157 {
158 Abc_Print( 1, "Networks are NOT EQUIVALENT. Output %d trivially differs (different phase). ", i/2 );
159 Abc_PrintTime( 1, "Time", Abc_Clock() - clk );
160 }
161 pPars->iOutFail = i/2;
162 Cec_ManTransformPattern( p, i/2, NULL );
163 return 0;
164 }
165 // get the drivers
166 pDri1 = Gia_ObjFanin0(pObj1);
167 pDri2 = Gia_ObjFanin0(pObj2);
168 // drivers are different PIs
169 if ( Gia_ObjIsPi(p, pDri1) && Gia_ObjIsPi(p, pDri2) && pDri1 != pDri2 )
170 {
171 if ( !pPars->fSilent )
172 {
173 Abc_Print( 1, "Networks are NOT EQUIVALENT. Output %d trivially differs (different PIs). ", i/2 );
174 Abc_PrintTime( 1, "Time", Abc_Clock() - clk );
175 }
176 pPars->iOutFail = i/2;
177 Cec_ManTransformPattern( p, i/2, NULL );
178 // if their compl attributes are the same - one should be complemented
179 assert( Gia_ObjFaninC0(pObj1) == Gia_ObjFaninC0(pObj2) );
180 Abc_InfoSetBit( p->pCexComb->pData, Gia_ObjCioId(pDri1) );
181 return 0;
182 }
183 // one of the drivers is a PI; another is a constant 0
184 if ( (Gia_ObjIsPi(p, pDri1) && Gia_ObjIsConst0(pDri2)) ||
185 (Gia_ObjIsPi(p, pDri2) && Gia_ObjIsConst0(pDri1)) )
186 {
187 if ( !pPars->fSilent )
188 {
189 Abc_Print( 1, "Networks are NOT EQUIVALENT. Output %d trivially differs (PI vs. constant). ", i/2 );
190 Abc_PrintTime( 1, "Time", Abc_Clock() - clk );
191 }
192 pPars->iOutFail = i/2;
193 Cec_ManTransformPattern( p, i/2, NULL );
194 // the compl attributes are the same - the PI should be complemented
195 assert( Gia_ObjFaninC0(pObj1) == Gia_ObjFaninC0(pObj2) );
196 if ( Gia_ObjIsPi(p, pDri1) )
197 Abc_InfoSetBit( p->pCexComb->pData, Gia_ObjCioId(pDri1) );
198 else
199 Abc_InfoSetBit( p->pCexComb->pData, Gia_ObjCioId(pDri2) );
200 return 0;
201 }
202 }
203 if ( Gia_ManAndNum(p) == 0 )
204 {
205 if ( !pPars->fSilent )
206 {
207 Abc_Print( 1, "Networks are equivalent. " );
208 Abc_PrintTime( 1, "Time", Abc_Clock() - clk );
209 }
210 return 1;
211 }
212 return -1;
213}
ABC_INT64_T abctime
Definition abc_global.h:332
ABC_NAMESPACE_IMPL_START void Cec_ManTransformPattern(Gia_Man_t *p, int iOut, int *pValues)
DECLARATIONS ///.
Definition cecCec.c:49
Cube * p
Definition exorList.c:222
#define Gia_ManForEachPo(p, pObj, i)
Definition gia.h:1250
struct Gia_Obj_t_ Gia_Obj_t
Definition gia.h:76
void Gia_ManSetPhase(Gia_Man_t *p)
Definition giaUtil.c:420
int iOutFail
Definition cec.h:141
int fSilent
Definition cec.h:138
#define assert(ex)
Definition util_old.h:213
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Cec_ManTransformPattern()

ABC_NAMESPACE_IMPL_START void Cec_ManTransformPattern ( Gia_Man_t * p,
int iOut,
int * pValues )

DECLARATIONS ///.

CFile****************************************************************

FileName [cecCec.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Combinational equivalence checking.]

Synopsis [Integrated combinatinal equivalence checker.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - June 20, 2005.]

Revision [

Id
cecCec.c,v 1.00 2005/06/20 00:00:00 alanmi Exp

] FUNCTION DEFINITIONS /// Function*************************************************************

Synopsis [Saves the input pattern with the given number.]

Description []

SideEffects []

SeeAlso []

Definition at line 49 of file cecCec.c.

50{
51 int i;
52 assert( p->pCexComb == NULL );
53 p->pCexComb = Abc_CexAlloc( 0, Gia_ManCiNum(p), 1 );
54 p->pCexComb->iPo = iOut;
55 for ( i = 0; i < Gia_ManCiNum(p); i++ )
56 if ( pValues && pValues[i] )
57 Abc_InfoSetBit( p->pCexComb->pData, i );
58}
ABC_NAMESPACE_IMPL_START Abc_Cex_t * Abc_CexAlloc(int nRegs, int nRealPis, int nFrames)
DECLARATIONS ///.
Definition utilCex.c:51
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Cec_ManVerify()

int Cec_ManVerify ( Gia_Man_t * pInit,
Cec_ParCec_t * pPars )

MACRO DEFINITIONS ///.

Function*************************************************************

Synopsis [New CEC engine.]

Description []

SideEffects []

SeeAlso []

Definition at line 326 of file cecCec.c.

327{
328 int fDumpUndecided = 0;
329 Cec_ParFra_t ParsFra, * pParsFra = &ParsFra;
330 Gia_Man_t * p, * pNew;
331 int RetValue;
332 abctime clk = Abc_Clock();
333 abctime clkTotal = Abc_Clock();
334 // consider special cases:
335 // 1) (SAT) a pair of POs have different value under all-0 pattern
336 // 2) (SAT) a pair of POs has different PI/Const drivers
337 // 3) (UNSAT) 1-2 do not hold and there is no nodes
338 RetValue = Cec_ManHandleSpecialCases( pInit, pPars );
339 if ( RetValue == 0 || RetValue == 1 )
340 return RetValue;
341 // preprocess
342 p = Gia_ManDup( pInit );
344 p = Gia_ManCleanup( pNew = p );
345 Gia_ManStop( pNew );
346 if ( pPars->fNaive )
347 {
348 RetValue = Cec_ManVerifyNaive( p, pPars );
349 Gia_ManStop( p );
350 return RetValue;
351 }
352 if ( pInit->vSimsPi )
353 {
354 p->vSimsPi = Vec_WrdDup(pInit->vSimsPi);
355 p->nSimWords = pInit->nSimWords;
356 }
357 // sweep for equivalences
358 Cec_ManFraSetDefaultParams( pParsFra );
359 pParsFra->nItersMax = 1000;
360 pParsFra->nBTLimit = pPars->nBTLimit;
361 pParsFra->TimeLimit = pPars->TimeLimit;
362 pParsFra->fVerbose = pPars->fVerbose;
363 pParsFra->fVeryVerbose = pPars->fVeryVerbose;
364 pParsFra->fCheckMiter = 1;
365 pParsFra->fDualOut = 1;
366 pNew = Cec_ManSatSweeping( p, pParsFra, pPars->fSilent );
367 pPars->iOutFail = pParsFra->iOutFail;
368 // update
369 pInit->pCexComb = p->pCexComb; p->pCexComb = NULL;
370 Gia_ManStop( p );
371 p = pInit;
372 // continue
373 if ( pNew == NULL )
374 {
375 if ( p->pCexComb != NULL )
376 {
377 if ( p->pCexComb && !Gia_ManVerifyCex( p, p->pCexComb, 1 ) )
378 Abc_Print( 1, "Counter-example simulation has failed.\n" );
379 if ( !pPars->fSilent )
380 {
381 Abc_Print( 1, "Networks are NOT EQUIVALENT. " );
382 Abc_PrintTime( 1, "Time", Abc_Clock() - clk );
383 }
384 return 0;
385 }
386 p = Gia_ManDup( pInit );
388 p = Gia_ManCleanup( pNew = p );
389 Gia_ManStop( pNew );
390 pNew = p;
391 }
392 if ( pPars->fVerbose )
393 {
394 Abc_Print( 1, "Networks are UNDECIDED after the new CEC engine. " );
395 Abc_PrintTime( 1, "Time", Abc_Clock() - clk );
396 }
397 if ( fDumpUndecided )
398 {
399 ABC_FREE( pNew->pReprs );
400 ABC_FREE( pNew->pNexts );
401 Gia_AigerWrite( pNew, "gia_cec_undecided.aig", 0, 0, 0 );
402 Abc_Print( 1, "The result is written into file \"%s\".\n", "gia_cec_undecided.aig" );
403 }
404 if ( pPars->TimeLimit && (Abc_Clock() - clkTotal)/CLOCKS_PER_SEC >= pPars->TimeLimit )
405 {
406 Gia_ManStop( pNew );
407 return -1;
408 }
409 // call other solver
410 if ( pPars->fVerbose )
411 Abc_Print( 1, "Calling the old CEC engine.\n" );
412 fflush( stdout );
413 RetValue = Cec_ManVerifyOld( pNew, pPars->fVerbose, &pPars->iOutFail, clkTotal, pPars->fSilent );
414 p->pCexComb = pNew->pCexComb; pNew->pCexComb = NULL;
415 if ( p->pCexComb && !Gia_ManVerifyCex( p, p->pCexComb, 1 ) )
416 Abc_Print( 1, "Counter-example simulation has failed.\n" );
417 Gia_ManStop( pNew );
418 return RetValue;
419}
#define ABC_FREE(obj)
Definition abc_global.h:267
int Cec_ManVerifyNaive(Gia_Man_t *p, Cec_ParCec_t *pPars)
Definition cecCec.c:226
int Cec_ManHandleSpecialCases(Gia_Man_t *p, Cec_ParCec_t *pPars)
Definition cecCec.c:142
int Cec_ManVerifyOld(Gia_Man_t *pMiter, int fVerbose, int *piOutFail, abctime clkTotal, int fSilent)
Definition cecCec.c:71
Gia_Man_t * Gia_ManDup(Gia_Man_t *p)
Definition giaDup.c:720
void Gia_ManEquivFixOutputPairs(Gia_Man_t *p)
Definition giaEquiv.c:882
Gia_Man_t * Gia_ManCleanup(Gia_Man_t *p)
Definition giaScl.c:84
int Gia_ManVerifyCex(Gia_Man_t *pAig, Abc_Cex_t *p, int fDualOut)
DECLARATIONS ///.
Definition giaCex.c:48
void Gia_AigerWrite(Gia_Man_t *p, char *pFileName, int fWriteSymbols, int fCompact, int fWriteNewLine)
Definition giaAiger.c:1595
int nBTLimit
Definition cec.h:132
int fVeryVerbose
Definition cec.h:139
int TimeLimit
Definition cec.h:133
int fNaive
Definition cec.h:137
int fVerbose
Definition cec.h:140
int fDualOut
Definition cec.h:114
int fVeryVerbose
Definition cec.h:120
int fCheckMiter
Definition cec.h:112
int TimeLimit
Definition cec.h:105
int iOutFail
Definition cec.h:122
int nSimWords
Definition gia.h:209
Gia_Rpr_t * pReprs
Definition gia.h:126
Vec_Wrd_t * vSimsPi
Definition gia.h:215
int * pNexts
Definition gia.h:127
Abc_Cex_t * pCexComb
Definition gia.h:149
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Cec_ManVerifyNaive()

int Cec_ManVerifyNaive ( Gia_Man_t * p,
Cec_ParCec_t * pPars )

Function*************************************************************

Synopsis [Performs naive checking.]

Description []

SideEffects []

SeeAlso []

Definition at line 226 of file cecCec.c.

227{
228 Cnf_Dat_t * pCnf = (Cnf_Dat_t *)Mf_ManGenerateCnf( p, 8, 0, 0, 0, 0 );
229 sat_solver * pSat = (sat_solver *)Cnf_DataWriteIntoSolver( pCnf, 1, 0 );
230 Gia_Obj_t * pObj0, * pObj1;
231 abctime clkStart = Abc_Clock();
232 int nPairs = Gia_ManPoNum(p)/2;
233 int nUnsats = 0, nSats = 0, nUndecs = 0, nTrivs = 0;
234 int i, iVar0, iVar1, pLits[2], status, RetValue;
235 ProgressBar * pProgress = Extra_ProgressBarStart( stdout, nPairs );
236 assert( Gia_ManPoNum(p) % 2 == 0 );
237 for ( i = 0; i < nPairs; i++ )
238 {
239 if ( (i & 0xFF) == 0 )
240 Extra_ProgressBarUpdate( pProgress, i, NULL );
241 pObj0 = Gia_ManPo(p, 2*i);
242 pObj1 = Gia_ManPo(p, 2*i+1);
243 if ( Gia_ObjChild0(pObj0) == Gia_ObjChild0(pObj1) )
244 {
245 nUnsats++;
246 nTrivs++;
247 continue;
248 }
249 if ( pPars->TimeLimit && (Abc_Clock() - clkStart)/CLOCKS_PER_SEC >= pPars->TimeLimit )
250 {
251 printf( "Timeout (%d sec) is reached.\n", pPars->TimeLimit );
252 nUndecs = nPairs - nUnsats - nSats;
253 break;
254 }
255 iVar0 = pCnf->pVarNums[ Gia_ObjId(p, pObj0) ];
256 iVar1 = pCnf->pVarNums[ Gia_ObjId(p, pObj1) ];
257 assert( iVar0 >= 0 && iVar1 >= 0 );
258 pLits[0] = Abc_Var2Lit( iVar0, 0 );
259 pLits[1] = Abc_Var2Lit( iVar1, 0 );
260 // check direct
261 pLits[0] = lit_neg(pLits[0]);
262 status = sat_solver_solve( pSat, pLits, pLits + 2, pPars->nBTLimit, 0, 0, 0 );
263 if ( status == l_False )
264 {
265 pLits[0] = lit_neg( pLits[0] );
266 pLits[1] = lit_neg( pLits[1] );
267 RetValue = sat_solver_addclause( pSat, pLits, pLits + 2 );
268 assert( RetValue );
269 }
270 else if ( status == l_True )
271 {
272 printf( "Output %d is SAT.\n", i );
273 nSats++;
274 continue;
275 }
276 else
277 {
278 nUndecs++;
279 continue;
280 }
281 // check inverse
282 status = sat_solver_solve( pSat, pLits, pLits + 2, pPars->nBTLimit, 0, 0, 0 );
283 if ( status == l_False )
284 {
285 pLits[0] = lit_neg( pLits[0] );
286 pLits[1] = lit_neg( pLits[1] );
287 RetValue = sat_solver_addclause( pSat, pLits, pLits + 2 );
288 assert( RetValue );
289 }
290 else if ( status == l_True )
291 {
292 printf( "Output %d is SAT.\n", i );
293 nSats++;
294 continue;
295 }
296 else
297 {
298 nUndecs++;
299 continue;
300 }
301 nUnsats++;
302 }
303 Extra_ProgressBarStop( pProgress );
304 printf( "UNSAT = %6d. SAT = %6d. UNDEC = %6d. Trivial = %6d. ", nUnsats, nSats, nUndecs, nTrivs );
305 Abc_PrintTime( 1, "Time", Abc_Clock() - clkStart );
306 Cnf_DataFree( pCnf );
307 sat_solver_delete( pSat );
308 if ( nSats )
309 return 0;
310 if ( nUndecs )
311 return -1;
312 return 1;
313}
ABC_NAMESPACE_IMPL_START typedef char ProgressBar
Definition bbrNtbdd.c:27
#define l_True
Definition bmcBmcS.c:35
#define l_False
Definition bmcBmcS.c:36
#define sat_solver_addclause
Definition cecSatG2.c:37
#define sat_solver
Definition cecSatG2.c:34
#define sat_solver_solve
Definition cecSatG2.c:45
struct Cnf_Dat_t_ Cnf_Dat_t
Definition cnf.h:52
void Cnf_DataFree(Cnf_Dat_t *p)
Definition cnfMan.c:207
void Extra_ProgressBarStop(ProgressBar *p)
ProgressBar * Extra_ProgressBarStart(FILE *pFile, int nItemsTotal)
FUNCTION DEFINITIONS ///.
void * Mf_ManGenerateCnf(Gia_Man_t *pGia, int nLutSize, int fCnfObjIds, int fAddOrCla, int fMapping, int fVerbose)
Definition giaMf.c:1877
void * Cnf_DataWriteIntoSolver(Cnf_Dat_t *p, int nFrames, int fInit)
Definition cnfMan.c:579
void sat_solver_delete(sat_solver *s)
Definition satSolver.c:1341
int * pVarNums
Definition cnf.h:63
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Cec_ManVerifyOld()

int Cec_ManVerifyOld ( Gia_Man_t * pMiter,
int fVerbose,
int * piOutFail,
abctime clkTotal,
int fSilent )

Function*************************************************************

Synopsis [Interface to the old CEC engine]

Description []

SideEffects []

SeeAlso []

Definition at line 71 of file cecCec.c.

72{
73// extern int Fra_FraigCec( Aig_Man_t ** ppAig, int nConfLimit, int fVerbose );
74 extern int Ssw_SecCexResimulate( Aig_Man_t * p, int * pModel, int * pnOutputs );
75 Gia_Man_t * pTemp = Gia_ManTransformMiter( pMiter );
76 Aig_Man_t * pMiterCec = Gia_ManToAig( pTemp, 0 );
77 int RetValue, iOut, nOuts;
78 if ( piOutFail )
79 *piOutFail = -1;
80 Gia_ManStop( pTemp );
81 // run CEC on this miter
82 RetValue = Fra_FraigCec( &pMiterCec, 10000000, fVerbose );
83 // report the miter
84 if ( RetValue == 1 )
85 {
86 if ( !fSilent )
87 {
88 Abc_Print( 1, "Networks are equivalent. " );
89 Abc_PrintTime( 1, "Time", Abc_Clock() - clkTotal );
90 }
91 }
92 else if ( RetValue == 0 )
93 {
94 if ( !fSilent )
95 {
96 Abc_Print( 1, "Networks are NOT EQUIVALENT. " );
97 Abc_PrintTime( 1, "Time", Abc_Clock() - clkTotal );
98 }
99 if ( pMiterCec->pData == NULL )
100 Abc_Print( 1, "Counter-example is not available.\n" );
101 else
102 {
103 iOut = Ssw_SecCexResimulate( pMiterCec, (int *)pMiterCec->pData, &nOuts );
104 if ( iOut == -1 )
105 Abc_Print( 1, "Counter-example verification has failed.\n" );
106 else
107 {
108 if ( !fSilent )
109 {
110 Abc_Print( 1, "Primary output %d has failed", iOut );
111 if ( nOuts-1 >= 0 )
112 Abc_Print( 1, ", along with other %d incorrect outputs", nOuts-1 );
113 Abc_Print( 1, ".\n" );
114 }
115 if ( piOutFail )
116 *piOutFail = iOut;
117 }
118 Cec_ManTransformPattern( pMiter, iOut, (int *)pMiterCec->pData );
119 }
120 }
121 else if ( !fSilent )
122 {
123 Abc_Print( 1, "Networks are UNDECIDED. " );
124 Abc_PrintTime( 1, "Time", Abc_Clock() - clkTotal );
125 }
126 fflush( stdout );
127 Aig_ManStop( pMiterCec );
128 return RetValue;
129}
void Aig_ManStop(Aig_Man_t *p)
Definition aigMan.c:187
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Definition aig.h:50
int Fra_FraigCec(Aig_Man_t **ppAig, int nConfLimit, int fVerbose)
Definition fraCec.c:320
Aig_Man_t * Gia_ManToAig(Gia_Man_t *p, int fChoices)
Definition giaAig.c:318
Gia_Man_t * Gia_ManTransformMiter(Gia_Man_t *p)
Definition giaDup.c:3376
int Ssw_SecCexResimulate(Aig_Man_t *p, int *pModel, int *pnOutputs)
Definition saigMiter.c:1038
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Cec_ManVerifySimple()

int Cec_ManVerifySimple ( Gia_Man_t * p)

Function*************************************************************

Synopsis [Simple SAT run to check equivalence.]

Description []

SideEffects []

SeeAlso []

Definition at line 432 of file cecCec.c.

433{
434 Cec_ParCec_t ParsCec, * pPars = &ParsCec;
436 pPars->fSilent = 1;
437 assert( Gia_ManCoNum(p) == 2 );
438 assert( Gia_ManRegNum(p) == 0 );
439 return Cec_ManVerify( p, pPars );
440}
int Cec_ManVerify(Gia_Man_t *pInit, Cec_ParCec_t *pPars)
MACRO DEFINITIONS ///.
Definition cecCec.c:326
void Cec_ManCecSetDefaultParams(Cec_ParCec_t *p)
Definition cecCore.c:159
struct Cec_ParCec_t_ Cec_ParCec_t
Definition cec.h:129
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Cec_ManVerifyTwo()

int Cec_ManVerifyTwo ( Gia_Man_t * p0,
Gia_Man_t * p1,
int fVerbose )

Function*************************************************************

Synopsis [New CEC engine applied to two circuits.]

Description []

SideEffects []

SeeAlso []

Definition at line 453 of file cecCec.c.

454{
455 Cec_ParCec_t ParsCec, * pPars = &ParsCec;
456 Gia_Man_t * pMiter;
457 int RetValue;
459 pPars->fVerbose = fVerbose;
460 pMiter = Gia_ManMiter( p0, p1, 0, 1, 0, 0, pPars->fVerbose );
461 if ( pMiter == NULL )
462 return -1;
463 RetValue = Cec_ManVerify( pMiter, pPars );
464 p0->pCexComb = pMiter->pCexComb; pMiter->pCexComb = NULL;
465 Gia_ManStop( pMiter );
466 return RetValue;
467}
Gia_Man_t * Gia_ManMiter(Gia_Man_t *pAig0, Gia_Man_t *pAig1, int nInsDup, int fDualOut, int fSeq, int fImplic, int fVerbose)
Definition giaDup.c:2983
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Cec_ManVerifyTwoAigs()

int Cec_ManVerifyTwoAigs ( Aig_Man_t * pAig0,
Aig_Man_t * pAig1,
int fVerbose )

Function*************************************************************

Synopsis [New CEC engine applied to two circuits.]

Description [Returns 1 if equivalent, 0 if counter-example, -1 if undecided. Counter-example is returned in the first manager as pAig0->pSeqModel. The format is given in Abc_Cex_t (file "abc\src\aig\gia\gia.h").]

SideEffects []

SeeAlso []

Definition at line 497 of file cecCec.c.

498{
499 Gia_Man_t * p0, * p1, * pTemp;
500 int RetValue;
501
502 p0 = Gia_ManFromAig( pAig0 );
503 p0 = Gia_ManCleanup( pTemp = p0 );
504 Gia_ManStop( pTemp );
505
506 p1 = Gia_ManFromAig( pAig1 );
507 p1 = Gia_ManCleanup( pTemp = p1 );
508 Gia_ManStop( pTemp );
509
510 RetValue = Cec_ManVerifyTwo( p0, p1, fVerbose );
511 pAig0->pSeqModel = p0->pCexComb; p0->pCexComb = NULL;
512 Gia_ManStop( p0 );
513 Gia_ManStop( p1 );
514 return RetValue;
515}
int Cec_ManVerifyTwo(Gia_Man_t *p0, Gia_Man_t *p1, int fVerbose)
Definition cecCec.c:453
Gia_Man_t * Gia_ManFromAig(Aig_Man_t *p)
INCLUDES ///.
Definition giaAig.c:76
Here is the call graph for this function:

◆ Cec_ManVerifyTwoInv()

int Cec_ManVerifyTwoInv ( Gia_Man_t * p0,
Gia_Man_t * p1,
int fVerbose )

Definition at line 468 of file cecCec.c.

469{
470 Cec_ParCec_t ParsCec, * pPars = &ParsCec;
471 Gia_Man_t * pMiter;
472 int RetValue;
474 pPars->fVerbose = fVerbose;
475 pMiter = Gia_ManMiterInverse( p0, p1, 1, pPars->fVerbose );
476 if ( pMiter == NULL )
477 return -1;
478 RetValue = Cec_ManVerify( pMiter, pPars );
479 p0->pCexComb = pMiter->pCexComb; pMiter->pCexComb = NULL;
480 Gia_ManStop( pMiter );
481 return RetValue;
482}
Gia_Man_t * Gia_ManMiterInverse(Gia_Man_t *pBot, Gia_Man_t *pTop, int fDualOut, int fVerbose)
Definition giaDup.c:3130
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Cec_SignalCorrespondence()

Aig_Man_t * Cec_SignalCorrespondence ( Aig_Man_t * pAig,
int nConfs,
int fUseCSat )

Function*************************************************************

Synopsis [Implementation of new signal correspodence.]

Description []

SideEffects []

SeeAlso []

Definition at line 554 of file cecCec.c.

555{
556 Gia_Man_t * pGia;
557 Cec_ParCor_t CorPars, * pCorPars = &CorPars;
558 Cec_ManCorSetDefaultParams( pCorPars );
559 pCorPars->fUseCSat = fUseCSat;
560 pCorPars->nBTLimit = nConfs;
561 pGia = Gia_ManFromAigSimple( pAig );
562 Cec_ManLSCorrespondenceClasses( pGia, pCorPars );
563 Gia_ManReprToAigRepr( pAig, pGia );
564 Gia_ManStop( pGia );
565 return Aig_ManDupSimple( pAig );
566}
Here is the call graph for this function:
Here is the caller graph for this function: