ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
wlcPth.c File Reference
#include "wlc.h"
#include "sat/bmc/bmc.h"
Include dependency graph for wlcPth.c:

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START Abc_Ntk_tAbc_NtkFromAigPhase (Aig_Man_t *pAig)
 DECLARATIONS ///.
 
int Abc_NtkDarBmc3 (Abc_Ntk_t *pAbcNtk, Saig_ParBmc_t *pBmcPars, int fOrDecomp)
 
int Wla_ManShrinkAbs (Wla_Man_t *pWla, int nFrames, int RunId)
 
int Wla_CallBackToStop (int RunId)
 
int Wla_GetGlobalRunId ()
 
void Wla_ManJoinThread (Wla_Man_t *pWla, int RunId)
 
void Wla_ManConcurrentBmc3 (Wla_Man_t *pWla, Aig_Man_t *pAig, Abc_Cex_t **ppCex)
 

Function Documentation

◆ Abc_NtkDarBmc3()

int Abc_NtkDarBmc3 ( Abc_Ntk_t * pNtk,
Saig_ParBmc_t * pPars,
int fOrDecomp )
extern

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 2449 of file abcDar.c.

2450{
2451 Aig_Man_t * pMan;
2452 Vec_Int_t * vMap = NULL;
2453 int status, RetValue = -1;
2454 abctime clk = Abc_Clock();
2455 abctime nTimeOut = pPars->nTimeOut ? pPars->nTimeOut * CLOCKS_PER_SEC + Abc_Clock(): 0;
2456 if ( fOrDecomp && !pPars->fSolveAll )
2457 pMan = Abc_NtkToDarBmc( pNtk, &vMap );
2458 else
2459 pMan = Abc_NtkToDar( pNtk, 0, 1 );
2460 if ( pMan == NULL )
2461 {
2462 Abc_Print( 1, "Converting miter into AIG has failed.\n" );
2463 return RetValue;
2464 }
2465 assert( pMan->nRegs > 0 );
2466 if ( pPars->fVerbose && vMap && Abc_NtkPoNum(pNtk) != Saig_ManPoNum(pMan) )
2467 Abc_Print( 1, "Expanded %d outputs into %d outputs using OR decomposition.\n", Abc_NtkPoNum(pNtk), Saig_ManPoNum(pMan) );
2468
2469 RetValue = Saig_ManBmcScalable( pMan, pPars );
2470 ABC_FREE( pNtk->pModel );
2471 ABC_FREE( pNtk->pSeqModel );
2472 pNtk->pSeqModel = pMan->pSeqModel; pMan->pSeqModel = NULL;
2473 if ( !pPars->fSilent )
2474 {
2475 if ( RetValue == 1 )
2476 {
2477 Abc_Print( 1, "Explored all reachable states after completing %d frames. ", 1<<Aig_ManRegNum(pMan) );
2478 }
2479 else if ( RetValue == -1 )
2480 {
2481 if ( pPars->nFailOuts == 0 )
2482 {
2483 Abc_Print( 1, "No output asserted in %d frames. Resource limit reached ", Abc_MaxInt(pPars->iFrame+1,0) );
2484 if ( nTimeOut && Abc_Clock() > nTimeOut )
2485 Abc_Print( 1, "(timeout %d sec). ", pPars->nTimeOut );
2486 else
2487 Abc_Print( 1, "(conf limit %d). ", pPars->nConfLimit );
2488 }
2489 else
2490 {
2491 Abc_Print( 1, "The total of %d outputs asserted in %d frames. Resource limit reached ", pPars->nFailOuts, pPars->iFrame );
2492 if ( Abc_Clock() > nTimeOut )
2493 Abc_Print( 1, "(timeout %d sec). ", pPars->nTimeOut );
2494 else
2495 Abc_Print( 1, "(conf limit %d). ", pPars->nConfLimit );
2496 }
2497 }
2498 else // if ( RetValue == 0 )
2499 {
2500 if ( !pPars->fSolveAll )
2501 {
2502 Abc_Cex_t * pCex = pNtk->pSeqModel;
2503 Abc_Print( 1, "Output %d of miter \"%s\" was asserted in frame %d. ", pCex->iPo, pNtk->pName, pCex->iFrame );
2504 }
2505 else
2506 {
2507 int nOutputs = Saig_ManPoNum(pMan) - Saig_ManConstrNum(pMan);
2508 if ( pMan->vSeqModelVec == NULL || Vec_PtrCountZero(pMan->vSeqModelVec) == nOutputs )
2509 Abc_Print( 1, "None of the %d outputs is found to be SAT", nOutputs );
2510 else if ( Vec_PtrCountZero(pMan->vSeqModelVec) == 0 )
2511 Abc_Print( 1, "All %d outputs are found to be SAT", nOutputs );
2512 else
2513 {
2514 Abc_Print( 1, "Some outputs are SAT (%d out of %d)", nOutputs - Vec_PtrCountZero(pMan->vSeqModelVec), nOutputs );
2515 if ( pPars->nDropOuts )
2516 Abc_Print( 1, " while others timed out (%d out of %d)", pPars->nDropOuts, nOutputs );
2517 }
2518 Abc_Print( 1, " after %d frames", pPars->iFrame+2 );
2519 Abc_Print( 1, ". " );
2520 }
2521 }
2522 ABC_PRT( "Time", Abc_Clock() - clk );
2523 }
2524 if ( RetValue == 0 && pPars->fSolveAll )
2525 {
2526 if ( pNtk->vSeqModelVec )
2527 Vec_PtrFreeFree( pNtk->vSeqModelVec );
2528 pNtk->vSeqModelVec = pMan->vSeqModelVec; pMan->vSeqModelVec = NULL;
2529 }
2530 if ( pNtk->pSeqModel )
2531 {
2532 status = Saig_ManVerifyCex( pMan, pNtk->pSeqModel );
2533 if ( status == 0 )
2534 Abc_Print( 1, "Abc_NtkDarBmc3(): Counter-example verification has FAILED.\n" );
2535 }
2536 Aig_ManStop( pMan );
2537 // update the counter-example
2538 if ( pNtk->pSeqModel && vMap )
2539 pNtk->pSeqModel->iPo = Vec_IntEntry( vMap, pNtk->pSeqModel->iPo );
2540 Vec_IntFreeP( &vMap );
2541 return RetValue;
2542}
Aig_Man_t * Abc_NtkToDarBmc(Abc_Ntk_t *pNtk, Vec_Int_t **pvMap)
Definition abcDar.c:115
Aig_Man_t * Abc_NtkToDar(Abc_Ntk_t *pNtk, int fExors, int fRegisters)
DECLARATIONS ///.
Definition abcDar.c:237
ABC_INT64_T abctime
Definition abc_global.h:332
#define ABC_PRT(a, t)
Definition abc_global.h:255
#define ABC_FREE(obj)
Definition abc_global.h:267
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
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition bblif.c:37
int Saig_ManBmcScalable(Aig_Man_t *pAig, Saig_ParBmc_t *pPars)
Definition bmcBmc3.c:1461
int Saig_ManVerifyCex(Aig_Man_t *pAig, Abc_Cex_t *p)
Definition saigDup.c:281
char * pName
Definition abc.h:158
Abc_Cex_t * pSeqModel
Definition abc.h:199
int * pModel
Definition abc.h:198
Vec_Ptr_t * vSeqModelVec
Definition abc.h:200
int nTimeOut
Definition bmc.h:113
int fVerbose
Definition bmc.h:129
int nConfLimit
Definition bmc.h:110
int fSolveAll
Definition bmc.h:117
int nDropOuts
Definition bmc.h:135
int nFailOuts
Definition bmc.h:134
int fSilent
Definition bmc.h:132
int iFrame
Definition bmc.h:133
typedefABC_NAMESPACE_HEADER_START struct Abc_Cex_t_ Abc_Cex_t
INCLUDES ///.
Definition utilCex.h:39
#define assert(ex)
Definition util_old.h:213
Here is the call graph for this function:

◆ Abc_NtkFromAigPhase()

ABC_NAMESPACE_IMPL_START Abc_Ntk_t * Abc_NtkFromAigPhase ( Aig_Man_t * pMan)
extern

DECLARATIONS ///.

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

FileName [wlcPth.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 - June 20, 2005.]

Revision [

Id
wlcPth.c

]

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

Synopsis [Converts the network from the AIG manager into ABC.]

Description [This procedure should be called after seq sweeping, which changes the number of registers.]

SideEffects []

SeeAlso []

Definition at line 595 of file abcDar.c.

596{
597 Vec_Ptr_t * vNodes;
598 Abc_Ntk_t * pNtkNew;
599 Abc_Obj_t * pObjNew;
600 Aig_Obj_t * pObj, * pObjLo, * pObjLi;
601 int i;
602 assert( pMan->nAsserts == 0 );
603 // perform strashing
605 pNtkNew->nConstrs = pMan->nConstrs;
606 pNtkNew->nBarBufs = pMan->nBarBufs;
607 // duplicate the name and the spec
608// pNtkNew->pName = Extra_UtilStrsav(pMan->pName);
609// pNtkNew->pSpec = Extra_UtilStrsav(pMan->pSpec);
610 Aig_ManConst1(pMan)->pData = Abc_AigConst1(pNtkNew);
611 // create PIs
612 Aig_ManForEachPiSeq( pMan, pObj, i )
613 {
614 pObjNew = Abc_NtkCreatePi( pNtkNew );
615// Abc_ObjAssignName( pObjNew, Abc_ObjName(pObjNew), NULL );
616 pObj->pData = pObjNew;
617 }
618 // create POs
619 Aig_ManForEachPoSeq( pMan, pObj, i )
620 {
621 pObjNew = Abc_NtkCreatePo( pNtkNew );
622// Abc_ObjAssignName( pObjNew, Abc_ObjName(pObjNew), NULL );
623 pObj->pData = pObjNew;
624 }
625 assert( Abc_NtkCiNum(pNtkNew) == Aig_ManCiNum(pMan) - Aig_ManRegNum(pMan) );
626 assert( Abc_NtkCoNum(pNtkNew) == Aig_ManCoNum(pMan) - Aig_ManRegNum(pMan) );
627 // create as many latches as there are registers in the manager
628 Aig_ManForEachLiLoSeq( pMan, pObjLi, pObjLo, i )
629 {
630 pObjNew = Abc_NtkCreateLatch( pNtkNew );
631 pObjLi->pData = Abc_NtkCreateBi( pNtkNew );
632 pObjLo->pData = Abc_NtkCreateBo( pNtkNew );
633 Abc_ObjAddFanin( pObjNew, (Abc_Obj_t *)pObjLi->pData );
634 Abc_ObjAddFanin( (Abc_Obj_t *)pObjLo->pData, pObjNew );
635 Abc_LatchSetInit0( pObjNew );
636// Abc_ObjAssignName( (Abc_Obj_t *)pObjLi->pData, Abc_ObjName((Abc_Obj_t *)pObjLi->pData), NULL );
637// Abc_ObjAssignName( (Abc_Obj_t *)pObjLo->pData, Abc_ObjName((Abc_Obj_t *)pObjLo->pData), NULL );
638 }
639 // rebuild the AIG
640 vNodes = Aig_ManDfs( pMan, 1 );
641 Vec_PtrForEachEntry( Aig_Obj_t *, vNodes, pObj, i )
642 if ( Aig_ObjIsBuf(pObj) )
643 pObj->pData = (Abc_Obj_t *)Aig_ObjChild0Copy(pObj);
644 else
645 pObj->pData = Abc_AigAnd( (Abc_Aig_t *)pNtkNew->pManFunc, (Abc_Obj_t *)Aig_ObjChild0Copy(pObj), (Abc_Obj_t *)Aig_ObjChild1Copy(pObj) );
646 Vec_PtrFree( vNodes );
647 // connect the PO nodes
648 Aig_ManForEachCo( pMan, pObj, i )
649 {
650 pObjNew = (Abc_Obj_t *)Aig_ObjChild0Copy(pObj);
651 Abc_ObjAddFanin( Abc_NtkCo(pNtkNew, i), pObjNew );
652 }
653
654 Abc_NtkAddDummyPiNames( pNtkNew );
655 Abc_NtkAddDummyPoNames( pNtkNew );
656 Abc_NtkAddDummyBoxNames( pNtkNew );
657
658 // check the resulting AIG
659 if ( !Abc_NtkCheck( pNtkNew ) )
660 Abc_Print( 1, "Abc_NtkFromAigPhase(): Network check has failed.\n" );
661 return pNtkNew;
662}
struct Abc_Obj_t_ Abc_Obj_t
Definition abc.h:116
ABC_DLL Abc_Ntk_t * Abc_NtkAlloc(Abc_NtkType_t Type, Abc_NtkFunc_t Func, int fUseMemMan)
DECLARATIONS ///.
Definition abcNtk.c:53
ABC_DLL void Abc_ObjAddFanin(Abc_Obj_t *pObj, Abc_Obj_t *pFanin)
Definition abcFanio.c:84
ABC_DLL void Abc_NtkAddDummyBoxNames(Abc_Ntk_t *pNtk)
Definition abcNames.c:547
ABC_DLL int Abc_NtkCheck(Abc_Ntk_t *pNtk)
FUNCTION DEFINITIONS ///.
Definition abcCheck.c:64
struct Abc_Aig_t_ Abc_Aig_t
Definition abc.h:117
struct Abc_Ntk_t_ Abc_Ntk_t
Definition abc.h:115
@ ABC_NTK_STRASH
Definition abc.h:58
ABC_DLL void Abc_NtkAddDummyPoNames(Abc_Ntk_t *pNtk)
Definition abcNames.c:521
ABC_DLL Abc_Obj_t * Abc_AigAnd(Abc_Aig_t *pMan, Abc_Obj_t *p0, Abc_Obj_t *p1)
Definition abcAig.c:700
@ ABC_FUNC_AIG
Definition abc.h:67
ABC_DLL Abc_Obj_t * Abc_AigConst1(Abc_Ntk_t *pNtk)
Definition abcAig.c:683
ABC_DLL void Abc_NtkAddDummyPiNames(Abc_Ntk_t *pNtk)
Definition abcNames.c:495
struct Aig_Obj_t_ Aig_Obj_t
Definition aig.h:51
#define Aig_ManForEachPiSeq(p, pObj, i)
SEQUENTIAL ITERATORS ///.
Definition aig.h:438
#define Aig_ManForEachCo(p, pObj, i)
Definition aig.h:398
Vec_Ptr_t * Aig_ManDfs(Aig_Man_t *p, int fNodesOnly)
Definition aigDfs.c:145
#define Aig_ManForEachPoSeq(p, pObj, i)
Definition aig.h:444
#define Aig_ManForEachLiLoSeq(p, pObjLi, pObjLo, k)
Definition aig.h:450
int nBarBufs
Definition abc.h:174
int nConstrs
Definition abc.h:173
void * pManFunc
Definition abc.h:191
void * pData
Definition aig.h:87
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

◆ Wla_CallBackToStop()

int Wla_CallBackToStop ( int RunId)

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 ( )

Definition at line 47 of file wlcPth.c.

47{ return g_nRunIds; }
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 )

Definition at line 52 of file wlcPth.c.

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

◆ Wla_ManJoinThread()

void Wla_ManJoinThread ( Wla_Man_t * pWla,
int RunId )

Definition at line 51 of file wlcPth.c.

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

◆ Wla_ManShrinkAbs()

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

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}
Wlc_Par_t * pPars
Definition wlc.h:254
Vec_Bit_t * vUnmark
Definition wlc.h:260
Wlc_Ntk_t * p
Definition wlc.h:253
typedefABC_NAMESPACE_HEADER_START struct Vec_Bit_t_ Vec_Bit_t
INCLUDES ///.
Definition vecBit.h:42
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
Definition vecInt.h:54
Vec_Int_t * Wla_ManCollectNodes(Wla_Man_t *pWla, int fBlack)
Definition wlcAbs.c:1330
Here is the call graph for this function: