80 DdNode * bBdd, * bBdd0, * bBdd1, * bTemp, * bResult, * bCube;
113 bResult =
Cudd_bddOr( dd, bTemp = bResult, bBdd0 );
114 if ( bResult == NULL )
143 if ( bResult != NULL )
171 DdNode * bBdd, * bBdd0, * bBdd1, * bPart;
196 if ( pObj->
pData == NULL )
419 DdNode ** pVarsX, ** pVarsY;
450 DdNode * bRes, * bVar, * bTemp;
479 Aig_Obj_t * pObjLo, * pObjLi, * pObjTemp;
480 DdNode * bRes, * bVar, * bTemp;
488 pObjTemp = pObjLo, pObjLo = pObjLi, pObjLi = pObjTemp;
518 if ( pValues[
Llb_ObjBddVar(vOrder, fBackward? pObjLi : pObjLo)] == 1 )
583 DdNode * bState = NULL, * bImage, * bOneCube, * bRing;
673 int nIters, nBddSizeFr = 0, nBddSizeTo = 0, nBddSizeTo2 = 0;
677 if ( p->pPars->fBackward )
680 if ( !p->pPars->fSkipOutCheck )
685 if ( p->pPars->fCluster )
686 p->bCurrent = p->dd->bFunc, p->dd->bFunc = NULL;
690 if ( p->bCurrent == NULL )
692 if ( !p->pPars->fSilent )
693 printf(
"Reached timeout (%d seconds) during constructing the bad states.\n", p->pPars->TimeLimit );
694 p->pPars->iFrame = -1;
701 if ( p->bCurrent == NULL )
703 if ( !p->pPars->fSilent )
704 printf(
"Reached timeout (%d seconds) during remapping bad states.\n", p->pPars->TimeLimit );
706 p->pPars->iFrame = -1;
715 if ( !p->pPars->fSkipOutCheck )
717 if ( p->pPars->fCluster )
718 p->bBad = p->dd->bFunc, p->dd->bFunc = NULL;
722 if ( p->bBad == NULL )
724 if ( !p->pPars->fSilent )
725 printf(
"Reached timeout (%d seconds) during constructing the bad states.\n", p->pPars->TimeLimit );
726 p->pPars->iFrame = -1;
732 else if ( p->dd->bFunc )
738 p->bReached = p->bCurrent;
Cudd_Ref( p->bReached );
739 for ( nIters = 0; nIters < p->pPars->nIterMax; nIters++ )
743 if ( p->pPars->TimeLimit &&
Abc_Clock() > p->pPars->TimeTarget )
745 if ( !p->pPars->fSilent )
746 printf(
"Reached timeout (%d seconds) during image computation.\n", p->pPars->TimeLimit );
747 p->pPars->iFrame = nIters - 1;
758 assert( p->pAig->pSeqModel == NULL );
762 if ( !p->pPars->fSilent )
764 Abc_Print( 1,
"Output %d of miter \"%s\" was asserted in frame %d. ", p->pAig->pSeqModel->iPo, p->pAig->pName, nIters );
767 p->pPars->iFrame = nIters - 1;
774 if ( p->bNext == NULL )
776 if ( !p->pPars->fSilent )
777 printf(
"Reached timeout (%d seconds) during image computation in quantification.\n", p->pPars->TimeLimit );
778 p->pPars->iFrame = nIters - 1;
787 if ( p->bNext == NULL )
789 if ( !p->pPars->fSilent )
790 printf(
"Reached timeout (%d seconds) during remapping next states.\n", p->pPars->TimeLimit );
792 p->pPars->iFrame = nIters - 1;
800 if ( p->pPars->fVerbose )
810 if ( p->bCurrent == NULL )
812 if ( !p->pPars->fSilent )
813 printf(
"Reached timeout (%d seconds) during image computation in transfer 1.\n", p->pPars->TimeLimit );
814 p->pPars->iFrame = nIters - 1;
830 p->bReached =
Cudd_bddOr( p->dd, bAux = p->bReached, p->bCurrent );
831 if ( p->bReached == NULL )
833 if ( !p->pPars->fSilent )
834 printf(
"Reached timeout (%d seconds) during image computation in transfer 1.\n", p->pPars->TimeLimit );
835 p->pPars->iFrame = nIters - 1;
844 if ( p->pPars->fVerbose )
846 printf(
"I =%5d : ", nIters );
847 printf(
"Fr =%7d ", nBddSizeFr );
848 printf(
"ImNs =%7d ", nBddSizeTo );
849 printf(
"ImCs =%7d ", nBddSizeTo2 );
863 if ( nIters == p->pPars->nIterMax - 1 )
865 if ( !p->pPars->fSilent )
866 printf(
"Reached limit on the number of timeframes (%d).\n", p->pPars->nIterMax );
867 p->pPars->iFrame = nIters;
873 if ( p->pPars->fVerbose )
877 printf(
"Reachability analysis completed after %d frames.\n", nIters );
879 printf(
"Reachability analysis is stopped after %d frames.\n", nIters );
880 printf(
"Reachable states = %.0f. (Ratio = %.4f %%)\n", nMints, 100.0*nMints/pow(2.0,
Saig_ManRegNum(p->pAig)) );
885 if ( !p->pPars->fSilent )
886 printf(
"Verified only for states reachable in %d frames. ", nIters );
887 p->pPars->iFrame = p->pPars->nIterMax;
891 if ( !p->pPars->fSilent )
892 printf(
"The miter is proved unreachable after %d iterations. ", nIters );
893 if ( !p->pPars->fSilent )
895 p->pPars->iFrame = nIters - 1;
948 p->pPars->TimeTarget = p->pPars->TimeLimit ? p->pPars->TimeLimit * CLOCKS_PER_SEC +
Abc_Clock(): 0;
950 if ( pPars->fCluster )
954 Llb4_Nonlin4Sweep( p->pAig, pPars->nBddMax, pPars->nClusterMax, &p->dd, &p->vOrder, &p->vRoots, pPars->fVerbose );
956 p->dd->TimeStop = p->pPars->TimeTarget;
966 p->dd->TimeStop = p->pPars->TimeTarget;
974 if ( pPars->fReorder )
994 if ( p->pPars->fVerbose )
997 p->timeOther = p->timeTotal - p->timeImage - p->timeRemap;
998 ABC_PRTP(
"Image ", p->timeImage, p->timeTotal );
999 ABC_PRTP(
"Remap ", p->timeRemap, p->timeTotal );
1000 ABC_PRTP(
"Other ", p->timeOther, p->timeTotal );
1001 ABC_PRTP(
"TOTAL ", p->timeTotal, p->timeTotal );
1002 ABC_PRTP(
" reo ", p->timeReo, p->timeTotal );
1044 int i, Counter0 = 0, Counter1 = 0;
1053 printf(
"Total = %d. Direct LO = %d. Compl LO = %d.\n",
Aig_ManRegNum(p->pAig), Counter1, Counter0 );
1071 if ( pPars->fVerbose )
1075 printf(
"The number of objects is more than 2^15. Clustering cannot be used.\n" );
1082 if ( !pPars->fSkipReach )
1118 pPars->fSkipOutCheck = 1;
1119 pPars->fCluster = 0;
1120 pPars->fReorder = 0;
1122 pPars->nBddMax = 100;
1123 pPars->nClusterMax = 500;
static int Vec_IntCountPositive(Vec_Int_t *p)
ABC_NAMESPACE_IMPL_START Abc_Cex_t * Llb4_Nonlin4TransformCex(Aig_Man_t *pAig, Vec_Ptr_t *vStates, int iCexPo, int fVerbose)
DECLARATIONS ///.
static int * Vec_IntArray(Vec_Int_t *p)
Vec_Int_t * Llb_Nonlin4CollectHighRefNodes(Aig_Man_t *pAig, int nFans)
static void Vec_PtrReverseOrder(Vec_Ptr_t *p)
typedefABC_NAMESPACE_IMPL_START struct Llb_Mnx_t_ Llb_Mnx_t
DECLARATIONS ///.
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
#define CUDD_UNIQUE_SLOTS
Llb_Mnx_t * Llb_MnxStart(Aig_Man_t *pAig, Gia_ParLlb_t *pPars)
void Llb4_Nonlin4Sweep(Aig_Man_t *pAig, int nSweepMax, int nClusterMax, DdManager **pdd, Vec_Int_t **pvOrder, Vec_Ptr_t **pvGroups, int fVerbose)
Aig_Man_t * Gia_ManToAigSimple(Gia_Man_t *p)
void Cudd_RecursiveDeref(DdManager *table, DdNode *n)
void Llb_Nonlin4CreateOrder_rec(Aig_Man_t *pAig, Aig_Obj_t *pObj, Vec_Int_t *vOrder, int *pCounter)
double Cudd_CountMinterm(DdManager *manager, DdNode *node, int nvars)
void Llb_ManSetDefaultParams(Gia_ParLlb_t *pPars)
MACRO DEFINITIONS ///.
static int Saig_ManPoNum(Aig_Man_t *p)
static int Saig_ObjIsLo(Aig_Man_t *p, Aig_Obj_t *pObj)
void Llb_Nonlin4SetupVarMap(DdManager *dd, Aig_Man_t *pAig, Vec_Int_t *vOrder)
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Vec_Ptr_t * Llb_Nonlin4Multiply(DdManager *dd, DdNode *bCube, Vec_Ptr_t *vParts)
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
void Aig_ManStop(Aig_Man_t *p)
int Cudd_bddPickOneCube(DdManager *ddm, DdNode *node, char *string)
#define Vec_PtrForEachEntryReverse(Type, vVec, pEntry, i)
static int Aig_ObjIsTravIdCurrent(Aig_Man_t *p, Aig_Obj_t *pObj)
static int Aig_ManObjNum(Aig_Man_t *p)
void Cudd_Deref(DdNode *node)
#define Saig_ManForEachLiLo(p, pObjLi, pObjLo, i)
int Cudd_ReadReorderings(DdManager *dd)
#define Cudd_IsConstant(node)
ABC_DLL Abc_Ntk_t * Abc_NtkStrash(Abc_Ntk_t *pNtk, int fAllNodes, int fCleanup, int fRecord)
DdNode * Cudd_ReadLogicZero(DdManager *dd)
DdNode * Cudd_bddExistAbstract(DdManager *manager, DdNode *f, DdNode *cube)
static Aig_Obj_t * Aig_ObjFanin0(Aig_Obj_t *pObj)
void Aig_ManPrintStats(Aig_Man_t *p)
int Cudd_SetVarMap(DdManager *manager, DdNode **x, DdNode **y, int n)
static void Vec_PtrCleanSimInfo(Vec_Ptr_t *vInfo, int iWord, int nWords)
#define Aig_ManForEachCi(p, pObj, i)
ITERATORS ///.
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
typedefABC_NAMESPACE_HEADER_START struct Gia_ParLlb_t_ Gia_ParLlb_t
INCLUDES ///.
Gia_Man_t * Gia_ManFromAigSimple(Aig_Man_t *p)
#define ABC_ALLOC(type, num)
void Llb_Nonlin4Reorder(DdManager *dd, int fTwice, int fVerbose)
static abctime Abc_Clock()
static Aig_Obj_t * Aig_ObjFanin1(Aig_Obj_t *pObj)
static int Vec_PtrSize(Vec_Ptr_t *p)
static Vec_Int_t * Vec_IntStartFull(int nSize)
static void Aig_ObjSetTravIdCurrent(Aig_Man_t *p, Aig_Obj_t *pObj)
void Llb_MnxCheckNextStateVars(Llb_Mnx_t *p)
int Cudd_ReadSize(DdManager *dd)
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
long Cudd_ReadReorderingTime(DdManager *dd)
#define ABC_PRTP(a, t, T)
void Aig_ManIncrementTravId(Aig_Man_t *p)
DECLARATIONS ///.
static void Abc_PrintTime(int level, const char *pStr, abctime time)
ABC_DLL void Abc_NodeFreeNames(Vec_Ptr_t *vNames)
DdNode * Llb_Nonlin4ComputeCube(DdManager *dd, Aig_Man_t *pAig, Vec_Int_t *vOrder, char *pValues, int Flag)
static int Aig_ObjIsNode(Aig_Obj_t *pObj)
static void Vec_IntWriteEntry(Vec_Int_t *p, int i, int Entry)
DdNode * Cudd_bddVarMap(DdManager *manager, DdNode *f)
Vec_Int_t * Llb_Nonlin4CreateVars2Q(DdManager *dd, Aig_Man_t *pAig, Vec_Int_t *vOrder, int fBackward)
DdNode * Llb_Nonlin4ComputeBad(DdManager *dd, Aig_Man_t *pAig, Vec_Int_t *vOrder)
FUNCTION DEFINITIONS ///.
ABC_DLL Abc_Ntk_t * Abc_NtkDeriveFromBdd(void *dd, void *bFunc, char *pNamePo, Vec_Ptr_t *vNamesPi)
FUNCTION DEFINITIONS ///.
#define Aig_ManForEachNode(p, pObj, i)
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Vec_Ptr_t * Llb_Nonlin4DeriveCex(Llb_Mnx_t *p, int fBackward, int fVerbose)
static void * Vec_PtrEntryLast(Vec_Ptr_t *p)
Aig_Man_t * Abc_NtkToDar(Abc_Ntk_t *pNtk, int fExors, int fRegisters)
#define Saig_ManForEachLi(p, pObj, i)
Vec_Ptr_t * Aig_ManDfsNodes(Aig_Man_t *p, Aig_Obj_t **ppNodes, int nNodes)
ABC_DLL Vec_Ptr_t * Abc_NodeGetFakeNames(int nNames)
static int Aig_ManCiNum(Aig_Man_t *p)
#define ABC_NAMESPACE_IMPL_END
static void Vec_IntFill(Vec_Int_t *p, int nSize, int Fill)
DdManager * Cudd_Init(unsigned int numVars, unsigned int numVarsZ, unsigned int numSlots, unsigned int cacheSize, unsigned long maxMemory)
int Llb_Nonlin4Reachability(Llb_Mnx_t *p)
DdNode * Llb_Nonlin4ComputeInitState(DdManager *dd, Aig_Man_t *pAig, Vec_Int_t *vOrder, int fBackward)
void Llb_Nonlin4RecordState(Aig_Man_t *pAig, Vec_Int_t *vOrder, unsigned *pState, char *pValues, int fBackward)
static void Vec_IntPush(Vec_Int_t *p, int Entry)
Vec_Int_t * Llb_Nonlin4CreateOrder(Aig_Man_t *pAig)
#define Saig_ManForEachLo(p, pObj, i)
Gia_Man_t * Llb_ReachableStatesGia(Gia_Man_t *p)
static void Vec_IntFreeP(Vec_Int_t **p)
DdNode * Cudd_bddXnor(DdManager *dd, DdNode *f, DdNode *g)
DdNode * Cudd_bddOr(DdManager *dd, DdNode *f, DdNode *g)
DdNode * Llb_Nonlin4Image(DdManager *dd, Vec_Ptr_t *vParts, DdNode *bCurrent, Vec_Int_t *vVars2Q)
static void Abc_Print(int level, const char *format,...)
static int Aig_ObjFaninC0(Aig_Obj_t *pObj)
static int Saig_ManRegNum(Aig_Man_t *p)
static int Aig_ManObjNumMax(Aig_Man_t *p)
Aig_Man_t * Llb_ReachableStates(Aig_Man_t *pAig)
static Aig_Obj_t * Aig_ManConst1(Aig_Man_t *p)
#define ABC_NAMESPACE_IMPL_START
static int Llb_ObjBddVar(Vec_Int_t *vOrder, Aig_Obj_t *pObj)
MACRO DEFINITIONS ///.
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
static void Abc_InfoSetBit(unsigned *p, int i)
void Llb_MnxStop(Llb_Mnx_t *p)
static int Aig_ManRegNum(Aig_Man_t *p)
DdNode * Cudd_ReadOne(DdManager *dd)
int Cudd_bddLeq(DdManager *dd, DdNode *f, DdNode *g)
void Llb_Nonlin4Deref(DdManager *dd, Vec_Ptr_t *vParts)
static int Vec_IntSize(Vec_Int_t *p)
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
DdNode * Cudd_bddIthVar(DdManager *dd, int i)
Vec_Int_t * Llb_Nonlin4CreateOrderSimple(Aig_Man_t *pAig)
ABC_DLL Abc_Ntk_t * Abc_NtkBddToMuxes(Abc_Ntk_t *pNtk)
void Aig_ManCleanMarkA(Aig_Man_t *p)
#define ABC_CALLOC(type, num)
unsigned int Cudd_ReadKeys(DdManager *dd)
void Cudd_SetMaxGrowth(DdManager *dd, double mg)
static void Vec_PtrFreeP(Vec_Ptr_t **p)
static int Aig_ObjFaninC1(Aig_Obj_t *pObj)
#define Cudd_NotCond(node, c)
DdNode * Cudd_bddAnd(DdManager *dd, DdNode *f, DdNode *g)
static int Abc_BitWordNum(int nBits)
#define Saig_ManForEachPo(p, pObj, i)
static int Aig_ObjId(Aig_Obj_t *pObj)
void Cudd_Quit(DdManager *unique)
Vec_Ptr_t * Llb_Nonlin4DerivePartitions(DdManager *dd, Aig_Man_t *pAig, Vec_Int_t *vOrder)
int Cudd_ReduceHeap(DdManager *table, Cudd_ReorderingType heuristic, int minsize)
void Cudd_AutodynEnable(DdManager *unique, Cudd_ReorderingType method)
static int Aig_ObjRefs(Aig_Obj_t *pObj)
unsigned int Cudd_ReadDead(DdManager *dd)
static void Vec_IntFree(Vec_Int_t *p)
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
static int Aig_ObjIsCi(Aig_Obj_t *pObj)
int Llb_Nonlin4CoreReach(Aig_Man_t *pAig, Gia_ParLlb_t *pPars)
void Aig_ManCleanData(Aig_Man_t *p)
DdNode * Cudd_bddIntersect(DdManager *dd, DdNode *f, DdNode *g)
static void ** Vec_PtrArray(Vec_Ptr_t *p)
int Cudd_ReadGarbageCollections(DdManager *dd)
static Vec_Ptr_t * Vec_PtrAllocSimInfo(int nEntries, int nWords)
int Cudd_DagSize(DdNode *node)
static void Vec_PtrFree(Vec_Ptr_t *p)
#define Saig_ManForEachPi(p, pObj, i)