ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
wlcAbs.c File Reference
#include "wlc.h"
#include "proof/pdr/pdr.h"
#include "proof/pdr/pdrInt.h"
#include "proof/ssw/ssw.h"
#include "aig/gia/giaAig.h"
#include "sat/bmc/bmc.h"
Include dependency graph for wlcAbs.c:

Go to the source code of this file.

Classes

struct  Int_Pair_t_
 

Typedefs

typedef struct Int_Pair_t_ Int_Pair_t
 

Functions

ABC_NAMESPACE_IMPL_START Vec_Vec_tIPdr_ManSaveClauses (Pdr_Man_t *p, int fDropLast)
 DECLARATIONS ///.
 
int IPdr_ManRestoreClauses (Pdr_Man_t *p, Vec_Vec_t *vClauses, Vec_Int_t *vMap)
 
int IPdr_ManRebuildClauses (Pdr_Man_t *p, Vec_Vec_t *vClauses)
 
int IPdr_ManSolveInt (Pdr_Man_t *p, int fCheckClauses, int fPushClauses)
 
int IPdr_ManCheckCombUnsat (Pdr_Man_t *p)
 
int IPdr_ManReduceClauses (Pdr_Man_t *p, Vec_Vec_t *vClauses)
 
void IPdr_ManPrintClauses (Vec_Vec_t *vClauses, int kStart, int nRegs)
 
void Wla_ManJoinThread (Wla_Man_t *pWla, int RunId)
 
void Wla_ManConcurrentBmc3 (Wla_Man_t *pWla, Aig_Man_t *pAig, Abc_Cex_t **ppCex)
 
int Wla_CallBackToStop (int RunId)
 
int Wla_GetGlobalRunId ()
 
int IntPairPtrCompare (Int_Pair_t **a, Int_Pair_t **b)
 
void Wlc_NtkPrintNtk (Wlc_Ntk_t *p)
 FUNCTION DEFINITIONS ///.
 
void Wlc_NtkAbsGetSupp_rec (Wlc_Ntk_t *p, Wlc_Obj_t *pObj, Vec_Bit_t *vCiMarks, Vec_Int_t *vSuppRefs, Vec_Int_t *vSuppList)
 
void Wlc_NtkAbsGetSupp (Wlc_Ntk_t *p, Wlc_Obj_t *pObj, Vec_Bit_t *vCiMarks, Vec_Int_t *vSuppRefs, Vec_Int_t *vSuppList)
 
int Wlc_NtkNumPiBits (Wlc_Ntk_t *pNtk)
 
void Wlc_NtkAbsAnalyzeRefine (Wlc_Ntk_t *p, Vec_Int_t *vBlacks, Vec_Bit_t *vUnmark, int *nDisj, int *nNDisj)
 
Wlc_Ntk_tWlc_NtkIntroduceChoices (Wlc_Ntk_t *pNtk, Vec_Int_t *vBlacks, Vec_Int_t *vPPIs)
 
Vec_Int_tWlc_NtkFlopsRemap (Wlc_Ntk_t *p, Vec_Int_t *vFfOld, Vec_Int_t *vFfNew)
 
Vec_Int_tWla_ManCollectNodes (Wla_Man_t *pWla, int fBlack)
 
int Wla_ManShrinkAbs (Wla_Man_t *pWla, int nFrames, int RunId)
 
Wlc_Ntk_tWla_ManCreateAbs (Wla_Man_t *pWla)
 
Aig_Man_tWla_ManBitBlast (Wla_Man_t *pWla, Wlc_Ntk_t *pAbs)
 
int Wla_ManCheckCombUnsat (Wla_Man_t *pWla, Aig_Man_t *pAig)
 
int Wla_ManSolveInt (Wla_Man_t *pWla, Aig_Man_t *pAig)
 
void Wla_ManRefine (Wla_Man_t *pWla)
 
Wla_Man_tWla_ManStart (Wlc_Ntk_t *pNtk, Wlc_Par_t *pPars)
 
void Wla_ManStop (Wla_Man_t *p)
 
int Wla_ManSolve (Wla_Man_t *pWla, Wlc_Par_t *pPars)
 
int Wlc_NtkPdrAbs (Wlc_Ntk_t *p, Wlc_Par_t *pPars)
 
int Wlc_NtkAbsCore (Wlc_Ntk_t *p, Wlc_Par_t *pPars)
 FUNCTION DECLARATIONS ///.
 

Typedef Documentation

◆ Int_Pair_t

typedef struct Int_Pair_t_ Int_Pair_t

Definition at line 46 of file wlcAbs.c.

Function Documentation

◆ IntPairPtrCompare()

int IntPairPtrCompare ( Int_Pair_t ** a,
Int_Pair_t ** b )

Definition at line 53 of file wlcAbs.c.

54{
55 return (*a)->second < (*b)->second;
56}

◆ IPdr_ManCheckCombUnsat()

int IPdr_ManCheckCombUnsat ( Pdr_Man_t * p)
extern

Definition at line 871 of file pdrIncr.c.

872{
873 int iFrame, RetValue = -1;
874
875 Pdr_ManCreateSolver( p, (iFrame = 0) );
876 Pdr_ManCreateSolver( p, (iFrame = 1) );
877
878 p->nFrames = iFrame;
879 p->iUseFrame = Abc_MaxInt(iFrame, 1);
880
881 RetValue = Pdr_ManCheckCube( p, iFrame, NULL, NULL, p->pPars->nConfLimit, 0, 1 );
882 return RetValue;
883}
Cube * p
Definition exorList.c:222
int Pdr_ManCheckCube(Pdr_Man_t *p, int k, Pdr_Set_t *pCube, Pdr_Set_t **ppPred, int nConfLimit, int fTryConf, int fUseLit)
Definition pdrSat.c:290
sat_solver * Pdr_ManCreateSolver(Pdr_Man_t *p, int k)
DECLARATIONS ///.
Definition pdrSat.c:45
Here is the call graph for this function:
Here is the caller graph for this function:

◆ IPdr_ManPrintClauses()

void IPdr_ManPrintClauses ( Vec_Vec_t * vClauses,
int kStart,
int nRegs )
extern

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 113 of file pdrIncr.c.

114{
115 Vec_Ptr_t * vArrayK;
116 Pdr_Set_t * pCube;
117 int i, k, Counter = 0;
118 Vec_VecForEachLevelStart( vClauses, vArrayK, k, kStart )
119 {
120 Vec_PtrSort( vArrayK, (int (*)(const void *, const void *))Pdr_SetCompare );
121 Vec_PtrForEachEntry( Pdr_Set_t *, vArrayK, pCube, i )
122 {
123 Abc_Print( 1, "Frame[%4d]Cube[%4d] = ", k, Counter++ );
124 // Pdr_SetPrint( stdout, pCube, nRegs, NULL );
125 ZPdr_SetPrint( pCube );
126 Abc_Print( 1, "\n" );
127 }
128 }
129}
struct Pdr_Set_t_ Pdr_Set_t
Definition pdrInt.h:74
void ZPdr_SetPrint(Pdr_Set_t *p)
Definition pdrUtil.c:263
int Pdr_SetCompare(Pdr_Set_t **pp1, Pdr_Set_t **pp2)
Definition pdrUtil.c:485
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition vecPtr.h:42
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition vecPtr.h:55
#define Vec_VecForEachLevelStart(vGlob, vVec, i, LevelStart)
Definition vecVec.h:57
Here is the call graph for this function:

◆ IPdr_ManRebuildClauses()

int IPdr_ManRebuildClauses ( Pdr_Man_t * p,
Vec_Vec_t * vClauses )
extern

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 256 of file pdrIncr.c.

257{
258 Vec_Ptr_t * vArrayK;
259 Pdr_Set_t * pCube;
260 int i, j;
261 int RetValue = -1;
262 int nCubes = 0;
263
264 if ( vClauses == NULL )
265 return RetValue;
266
267 assert( Vec_VecSize(vClauses) >= 2 );
268 assert( Vec_VecSize(p->vClauses) == 0 );
269 Vec_VecExpand( p->vClauses, 1 );
270
271 IPdr_ManSetSolver( p, 0, 1 );
272
273 // push clauses from R0 to R1
274 Vec_VecForEachLevelStart( vClauses, vArrayK, i, 1 )
275 {
276 Vec_PtrForEachEntry( Pdr_Set_t *, vArrayK, pCube, j )
277 {
278 ++nCubes;
279
280 RetValue = Pdr_ManCheckCube( p, 0, pCube, NULL, 0, 0, 1 );
281 Vec_IntWriteEntry( p->vActVars, 0, 0 );
282
283 assert( RetValue != -1 );
284
285 if ( RetValue == 0 )
286 {
287 Abc_Print( 1, "Cube[%d][%d] cannot be pushed from R0 to R1.\n", i, j );
288 Pdr_SetDeref( pCube );
289 continue;
290 }
291
292 Vec_VecPush( p->vClauses, 1, pCube );
293 }
294 }
295 Abc_Print( 1, "RebuildClauses: %d out of %d cubes reused in R1.\n", Vec_PtrSize(Vec_VecEntry(p->vClauses, 1)), nCubes );
296 IPdr_ManSetSolver( p, 1, 0 );
297 Vec_VecFree( vClauses );
298
299 /*
300 for ( i = 1; i < Vec_VecSize( vClauses ) - 1; ++i )
301 {
302 vArrayK = IPdr_ManPushClausesK( p, i );
303 if ( Vec_PtrSize(vArrayK) == 0 )
304 {
305 Abc_Print( 1, "RebuildClauses: stopped at frame %d.\n", i );
306 break;
307 }
308
309 Vec_PtrGrow( (Vec_Ptr_t *)(p->vClauses), i + 2 );
310 p->vClauses->nSize = i + 2;
311 p->vClauses->pArray[i+1] = vArrayK;
312 IPdr_ManSetSolver( p, i + 1, 0 );
313 }
314
315 Abc_Print( 1, "After rebuild:" );
316 Vec_VecForEachLevel( p->vClauses, vArrayK, i )
317 Abc_Print( 1, " %d", Vec_PtrSize( vArrayK ) );
318 Abc_Print( 1, "\n" );
319 */
320
321 return 0;
322}
sat_solver * IPdr_ManSetSolver(Pdr_Man_t *p, int k, int fSetPropOutput)
Definition pdrIncr.c:216
void Pdr_SetDeref(Pdr_Set_t *p)
Definition pdrUtil.c:208
#define assert(ex)
Definition util_old.h:213
Here is the call graph for this function:
Here is the caller graph for this function:

◆ IPdr_ManReduceClauses()

int IPdr_ManReduceClauses ( Pdr_Man_t * p,
Vec_Vec_t * vClauses )
extern

Definition at line 971 of file pdrIncr.c.

972{
973 int iFrame, RetValue = -1;
974 Vec_Ptr_t * vLast = NULL;
975
976 Pdr_ManCreateSolver( p, (iFrame = 0) );
977 Pdr_ManCreateSolver( p, (iFrame = 1) );
978
979 p->nFrames = iFrame;
980 p->iUseFrame = Abc_MaxInt(iFrame, 1);
981
982 vLast = Vec_VecEntry( vClauses, Vec_VecSize( vClauses ) - 1 );
983 RetValue = IPdr_ManCheckCubeReduce( p, vLast, NULL, p->pPars->nConfLimit );
984 return RetValue;
985}
int IPdr_ManCheckCubeReduce(Pdr_Man_t *p, Vec_Ptr_t *vClauses, Pdr_Set_t *pCube, int nConfLimit)
Definition pdrIncr.c:885
Here is the call graph for this function:

◆ IPdr_ManRestoreClauses()

int IPdr_ManRestoreClauses ( Pdr_Man_t * p,
Vec_Vec_t * vClauses,
Vec_Int_t * vMap )
extern

Definition at line 338 of file pdrIncr.c.

339{
340 int i;
341
342 assert(vClauses);
343
344 Vec_VecFree(p->vClauses);
345 p->vClauses = vClauses;
346
347 // remap clause literals using mapping (old flop -> new flop) found in array vMap
348 if ( vMap )
349 {
350 Pdr_Set_t * pSet; int j, k;
351 Vec_VecForEachEntry( Pdr_Set_t *, vClauses, pSet, i, j )
352 for ( k = 0; k < pSet->nLits; k++ )
353 pSet->Lits[k] = Abc_Lit2LitV( Vec_IntArray(vMap), pSet->Lits[k] );
354 }
355
356 for ( i = 0; i < Vec_VecSize(p->vClauses); ++i )
357 IPdr_ManSetSolver( p, i, i < Vec_VecSize( p->vClauses ) - 1 );
358
359 return 0;
360}
int Lits[0]
Definition pdrInt.h:81
int nLits
Definition pdrInt.h:80
#define Vec_VecForEachEntry(Type, vGlob, pEntry, i, k)
Definition vecVec.h:87
Here is the call graph for this function:
Here is the caller graph for this function:

◆ IPdr_ManSaveClauses()

ABC_NAMESPACE_IMPL_START Vec_Vec_t * IPdr_ManSaveClauses ( Pdr_Man_t * p,
int fDropLast )
extern

DECLARATIONS ///.

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

FileName [wlcAbs.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Verilog parser.]

Synopsis [Abstraction for word-level networks.]

Author [Yen-Sheng Ho, Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - August 22, 2014.]

Revision [

Id
wlcAbs.c,v 1.00 2014/09/12 00:00:00 alanmi Exp

]

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 182 of file pdrIncr.c.

183{
184 int i, k;
185 Vec_Vec_t * vClausesSaved;
186 Pdr_Set_t * pCla;
187
188 if ( Vec_VecSize( p->vClauses ) == 1 )
189 return NULL;
190 if ( Vec_VecSize( p->vClauses ) == 2 && fDropLast )
191 return NULL;
192
193 if ( fDropLast )
194 vClausesSaved = Vec_VecStart( Vec_VecSize(p->vClauses)-1 );
195 else
196 vClausesSaved = Vec_VecStart( Vec_VecSize(p->vClauses) );
197
198 Vec_VecForEachEntryStartStop( Pdr_Set_t *, p->vClauses, pCla, i, k, 0, Vec_VecSize(vClausesSaved) )
199 Vec_VecPush(vClausesSaved, i, Pdr_SetDup(pCla));
200
201 return vClausesSaved;
202}
Pdr_Set_t * Pdr_SetDup(Pdr_Set_t *pSet)
Definition pdrUtil.c:166
#define Vec_VecForEachEntryStartStop(Type, vGlob, pEntry, i, k, LevelStart, LevelStop)
Definition vecVec.h:95
typedefABC_NAMESPACE_HEADER_START struct Vec_Vec_t_ Vec_Vec_t
INCLUDES ///.
Definition vecVec.h:42
Here is the call graph for this function:
Here is the caller graph for this function:

◆ IPdr_ManSolveInt()

int IPdr_ManSolveInt ( Pdr_Man_t * p,
int fCheckClauses,
int fPushClauses )
extern

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 373 of file pdrIncr.c.

374{
375 int fPrintClauses = 0;
376 Pdr_Set_t * pCube = NULL;
377 Aig_Obj_t * pObj;
378 Abc_Cex_t * pCexNew;
379 int iFrame, RetValue = -1;
380 int nOutDigits = Abc_Base10Log( Saig_ManPoNum(p->pAig) );
381 abctime clkStart = Abc_Clock(), clkOne = 0;
382 p->timeToStop = p->pPars->nTimeOut ? p->pPars->nTimeOut * CLOCKS_PER_SEC + Abc_Clock(): 0;
383 // assert( Vec_PtrSize(p->vSolvers) == 0 );
384 // in the multi-output mode, mark trivial POs (those fed by const0) as solved
385 if ( p->pPars->fSolveAll )
386 Saig_ManForEachPo( p->pAig, pObj, iFrame )
387 if ( Aig_ObjChild0(pObj) == Aig_ManConst0(p->pAig) )
388 {
389 Vec_IntWriteEntry( p->pPars->vOutMap, iFrame, 1 ); // unsat
390 p->pPars->nProveOuts++;
391 if ( p->pPars->fUseBridge )
392 Gia_ManToBridgeResult( stdout, 1, NULL, iFrame );
393 }
394 // create the first timeframe
395 p->pPars->timeLastSolved = Abc_Clock();
396
397 if ( Vec_VecSize(p->vClauses) == 0 )
398 Pdr_ManCreateSolver( p, (iFrame = 0) );
399 else {
400 iFrame = Vec_VecSize(p->vClauses) - 1;
401
402 if ( fCheckClauses )
403 {
404 if ( p->pPars->fVerbose )
405 Abc_Print( 1, "IPDR: Checking the reloaded length-%d trace...", iFrame + 1 ) ;
407 if ( p->pPars->fVerbose )
408 Abc_Print( 1, " Passed!\n" ) ;
409 }
410
411 if ( fPushClauses )
412 {
413 p->iUseFrame = Abc_MaxInt(iFrame, 1);
414
415 if ( p->pPars->fVerbose )
416 {
417 Abc_Print( 1, "IPDR: Pushing the reloaded clauses. Before:\n" );
418 Pdr_ManPrintProgress( p, 1, Abc_Clock() - clkStart );
419 }
420
421 RetValue = Pdr_ManPushClauses( p );
422
423 if ( p->pPars->fVerbose )
424 {
425 Abc_Print( 1, "IPDR: Finished pushing. After:\n" );
426 Pdr_ManPrintProgress( p, 1, Abc_Clock() - clkStart );
427 }
428
429 if ( RetValue )
430 {
433 return 1;
434 }
435 }
436
437 if ( p->pPars->fUseAbs && p->vAbsFlops == NULL && iFrame >= 1 )
438 {
439 assert( p->vAbsFlops == NULL );
440 p->vAbsFlops = Vec_IntStart( Saig_ManRegNum(p->pAig) );
441 p->vMapFf2Ppi = Vec_IntStartFull( Saig_ManRegNum(p->pAig) );
442 p->vMapPpi2Ff = Vec_IntAlloc( 100 );
443
445 }
446
447 }
448 while ( 1 )
449 {
450 int fRefined = 0;
451 if ( p->pPars->fUseAbs && p->vAbsFlops == NULL && iFrame == 1 )
452 {
453// int i, Prio;
454 assert( p->vAbsFlops == NULL );
455 p->vAbsFlops = Vec_IntStart( Saig_ManRegNum(p->pAig) );
456 p->vMapFf2Ppi = Vec_IntStartFull( Saig_ManRegNum(p->pAig) );
457 p->vMapPpi2Ff = Vec_IntAlloc( 100 );
458// Vec_IntForEachEntry( p->vPrio, Prio, i )
459// if ( Prio >> p->nPrioShift )
460// Vec_IntWriteEntry( p->vAbsFlops, i, 1 );
461 }
462 //if ( p->pPars->fUseAbs && p->vAbsFlops )
463 // printf( "Starting frame %d with %d (%d) flops.\n", iFrame, Vec_IntCountPositive(p->vAbsFlops), Vec_IntCountPositive(p->vPrio) );
464 p->nFrames = iFrame;
465 assert( iFrame == Vec_PtrSize(p->vSolvers)-1 );
466 p->iUseFrame = Abc_MaxInt(iFrame, 1);
467 Saig_ManForEachPo( p->pAig, pObj, p->iOutCur )
468 {
469 // skip disproved outputs
470 if ( p->vCexes && Vec_PtrEntry(p->vCexes, p->iOutCur) )
471 continue;
472 // skip output whose time has run out
473 if ( p->pTime4Outs && p->pTime4Outs[p->iOutCur] == 0 )
474 continue;
475 // check if the output is trivially solved
476 if ( Aig_ObjChild0(pObj) == Aig_ManConst0(p->pAig) )
477 continue;
478 // check if the output is trivially solved
479 if ( Aig_ObjChild0(pObj) == Aig_ManConst1(p->pAig) )
480 {
481 if ( !p->pPars->fSolveAll )
482 {
483 pCexNew = Abc_CexMakeTriv( Aig_ManRegNum(p->pAig), Saig_ManPiNum(p->pAig), Saig_ManPoNum(p->pAig), iFrame*Saig_ManPoNum(p->pAig)+p->iOutCur );
484 p->pAig->pSeqModel = pCexNew;
485 return 0; // SAT
486 }
487 pCexNew = (p->pPars->fUseBridge || p->pPars->fStoreCex) ? Abc_CexMakeTriv( Aig_ManRegNum(p->pAig), Saig_ManPiNum(p->pAig), Saig_ManPoNum(p->pAig), iFrame*Saig_ManPoNum(p->pAig)+p->iOutCur ) : (Abc_Cex_t *)(ABC_PTRINT_T)1;
488 p->pPars->nFailOuts++;
489 if ( p->pPars->vOutMap ) Vec_IntWriteEntry( p->pPars->vOutMap, p->iOutCur, 0 );
490 if ( !p->pPars->fNotVerbose )
491 Abc_Print( 1, "Output %*d was trivially asserted in frame %2d (solved %*d out of %*d outputs).\n",
492 nOutDigits, p->iOutCur, iFrame, nOutDigits, p->pPars->nFailOuts, nOutDigits, Saig_ManPoNum(p->pAig) );
493 assert( Vec_PtrEntry(p->vCexes, p->iOutCur) == NULL );
494 if ( p->pPars->fUseBridge )
495 Gia_ManToBridgeResult( stdout, 0, pCexNew, pCexNew->iPo );
496 Vec_PtrWriteEntry( p->vCexes, p->iOutCur, pCexNew );
497 if ( p->pPars->pFuncOnFail && p->pPars->pFuncOnFail(p->iOutCur, p->pPars->fStoreCex ? (Abc_Cex_t *)Vec_PtrEntry(p->vCexes, p->iOutCur) : NULL) )
498 {
499 if ( p->pPars->fVerbose )
500 Pdr_ManPrintProgress( p, 1, Abc_Clock() - clkStart );
501 if ( !p->pPars->fSilent )
502 Abc_Print( 1, "Quitting due to callback on fail in frame %d.\n", iFrame );
503 p->pPars->iFrame = iFrame;
504 return -1;
505 }
506 if ( p->pPars->nFailOuts + p->pPars->nDropOuts == Saig_ManPoNum(p->pAig) )
507 return p->pPars->nFailOuts ? 0 : -1; // SAT or UNDEC
508 p->pPars->timeLastSolved = Abc_Clock();
509 continue;
510 }
511 // try to solve this output
512 if ( p->pTime4Outs )
513 {
514 assert( p->pTime4Outs[p->iOutCur] > 0 );
515 clkOne = Abc_Clock();
516 p->timeToStopOne = p->pTime4Outs[p->iOutCur] + Abc_Clock();
517 }
518 while ( 1 )
519 {
520 if ( p->pPars->nTimeOutGap && p->pPars->timeLastSolved && Abc_Clock() > p->pPars->timeLastSolved + p->pPars->nTimeOutGap * CLOCKS_PER_SEC )
521 {
522 if ( p->pPars->fVerbose )
523 Pdr_ManPrintProgress( p, 1, Abc_Clock() - clkStart );
524 if ( !p->pPars->fSilent )
525 Abc_Print( 1, "Reached gap timeout (%d seconds) in frame %d.\n", p->pPars->nTimeOutGap, iFrame );
526 p->pPars->iFrame = iFrame;
527 return -1;
528 }
529 RetValue = Pdr_ManCheckCube( p, iFrame, NULL, &pCube, p->pPars->nConfLimit, 0, 1 );
530 if ( RetValue == 1 )
531 break;
532 if ( RetValue == -1 )
533 {
534 if ( p->pPars->fVerbose )
535 Pdr_ManPrintProgress( p, 1, Abc_Clock() - clkStart );
536 if ( p->timeToStop && Abc_Clock() > p->timeToStop )
537 Abc_Print( 1, "Reached timeout (%d seconds) in frame %d.\n", p->pPars->nTimeOut, iFrame );
538 else if ( p->pPars->nTimeOutGap && p->pPars->timeLastSolved && Abc_Clock() > p->pPars->timeLastSolved + p->pPars->nTimeOutGap * CLOCKS_PER_SEC )
539 Abc_Print( 1, "Reached gap timeout (%d seconds) in frame %d.\n", p->pPars->nTimeOutGap, iFrame );
540 else if ( p->timeToStopOne && Abc_Clock() > p->timeToStopOne )
541 {
542 Pdr_QueueClean( p );
543 pCube = NULL;
544 break; // keep solving
545 }
546 else if ( p->pPars->nConfLimit )
547 Abc_Print( 1, "Reached conflict limit (%d) in frame %d.\n", p->pPars->nConfLimit, iFrame );
548 else if ( p->pPars->fVerbose )
549 Abc_Print( 1, "Computation cancelled by the callback in frame %d.\n", iFrame );
550 p->pPars->iFrame = iFrame;
551 return -1;
552 }
553 if ( RetValue == 0 )
554 {
555 RetValue = Pdr_ManBlockCube( p, pCube );
556 if ( RetValue == -1 )
557 {
558 if ( p->pPars->fVerbose )
559 Pdr_ManPrintProgress( p, 1, Abc_Clock() - clkStart );
560 if ( p->timeToStop && Abc_Clock() > p->timeToStop )
561 Abc_Print( 1, "Reached timeout (%d seconds) in frame %d.\n", p->pPars->nTimeOut, iFrame );
562 else if ( p->pPars->nTimeOutGap && p->pPars->timeLastSolved && Abc_Clock() > p->pPars->timeLastSolved + p->pPars->nTimeOutGap * CLOCKS_PER_SEC )
563 Abc_Print( 1, "Reached gap timeout (%d seconds) in frame %d.\n", p->pPars->nTimeOutGap, iFrame );
564 else if ( p->timeToStopOne && Abc_Clock() > p->timeToStopOne )
565 {
566 Pdr_QueueClean( p );
567 pCube = NULL;
568 break; // keep solving
569 }
570 else if ( p->pPars->nConfLimit )
571 Abc_Print( 1, "Reached conflict limit (%d) in frame %d.\n", p->pPars->nConfLimit, iFrame );
572 else if ( p->pPars->fVerbose )
573 Abc_Print( 1, "Computation cancelled by the callback in frame %d.\n", iFrame );
574 p->pPars->iFrame = iFrame;
575 return -1;
576 }
577 if ( RetValue == 0 )
578 {
579 if ( fPrintClauses )
580 {
581 Abc_Print( 1, "*** Clauses after frame %d:\n", iFrame );
583 }
584 if ( p->pPars->fVerbose && !p->pPars->fUseAbs )
585 Pdr_ManPrintProgress( p, !p->pPars->fSolveAll, Abc_Clock() - clkStart );
586 p->pPars->iFrame = iFrame;
587 if ( !p->pPars->fSolveAll )
588 {
589 abctime clk = Abc_Clock();
591 p->tAbs += Abc_Clock() - clk;
592 if ( pCex == NULL )
593 {
594 assert( p->pPars->fUseAbs );
595 Pdr_QueueClean( p );
596 pCube = NULL;
597 fRefined = 1;
598 break; // keep solving
599 }
600 p->pAig->pSeqModel = pCex;
601
602 if ( p->pPars->fVerbose && p->pPars->fUseAbs )
603 Pdr_ManPrintProgress( p, !p->pPars->fSolveAll, Abc_Clock() - clkStart );
604 return 0; // SAT
605 }
606 p->pPars->nFailOuts++;
607 pCexNew = (p->pPars->fUseBridge || p->pPars->fStoreCex) ? Pdr_ManDeriveCex(p) : (Abc_Cex_t *)(ABC_PTRINT_T)1;
608 if ( p->pPars->vOutMap ) Vec_IntWriteEntry( p->pPars->vOutMap, p->iOutCur, 0 );
609 assert( Vec_PtrEntry(p->vCexes, p->iOutCur) == NULL );
610 if ( p->pPars->fUseBridge )
611 Gia_ManToBridgeResult( stdout, 0, pCexNew, pCexNew->iPo );
612 Vec_PtrWriteEntry( p->vCexes, p->iOutCur, pCexNew );
613 if ( p->pPars->pFuncOnFail && p->pPars->pFuncOnFail(p->iOutCur, p->pPars->fStoreCex ? (Abc_Cex_t *)Vec_PtrEntry(p->vCexes, p->iOutCur) : NULL) )
614 {
615 if ( p->pPars->fVerbose )
616 Pdr_ManPrintProgress( p, 1, Abc_Clock() - clkStart );
617 if ( !p->pPars->fSilent )
618 Abc_Print( 1, "Quitting due to callback on fail in frame %d.\n", iFrame );
619 p->pPars->iFrame = iFrame;
620 return -1;
621 }
622 if ( !p->pPars->fNotVerbose )
623 Abc_Print( 1, "Output %*d was asserted in frame %2d (%2d) (solved %*d out of %*d outputs).\n",
624 nOutDigits, p->iOutCur, iFrame, iFrame, nOutDigits, p->pPars->nFailOuts, nOutDigits, Saig_ManPoNum(p->pAig) );
625 if ( p->pPars->nFailOuts == Saig_ManPoNum(p->pAig) )
626 return 0; // all SAT
627 Pdr_QueueClean( p );
628 pCube = NULL;
629 break; // keep solving
630 }
631 if ( p->pPars->fVerbose )
632 Pdr_ManPrintProgress( p, 0, Abc_Clock() - clkStart );
633 }
634 }
635 if ( fRefined )
636 break;
637 if ( p->pTime4Outs )
638 {
639 abctime timeSince = Abc_Clock() - clkOne;
640 assert( p->pTime4Outs[p->iOutCur] > 0 );
641 p->pTime4Outs[p->iOutCur] = (p->pTime4Outs[p->iOutCur] > timeSince) ? p->pTime4Outs[p->iOutCur] - timeSince : 0;
642 if ( p->pTime4Outs[p->iOutCur] == 0 && Vec_PtrEntry(p->vCexes, p->iOutCur) == NULL ) // undecided
643 {
644 p->pPars->nDropOuts++;
645 if ( p->pPars->vOutMap )
646 Vec_IntWriteEntry( p->pPars->vOutMap, p->iOutCur, -1 );
647 if ( !p->pPars->fNotVerbose )
648 Abc_Print( 1, "Timing out on output %*d in frame %d.\n", nOutDigits, p->iOutCur, iFrame );
649 }
650 p->timeToStopOne = 0;
651 }
652 }
653 /*
654 if ( p->pPars->fUseAbs && p->vAbsFlops && !fRefined )
655 {
656 int i, Used;
657 Vec_IntForEachEntry( p->vAbsFlops, Used, i )
658 if ( Used && (Vec_IntEntry(p->vPrio, i) >> p->nPrioShift) == 0 )
659 Vec_IntWriteEntry( p->vAbsFlops, i, 0 );
660 }
661 */
662 if ( p->pPars->fUseAbs && p->vAbsFlops && !fRefined )
663 {
664 Pdr_Set_t * pSet;
665 int i, j, k;
666 Vec_IntFill( p->vAbsFlops, Vec_IntSize( p->vAbsFlops ), 0 );
667 Vec_VecForEachEntry( Pdr_Set_t *, p->vClauses, pSet, i, j )
668 for ( k = 0; k < pSet->nLits; k++ )
669 Vec_IntWriteEntry( p->vAbsFlops, Abc_Lit2Var(pSet->Lits[k]), 1 );
670 }
671
672 if ( p->pPars->fVerbose )
673 Pdr_ManPrintProgress( p, !fRefined, Abc_Clock() - clkStart );
674 if ( fRefined )
675 continue;
676 //if ( p->pPars->fUseAbs && p->vAbsFlops )
677 // printf( "Finished frame %d with %d (%d) flops.\n", iFrame, Vec_IntCountPositive(p->vAbsFlops), Vec_IntCountPositive(p->vPrio) );
678 // open a new timeframe
679 p->nQueLim = p->pPars->nRestLimit;
680 assert( pCube == NULL );
681 Pdr_ManSetPropertyOutput( p, iFrame );
682 Pdr_ManCreateSolver( p, ++iFrame );
683 if ( fPrintClauses )
684 {
685 Abc_Print( 1, "*** Clauses after frame %d:\n", iFrame );
687 }
688 // push clauses into this timeframe
689 RetValue = Pdr_ManPushClauses( p );
690 if ( RetValue == -1 )
691 {
692 if ( p->pPars->fVerbose )
693 Pdr_ManPrintProgress( p, 1, Abc_Clock() - clkStart );
694 if ( !p->pPars->fSilent )
695 {
696 if ( p->timeToStop && Abc_Clock() > p->timeToStop )
697 Abc_Print( 1, "Reached timeout (%d seconds) in frame %d.\n", p->pPars->nTimeOut, iFrame );
698 else
699 Abc_Print( 1, "Reached conflict limit (%d) in frame.\n", p->pPars->nConfLimit, iFrame );
700 }
701 p->pPars->iFrame = iFrame;
702 return -1;
703 }
704 if ( RetValue )
705 {
706 if ( p->pPars->fVerbose )
707 Pdr_ManPrintProgress( p, 1, Abc_Clock() - clkStart );
708 if ( !p->pPars->fSilent )
710 if ( !p->pPars->fSilent )
712 p->pPars->iFrame = iFrame;
713 // count the number of UNSAT outputs
714 p->pPars->nProveOuts = Saig_ManPoNum(p->pAig) - p->pPars->nFailOuts - p->pPars->nDropOuts;
715 // convert previously 'unknown' into 'unsat'
716 if ( p->pPars->vOutMap )
717 for ( iFrame = 0; iFrame < Saig_ManPoNum(p->pAig); iFrame++ )
718 if ( Vec_IntEntry(p->pPars->vOutMap, iFrame) == -2 ) // unknown
719 {
720 Vec_IntWriteEntry( p->pPars->vOutMap, iFrame, 1 ); // unsat
721 if ( p->pPars->fUseBridge )
722 Gia_ManToBridgeResult( stdout, 1, NULL, iFrame );
723 }
724 if ( p->pPars->nProveOuts == Saig_ManPoNum(p->pAig) )
725 return 1; // UNSAT
726 if ( p->pPars->nFailOuts > 0 )
727 return 0; // SAT
728 return -1;
729 }
730 if ( p->pPars->fVerbose )
731 Pdr_ManPrintProgress( p, 0, Abc_Clock() - clkStart );
732
733 // check termination
734 if ( p->pPars->pFuncStop && p->pPars->pFuncStop(p->pPars->RunId) )
735 {
736 p->pPars->iFrame = iFrame;
737 return -1;
738 }
739 if ( p->timeToStop && Abc_Clock() > p->timeToStop )
740 {
741 if ( fPrintClauses )
742 {
743 Abc_Print( 1, "*** Clauses after frame %d:\n", iFrame );
745 }
746 if ( p->pPars->fVerbose )
747 Pdr_ManPrintProgress( p, 1, Abc_Clock() - clkStart );
748 if ( !p->pPars->fSilent )
749 Abc_Print( 1, "Reached timeout (%d seconds) in frame %d.\n", p->pPars->nTimeOut, iFrame );
750 p->pPars->iFrame = iFrame;
751 return -1;
752 }
753 if ( p->pPars->nTimeOutGap && p->pPars->timeLastSolved && Abc_Clock() > p->pPars->timeLastSolved + p->pPars->nTimeOutGap * CLOCKS_PER_SEC )
754 {
755 if ( fPrintClauses )
756 {
757 Abc_Print( 1, "*** Clauses after frame %d:\n", iFrame );
759 }
760 if ( p->pPars->fVerbose )
761 Pdr_ManPrintProgress( p, 1, Abc_Clock() - clkStart );
762 if ( !p->pPars->fSilent )
763 Abc_Print( 1, "Reached gap timeout (%d seconds) in frame %d.\n", p->pPars->nTimeOutGap, iFrame );
764 p->pPars->iFrame = iFrame;
765 return -1;
766 }
767 if ( p->pPars->nFrameMax && iFrame >= p->pPars->nFrameMax )
768 {
769 if ( p->pPars->fVerbose )
770 Pdr_ManPrintProgress( p, 1, Abc_Clock() - clkStart );
771 if ( !p->pPars->fSilent )
772 Abc_Print( 1, "Reached limit on the number of timeframes (%d).\n", p->pPars->nFrameMax );
773 p->pPars->iFrame = iFrame;
774 return -1;
775 }
776 }
777 assert( 0 );
778 return -1;
779}
ABC_INT64_T abctime
Definition abc_global.h:332
struct Aig_Obj_t_ Aig_Obj_t
Definition aig.h:51
int IPdr_ManCheckClauses(Pdr_Man_t *p)
Definition pdrIncr.c:144
int Pdr_ManBlockCube(Pdr_Man_t *p, Pdr_Set_t *pCube)
Definition pdrCore.c:1248
int IPdr_ManRestoreAbsFlops(Pdr_Man_t *p)
Definition pdrIncr.c:324
int Gia_ManToBridgeResult(FILE *pFile, int Result, Abc_Cex_t *pCex, int iPoProved)
DECLARATIONS ///.
Definition utilBridge.c:287
int Pdr_ManPushClauses(Pdr_Man_t *p)
Definition pdrCore.c:150
void Pdr_ManPrintClauses(Pdr_Man_t *p, int kStart)
Definition pdrInv.c:244
void Pdr_QueueClean(Pdr_Man_t *p)
Definition pdrUtil.c:632
Abc_Cex_t * Pdr_ManDeriveCexAbs(Pdr_Man_t *p)
Definition pdrMan.c:448
void Pdr_ManPrintProgress(Pdr_Man_t *p, int fClose, abctime Time)
DECLARATIONS ///.
Definition pdrInv.c:48
void Pdr_ManSetPropertyOutput(Pdr_Man_t *p, int k)
Definition pdrSat.c:179
void Pdr_ManReportInvariant(Pdr_Man_t *p)
Definition pdrInv.c:477
void Pdr_ManVerifyInvariant(Pdr_Man_t *p)
Definition pdrInv.c:500
Abc_Cex_t * Pdr_ManDeriveCex(Pdr_Man_t *p)
Definition pdrMan.c:408
#define Saig_ManForEachPo(p, pObj, i)
Definition saig.h:93
Abc_Cex_t * Abc_CexMakeTriv(int nRegs, int nTruePis, int nTruePos, int iFrameOut)
Definition utilCex.c:85
typedefABC_NAMESPACE_HEADER_START struct Abc_Cex_t_ Abc_Cex_t
INCLUDES ///.
Definition utilCex.h:39
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Wla_CallBackToStop()

int Wla_CallBackToStop ( int RunId)
extern

Definition at line 46 of file wlcPth.c.

46{ assert( RunId <= g_nRunIds ); return RunId < g_nRunIds; }
Here is the caller graph for this function:

◆ Wla_GetGlobalRunId()

int Wla_GetGlobalRunId ( )
extern

Definition at line 47 of file wlcPth.c.

47{ return g_nRunIds; }
Here is the caller graph for this function:

◆ Wla_ManBitBlast()

Aig_Man_t * Wla_ManBitBlast ( Wla_Man_t * pWla,
Wlc_Ntk_t * pAbs )

Definition at line 1398 of file wlcAbs.c.

1399{
1400 int nDcFlops;
1401 Gia_Man_t * pTemp;
1402 Aig_Man_t * pAig;
1403
1404 pWla->pGia = Wlc_NtkBitBlast( pAbs, NULL );
1405
1406 // if the abstraction has flops with DC-init state,
1407 // new PIs were introduced by bit-blasting at the end of the PI list
1408 // here we move these variables to be *before* PPIs, because
1409 // PPIs are supposed to be at the end of the PI list for refinement
1410 nDcFlops = Wlc_NtkDcFlopNum(pAbs);
1411 if ( nDcFlops > 0 ) // DC-init flops are present
1412 {
1413 pWla->pGia = Gia_ManPermuteInputs( pTemp = pWla->pGia, Wlc_NtkCountObjBits(pWla->p, pWla->vBlacks), nDcFlops );
1414 Gia_ManStop( pTemp );
1415 }
1416 // if the word-level outputs have to be XORs, this is a place to do it
1417 if ( pWla->pPars->fXorOutput )
1418 {
1419 pWla->pGia = Gia_ManTransformMiter2( pTemp = pWla->pGia );
1420 Gia_ManStop( pTemp );
1421 }
1422 if ( pWla->pPars->fVerbose )
1423 {
1424 printf( "Derived abstraction with %d objects and %d PPIs. Bit-blasted AIG stats are:\n", Wlc_NtkObjNum(pAbs), Vec_IntSize(pWla->vBlacks) );
1425 Gia_ManPrintStats( pWla->pGia, NULL );
1426 }
1427
1428 // try to prove abstracted GIA by converting it to AIG and calling PDR
1429 pAig = Gia_ManToAigSimple( pWla->pGia );
1430
1431 return pAig;
1432}
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Definition aig.h:50
Aig_Man_t * Gia_ManToAigSimple(Gia_Man_t *p)
Definition giaAig.c:408
void Gia_ManStop(Gia_Man_t *p)
Definition giaMan.c:82
Gia_Man_t * Gia_ManPermuteInputs(Gia_Man_t *p, int nPpis, int nExtra)
Definition giaDup.c:2758
struct Gia_Man_t_ Gia_Man_t
Definition gia.h:96
Gia_Man_t * Gia_ManTransformMiter2(Gia_Man_t *p)
Definition giaDup.c:3409
void Gia_ManPrintStats(Gia_Man_t *p, Gps_Par_t *pPars)
Definition giaMan.c:495
Vec_Int_t * vBlacks
Definition wlc.h:256
Wlc_Par_t * pPars
Definition wlc.h:254
Gia_Man_t * pGia
Definition wlc.h:259
Wlc_Ntk_t * p
Definition wlc.h:253
int fXorOutput
Definition wlc.h:187
int fVerbose
Definition wlc.h:201
Gia_Man_t * Wlc_NtkBitBlast(Wlc_Ntk_t *p, Wlc_BstPar_t *pPars)
Definition wlcBlast.c:1349
int Wlc_NtkCountObjBits(Wlc_Ntk_t *p, Vec_Int_t *vPisNew)
Definition wlcNtk.c:1395
int Wlc_NtkDcFlopNum(Wlc_Ntk_t *p)
Definition wlcNtk.c:1351
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Wla_ManCheckCombUnsat()

int Wla_ManCheckCombUnsat ( Wla_Man_t * pWla,
Aig_Man_t * pAig )

Definition at line 1434 of file wlcAbs.c.

1435{
1436 Pdr_Man_t * pPdr;
1437 Pdr_Par_t * pPdrPars = (Pdr_Par_t *)pWla->pPdrPars;
1438 abctime clk;
1439 int RetValue = -1;
1440
1441 if ( Aig_ManAndNum( pAig ) <= 20000 )
1442 {
1443 Aig_Man_t * pAigScorr;
1444 Ssw_Pars_t ScorrPars, * pScorrPars = &ScorrPars;
1445 int nAnds;
1446
1447 clk = Abc_Clock();
1448
1449 Ssw_ManSetDefaultParams( pScorrPars );
1450 pScorrPars->fStopWhenGone = 1;
1451 pScorrPars->nFramesK = 1;
1452 pAigScorr = Ssw_SignalCorrespondence( pAig, pScorrPars );
1453 assert ( pAigScorr );
1454 nAnds = Aig_ManAndNum( pAigScorr);
1455 Aig_ManStop( pAigScorr );
1456
1457 if ( nAnds == 0 )
1458 {
1459 if ( pWla->pPars->fVerbose )
1460 Abc_PrintTime( 1, "SCORR proved UNSAT. Time", Abc_Clock() - clk );
1461 return 1;
1462 }
1463 else if ( pWla->pPars->fVerbose )
1464 {
1465 Abc_Print( 1, "SCORR failed with %d ANDs. ", nAnds);
1466 Abc_PrintTime( 1, "Time", Abc_Clock() - clk );
1467 }
1468 }
1469
1470 clk = Abc_Clock();
1471
1472 pPdrPars->fVerbose = 0;
1473 pPdr = Pdr_ManStart( pAig, pPdrPars, NULL );
1474 RetValue = IPdr_ManCheckCombUnsat( pPdr );
1475 Pdr_ManStop( pPdr );
1476 pPdrPars->fVerbose = pWla->pPars->fPdrVerbose;
1477
1478 pWla->tPdr += Abc_Clock() - clk;
1479
1480 return RetValue;
1481}
void Aig_ManStop(Aig_Man_t *p)
Definition aigMan.c:187
Pdr_Man_t * Pdr_ManStart(Aig_Man_t *pAig, Pdr_Par_t *pPars, Vec_Int_t *vPrioInit)
Definition pdrMan.c:248
void Pdr_ManStop(Pdr_Man_t *p)
Definition pdrMan.c:318
struct Pdr_Man_t_ Pdr_Man_t
Definition pdrInt.h:95
typedefABC_NAMESPACE_HEADER_START struct Pdr_Par_t_ Pdr_Par_t
INCLUDES ///.
Definition pdr.h:40
void Ssw_ManSetDefaultParams(Ssw_Pars_t *p)
DECLARATIONS ///.
Definition sswCore.c:45
typedefABC_NAMESPACE_HEADER_START struct Ssw_Pars_t_ Ssw_Pars_t
INCLUDES ///.
Definition ssw.h:40
Aig_Man_t * Ssw_SignalCorrespondence(Aig_Man_t *pAig, Ssw_Pars_t *pPars)
Definition sswCore.c:436
abctime tPdr
Definition wlc.h:272
void * pPdrPars
Definition wlc.h:261
int fPdrVerbose
Definition wlc.h:202
int IPdr_ManCheckCombUnsat(Pdr_Man_t *p)
Definition pdrIncr.c:871
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Wla_ManCollectNodes()

Vec_Int_t * Wla_ManCollectNodes ( Wla_Man_t * pWla,
int fBlack )

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

Synopsis [Performs PDR with word-level abstraction.]

Description []

SideEffects []

SeeAlso []

Definition at line 1330 of file wlcAbs.c.

1331{
1332 Vec_Int_t * vNodes = NULL;
1333 int i, Entry;
1334
1335 assert( pWla->vSignals );
1336
1337 vNodes = Vec_IntAlloc( 100 );
1338 Vec_IntForEachEntry( pWla->vSignals, Entry, i )
1339 {
1340 if ( !fBlack && Vec_BitEntry(pWla->vUnmark, Entry) )
1341 Vec_IntPush( vNodes, Entry );
1342
1343 if ( fBlack && !Vec_BitEntry(pWla->vUnmark, Entry) )
1344 Vec_IntPush( vNodes, Entry );
1345 }
1346
1347 return vNodes;
1348}
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition bblif.c:37
Vec_Int_t * vSignals
Definition wlc.h:257
Vec_Bit_t * vUnmark
Definition wlc.h:260
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
Definition vecInt.h:54
Here is the caller graph for this function:

◆ Wla_ManConcurrentBmc3()

void Wla_ManConcurrentBmc3 ( Wla_Man_t * pWla,
Aig_Man_t * pAig,
Abc_Cex_t ** ppCex )
extern

Definition at line 52 of file wlcPth.c.

52{}
Here is the caller graph for this function:

◆ Wla_ManCreateAbs()

Wlc_Ntk_t * Wla_ManCreateAbs ( Wla_Man_t * pWla)

Definition at line 1379 of file wlcAbs.c.

1380{
1381 Wlc_Ntk_t * pAbs;
1382
1383 // get abstracted GIA and the set of pseudo-PIs (vBlacks)
1384 if ( pWla->vBlacks == NULL )
1385 {
1386 pWla->vBlacks = Wlc_NtkGetBlacks( pWla->p, pWla->pPars );
1387 pWla->vSignals = Vec_IntDup( pWla->vBlacks );
1388 }
1389 else
1390 {
1391 Wlc_NtkUpdateBlacks( pWla->p, pWla->pPars, &pWla->vBlacks, pWla->vUnmark, pWla->vSignals );
1392 }
1393 pAbs = Wlc_NtkAbs2( pWla->p, pWla->vBlacks, NULL );
1394
1395 return pAbs;
1396}
struct Wlc_Ntk_t_ Wlc_Ntk_t
Definition wlc.h:135
Here is the caller graph for this function:

◆ Wla_ManJoinThread()

void Wla_ManJoinThread ( Wla_Man_t * pWla,
int RunId )
extern

Definition at line 51 of file wlcPth.c.

51{}
Here is the caller graph for this function:

◆ Wla_ManRefine()

void Wla_ManRefine ( Wla_Man_t * pWla)

Definition at line 1570 of file wlcAbs.c.

1571{
1572 abctime clk;
1573 int nNodes;
1574 Vec_Int_t * vRefine = NULL;
1575
1576 if ( pWla->fNewAbs )
1577 {
1578 if ( pWla->pCex )
1579 Abc_CexFree( pWla->pCex );
1580 pWla->pCex = NULL;
1581 Gia_ManStop( pWla->pGia ); pWla->pGia = NULL;
1582 return;
1583 }
1584
1585 // perform refinement
1586 if ( pWla->pPars->fHybrid || !pWla->pPars->fProofRefine )
1587 {
1588 clk = Abc_Clock();
1589 vRefine = Wlc_NtkAbsRefinement( pWla->p, pWla->pGia, pWla->pCex, pWla->vBlacks );
1590 pWla->tCbr += Abc_Clock() - clk;
1591 }
1592 else // proof-based only
1593 {
1594 vRefine = Vec_IntDup( pWla->vBlacks );
1595 }
1596 if ( pWla->pPars->fProofRefine )
1597 {
1598 clk = Abc_Clock();
1599 Wlc_NtkProofRefine( pWla->p, pWla->pPars, pWla->pCex, pWla->vBlacks, &vRefine );
1600 pWla->tPbr += Abc_Clock() - clk;
1601 }
1602
1603 if ( pWla->vClauses && pWla->pPars->fVerbose )
1604 {
1605 int i;
1606 Vec_Ptr_t * vVec;
1607 Vec_VecForEachLevel( pWla->vClauses, vVec, i )
1608 pWla->nTotalCla += Vec_PtrSize( vVec );
1609 }
1610
1611 // update the set of objects to be un-abstracted
1612 clk = Abc_Clock();
1613 if ( pWla->pPars->fMFFC )
1614 {
1615 nNodes = Wlc_NtkRemoveFromAbstraction( pWla->p, vRefine, pWla->vUnmark );
1616 if ( pWla->pPars->fVerbose )
1617 printf( "Refinement of CEX in frame %d came up with %d un-abstacted PPIs, whose MFFCs include %d objects.\n", pWla->pCex->iFrame, Vec_IntSize(vRefine), nNodes );
1618 }
1619 else
1620 {
1621 nNodes = Wlc_NtkUnmarkRefinement( pWla->p, vRefine, pWla->vUnmark );
1622 if ( pWla->pPars->fVerbose )
1623 printf( "Refinement of CEX in frame %d came up with %d un-abstacted PPIs.\n", pWla->pCex->iFrame, Vec_IntSize(vRefine) );
1624
1625 }
1626 /*
1627 if ( pWla->pPars->fVerbose )
1628 {
1629 Wlc_NtkAbsAnalyzeRefine( pWla->p, pWla->vBlacks, pWla->vUnmark, &pWla->nDisj, &pWla->nNDisj );
1630 Abc_Print( 1, "Refine analysis (total): %d disjoint PPIs and %d non-disjoint PPIs\n", pWla->nDisj, pWla->nNDisj );
1631 }
1632 */
1633 pWla->tCbr += Abc_Clock() - clk;
1634
1635 // Experimental
1636 /*
1637 if ( pWla->pCex->iFrame > 0 )
1638 {
1639 Vec_Int_t * vWhites = Wla_ManCollectWhites( pWla );
1640 Vec_Bit_t * vCore = Wlc_NtkProofReduce( pWla->p, pWla->pPars, pWla->pCex->iFrame, vWhites );
1641 Vec_IntFree( vWhites );
1642 Vec_BitFree( vCore );
1643 }
1644 */
1645
1646 pWla->iCexFrame = pWla->pCex->iFrame;
1647
1648 Vec_IntFree( vRefine );
1649 Gia_ManStop( pWla->pGia ); pWla->pGia = NULL;
1650 Abc_CexFree( pWla->pCex ); pWla->pCex = NULL;
1651}
abctime tCbr
Definition wlc.h:273
int iCexFrame
Definition wlc.h:264
abctime tPbr
Definition wlc.h:274
Vec_Vec_t * vClauses
Definition wlc.h:255
int fNewAbs
Definition wlc.h:265
Abc_Cex_t * pCex
Definition wlc.h:258
int nTotalCla
Definition wlc.h:268
int fHybrid
Definition wlc.h:194
int fProofRefine
Definition wlc.h:193
int fMFFC
Definition wlc.h:190
void Abc_CexFree(Abc_Cex_t *p)
Definition utilCex.c:382
#define Vec_VecForEachLevel(vGlob, vVec, i)
MACRO DEFINITIONS ///.
Definition vecVec.h:55
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Wla_ManShrinkAbs()

int Wla_ManShrinkAbs ( Wla_Man_t * pWla,
int nFrames,
int RunId )

Definition at line 1350 of file wlcAbs.c.

1351{
1352 int i, Entry;
1353 int RetValue = 0;
1354
1355 Vec_Int_t * vWhites = Wla_ManCollectNodes( pWla, 0 );
1356 Vec_Int_t * vBlacks = Wla_ManCollectNodes( pWla, 1 );
1357 Vec_Bit_t * vCoreMarks = Wlc_NtkProofReduce( pWla->p, pWla->pPars, nFrames, vWhites, vBlacks, RunId );
1358
1359 if ( vCoreMarks == NULL )
1360 {
1361 Vec_IntFree( vWhites );
1362 Vec_IntFree( vBlacks );
1363 return -1;
1364 }
1365
1366 RetValue = Vec_IntSize( vWhites ) != Vec_BitCount( vCoreMarks );
1367
1368 Vec_IntForEachEntry( vWhites, Entry, i )
1369 if ( !Vec_BitEntry( vCoreMarks, i ) )
1370 Vec_BitWriteEntry( pWla->vUnmark, Entry, 0 );
1371
1372 Vec_IntFree( vWhites );
1373 Vec_IntFree( vBlacks );
1374 Vec_BitFree( vCoreMarks );
1375
1376 return RetValue;
1377}
typedefABC_NAMESPACE_HEADER_START struct Vec_Bit_t_ Vec_Bit_t
INCLUDES ///.
Definition vecBit.h:42
Vec_Int_t * Wla_ManCollectNodes(Wla_Man_t *pWla, int fBlack)
Definition wlcAbs.c:1330
Here is the call graph for this function:

◆ Wla_ManSolve()

int Wla_ManSolve ( Wla_Man_t * pWla,
Wlc_Par_t * pPars )

Definition at line 1698 of file wlcAbs.c.

1699{
1700 abctime clk = Abc_Clock();
1701 abctime tTotal;
1702 Wlc_Ntk_t * pAbs = NULL;
1703 Aig_Man_t * pAig = NULL;
1704
1705 int RetValue = -1;
1706
1707 // perform refinement iterations
1708 for ( pWla->nIters = 1; pWla->nIters < pPars->nIterMax; ++pWla->nIters )
1709 {
1710 if ( pPars->fVerbose )
1711 printf( "\nIteration %d:\n", pWla->nIters );
1712
1713 pAbs = Wla_ManCreateAbs( pWla );
1714
1715 pAig = Wla_ManBitBlast( pWla, pAbs );
1716 Wlc_NtkFree( pAbs );
1717
1718 RetValue = Wla_ManSolveInt( pWla, pAig );
1719 Aig_ManStop( pAig );
1720
1721 if ( RetValue != -1 || (pPars->pFuncStop && pPars->pFuncStop( pPars->RunId)) )
1722 break;
1723
1724 Wla_ManRefine( pWla );
1725 }
1726
1727 // report the result
1728 if ( pPars->fVerbose )
1729 printf( "\n" );
1730 printf( "Abstraction " );
1731 if ( RetValue == 0 )
1732 printf( "resulted in a real CEX" );
1733 else if ( RetValue == 1 )
1734 printf( "is successfully proved" );
1735 else
1736 printf( "timed out" );
1737 printf( " after %d iterations. ", pWla->nIters );
1738 tTotal = Abc_Clock() - clk;
1739 Abc_PrintTime( 1, "Time", tTotal );
1740
1741 if ( pPars->fVerbose )
1742 Abc_Print( 1, "PDRA reused %d clauses.\n", pWla->nTotalCla );
1743 if ( pPars->fVerbose )
1744 {
1745 ABC_PRTP( "PDR ", pWla->tPdr, tTotal );
1746 ABC_PRTP( "CEX Refine ", pWla->tCbr, tTotal );
1747 ABC_PRTP( "Proof Refine ", pWla->tPbr, tTotal );
1748 ABC_PRTP( "Misc. ", tTotal - pWla->tPdr - pWla->tCbr - pWla->tPbr, tTotal );
1749 ABC_PRTP( "Total ", tTotal, tTotal );
1750 }
1751
1752 return RetValue;
1753}
#define ABC_PRTP(a, t, T)
Definition abc_global.h:258
int nIters
Definition wlc.h:267
int(* pFuncStop)(int)
Definition wlc.h:204
int nIterMax
Definition wlc.h:185
int RunId
Definition wlc.h:203
Aig_Man_t * Wla_ManBitBlast(Wla_Man_t *pWla, Wlc_Ntk_t *pAbs)
Definition wlcAbs.c:1398
void Wla_ManRefine(Wla_Man_t *pWla)
Definition wlcAbs.c:1570
int Wla_ManSolveInt(Wla_Man_t *pWla, Aig_Man_t *pAig)
Definition wlcAbs.c:1483
Wlc_Ntk_t * Wla_ManCreateAbs(Wla_Man_t *pWla)
Definition wlcAbs.c:1379
void Wlc_NtkFree(Wlc_Ntk_t *p)
Definition wlcNtk.c:253
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Wla_ManSolveInt()

int Wla_ManSolveInt ( Wla_Man_t * pWla,
Aig_Man_t * pAig )

Definition at line 1483 of file wlcAbs.c.

1484{
1485 abctime clk;
1486 Pdr_Man_t * pPdr;
1487 Pdr_Par_t * pPdrPars = (Pdr_Par_t *)pWla->pPdrPars;
1488 Abc_Cex_t * pBmcCex = NULL;
1489 Abc_Cex_t * pCexReal = NULL;
1490 int RetValue = -1;
1491 int RunId = Wla_GetGlobalRunId();
1492
1493 if ( pWla->vClauses && pWla->pPars->fCheckCombUnsat )
1494 {
1495 clk = Abc_Clock();
1496
1497 RetValue = Wla_ManCheckCombUnsat( pWla, pAig );
1498 if ( RetValue == 1 )
1499 {
1500 if ( pWla->pPars->fVerbose )
1501 Abc_PrintTime( 1, "ABS becomes combinationally UNSAT. Time", Abc_Clock() - clk );
1502 return 1;
1503 }
1504
1505 if ( pWla->pPars->fVerbose )
1506 Abc_PrintTime( 1, "Check comb. unsat failed. Time", Abc_Clock() - clk );
1507 }
1508
1509 if ( pWla->pPars->fUseBmc3 )
1510 {
1511 pPdrPars->RunId = RunId;
1512 pPdrPars->pFuncStop = Wla_CallBackToStop;
1513
1514 Wla_ManConcurrentBmc3( pWla, Aig_ManDupSimple(pAig), &pBmcCex );
1515 }
1516
1517 clk = Abc_Clock();
1518 pPdr = Pdr_ManStart( pAig, pPdrPars, NULL );
1519 if ( pWla->vClauses ) {
1520 assert( Vec_VecSize( pWla->vClauses) >= 2 );
1521
1522 if ( pWla->fNewAbs )
1523 IPdr_ManRebuildClauses( pPdr, pWla->pPars->fShrinkScratch ? NULL : pWla->vClauses );
1524 else
1525 IPdr_ManRestoreClauses( pPdr, pWla->vClauses, NULL );
1526
1527 pWla->fNewAbs = 0;
1528 }
1529
1530 RetValue = IPdr_ManSolveInt( pPdr, pWla->pPars->fCheckClauses, pWla->pPars->fPushClauses );
1531 pPdr->tTotal += Abc_Clock() - clk;
1532 pWla->tPdr += pPdr->tTotal;
1533 if ( pWla->pPars->fLoadTrace)
1534 pWla->vClauses = IPdr_ManSaveClauses( pPdr, 0 );
1535 Pdr_ManStop( pPdr );
1536
1537
1538 if ( pWla->pPars->fUseBmc3 )
1539 Wla_ManJoinThread( pWla, RunId );
1540
1541 if ( pBmcCex )
1542 {
1543 pWla->pCex = pBmcCex ;
1544 }
1545 else
1546 {
1547 pWla->pCex = pAig->pSeqModel;
1548 pAig->pSeqModel = NULL;
1549 }
1550
1551 // consider outcomes
1552 if ( pWla->pCex == NULL )
1553 {
1554 assert( RetValue ); // proved or undecided
1555 return RetValue;
1556 }
1557
1558 // verify CEX
1559 pCexReal = Wlc_NtkCexIsReal( pWla->p, pWla->pCex );
1560 if ( pCexReal )
1561 {
1562 Abc_CexFree( pWla->pCex );
1563 pWla->pCex = pCexReal;
1564 return 0;
1565 }
1566
1567 return -1;
1568}
Aig_Man_t * Aig_ManDupSimple(Aig_Man_t *p)
DECLARATIONS ///.
Definition aigDup.c:46
int fCheckCombUnsat
Definition wlc.h:195
int fShrinkScratch
Definition wlc.h:200
int fUseBmc3
Definition wlc.h:198
int fPushClauses
Definition wlc.h:189
int fCheckClauses
Definition wlc.h:188
int fLoadTrace
Definition wlc.h:192
void Wla_ManJoinThread(Wla_Man_t *pWla, int RunId)
Definition wlcPth.c:51
int IPdr_ManSolveInt(Pdr_Man_t *p, int fCheckClauses, int fPushClauses)
Definition pdrIncr.c:373
int IPdr_ManRebuildClauses(Pdr_Man_t *p, Vec_Vec_t *vClauses)
Definition pdrIncr.c:256
int Wla_CallBackToStop(int RunId)
Definition wlcPth.c:46
int Wla_GetGlobalRunId()
Definition wlcPth.c:47
int IPdr_ManRestoreClauses(Pdr_Man_t *p, Vec_Vec_t *vClauses, Vec_Int_t *vMap)
Definition pdrIncr.c:338
void Wla_ManConcurrentBmc3(Wla_Man_t *pWla, Aig_Man_t *pAig, Abc_Cex_t **ppCex)
Definition wlcPth.c:52
int Wla_ManCheckCombUnsat(Wla_Man_t *pWla, Aig_Man_t *pAig)
Definition wlcAbs.c:1434
ABC_NAMESPACE_IMPL_START Vec_Vec_t * IPdr_ManSaveClauses(Pdr_Man_t *p, int fDropLast)
DECLARATIONS ///.
Definition pdrIncr.c:182
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Wla_ManStart()

Wla_Man_t * Wla_ManStart ( Wlc_Ntk_t * pNtk,
Wlc_Par_t * pPars )

Definition at line 1653 of file wlcAbs.c.

1654{
1655 Wla_Man_t * p = ABC_CALLOC( Wla_Man_t, 1 );
1656 Pdr_Par_t * pPdrPars;
1657 p->p = pNtk;
1658 p->pPars = pPars;
1659 p->vUnmark = Vec_BitStart( Wlc_NtkObjNumMax(pNtk) );
1660
1661 pPdrPars = ABC_CALLOC( Pdr_Par_t, 1 );
1662 Pdr_ManSetDefaultParams( pPdrPars );
1663 pPdrPars->fVerbose = pPars->fPdrVerbose;
1664 pPdrPars->fVeryVerbose = 0;
1665 pPdrPars->pFuncStop = pPars->pFuncStop;
1666 pPdrPars->RunId = pPars->RunId;
1667 if ( pPars->fPdra )
1668 {
1669 pPdrPars->fUseAbs = 1; // use 'pdr -t' (on-the-fly abstraction)
1670 pPdrPars->fCtgs = 1; // use 'pdr -nc' (improved generalization)
1671 pPdrPars->fSkipDown = 0; // use 'pdr -nc' (improved generalization)
1672 pPdrPars->nRestLimit = 500; // reset queue or proof-obligations when it gets larger than this
1673 }
1674 p->pPdrPars = (void *)pPdrPars;
1675
1676 p->iCexFrame = 0;
1677 p->fNewAbs = 0;
1678
1679 p->nIters = 1;
1680 p->nTotalCla = 0;
1681 p->nDisj = 0;
1682 p->nNDisj = 0;
1683
1684 return p;
1685}
#define ABC_CALLOC(type, num)
Definition abc_global.h:265
void Pdr_ManSetDefaultParams(Pdr_Par_t *pPars)
MACRO DEFINITIONS ///.
Definition pdrCore.c:50
int fPdra
Definition wlc.h:191
struct Wla_Man_t_ Wla_Man_t
Definition wlc.h:250
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Wla_ManStop()

void Wla_ManStop ( Wla_Man_t * p)

Definition at line 1687 of file wlcAbs.c.

1688{
1689 if ( p->vBlacks ) Vec_IntFree( p->vBlacks );
1690 if ( p->vSignals ) Vec_IntFree( p->vSignals );
1691 if ( p->pGia ) Gia_ManStop( p->pGia );
1692 if ( p->pCex ) Abc_CexFree( p->pCex );
1693 Vec_BitFree( p->vUnmark );
1694 ABC_FREE( p->pPdrPars );
1695 ABC_FREE( p );
1696}
#define ABC_FREE(obj)
Definition abc_global.h:267
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Wlc_NtkAbsAnalyzeRefine()

void Wlc_NtkAbsAnalyzeRefine ( Wlc_Ntk_t * p,
Vec_Int_t * vBlacks,
Vec_Bit_t * vUnmark,
int * nDisj,
int * nNDisj )

Definition at line 129 of file wlcAbs.c.

130{
131 Vec_Bit_t * vCurCis, * vCandCis;
132 Vec_Int_t * vSuppList;
133 Vec_Int_t * vDeltaB;
134 Vec_Int_t * vSuppRefs;
135 int i, Entry;
136 Wlc_Obj_t * pObj;
137
138 vCurCis = Vec_BitStart( Wlc_NtkObjNumMax( p ) );
139 vCandCis = Vec_BitStart( Wlc_NtkObjNumMax( p ) );
140 vDeltaB = Vec_IntAlloc( Vec_IntSize(vBlacks) );
141 vSuppList = Vec_IntAlloc( Wlc_NtkCiNum(p) + Vec_IntSize(vBlacks) );
142 vSuppRefs = Vec_IntAlloc( Wlc_NtkObjNumMax( p ) );
143
144
145 Vec_IntFill( vSuppRefs, Wlc_NtkObjNumMax( p ), 0 );
146
147 Wlc_NtkForEachCi( p, pObj, i )
148 {
149 Vec_BitWriteEntry( vCurCis, Wlc_ObjId(p, pObj), 1 ) ;
150 Vec_BitWriteEntry( vCandCis, Wlc_ObjId(p, pObj), 1 ) ;
151 }
152
153 Vec_IntForEachEntry( vBlacks, Entry, i )
154 {
155 Vec_BitWriteEntry( vCurCis, Entry, 1 );
156 if ( !Vec_BitEntry( vUnmark, Entry ) )
157 Vec_BitWriteEntry( vCandCis, Entry, 1 );
158 else
159 Vec_IntPush( vDeltaB, Entry );
160 }
161 assert( Vec_IntSize( vDeltaB ) );
162
163 Wlc_NtkForEachCo( p, pObj, i )
164 Wlc_NtkAbsGetSupp( p, pObj, vCurCis, vSuppRefs, NULL );
165
166 /*
167 Abc_Print( 1, "SuppCurrentAbs =" );
168 Wlc_NtkForEachObj( p, pObj, i )
169 if ( Vec_IntEntry(vSuppRefs, i) > 0 )
170 Abc_Print( 1, " %d", i );
171 Abc_Print( 1, "\n" );
172 */
173
174 Vec_IntForEachEntry( vDeltaB, Entry, i )
175 Wlc_NtkAbsGetSupp( p, Wlc_NtkObj(p, Entry), vCandCis, vSuppRefs, NULL );
176
177 Vec_IntForEachEntry( vDeltaB, Entry, i )
178 {
179 int iSupp, ii;
180 int fDisjoint = 1;
181
182 Vec_IntClear( vSuppList );
183 Wlc_NtkAbsGetSupp( p, Wlc_NtkObj(p, Entry), vCandCis, NULL, vSuppList );
184
185 //Abc_Print( 1, "SuppCandAbs =" );
186 Vec_IntForEachEntry( vSuppList, iSupp, ii )
187 {
188 //Abc_Print( 1, " %d(%d)", iSupp, Vec_IntEntry( vSuppRefs, iSupp ) );
189 if ( Vec_IntEntry( vSuppRefs, iSupp ) >= 2 )
190 {
191 fDisjoint = 0;
192 break;
193 }
194 }
195 //Abc_Print( 1, "\n" );
196
197 if ( fDisjoint )
198 {
199 //Abc_Print( 1, "PPI[%d] is disjoint.\n", Entry );
200 ++(*nDisj);
201 }
202 else
203 {
204 //Abc_Print( 1, "PPI[%d] is non-disjoint.\n", Entry );
205 ++(*nNDisj);
206 }
207 }
208
209 Vec_BitFree( vCurCis );
210 Vec_BitFree( vCandCis );
211 Vec_IntFree( vDeltaB );
212 Vec_IntFree( vSuppList );
213 Vec_IntFree( vSuppRefs );
214}
void Wlc_NtkAbsGetSupp(Wlc_Ntk_t *p, Wlc_Obj_t *pObj, Vec_Bit_t *vCiMarks, Vec_Int_t *vSuppRefs, Vec_Int_t *vSuppList)
Definition wlcAbs.c:110
#define Wlc_NtkForEachCi(p, pCi, i)
Definition wlc.h:366
struct Wlc_Obj_t_ Wlc_Obj_t
BASIC TYPES ///.
Definition wlc.h:118
#define Wlc_NtkForEachCo(p, pCo, i)
Definition wlc.h:368
Here is the call graph for this function:

◆ Wlc_NtkAbsCore()

int Wlc_NtkAbsCore ( Wlc_Ntk_t * p,
Wlc_Par_t * pPars )

FUNCTION DECLARATIONS ///.

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

Synopsis [Performs abstraction.]

Description [Derives initial abstraction based on user-specified parameter values, which tell what is the smallest bit-width of a primitive that is being abstracted away. Currently only add/sub, mul/div, mux, and flop are supported with individual parameters. The second step is to refine the initial abstraction until the point when the property is proved.]

SideEffects []

SeeAlso []

Definition at line 1786 of file wlcAbs.c.

1787{
1788 abctime clk = Abc_Clock();
1789 Vec_Int_t * vBlacks = NULL;
1790 int nIters, nNodes, nDcFlops, RetValue = -1;
1791 // start the bitmap to mark objects that cannot be abstracted because of refinement
1792 // currently, this bitmap is empty because abstraction begins without refinement
1793 Vec_Bit_t * vUnmark = Vec_BitStart( Wlc_NtkObjNumMax(p) );
1794 // set up parameters to run PDR
1795 Pdr_Par_t PdrPars, * pPdrPars = &PdrPars;
1796 Pdr_ManSetDefaultParams( pPdrPars );
1797 //pPdrPars->fUseAbs = 1; // use 'pdr -t' (on-the-fly abstraction)
1798 //pPdrPars->fCtgs = 1; // use 'pdr -nc' (improved generalization)
1799 //pPdrPars->fSkipDown = 0; // use 'pdr -nc' (improved generalization)
1800 //pPdrPars->nRestLimit = 500; // reset queue or proof-obligations when it gets larger than this
1801 pPdrPars->fVerbose = pPars->fPdrVerbose;
1802 pPdrPars->fVeryVerbose = 0;
1803 // perform refinement iterations
1804 for ( nIters = 1; nIters < pPars->nIterMax; nIters++ )
1805 {
1806 Aig_Man_t * pAig;
1807 Abc_Cex_t * pCex;
1808 Vec_Int_t * vPisNew, * vRefine;
1809 Gia_Man_t * pGia, * pTemp;
1810 Wlc_Ntk_t * pAbs;
1811
1812 if ( pPars->fVerbose )
1813 printf( "\nIteration %d:\n", nIters );
1814
1815 // get abstracted GIA and the set of pseudo-PIs (vPisNew)
1816 if ( pPars->fAbs2 )
1817 {
1818 if ( vBlacks == NULL )
1819 vBlacks = Wlc_NtkGetBlacks( p, pPars );
1820 else
1821 Wlc_NtkUpdateBlacks( p, pPars, &vBlacks, vUnmark, NULL );
1822 pAbs = Wlc_NtkAbs2( p, vBlacks, NULL );
1823 vPisNew = Vec_IntDup( vBlacks );
1824 }
1825 else
1826 {
1827 if ( nIters == 1 && pPars->nLimit < ABC_INFINITY )
1828 Wlc_NtkSetUnmark( p, pPars, vUnmark );
1829
1830 pAbs = Wlc_NtkAbs( p, pPars, vUnmark, &vPisNew, NULL, pPars->fVerbose );
1831 }
1832 pGia = Wlc_NtkBitBlast( pAbs, NULL );
1833
1834 // if the abstraction has flops with DC-init state,
1835 // new PIs were introduced by bit-blasting at the end of the PI list
1836 // here we move these variables to be *before* PPIs, because
1837 // PPIs are supposed to be at the end of the PI list for refinement
1838 nDcFlops = Wlc_NtkDcFlopNum(pAbs);
1839 if ( nDcFlops > 0 ) // DC-init flops are present
1840 {
1841 pGia = Gia_ManPermuteInputs( pTemp = pGia, Wlc_NtkCountObjBits(p, vPisNew), nDcFlops );
1842 Gia_ManStop( pTemp );
1843 }
1844 // if the word-level outputs have to be XORs, this is a place to do it
1845 if ( pPars->fXorOutput )
1846 {
1847 pGia = Gia_ManTransformMiter2( pTemp = pGia );
1848 Gia_ManStop( pTemp );
1849 }
1850 if ( pPars->fVerbose )
1851 {
1852 printf( "Derived abstraction with %d objects and %d PPIs. Bit-blasted AIG stats are:\n", Wlc_NtkObjNum(pAbs), Vec_IntSize(vPisNew) );
1853 Gia_ManPrintStats( pGia, NULL );
1854 }
1855 Wlc_NtkFree( pAbs );
1856
1857 // try to prove abstracted GIA by converting it to AIG and calling PDR
1858 pAig = Gia_ManToAigSimple( pGia );
1859 RetValue = Pdr_ManSolve( pAig, pPdrPars );
1860 pCex = pAig->pSeqModel; pAig->pSeqModel = NULL;
1861 Aig_ManStop( pAig );
1862
1863 // consider outcomes
1864 if ( pCex == NULL )
1865 {
1866 assert( RetValue ); // proved or undecided
1867 Gia_ManStop( pGia );
1868 Vec_IntFree( vPisNew );
1869 break;
1870 }
1871
1872 // perform refinement
1873 vRefine = Wlc_NtkAbsRefinement( p, pGia, pCex, vPisNew );
1874 Gia_ManStop( pGia );
1875 Vec_IntFree( vPisNew );
1876 if ( vRefine == NULL ) // real CEX
1877 {
1878 Abc_CexFree( pCex ); // return CEX in the future
1879 break;
1880 }
1881
1882 // update the set of objects to be un-abstracted
1883 nNodes = Wlc_NtkRemoveFromAbstraction( p, vRefine, vUnmark );
1884 if ( pPars->fVerbose )
1885 printf( "Refinement of CEX in frame %d came up with %d un-abstacted PPIs, whose MFFCs include %d objects.\n", pCex->iFrame, Vec_IntSize(vRefine), nNodes );
1886 Vec_IntFree( vRefine );
1887 Abc_CexFree( pCex );
1888 }
1889 Vec_IntFreeP( &vBlacks );
1890 Vec_BitFreeP( &vUnmark );
1891 // report the result
1892 if ( pPars->fVerbose )
1893 printf( "\n" );
1894 printf( "Abstraction " );
1895 if ( RetValue == 0 )
1896 printf( "resulted in a real CEX" );
1897 else if ( RetValue == 1 )
1898 printf( "is successfully proved" );
1899 else
1900 printf( "timed out" );
1901 printf( " after %d iterations. ", nIters );
1902 Abc_PrintTime( 1, "Time", Abc_Clock() - clk );
1903 return RetValue;
1904}
#define ABC_INFINITY
MACRO DEFINITIONS ///.
Definition abc_global.h:250
int Pdr_ManSolve(Aig_Man_t *p, Pdr_Par_t *pPars)
Definition pdrCore.c:1765
int fAbs2
Definition wlc.h:196
int nLimit
Definition wlc.h:186
Here is the call graph for this function:

◆ Wlc_NtkAbsGetSupp()

void Wlc_NtkAbsGetSupp ( Wlc_Ntk_t * p,
Wlc_Obj_t * pObj,
Vec_Bit_t * vCiMarks,
Vec_Int_t * vSuppRefs,
Vec_Int_t * vSuppList )

Definition at line 110 of file wlcAbs.c.

111{
112 assert( vSuppRefs || vSuppList );
114
115 Wlc_NtkAbsGetSupp_rec( p, pObj, vCiMarks, vSuppRefs, vSuppList );
116}
void Wlc_NtkAbsGetSupp_rec(Wlc_Ntk_t *p, Wlc_Obj_t *pObj, Vec_Bit_t *vCiMarks, Vec_Int_t *vSuppRefs, Vec_Int_t *vSuppList)
Definition wlcAbs.c:91
void Wlc_NtkCleanMarks(Wlc_Ntk_t *p)
Definition wlcNtk.c:1135
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Wlc_NtkAbsGetSupp_rec()

void Wlc_NtkAbsGetSupp_rec ( Wlc_Ntk_t * p,
Wlc_Obj_t * pObj,
Vec_Bit_t * vCiMarks,
Vec_Int_t * vSuppRefs,
Vec_Int_t * vSuppList )

Definition at line 91 of file wlcAbs.c.

92{
93 int i, iFanin, iObj;
94 if ( pObj->Mark ) // visited
95 return;
96 pObj->Mark = 1;
97 iObj = Wlc_ObjId( p, pObj );
98 if ( Vec_BitEntry( vCiMarks, iObj ) )
99 {
100 if ( vSuppRefs )
101 Vec_IntAddToEntry( vSuppRefs, iObj, 1 );
102 if ( vSuppList )
103 Vec_IntPush( vSuppList, iObj );
104 return;
105 }
106 Wlc_ObjForEachFanin( pObj, iFanin, i )
107 Wlc_NtkAbsGetSupp_rec( p, Wlc_NtkObj(p, iFanin), vCiMarks, vSuppRefs, vSuppList );
108}
unsigned Mark
Definition wlc.h:123
#define Wlc_ObjForEachFanin(pObj, iFanin, i)
Definition wlc.h:375
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Wlc_NtkFlopsRemap()

Vec_Int_t * Wlc_NtkFlopsRemap ( Wlc_Ntk_t * p,
Vec_Int_t * vFfOld,
Vec_Int_t * vFfNew )

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

Synopsis [Computes the map for remapping flop IDs used in the clauses.]

Description [Takes the original network (Wlc_Ntk_t) and the array of word-level flops used in the old abstraction (vFfOld) and those used in the new abstraction (vFfNew). Returns the integer map, which remaps every binary flop found in the old abstraction into a binary flop found in the new abstraction.]

SideEffects []

SeeAlso []

Definition at line 1284 of file wlcAbs.c.

1285{
1286 Vec_Int_t * vMap = Vec_IntAlloc( 1000 ); // the resulting map
1287 Vec_Int_t * vMapFfNew2Bit1 = Vec_IntAlloc( 1000 ); // first binary bit of each new word-level flop
1288 int i, b, iFfOld, iFfNew, iBit1New, nBits = 0;
1289 // map object IDs of old flops into their flop indexes
1290 Vec_Int_t * vMapFfObj2FfId = Vec_IntStartFull( Wlc_NtkObjNumMax(p) );
1291 Vec_IntForEachEntry( vFfNew, iFfNew, i )
1292 Vec_IntWriteEntry( vMapFfObj2FfId, iFfNew, i );
1293 // map each new flop index into its first bit
1294 Vec_IntForEachEntry( vFfNew, iFfNew, i )
1295 {
1296 Wlc_Obj_t * pObj = Wlc_NtkObj( p, iFfNew );
1297 int nRange = Wlc_ObjRange( pObj );
1298 Vec_IntPush( vMapFfNew2Bit1, nBits );
1299 nBits += nRange;
1300 }
1301 assert( Vec_IntSize(vMapFfNew2Bit1) == Vec_IntSize(vFfNew) );
1302 // remap old binary flops into new binary flops
1303 Vec_IntForEachEntry( vFfOld, iFfOld, i )
1304 {
1305 Wlc_Obj_t * pObj = Wlc_NtkObj( p, iFfOld );
1306 int nRange = Wlc_ObjRange( pObj );
1307 iFfNew = Vec_IntEntry( vMapFfObj2FfId, iFfOld );
1308 assert( iFfNew >= 0 ); // every old flop should be present in the new abstraction
1309 // find the first bit of this new flop
1310 iBit1New = Vec_IntEntry( vMapFfNew2Bit1, iFfNew );
1311 for ( b = 0; b < nRange; b++ )
1312 Vec_IntPush( vMap, iBit1New + b );
1313 }
1314 Vec_IntFree( vMapFfNew2Bit1 );
1315 Vec_IntFree( vMapFfObj2FfId );
1316 return vMap;
1317}

◆ Wlc_NtkIntroduceChoices()

Wlc_Ntk_t * Wlc_NtkIntroduceChoices ( Wlc_Ntk_t * pNtk,
Vec_Int_t * vBlacks,
Vec_Int_t * vPPIs )

Definition at line 435 of file wlcAbs.c.

436{
437 //if ( vBlacks== NULL ) return NULL;
438 Vec_Int_t * vNodes = Vec_IntDup( vBlacks );
439 Wlc_Ntk_t * pNew;
440 Wlc_Obj_t * pObj;
441 int i, k, iObj, iFanin;
442 Vec_Int_t * vFanins = Vec_IntAlloc( 3 );
443 Vec_Int_t * vMapNode2Pi = Vec_IntStart( Wlc_NtkObjNumMax(pNtk) );
444 Vec_Int_t * vMapNode2Sel = Vec_IntStart( Wlc_NtkObjNumMax(pNtk) );
445 int nOrigObjNum = Wlc_NtkObjNumMax( pNtk );
446 Wlc_Ntk_t * p = Wlc_NtkDupDfsSimple( pNtk );
447 Vec_Bit_t * vPPIMark = NULL;
448
449 Wlc_NtkForEachObjVec( vNodes, pNtk, pObj, i )
450 {
451 // TODO : fix FOs here
452 Vec_IntWriteEntry(vNodes, i, Wlc_ObjCopy(pNtk, Wlc_ObjId(pNtk, pObj)));
453 }
454
455 if ( vPPIs )
456 {
457 vPPIMark = Vec_BitStart( Wlc_NtkObjNumMax(pNtk) );
458 Wlc_NtkForEachObjVec( vPPIs, pNtk, pObj, i )
459 {
460 Vec_IntWriteEntry(vPPIs, i, Wlc_ObjCopy(pNtk, Wlc_ObjId(pNtk, pObj)));
461 Vec_BitWriteEntry( vPPIMark, Vec_IntEntry(vPPIs, i), 1 );
462 }
463 }
464
465 // Vec_IntPrint(vNodes);
466 Wlc_NtkCleanCopy( p );
467
468 // mark nodes
469 Wlc_NtkForEachObjVec( vNodes, p, pObj, i )
470 {
471 iObj = Wlc_ObjId(p, pObj);
472 pObj->Mark = 1;
473 // add fresh PI with the same number of bits
474 Vec_IntWriteEntry( vMapNode2Pi, iObj, Wlc_ObjAlloc( p, WLC_OBJ_PI, Wlc_ObjIsSigned(pObj), Wlc_ObjRange(pObj) - 1, 0 ) );
475 }
476
477 if ( vPPIs )
478 {
479 Wlc_NtkForEachObjVec( vPPIs, p, pObj, i )
480 {
481 iObj = Wlc_ObjId(p, pObj);
482 pObj->Mark = 1;
483 // add fresh PI with the same number of bits
484 Vec_IntWriteEntry( vMapNode2Pi, iObj, Wlc_ObjAlloc( p, WLC_OBJ_PI, Wlc_ObjIsSigned(pObj), Wlc_ObjRange(pObj) - 1, 0 ) );
485 }
486 }
487
488 // add sel PI
489 Wlc_NtkForEachObjVec( vNodes, p, pObj, i )
490 {
491 iObj = Wlc_ObjId( p, pObj );
492 Vec_IntWriteEntry( vMapNode2Sel, iObj, Wlc_ObjAlloc( p, WLC_OBJ_PI, 0, 0, 0 ) );
493 }
494
495 // iterate through the nodes in the DFS order
496 Wlc_NtkForEachObj( p, pObj, i )
497 {
498 int isSigned, range;
499 if ( i == nOrigObjNum )
500 {
501 // cout << "break at " << i << endl;
502 break;
503 }
504
505 // update fanins
506 Wlc_ObjForEachFanin( pObj, iFanin, k )
507 Wlc_ObjFanins(pObj)[k] = Wlc_ObjCopy(p, iFanin);
508 // node to remain
509 iObj = i;
510
511 if ( pObj->Mark )
512 {
513 // clean
514 pObj->Mark = 0;
515
516 if ( vPPIMark && Vec_BitEntry(vPPIMark, i) )
517 iObj = Vec_IntEntry( vMapNode2Pi, i );
518 else
519 {
520 isSigned = Wlc_ObjIsSigned(pObj);
521 range = Wlc_ObjRange(pObj);
522 Vec_IntClear(vFanins);
523 Vec_IntPush(vFanins, Vec_IntEntry( vMapNode2Sel, i) );
524 Vec_IntPush(vFanins, Vec_IntEntry( vMapNode2Pi, i ) );
525 Vec_IntPush(vFanins, i);
526 iObj = Wlc_ObjCreate(p, WLC_OBJ_MUX, isSigned, range - 1, 0, vFanins);
527 }
528 }
529
530 Wlc_ObjSetCopy( p, i, iObj );
531 }
532
533 Wlc_NtkForEachCo( p, pObj, i )
534 {
535 iObj = Wlc_ObjId(p, pObj);
536 if (iObj != Wlc_ObjCopy(p, iObj))
537 {
538 if (pObj->fIsFi)
539 Wlc_NtkObj(p, Wlc_ObjCopy(p, iObj))->fIsFi = 1;
540 else
541 Wlc_NtkObj(p, Wlc_ObjCopy(p, iObj))->fIsPo = 1;
542
543 Vec_IntWriteEntry(&p->vCos, i, Wlc_ObjCopy(p, iObj));
544 }
545 }
546
547 // DumpWlcNtk(p);
548 pNew = Wlc_NtkDupDfsSimple( p );
549
550 if ( vPPIMark )
551 Vec_BitFree( vPPIMark );
552 Vec_IntFree( vFanins );
553 Vec_IntFree( vMapNode2Pi );
554 Vec_IntFree( vMapNode2Sel );
555 Vec_IntFree( vNodes );
556 Wlc_NtkFree( p );
557
558 return pNew;
559}
unsigned fIsFi
Definition wlc.h:126
int Wlc_ObjAlloc(Wlc_Ntk_t *p, int Type, int Signed, int End, int Beg)
Definition wlcNtk.c:199
#define Wlc_NtkForEachObjVec(vVec, p, pObj, i)
Definition wlc.h:360
#define Wlc_NtkForEachObj(p, pObj, i)
MACRO DEFINITIONS ///.
Definition wlc.h:356
int Wlc_ObjCreate(Wlc_Ntk_t *p, int Type, int Signed, int End, int Beg, Vec_Int_t *vFanins)
Definition wlcNtk.c:219
@ WLC_OBJ_MUX
Definition wlc.h:53
@ WLC_OBJ_PI
Definition wlc.h:46
Wlc_Ntk_t * Wlc_NtkDupDfsSimple(Wlc_Ntk_t *p)
Definition wlcNtk.c:957
Here is the call graph for this function:

◆ Wlc_NtkNumPiBits()

int Wlc_NtkNumPiBits ( Wlc_Ntk_t * pNtk)

Definition at line 118 of file wlcAbs.c.

119{
120 int num = 0;
121 int i;
122 Wlc_Obj_t * pObj;
123 Wlc_NtkForEachPi(pNtk, pObj, i) {
124 num += Wlc_ObjRange(pObj);
125 }
126 return num;
127}
#define Wlc_NtkForEachPi(p, pPi, i)
Definition wlc.h:362

◆ Wlc_NtkPdrAbs()

int Wlc_NtkPdrAbs ( Wlc_Ntk_t * p,
Wlc_Par_t * pPars )

Definition at line 1755 of file wlcAbs.c.

1756{
1757 Wla_Man_t * pWla = NULL;
1758
1759 int RetValue = -1;
1760
1761 pWla = Wla_ManStart( p, pPars );
1762
1763 RetValue = Wla_ManSolve( pWla, pPars );
1764
1765 Wla_ManStop( pWla );
1766
1767 return RetValue;
1768}
void Wla_ManStop(Wla_Man_t *p)
Definition wlcAbs.c:1687
Wla_Man_t * Wla_ManStart(Wlc_Ntk_t *pNtk, Wlc_Par_t *pPars)
Definition wlcAbs.c:1653
int Wla_ManSolve(Wla_Man_t *pWla, Wlc_Par_t *pPars)
Definition wlcAbs.c:1698
Here is the call graph for this function:

◆ Wlc_NtkPrintNtk()

void Wlc_NtkPrintNtk ( Wlc_Ntk_t * p)

FUNCTION DEFINITIONS ///.

Definition at line 62 of file wlcAbs.c.

63{
64 int i;
65 Wlc_Obj_t * pObj;
66
67 Abc_Print( 1, "PIs:");
68 Wlc_NtkForEachPi( p, pObj, i )
69 Abc_Print( 1, " %s", Wlc_ObjName(p, Wlc_ObjId(p, pObj)) );
70 Abc_Print( 1, "\n\n");
71
72 Abc_Print( 1, "POs:");
73 Wlc_NtkForEachPo( p, pObj, i )
74 Abc_Print( 1, " %s", Wlc_ObjName(p, Wlc_ObjId(p, pObj)) );
75 Abc_Print( 1, "\n\n");
76
77 Abc_Print( 1, "FO(Fi)s:");
78 Wlc_NtkForEachCi( p, pObj, i )
79 if ( !Wlc_ObjIsPi( pObj ) )
80 Abc_Print( 1, " %s(%s)", Wlc_ObjName(p, Wlc_ObjId(p, pObj)), Wlc_ObjName(p, Wlc_ObjId(p, Wlc_ObjFo2Fi(p, pObj))) );
81 Abc_Print( 1, "\n\n");
82
83 Abc_Print( 1, "Objs:\n");
84 Wlc_NtkForEachObj( p, pObj, i )
85 {
86 if ( !Wlc_ObjIsCi(pObj) )
87 Wlc_NtkPrintNode( p, pObj ) ;
88 }
89}
#define Wlc_NtkForEachPo(p, pPo, i)
Definition wlc.h:364
void Wlc_NtkPrintNode(Wlc_Ntk_t *p, Wlc_Obj_t *pObj)
Definition wlcNtk.c:703
char * Wlc_ObjName(Wlc_Ntk_t *p, int iObj)
Definition wlcNtk.c:225
Here is the call graph for this function: