ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
llbInt.h File Reference
#include <stdio.h>
#include "aig/aig/aig.h"
#include "aig/saig/saig.h"
#include "proof/ssw/ssw.h"
#include "llb.h"
#include "bdd/extrab/extraBdd.h"
Include dependency graph for llbInt.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  Llb_Man_t_
 
struct  Llb_Mtr_t_
 
struct  Llb_Grp_t_
 

Typedefs

typedef typedefABC_NAMESPACE_HEADER_START struct Llb_Man_t_ Llb_Man_t
 INCLUDES ///.
 
typedef struct Llb_Mtr_t_ Llb_Mtr_t
 
typedef struct Llb_Grp_t_ Llb_Grp_t
 

Functions

Vec_Int_tLlb_ManDeriveConstraints (Aig_Man_t *p)
 FUNCTION DECLARATIONS ///.
 
void Llb_ManPrintEntries (Aig_Man_t *p, Vec_Int_t *vCands)
 
int Llb_ManModelCheckAig (Aig_Man_t *pAigGlo, Gia_ParLlb_t *pPars, Vec_Int_t *vHints, DdManager **pddGlo)
 
void Llb_ManCluster (Llb_Mtr_t *p)
 
void Llb_ManDumpReached (DdManager *ddG, DdNode *bReached, char *pModel, char *pFileName)
 
Vec_Ptr_tLlb_ManFlow (Aig_Man_t *p, Vec_Ptr_t *vSources, int *pnFlow)
 
int Llb_ManReachabilityWithHints (Llb_Man_t *p)
 
int Llb_ManModelCheckAigWithHints (Aig_Man_t *pAigGlo, Gia_ParLlb_t *pPars)
 
void Llb_ManPrepareVarMap (Llb_Man_t *p)
 DECLARATIONS ///.
 
Llb_Man_tLlb_ManStart (Aig_Man_t *pAigGlo, Aig_Man_t *pAig, Gia_ParLlb_t *pPars)
 
void Llb_ManStop (Llb_Man_t *p)
 
void Llb_MtrVerifyMatrix (Llb_Mtr_t *p)
 
Llb_Mtr_tLlb_MtrCreate (Llb_Man_t *p)
 
void Llb_MtrFree (Llb_Mtr_t *p)
 
void Llb_MtrPrint (Llb_Mtr_t *p, int fOrder)
 
void Llb_MtrPrintMatrixStats (Llb_Mtr_t *p)
 
Llb_Grp_tLlb_ManGroupAlloc (Llb_Man_t *pMan)
 DECLARATIONS ///.
 
void Llb_ManGroupStop (Llb_Grp_t *p)
 
void Llb_ManPrepareGroups (Llb_Man_t *pMan)
 
Llb_Grp_tLlb_ManGroupsCombine (Llb_Grp_t *p1, Llb_Grp_t *p2)
 
Llb_Grp_tLlb_ManGroupCreateFromCuts (Llb_Man_t *pMan, Vec_Int_t *vCut1, Vec_Int_t *vCut2)
 
void Llb_ManPrepareVarLimits (Llb_Man_t *p)
 
int Llb_ManTracePaths (Aig_Man_t *p, Aig_Obj_t *pPivot)
 
Vec_Int_tLlb_ManMarkPivotNodes (Aig_Man_t *p, int fUseInternal)
 
int Llb_ManReachability (Llb_Man_t *p, Vec_Int_t *vHints, DdManager **pddGlo)
 
void Llb_MtrSchedule (Llb_Mtr_t *p)
 
DdNode * Llb_BddComputeBad (Aig_Man_t *pInit, DdManager *dd, abctime TimeOut)
 DECLARATIONS ///.
 
DdNode * Llb_BddQuantifyPis (Aig_Man_t *pInit, DdManager *dd, DdNode *bFunc)
 
DdNode * Llb_CoreComputeCube (DdManager *dd, Vec_Int_t *vVars, int fUseVarIndex, char *pValues)
 FUNCTION DEFINITIONS ///.
 
int Llb_CoreExperiment (Aig_Man_t *pInit, Aig_Man_t *pAig, Gia_ParLlb_t *pPars, Vec_Ptr_t *vResult, abctime TimeTarget)
 
Vec_Int_tLlb_DriverCountRefs (Aig_Man_t *p)
 DECLARATIONS ///.
 
Vec_Int_tLlb_DriverCollectNs (Aig_Man_t *pAig, Vec_Int_t *vDriRefs)
 
Vec_Int_tLlb_DriverCollectCs (Aig_Man_t *pAig)
 
DdNode * Llb_DriverPhaseCube (Aig_Man_t *pAig, Vec_Int_t *vDriRefs, DdManager *dd)
 
DdManager * Llb_DriverLastPartition (Aig_Man_t *p, Vec_Int_t *vVarsNs, abctime TimeTarget)
 
Vec_Ptr_tLlb_ImgSupports (Aig_Man_t *p, Vec_Ptr_t *vDdMans, Vec_Int_t *vStart, Vec_Int_t *vStop, int fAddPis, int fVerbose)
 FUNCTION DEFINITIONS ///.
 
void Llb_ImgSchedule (Vec_Ptr_t *vSupps, Vec_Ptr_t **pvQuant0, Vec_Ptr_t **pvQuant1, int fVerbose)
 
DdManager * Llb_ImgPartition (Aig_Man_t *p, Vec_Ptr_t *vLower, Vec_Ptr_t *vUpper, abctime TimeTarget)
 
void Llb_ImgQuantifyFirst (Aig_Man_t *pAig, Vec_Ptr_t *vDdMans, Vec_Ptr_t *vQuant0, int fVerbose)
 
void Llb_ImgQuantifyReset (Vec_Ptr_t *vDdMans)
 
DdNode * Llb_ImgComputeImage (Aig_Man_t *pAig, Vec_Ptr_t *vDdMans, DdManager *dd, DdNode *bInit, Vec_Ptr_t *vQuant0, Vec_Ptr_t *vQuant1, Vec_Int_t *vDriRefs, abctime TimeTarget, int fBackward, int fReorder, int fVerbose)
 
DdManager * Llb_NonlinImageStart (Aig_Man_t *pAig, Vec_Ptr_t *vLeaves, Vec_Ptr_t *vRoots, int *pVars2Q, int *pOrder, int fFirst, abctime TimeTarget)
 
DdNode * Llb_NonlinImageCompute (DdNode *bCurrent, int fReorder, int fDrop, int fVerbose, int *pOrder)
 
void Llb_NonlinImageQuit ()
 
DdNode * Llb_NonlinImage (Aig_Man_t *pAig, Vec_Ptr_t *vLeaves, Vec_Ptr_t *vRoots, int *pVars2Q, DdManager *dd, DdNode *bCurrent, int fReorder, int fVerbose, int *pOrder)
 
DdNode * Llb_NonlinComputeInitState (Aig_Man_t *pAig, DdManager *dd)
 
Abc_Cex_tLlb4_Nonlin4TransformCex (Aig_Man_t *pAig, Vec_Ptr_t *vStates, int iCexPo, int fVerbose)
 DECLARATIONS ///.
 
DdNode * Llb_Nonlin4Image (DdManager *dd, Vec_Ptr_t *vParts, DdNode *bCurrent, Vec_Int_t *vVars2Q)
 
Vec_Ptr_tLlb_Nonlin4Group (DdManager *dd, Vec_Ptr_t *vParts, Vec_Int_t *vVars2Q, int nSizeMax)
 
void Llb4_Nonlin4Sweep (Aig_Man_t *pAig, int nSweepMax, int nClusterMax, DdManager **pdd, Vec_Int_t **pvOrder, Vec_Ptr_t **pvGroups, int fVerbose)
 

Typedef Documentation

◆ Llb_Grp_t

typedef struct Llb_Grp_t_ Llb_Grp_t

Definition at line 49 of file llbInt.h.

◆ Llb_Man_t

typedef typedefABC_NAMESPACE_HEADER_START struct Llb_Man_t_ Llb_Man_t

INCLUDES ///.

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

FileName [llbInt.h]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [BDD-based reachability.]

Synopsis [External declarations.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - May 8, 2010.]

Revision [

Id
llbInt.h,v 1.00 2010/05/08 00:00:00 alanmi Exp

] PARAMETERS /// BASIC TYPES ///

Definition at line 47 of file llbInt.h.

◆ Llb_Mtr_t

typedef struct Llb_Mtr_t_ Llb_Mtr_t

Definition at line 48 of file llbInt.h.

Function Documentation

◆ Llb4_Nonlin4Sweep()

void Llb4_Nonlin4Sweep ( Aig_Man_t * pAig,
int nSweepMax,
int nClusterMax,
DdManager ** pdd,
Vec_Int_t ** pvOrder,
Vec_Ptr_t ** pvGroups,
int fVerbose )
extern

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

Synopsis [Performs BDD sweep on the netlist.]

Description [Returns BDD manager, ordering, clusters, and bad states inside dd->bFunc.]

SideEffects []

SeeAlso []

Definition at line 520 of file llb4Sweep.c.

521{
522 DdManager * ddBad, * ddWork;
523 Vec_Ptr_t * vGroups;
524 Vec_Int_t * vOrder;
525 int Counter, nCutPoints;
526
527 // get the original ordering
528 Aig_ManCleanMarkA( pAig );
529 vOrder = Llb_Nonlin4SweepOrder( pAig, &Counter, 1 );
530 assert( Counter == Aig_ManNodeNum(pAig) );
531 // mark the nodes
532 nCutPoints = Llb4_Nonlin4SweepCutpoints( pAig, vOrder, nSweepMax, fVerbose );
533 Vec_IntFree( vOrder );
534 // get better ordering
535 vOrder = Llb_Nonlin4SweepOrder( pAig, &Counter, 0 );
536 assert( Counter == nCutPoints );
537 Aig_ManCleanMarkA( pAig );
538 // compute the BAD states
539 ddBad = Llb4_Nonlin4SweepBadStates( pAig, vOrder, nCutPoints + Aig_ManCiNum(pAig) + Aig_ManCoNum(pAig) );
540 // compute the clusters
541 ddWork = Llb4_Nonlin4SweepGroups( pAig, vOrder, nCutPoints + Aig_ManCiNum(pAig) + Aig_ManCoNum(pAig), &vGroups, nClusterMax, fVerbose );
542 // transfer the result from the Bad manager
543//printf( "Bad before = %d.\n", Cudd_DagSize(ddBad->bFunc) );
544 ddWork->bFunc = Cudd_bddTransfer( ddBad, ddWork, ddBad->bFunc ); Cudd_Ref( ddWork->bFunc );
545 Cudd_RecursiveDeref( ddBad, ddBad->bFunc ); ddBad->bFunc = NULL;
546 Extra_StopManager( ddBad );
547 // update ordering to exclude quantified variables
548//printf( "Bad after = %d.\n", Cudd_DagSize(ddWork->bFunc) );
549
550 Llb_Nonlin4SweepPrintSuppProfile( ddWork, pAig, vOrder, vGroups, fVerbose );
551
552 // return the result
553 *pdd = ddWork;
554 *pvOrder = vOrder;
555 *pvGroups = vGroups;
556}
void Aig_ManCleanMarkA(Aig_Man_t *p)
Definition aigUtil.c:148
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition bblif.c:37
void Extra_StopManager(DdManager *dd)
DdManager * Llb4_Nonlin4SweepGroups(Aig_Man_t *pAig, Vec_Int_t *vOrder, int nVars, Vec_Ptr_t **pvGroups, int nBddLimitClp, int fVerbose)
Definition llb4Sweep.c:420
void Llb_Nonlin4SweepPrintSuppProfile(DdManager *dd, Aig_Man_t *pAig, Vec_Int_t *vOrder, Vec_Ptr_t *vGroups, int fVerbose)
Definition llb4Sweep.c:461
DdManager * Llb4_Nonlin4SweepBadStates(Aig_Man_t *pAig, Vec_Int_t *vOrder, int nVars)
Definition llb4Sweep.c:384
int Llb4_Nonlin4SweepCutpoints(Aig_Man_t *pAig, Vec_Int_t *vOrder, int nBddLimit, int fVerbose)
Definition llb4Sweep.c:121
Vec_Int_t * Llb_Nonlin4SweepOrder(Aig_Man_t *pAig, int *pCounter, int fSaveAll)
Definition llb4Sweep.c:86
#define assert(ex)
Definition util_old.h:213
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition vecPtr.h:42
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Llb4_Nonlin4TransformCex()

Abc_Cex_t * Llb4_Nonlin4TransformCex ( Aig_Man_t * pAig,
Vec_Ptr_t * vStates,
int iCexPo,
int fVerbose )
extern

DECLARATIONS ///.

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

FileName [llb2Cex.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [BDD based reachability.]

Synopsis [Non-linear quantification scheduling.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

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

Revision [

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

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

Synopsis [Translates a sequence of states into a counter-example.]

Description []

SideEffects []

SeeAlso []

Definition at line 47 of file llb4Cex.c.

48{
49 Abc_Cex_t * pCex;
50 Cnf_Dat_t * pCnf;
51 Vec_Int_t * vAssumps;
52 sat_solver * pSat;
53 Aig_Obj_t * pObj;
54 unsigned * pNext, * pThis;
55 int i, k, iBit, status, nRegs;//, clk = Abc_Clock();
56/*
57 Vec_PtrForEachEntry( unsigned *, vStates, pNext, i )
58 {
59 printf( "%4d : ", i );
60 Extra_PrintBinary( stdout, pNext, Aig_ManRegNum(pAig) );
61 printf( "\n" );
62 }
63*/
64 // derive SAT solver
65 nRegs = Aig_ManRegNum(pAig); pAig->nRegs = 0;
66 pCnf = Cnf_Derive( pAig, Aig_ManCoNum(pAig) );
67 pAig->nRegs = nRegs;
68// Cnf_DataTranformPolarity( pCnf, 0 );
69 // convert into SAT solver
70 pSat = (sat_solver *)Cnf_DataWriteIntoSolver( pCnf, 1, 0 );
71 if ( pSat == NULL )
72 {
73 printf( "Llb4_Nonlin4TransformCex(): Counter-example generation has failed.\n" );
74 Cnf_DataFree( pCnf );
75 return NULL;
76 }
77 // simplify the problem
78 status = sat_solver_simplify(pSat);
79 if ( status == 0 )
80 {
81 printf( "Llb4_Nonlin4TransformCex(): SAT solver is invalid.\n" );
82 sat_solver_delete( pSat );
83 Cnf_DataFree( pCnf );
84 return NULL;
85 }
86 // start the counter-example
87 pCex = Abc_CexAlloc( Saig_ManRegNum(pAig), Saig_ManPiNum(pAig), Vec_PtrSize(vStates) );
88 pCex->iFrame = Vec_PtrSize(vStates)-1;
89 pCex->iPo = -1;
90
91 // solve each time frame
92 iBit = Saig_ManRegNum(pAig);
93 pThis = (unsigned *)Vec_PtrEntry( vStates, 0 );
94 vAssumps = Vec_IntAlloc( 2 * Aig_ManRegNum(pAig) );
95 Vec_PtrForEachEntryStart( unsigned *, vStates, pNext, i, 1 )
96 {
97 // create assumptions
98 Vec_IntClear( vAssumps );
99 Saig_ManForEachLo( pAig, pObj, k )
100 Vec_IntPush( vAssumps, toLitCond( pCnf->pVarNums[Aig_ObjId(pObj)], !Abc_InfoHasBit(pThis,k) ) );
101 Saig_ManForEachLi( pAig, pObj, k )
102 Vec_IntPush( vAssumps, toLitCond( pCnf->pVarNums[Aig_ObjId(pObj)], !Abc_InfoHasBit(pNext,k) ) );
103 // solve SAT problem
104 status = sat_solver_solve( pSat, Vec_IntArray(vAssumps), Vec_IntArray(vAssumps) + Vec_IntSize(vAssumps),
105 (ABC_INT64_T)0, (ABC_INT64_T)0, (ABC_INT64_T)0, (ABC_INT64_T)0 );
106 // if the problem is SAT, get the counterexample
107 if ( status != l_True )
108 {
109 printf( "Llb4_Nonlin4TransformCex(): There is no transition between state %d and %d.\n", i-1, i );
110 Vec_IntFree( vAssumps );
111 sat_solver_delete( pSat );
112 Cnf_DataFree( pCnf );
113 ABC_FREE( pCex );
114 return NULL;
115 }
116 // get the assignment of PIs
117 Saig_ManForEachPi( pAig, pObj, k )
118 if ( sat_solver_var_value(pSat, pCnf->pVarNums[Aig_ObjId(pObj)]) )
119 Abc_InfoSetBit( pCex->pData, iBit + k );
120 // update the counter
121 iBit += Saig_ManPiNum(pAig);
122 pThis = pNext;
123 }
124
125 // add the last frame when the property fails
126 Vec_IntClear( vAssumps );
127 if ( iCexPo >= 0 )
128 {
129 Saig_ManForEachPo( pAig, pObj, k )
130 if ( k == iCexPo )
131 Vec_IntPush( vAssumps, toLitCond( pCnf->pVarNums[Aig_ObjId(pObj)], 0 ) );
132 }
133 else
134 {
135 Saig_ManForEachPo( pAig, pObj, k )
136 Vec_IntPush( vAssumps, toLitCond( pCnf->pVarNums[Aig_ObjId(pObj)], 0 ) );
137 }
138
139 // add clause
140 status = sat_solver_addclause( pSat, Vec_IntArray(vAssumps), Vec_IntArray(vAssumps) + Vec_IntSize(vAssumps) );
141 if ( status == 0 )
142 {
143 printf( "Llb4_Nonlin4TransformCex(): The SAT solver is unsat after adding last clause.\n" );
144 Vec_IntFree( vAssumps );
145 sat_solver_delete( pSat );
146 Cnf_DataFree( pCnf );
147 ABC_FREE( pCex );
148 return NULL;
149 }
150 // create assumptions
151 Vec_IntClear( vAssumps );
152 Saig_ManForEachLo( pAig, pObj, k )
153 Vec_IntPush( vAssumps, toLitCond( pCnf->pVarNums[Aig_ObjId(pObj)], !Abc_InfoHasBit(pThis,k) ) );
154 // solve the last frame
155 status = sat_solver_solve( pSat, Vec_IntArray(vAssumps), Vec_IntArray(vAssumps) + Vec_IntSize(vAssumps),
156 (ABC_INT64_T)0, (ABC_INT64_T)0, (ABC_INT64_T)0, (ABC_INT64_T)0 );
157 if ( status != l_True )
158 {
159 printf( "Llb4_Nonlin4TransformCex(): There is no last transition that makes the property fail.\n" );
160 Vec_IntFree( vAssumps );
161 sat_solver_delete( pSat );
162 Cnf_DataFree( pCnf );
163 ABC_FREE( pCex );
164 return NULL;
165 }
166 // get the assignment of PIs
167 Saig_ManForEachPi( pAig, pObj, k )
168 if ( sat_solver_var_value(pSat, pCnf->pVarNums[Aig_ObjId(pObj)]) )
169 Abc_InfoSetBit( pCex->pData, iBit + k );
170 iBit += Saig_ManPiNum(pAig);
171 assert( iBit == pCex->nBits );
172
173 // free the sat_solver
174 Vec_IntFree( vAssumps );
175 sat_solver_delete( pSat );
176 Cnf_DataFree( pCnf );
177
178 // verify counter-example
179 status = Saig_ManFindFailedPoCex( pAig, pCex );
180 if ( status >= 0 && status < Saig_ManPoNum(pAig) )
181 pCex->iPo = status;
182 else
183 {
184 printf( "Llb4_Nonlin4TransformCex(): Counter-example verification has FAILED.\n" );
185 ABC_FREE( pCex );
186 return NULL;
187 }
188 // report the results
189// if ( fVerbose )
190// Abc_PrintTime( 1, "SAT-based cex generation time", Abc_Clock() - clk );
191 return pCex;
192}
#define ABC_FREE(obj)
Definition abc_global.h:267
struct Aig_Obj_t_ Aig_Obj_t
Definition aig.h:51
#define l_True
Definition bmcBmcS.c:35
#define sat_solver_addclause
Definition cecSatG2.c:37
#define sat_solver
Definition cecSatG2.c:34
#define sat_solver_solve
Definition cecSatG2.c:45
Cnf_Dat_t * Cnf_Derive(Aig_Man_t *pAig, int nOutputs)
Definition cnfCore.c:165
struct Cnf_Dat_t_ Cnf_Dat_t
Definition cnf.h:52
void Cnf_DataFree(Cnf_Dat_t *p)
Definition cnfMan.c:207
void * Cnf_DataWriteIntoSolver(Cnf_Dat_t *p, int nFrames, int fInit)
Definition cnfMan.c:579
#define Saig_ManForEachLi(p, pObj, i)
Definition saig.h:98
#define Saig_ManForEachPo(p, pObj, i)
Definition saig.h:93
int Saig_ManFindFailedPoCex(Aig_Man_t *pAig, Abc_Cex_t *p)
Definition saigDup.c:436
#define Saig_ManForEachLo(p, pObj, i)
Definition saig.h:96
#define Saig_ManForEachPi(p, pObj, i)
Definition saig.h:91
int sat_solver_simplify(sat_solver *s)
Definition satSolver.c:1515
void sat_solver_delete(sat_solver *s)
Definition satSolver.c:1341
int * pVarNums
Definition cnf.h:63
ABC_NAMESPACE_IMPL_START Abc_Cex_t * Abc_CexAlloc(int nRegs, int nRealPis, int nFrames)
DECLARATIONS ///.
Definition utilCex.c:51
typedefABC_NAMESPACE_HEADER_START struct Abc_Cex_t_ Abc_Cex_t
INCLUDES ///.
Definition utilCex.h:39
#define Vec_PtrForEachEntryStart(Type, vVec, pEntry, i, Start)
Definition vecPtr.h:57
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Llb_BddComputeBad()

DdNode * Llb_BddComputeBad ( Aig_Man_t * pInit,
DdManager * dd,
abctime TimeOut )
extern

DECLARATIONS ///.

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

FileName [llb2Bad.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [BDD based reachability.]

Synopsis [Computing bad states.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

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

Revision [

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

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

Synopsis [Computes bad in working manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 45 of file llb2Bad.c.

46{
47 Vec_Ptr_t * vNodes;
48 DdNode * bBdd0, * bBdd1, * bTemp, * bResult;
49 Aig_Obj_t * pObj;
50 int i, k;
51 assert( Cudd_ReadSize(dd) == Aig_ManCiNum(pInit) );
52 // initialize elementary variables
53 Aig_ManConst1(pInit)->pData = Cudd_ReadOne( dd );
54 Saig_ManForEachLo( pInit, pObj, i )
55 pObj->pData = Cudd_bddIthVar( dd, i );
56 Saig_ManForEachPi( pInit, pObj, i )
57 pObj->pData = Cudd_bddIthVar( dd, Aig_ManRegNum(pInit) + i );
58 // compute internal nodes
59 vNodes = Aig_ManDfsNodes( pInit, (Aig_Obj_t **)Vec_PtrArray(pInit->vCos), Saig_ManPoNum(pInit) );
60 Vec_PtrForEachEntry( Aig_Obj_t *, vNodes, pObj, i )
61 {
62 if ( !Aig_ObjIsNode(pObj) )
63 continue;
64 bBdd0 = Cudd_NotCond( (DdNode *)Aig_ObjFanin0(pObj)->pData, Aig_ObjFaninC0(pObj) );
65 bBdd1 = Cudd_NotCond( (DdNode *)Aig_ObjFanin1(pObj)->pData, Aig_ObjFaninC1(pObj) );
66// pObj->pData = Extra_bddAndTime( dd, bBdd0, bBdd1, TimeOut );
67 pObj->pData = Cudd_bddAnd( dd, bBdd0, bBdd1 );
68 if ( pObj->pData == NULL )
69 {
70 Vec_PtrForEachEntryStop( Aig_Obj_t *, vNodes, pObj, k, i )
71 if ( pObj->pData )
72 Cudd_RecursiveDeref( dd, (DdNode *)pObj->pData );
73 Vec_PtrFree( vNodes );
74 return NULL;
75 }
76 Cudd_Ref( (DdNode *)pObj->pData );
77 }
78 // quantify PIs of each PO
79 bResult = Cudd_ReadLogicZero( dd ); Cudd_Ref( bResult );
80 Saig_ManForEachPo( pInit, pObj, i )
81 {
82 bBdd0 = Cudd_NotCond( Aig_ObjFanin0(pObj)->pData, Aig_ObjFaninC0(pObj) );
83 bResult = Cudd_bddOr( dd, bTemp = bResult, bBdd0 ); Cudd_Ref( bResult );
84 Cudd_RecursiveDeref( dd, bTemp );
85 }
86 // deref
87 Vec_PtrForEachEntry( Aig_Obj_t *, vNodes, pObj, i )
88 {
89 if ( !Aig_ObjIsNode(pObj) )
90 continue;
91 Cudd_RecursiveDeref( dd, (DdNode *)pObj->pData );
92 }
93 Vec_PtrFree( vNodes );
94 Cudd_Deref( bResult );
95 return bResult;
96}
Vec_Ptr_t * Aig_ManDfsNodes(Aig_Man_t *p, Aig_Obj_t **ppNodes, int nNodes)
Definition aigDfs.c:347
void * pData
Definition aig.h:87
#define Vec_PtrForEachEntryStop(Type, vVec, pEntry, i, Stop)
Definition vecPtr.h:59
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition vecPtr.h:55
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Llb_BddQuantifyPis()

DdNode * Llb_BddQuantifyPis ( Aig_Man_t * pInit,
DdManager * dd,
DdNode * bFunc )
extern

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 109 of file llb2Bad.c.

110{
111 DdNode * bVar, * bCube, * bTemp;
112 Aig_Obj_t * pObj;
113 int i;
114 abctime TimeStop;
115 assert( Cudd_ReadSize(dd) == Aig_ManCiNum(pInit) );
116 TimeStop = dd->TimeStop; dd->TimeStop = 0;
117 // create PI cube
118 bCube = Cudd_ReadOne( dd ); Cudd_Ref( bCube );
119 Saig_ManForEachPi( pInit, pObj, i ) {
120 bVar = Cudd_bddIthVar( dd, Aig_ManRegNum(pInit) + i );
121 bCube = Cudd_bddAnd( dd, bTemp = bCube, bVar ); Cudd_Ref( bCube );
122 Cudd_RecursiveDeref( dd, bTemp );
123 }
124 // quantify PI cube
125 bFunc = Cudd_bddExistAbstract( dd, bFunc, bCube ); Cudd_Ref( bFunc );
126 Cudd_RecursiveDeref( dd, bCube );
127 Cudd_Deref( bFunc );
128 dd->TimeStop = TimeStop;
129 return bFunc;
130}
ABC_INT64_T abctime
Definition abc_global.h:332
Here is the caller graph for this function:

◆ Llb_CoreComputeCube()

DdNode * Llb_CoreComputeCube ( DdManager * dd,
Vec_Int_t * vVars,
int fUseVarIndex,
char * pValues )
extern

FUNCTION DEFINITIONS ///.

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

Synopsis [Computes cube composed of given variables with given values.]

Description []

SideEffects []

SeeAlso []

Definition at line 68 of file llb2Core.c.

69{
70 DdNode * bRes, * bVar, * bTemp;
71 int i, iVar, Index;
72 abctime TimeStop;
73 TimeStop = dd->TimeStop; dd->TimeStop = 0;
74 bRes = Cudd_ReadOne( dd ); Cudd_Ref( bRes );
75 Vec_IntForEachEntry( vVars, Index, i )
76 {
77 iVar = fUseVarIndex ? Index : i;
78 bVar = Cudd_NotCond( Cudd_bddIthVar(dd, iVar), (int)(pValues == NULL || pValues[i] != 1) );
79 bRes = Cudd_bddAnd( dd, bTemp = bRes, bVar ); Cudd_Ref( bRes );
80 Cudd_RecursiveDeref( dd, bTemp );
81 }
82 Cudd_Deref( bRes );
83 dd->TimeStop = TimeStop;
84 return bRes;
85}
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
Definition vecInt.h:54
Here is the caller graph for this function:

◆ Llb_CoreExperiment()

int Llb_CoreExperiment ( Aig_Man_t * pInit,
Aig_Man_t * pAig,
Gia_ParLlb_t * pPars,
Vec_Ptr_t * vResult,
abctime TimeTarget )
extern

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 694 of file llb2Core.c.

695{
696 int RetValue;
697 Llb_Img_t * p;
698// printf( "\n" );
699// pPars->fVerbose = 1;
700 p = Llb_CoreStart( pInit, pAig, pPars );
701 p->vDdMans = Llb_CoreConstructAll( pAig, vResult, p->vVarsNs, TimeTarget );
702 if ( p->vDdMans == NULL )
703 {
704 if ( !pPars->fSilent )
705 printf( "Reached timeout (%d seconds) while deriving the partitions.\n", pPars->TimeLimit );
706 Llb_CoreStop( p );
707 return -1;
708 }
709 RetValue = Llb_CoreReachability( p );
710 Llb_CoreStop( p );
711 return RetValue;
712}
Cube * p
Definition exorList.c:222
Vec_Ptr_t * Llb_CoreConstructAll(Aig_Man_t *p, Vec_Ptr_t *vResult, Vec_Int_t *vVarsNs, abctime TimeTarget)
Definition llb2Core.c:534
typedefABC_NAMESPACE_IMPL_START struct Llb_Img_t_ Llb_Img_t
DECLARATIONS ///.
Definition llb2Core.c:30
void Llb_CoreStop(Llb_Img_t *p)
Definition llb2Core.c:650
Llb_Img_t * Llb_CoreStart(Aig_Man_t *pInit, Aig_Man_t *pAig, Gia_ParLlb_t *pPars)
Definition llb2Core.c:618
int Llb_CoreReachability(Llb_Img_t *p)
Definition llb2Core.c:499
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Llb_DriverCollectCs()

Vec_Int_t * Llb_DriverCollectCs ( Aig_Man_t * pAig)
extern

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

Synopsis [Returns array of CS variables.]

Description []

SideEffects []

SeeAlso []

Definition at line 106 of file llb2Driver.c.

107{
108 Vec_Int_t * vVars;
109 Aig_Obj_t * pObj;
110 int i;
111 vVars = Vec_IntAlloc( Aig_ManRegNum(pAig) );
112 Saig_ManForEachLo( pAig, pObj, i )
113 Vec_IntPush( vVars, Aig_ObjId(pObj) );
114 return vVars;
115}
Here is the caller graph for this function:

◆ Llb_DriverCollectNs()

Vec_Int_t * Llb_DriverCollectNs ( Aig_Man_t * pAig,
Vec_Int_t * vDriRefs )
extern

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

Synopsis [Returns array of NS variables.]

Description []

SideEffects []

SeeAlso []

Definition at line 78 of file llb2Driver.c.

79{
80 Vec_Int_t * vVars;
81 Aig_Obj_t * pObj, * pDri;
82 int i;
83 vVars = Vec_IntAlloc( Aig_ManRegNum(pAig) );
84 Saig_ManForEachLi( pAig, pObj, i )
85 {
86 pDri = Aig_ObjFanin0(pObj);
87 if ( Vec_IntEntry( vDriRefs, Aig_ObjId(pDri) ) != 1 || Saig_ObjIsPi(pAig, pDri) || Aig_ObjIsConst1(pDri) )
88 Vec_IntPush( vVars, Aig_ObjId(pObj) );
89 else
90 Vec_IntPush( vVars, Aig_ObjId(pDri) );
91 }
92 return vVars;
93}
Here is the caller graph for this function:

◆ Llb_DriverCountRefs()

Vec_Int_t * Llb_DriverCountRefs ( Aig_Man_t * p)
extern

DECLARATIONS ///.

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

FileName [llb2Driver.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [BDD based reachability.]

Synopsis [Procedures working with flop drivers.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

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

Revision [

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

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

Synopsis [Returns the array of times each flop driver is referenced.]

Description []

SideEffects []

SeeAlso []

Definition at line 56 of file llb2Driver.c.

57{
58 Vec_Int_t * vCounts;
59 Aig_Obj_t * pObj;
60 int i;
61 vCounts = Vec_IntStart( Aig_ManObjNumMax(p) );
62 Saig_ManForEachLi( p, pObj, i )
63 Vec_IntAddToEntry( vCounts, Aig_ObjFaninId0(pObj), 1 );
64 return vCounts;
65}
Here is the caller graph for this function:

◆ Llb_DriverLastPartition()

DdManager * Llb_DriverLastPartition ( Aig_Man_t * p,
Vec_Int_t * vVarsNs,
abctime TimeTarget )
extern

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

Synopsis [Compute the last partition.]

Description []

SideEffects []

SeeAlso []

Definition at line 163 of file llb2Driver.c.

164{
165// int fVerbose = 1;
166 DdManager * dd;
167 DdNode * bVar1, * bVar2, * bProd, * bRes, * bTemp;
168 Aig_Obj_t * pObj;
169 int i;
170 dd = Cudd_Init( Aig_ManObjNumMax(p), 0, CUDD_UNIQUE_SLOTS, CUDD_CACHE_SLOTS, 0 );
171 Cudd_AutodynEnable( dd, CUDD_REORDER_SYMM_SIFT );
172 dd->TimeStop = TimeTarget;
173 bRes = Cudd_ReadOne(dd); Cudd_Ref( bRes );
174
175 // mark the duplicated flop inputs
176 Aig_ManForEachObjVec( vVarsNs, p, pObj, i )
177 {
178 if ( !Saig_ObjIsLi(p, pObj) )
179 continue;
180 bVar1 = Cudd_bddIthVar( dd, Aig_ObjId(pObj) );
181 bVar2 = Cudd_bddIthVar( dd, Aig_ObjFaninId0(pObj) );
182 if ( Aig_ObjIsConst1(Aig_ObjFanin0(pObj)) )
183 bVar2 = Cudd_ReadOne(dd);
184 bVar2 = Cudd_NotCond( bVar2, Aig_ObjFaninC0(pObj) );
185 bProd = Cudd_bddXnor( dd, bVar1, bVar2 ); Cudd_Ref( bProd );
186// bRes = Cudd_bddAnd( dd, bTemp = bRes, bProd ); Cudd_Ref( bRes );
187// bRes = Extra_bddAndTime( dd, bTemp = bRes, bProd, TimeTarget );
188 bRes = Cudd_bddAnd( dd, bTemp = bRes, bProd );
189 if ( bRes == NULL )
190 {
191 Cudd_RecursiveDeref( dd, bTemp );
192 Cudd_RecursiveDeref( dd, bProd );
193 return NULL;
194 }
195 Cudd_Ref( bRes );
196 Cudd_RecursiveDeref( dd, bTemp );
197 Cudd_RecursiveDeref( dd, bProd );
198 }
199
200/*
201 Saig_ManForEachLi( p, pObj, i )
202 printf( "%d ", Aig_ObjId(pObj) );
203 printf( "\n" );
204 Saig_ManForEachLi( p, pObj, i )
205 printf( "%c%d ", Aig_ObjFaninC0(pObj)? '-':'+', Aig_ObjFaninId0(pObj) );
206 printf( "\n" );
207*/
208 Cudd_AutodynDisable( dd );
209// Cudd_RecursiveDeref( dd, bRes );
210// Extra_StopManager( dd );
211 dd->bFunc = bRes;
212 dd->TimeStop = 0;
213 return dd;
214}
#define Aig_ManForEachObjVec(vIds, p, pObj, i)
Definition aig.h:408
Here is the caller graph for this function:

◆ Llb_DriverPhaseCube()

DdNode * Llb_DriverPhaseCube ( Aig_Man_t * pAig,
Vec_Int_t * vDriRefs,
DdManager * dd )
extern

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

Synopsis [Create cube for phase swapping.]

Description []

SideEffects []

SeeAlso []

Definition at line 128 of file llb2Driver.c.

129{
130 DdNode * bCube, * bVar, * bTemp;
131 Aig_Obj_t * pObj;
132 int i;
133 abctime TimeStop;
134 TimeStop = dd->TimeStop; dd->TimeStop = 0;
135 bCube = Cudd_ReadOne( dd ); Cudd_Ref( bCube );
136 Saig_ManForEachLi( pAig, pObj, i )
137 {
138 assert( Vec_IntEntry( vDriRefs, Aig_ObjFaninId0(pObj) ) >= 1 );
139 if ( Vec_IntEntry( vDriRefs, Aig_ObjFaninId0(pObj) ) != 1 )
140 continue;
141 if ( !Aig_ObjFaninC0(pObj) )
142 continue;
143 bVar = Cudd_bddIthVar( dd, Aig_ObjFaninId0(pObj) );
144 bCube = Cudd_bddAnd( dd, bTemp = bCube, bVar ); Cudd_Ref( bCube );
145 Cudd_RecursiveDeref( dd, bTemp );
146 }
147 Cudd_Deref( bCube );
148 dd->TimeStop = TimeStop;
149 return bCube;
150}
Here is the caller graph for this function:

◆ Llb_ImgComputeImage()

DdNode * Llb_ImgComputeImage ( Aig_Man_t * pAig,
Vec_Ptr_t * vDdMans,
DdManager * dd,
DdNode * bInit,
Vec_Ptr_t * vQuant0,
Vec_Ptr_t * vQuant1,
Vec_Int_t * vDriRefs,
abctime TimeTarget,
int fBackward,
int fReorder,
int fVerbose )
extern

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

Synopsis [Computes image of the initial set of states.]

Description []

SideEffects []

SeeAlso []

Definition at line 364 of file llb2Image.c.

367{
368// int fCheckSupport = 0;
369 DdManager * ddPart;
370 DdNode * bImage, * bGroup, * bCube, * bTemp;
371 int i;
372 abctime clk, clk0 = Abc_Clock();
373
374 bImage = bInit; Cudd_Ref( bImage );
375 if ( fBackward )
376 {
377 // change polarity
378 bCube = Llb_DriverPhaseCube( pAig, vDriRefs, dd ); Cudd_Ref( bCube );
379 bImage = Extra_bddChangePolarity( dd, bTemp = bImage, bCube ); Cudd_Ref( bImage );
380 Cudd_RecursiveDeref( dd, bTemp );
381 Cudd_RecursiveDeref( dd, bCube );
382 }
383 else
384 {
385 // quantify unique vriables
386 bCube = Llb_ImgComputeCube( pAig, (Vec_Int_t *)Vec_PtrEntry(vQuant0, 0), dd ); Cudd_Ref( bCube );
387 bImage = Cudd_bddExistAbstract( dd, bTemp = bImage, bCube );
388 if ( bImage == NULL )
389 {
390 Cudd_RecursiveDeref( dd, bTemp );
391 Cudd_RecursiveDeref( dd, bCube );
392 return NULL;
393 }
394 Cudd_Ref( bImage );
395 Cudd_RecursiveDeref( dd, bTemp );
396 Cudd_RecursiveDeref( dd, bCube );
397 }
398 // perform image computation
399 Vec_PtrForEachEntry( DdManager *, vDdMans, ddPart, i )
400 {
401 clk = Abc_Clock();
402if ( fVerbose )
403printf( " %2d : ", i );
404 // transfer the BDD from the group manager to the main manager
405 bGroup = Cudd_bddTransfer( ddPart, dd, ddPart->bFunc );
406 if ( bGroup == NULL )
407 return NULL;
408 Cudd_Ref( bGroup );
409if ( fVerbose )
410printf( "Pt0 =%6d. Pt1 =%6d. ", Cudd_DagSize(ddPart->bFunc), Cudd_DagSize(bGroup) );
411 // perform partial product
412 bCube = Llb_ImgComputeCube( pAig, (Vec_Int_t *)Vec_PtrEntry(vQuant1, i+1), dd ); Cudd_Ref( bCube );
413// bImage = Cudd_bddAndAbstract( dd, bTemp = bImage, bGroup, bCube );
414// bImage = Extra_bddAndAbstractTime( dd, bTemp = bImage, bGroup, bCube, TimeTarget );
415 bImage = Cudd_bddAndAbstract( dd, bTemp = bImage, bGroup, bCube );
416 if ( bImage == NULL )
417 {
418 Cudd_RecursiveDeref( dd, bTemp );
419 Cudd_RecursiveDeref( dd, bCube );
420 Cudd_RecursiveDeref( dd, bGroup );
421 return NULL;
422 }
423 Cudd_Ref( bImage );
424
425if ( fVerbose )
426printf( "Im0 =%6d. Im1 =%6d. ", Cudd_DagSize(bTemp), Cudd_DagSize(bImage) );
427//printf("\n"); Extra_bddPrintSupport(dd, bImage); printf("\n");
428 Cudd_RecursiveDeref( dd, bTemp );
429 Cudd_RecursiveDeref( dd, bCube );
430 Cudd_RecursiveDeref( dd, bGroup );
431
432// Cudd_ReduceHeap( dd, CUDD_REORDER_SYMM_SIFT, 100 );
433// Abc_Print( 1, "Reo =%6d. ", Cudd_DagSize(bImage) );
434
435if ( fVerbose )
436printf( "Supp =%3d. ", Cudd_SupportSize(dd, bImage) );
437if ( fVerbose )
438Abc_PrintTime( 1, "T", Abc_Clock() - clk );
439 }
440
441 if ( !fBackward )
442 {
443 // change polarity
444 bCube = Llb_DriverPhaseCube( pAig, vDriRefs, dd ); Cudd_Ref( bCube );
445 bImage = Extra_bddChangePolarity( dd, bTemp = bImage, bCube ); Cudd_Ref( bImage );
446 Cudd_RecursiveDeref( dd, bTemp );
447 Cudd_RecursiveDeref( dd, bCube );
448 }
449 else
450 {
451 // quantify unique vriables
452 bCube = Llb_ImgComputeCube( pAig, (Vec_Int_t *)Vec_PtrEntry(vQuant0, 0), dd ); Cudd_Ref( bCube );
453 bImage = Cudd_bddExistAbstract( dd, bTemp = bImage, bCube ); Cudd_Ref( bImage );
454 Cudd_RecursiveDeref( dd, bTemp );
455 Cudd_RecursiveDeref( dd, bCube );
456 }
457
458 if ( fReorder )
459 {
460 if ( fVerbose )
461 Abc_Print( 1, " Reordering... Before =%5d. ", Cudd_DagSize(bImage) );
462 Cudd_ReduceHeap( dd, CUDD_REORDER_SYMM_SIFT, 100 );
463 if ( fVerbose )
464 Abc_Print( 1, "After =%5d. ", Cudd_DagSize(bImage) );
465// Cudd_ReduceHeap( dd, CUDD_REORDER_SYMM_SIFT, 100 );
466// Abc_Print( 1, "After =%5d. ", Cudd_DagSize(bImage) );
467 if ( fVerbose )
468 Abc_PrintTime( 1, "Time", Abc_Clock() - clk0 );
469// Abc_Print( 1, "\n" );
470 }
471
472 Cudd_Deref( bImage );
473 return bImage;
474}
DdNode * Extra_bddChangePolarity(DdManager *dd, DdNode *bFunc, DdNode *bVars)
DdNode * Llb_DriverPhaseCube(Aig_Man_t *pAig, Vec_Int_t *vDriRefs, DdManager *dd)
Definition llb2Driver.c:128
DdNode * Llb_ImgComputeCube(Aig_Man_t *pAig, Vec_Int_t *vNodeIds, DdManager *dd)
Definition llb2Image.c:259
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Llb_ImgPartition()

DdManager * Llb_ImgPartition ( Aig_Man_t * p,
Vec_Ptr_t * vLower,
Vec_Ptr_t * vUpper,
abctime TimeTarget )
extern

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

Synopsis [Computes one partition in a separate BDD manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 183 of file llb2Image.c.

184{
185 Vec_Ptr_t * vNodes, * vRange;
186 Aig_Obj_t * pObj;
187 DdManager * dd;
188 DdNode * bBdd0, * bBdd1, * bProd, * bRes, * bTemp;
189 int i;
190
191 dd = Cudd_Init( Aig_ManObjNumMax(p), 0, CUDD_UNIQUE_SLOTS, CUDD_CACHE_SLOTS, 0 );
192 Cudd_AutodynEnable( dd, CUDD_REORDER_SYMM_SIFT );
193 dd->TimeStop = TimeTarget;
194
195 Vec_PtrForEachEntry( Aig_Obj_t *, vLower, pObj, i )
196 pObj->pData = Cudd_bddIthVar( dd, Aig_ObjId(pObj) );
197
198 vNodes = Llb_ManCutNodes( p, vLower, vUpper );
199 Vec_PtrForEachEntry( Aig_Obj_t *, vNodes, pObj, i )
200 {
201 bBdd0 = Cudd_NotCond( (DdNode *)Aig_ObjFanin0(pObj)->pData, Aig_ObjFaninC0(pObj) );
202 bBdd1 = Cudd_NotCond( (DdNode *)Aig_ObjFanin1(pObj)->pData, Aig_ObjFaninC1(pObj) );
203// pObj->pData = Cudd_bddAnd( dd, bBdd0, bBdd1 ); Cudd_Ref( (DdNode *)pObj->pData );
204// pObj->pData = Extra_bddAndTime( dd, bBdd0, bBdd1, TimeTarget );
205 pObj->pData = Cudd_bddAnd( dd, bBdd0, bBdd1 );
206 if ( pObj->pData == NULL )
207 {
208 Cudd_Quit( dd );
209 Vec_PtrFree( vNodes );
210 return NULL;
211 }
212 Cudd_Ref( (DdNode *)pObj->pData );
213 }
214
215 vRange = Llb_ManCutRange( p, vLower, vUpper );
216 bRes = Cudd_ReadOne(dd); Cudd_Ref( bRes );
217 Vec_PtrForEachEntry( Aig_Obj_t *, vRange, pObj, i )
218 {
219 assert( Aig_ObjIsNode(pObj) );
220 bProd = Cudd_bddXnor( dd, Cudd_bddIthVar(dd, Aig_ObjId(pObj)), (DdNode *)pObj->pData ); Cudd_Ref( bProd );
221// bRes = Cudd_bddAnd( dd, bTemp = bRes, bProd ); Cudd_Ref( bRes );
222// bRes = Extra_bddAndTime( dd, bTemp = bRes, bProd, TimeTarget );
223 bRes = Cudd_bddAnd( dd, bTemp = bRes, bProd );
224 if ( bRes == NULL )
225 {
226 Cudd_Quit( dd );
227 Vec_PtrFree( vRange );
228 Vec_PtrFree( vNodes );
229 return NULL;
230 }
231 Cudd_Ref( bRes );
232 Cudd_RecursiveDeref( dd, bTemp );
233 Cudd_RecursiveDeref( dd, bProd );
234 }
235 Vec_PtrForEachEntry( Aig_Obj_t *, vNodes, pObj, i )
236 Cudd_RecursiveDeref( dd, (DdNode *)pObj->pData );
237
238 Vec_PtrFree( vRange );
239 Vec_PtrFree( vNodes );
240 Cudd_AutodynDisable( dd );
241// Cudd_RecursiveDeref( dd, bRes );
242// Extra_StopManager( dd );
243 dd->bFunc = bRes;
244 dd->TimeStop = 0;
245 return dd;
246}
Vec_Ptr_t * Llb_ManCutRange(Aig_Man_t *p, Vec_Ptr_t *vLower, Vec_Ptr_t *vUpper)
Definition llb2Flow.c:436
ABC_NAMESPACE_IMPL_START Vec_Ptr_t * Llb_ManCutNodes(Aig_Man_t *p, Vec_Ptr_t *vLower, Vec_Ptr_t *vUpper)
DECLARATIONS ///.
Definition llb2Flow.c:374
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Llb_ImgQuantifyFirst()

void Llb_ImgQuantifyFirst ( Aig_Man_t * pAig,
Vec_Ptr_t * vDdMans,
Vec_Ptr_t * vQuant0,
int fVerbose )
extern

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 288 of file llb2Image.c.

289{
290 DdManager * dd;
291 DdNode * bProd, * bRes, * bTemp;
292 int i;
293 abctime clk = Abc_Clock();
294 Vec_PtrForEachEntry( DdManager *, vDdMans, dd, i )
295 {
296 // remember unquantified ones
297 assert( dd->bFunc2 == NULL );
298 dd->bFunc2 = dd->bFunc; Cudd_Ref( dd->bFunc2 );
299
300 Cudd_AutodynEnable( dd, CUDD_REORDER_SYMM_SIFT );
301
302 bRes = dd->bFunc;
303 if ( fVerbose )
304 Abc_Print( 1, "Part %2d : Init =%5d. ", i, Cudd_DagSize(bRes) );
305 bProd = Llb_ImgComputeCube( pAig, (Vec_Int_t *)Vec_PtrEntry(vQuant0, i+1), dd ); Cudd_Ref( bProd );
306 bRes = Cudd_bddExistAbstract( dd, bTemp = bRes, bProd ); Cudd_Ref( bRes );
307 Cudd_RecursiveDeref( dd, bTemp );
308 Cudd_RecursiveDeref( dd, bProd );
309 dd->bFunc = bRes;
310
311 Cudd_AutodynDisable( dd );
312
313 if ( fVerbose )
314 Abc_Print( 1, "Quant =%5d. ", Cudd_DagSize(bRes) );
315 Cudd_ReduceHeap( dd, CUDD_REORDER_SYMM_SIFT, 100 );
316 if ( fVerbose )
317 Abc_Print( 1, "Reo = %5d. ", Cudd_DagSize(bRes) );
318 Cudd_ReduceHeap( dd, CUDD_REORDER_SYMM_SIFT, 100 );
319 if ( fVerbose )
320 Abc_Print( 1, "Reo = %5d. ", Cudd_DagSize(bRes) );
321 if ( fVerbose )
322 Abc_Print( 1, "Supp = %3d. ", Cudd_SupportSize(dd, bRes) );
323 if ( fVerbose )
324 Abc_PrintTime( 1, "Time", Abc_Clock() - clk );
325
326 }
327}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Llb_ImgQuantifyReset()

void Llb_ImgQuantifyReset ( Vec_Ptr_t * vDdMans)
extern

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 340 of file llb2Image.c.

341{
342 DdManager * dd;
343 int i;
344 Vec_PtrForEachEntry( DdManager *, vDdMans, dd, i )
345 {
346 assert( dd->bFunc2 != NULL );
347 Cudd_RecursiveDeref( dd, dd->bFunc );
348 dd->bFunc = dd->bFunc2;
349 dd->bFunc2 = NULL;
350 }
351}
Here is the caller graph for this function:

◆ Llb_ImgSchedule()

void Llb_ImgSchedule ( Vec_Ptr_t * vSupps,
Vec_Ptr_t ** pvQuant0,
Vec_Ptr_t ** pvQuant1,
int fVerbose )
extern

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

Synopsis [Computes quantification schedule.]

Description [Input array contains supports: 0=starting, ... intermediate... N-1=final. Output arrays contain immediately quantifiable vars (vQuant0) and vars that should be quantified after conjunction (vQuant1).]

SideEffects []

SeeAlso []

Definition at line 122 of file llb2Image.c.

123{
124 Vec_Int_t * vOne;
125 int nVarsAll, Counter, iSupp = -1, Entry, i, k;
126 // start quantification arrays
127 *pvQuant0 = Vec_PtrAlloc( Vec_PtrSize(vSupps) );
128 *pvQuant1 = Vec_PtrAlloc( Vec_PtrSize(vSupps) );
129 Vec_PtrForEachEntry( Vec_Int_t *, vSupps, vOne, k )
130 {
131 Vec_PtrPush( *pvQuant0, Vec_IntAlloc(16) );
132 Vec_PtrPush( *pvQuant1, Vec_IntAlloc(16) );
133 }
134 // count how many times each var appears
135 nVarsAll = Vec_IntSize( (Vec_Int_t *)Vec_PtrEntry(vSupps, 0) );
136 for ( i = 0; i < nVarsAll; i++ )
137 {
138 Counter = 0;
139 Vec_PtrForEachEntry( Vec_Int_t *, vSupps, vOne, k )
140 if ( Vec_IntEntry(vOne, i) )
141 {
142 iSupp = k;
143 Counter++;
144 }
145 if ( Counter == 0 )
146 continue;
147 if ( Counter == 1 )
148 Vec_IntPush( (Vec_Int_t *)Vec_PtrEntry(*pvQuant0, iSupp), i );
149 else // if ( Counter > 1 )
150 Vec_IntPush( (Vec_Int_t *)Vec_PtrEntry(*pvQuant1, iSupp), i );
151 }
152
153 if ( fVerbose )
154 for ( i = 0; i < Vec_PtrSize(vSupps); i++ )
155 {
156 printf( "%2d : Quant0 = ", i );
157 Vec_IntForEachEntry( (Vec_Int_t *)Vec_PtrEntry(*pvQuant0, i), Entry, k )
158 printf( "%d ", Entry );
159 printf( "\n" );
160 }
161
162 if ( fVerbose )
163 for ( i = 0; i < Vec_PtrSize(vSupps); i++ )
164 {
165 printf( "%2d : Quant1 = ", i );
166 Vec_IntForEachEntry( (Vec_Int_t *)Vec_PtrEntry(*pvQuant1, i), Entry, k )
167 printf( "%d ", Entry );
168 printf( "\n" );
169 }
170}
Here is the caller graph for this function:

◆ Llb_ImgSupports()

Vec_Ptr_t * Llb_ImgSupports ( Aig_Man_t * p,
Vec_Ptr_t * vDdMans,
Vec_Int_t * vStart,
Vec_Int_t * vStop,
int fAddPis,
int fVerbose )
extern

FUNCTION DEFINITIONS ///.

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

Synopsis [Computes supports of the partitions.]

Description []

SideEffects []

SeeAlso []

Definition at line 48 of file llb2Image.c.

49{
50 Vec_Ptr_t * vSupps;
51 Vec_Int_t * vOne;
52 Aig_Obj_t * pObj;
53 DdManager * dd;
54 DdNode * bSupp, * bTemp;
55 int i, Entry, nSize;
56 nSize = Cudd_ReadSize( (DdManager *)Vec_PtrEntry( vDdMans, 0 ) );
57 vSupps = Vec_PtrAlloc( 100 );
58 // create initial
59 vOne = Vec_IntStart( nSize );
60 Vec_IntForEachEntry( vStart, Entry, i )
61 Vec_IntWriteEntry( vOne, Entry, 1 );
62 Vec_PtrPush( vSupps, vOne );
63 // create intermediate
64 Vec_PtrForEachEntry( DdManager *, vDdMans, dd, i )
65 {
66 vOne = Vec_IntStart( nSize );
67 bSupp = Cudd_Support( dd, dd->bFunc ); Cudd_Ref( bSupp );
68 for ( bTemp = bSupp; bTemp != Cudd_ReadOne(dd); bTemp = cuddT(bTemp) )
69 Vec_IntWriteEntry( vOne, bTemp->index, 1 );
70 Cudd_RecursiveDeref( dd, bSupp );
71 Vec_PtrPush( vSupps, vOne );
72 }
73 // create final
74 vOne = Vec_IntStart( nSize );
75 Vec_IntForEachEntry( vStop, Entry, i )
76 Vec_IntWriteEntry( vOne, Entry, 1 );
77 if ( fAddPis )
78 Saig_ManForEachPi( p, pObj, i )
79 Vec_IntWriteEntry( vOne, Aig_ObjId(pObj), 1 );
80 Vec_PtrPush( vSupps, vOne );
81
82 // print supports
83 assert( nSize == Aig_ManObjNumMax(p) );
84 if ( !fVerbose )
85 return vSupps;
86 Aig_ManForEachObj( p, pObj, i )
87 {
88 int k, Counter = 0;
89 Vec_PtrForEachEntry( Vec_Int_t *, vSupps, vOne, k )
90 Counter += Vec_IntEntry(vOne, i);
91 if ( Counter == 0 )
92 continue;
93 printf( "Obj = %4d : ", i );
94 if ( Saig_ObjIsPi(p,pObj) )
95 printf( "pi " );
96 else if ( Saig_ObjIsLo(p,pObj) )
97 printf( "lo " );
98 else if ( Saig_ObjIsLi(p,pObj) )
99 printf( "li " );
100 else if ( Aig_ObjIsNode(pObj) )
101 printf( "and " );
102 Vec_PtrForEachEntry( Vec_Int_t *, vSupps, vOne, k )
103 printf( "%d", Vec_IntEntry(vOne, i) );
104 printf( "\n" );
105 }
106 return vSupps;
107}
#define Aig_ManForEachObj(p, pObj, i)
Definition aig.h:403
Here is the caller graph for this function:

◆ Llb_ManCluster()

void Llb_ManCluster ( Llb_Mtr_t * p)
extern

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

Synopsis [Combines one pair of columns.]

Description []

SideEffects []

SeeAlso []

Definition at line 324 of file llb1Cluster.c.

325{
326 int RetValue;
327 do
328 {
329 do {
330 RetValue = Llb_ManComputeBestQuant( p );
331 if ( RetValue > 0 )
332 Llb_ManClusterOne( p, RetValue >> 16, RetValue & 0xffff );
333 }
334 while ( RetValue > 0 );
335
336 RetValue = Llb_ManComputeBestAttr( p );
337 if ( RetValue > 0 )
338 Llb_ManClusterOne( p, RetValue >> 16, RetValue & 0xffff );
339
341 }
342 while ( RetValue > 0 );
343
345
347}
void Llb_ManClusterOne(Llb_Mtr_t *p, int iCol1, int iCol2)
int Llb_ManComputeBestAttr(Llb_Mtr_t *p)
int Llb_ManComputeBestQuant(Llb_Mtr_t *p)
Definition llb1Cluster.c:72
void Llb_ManClusterCompress(Llb_Mtr_t *p)
void Llb_MtrVerifyMatrix(Llb_Mtr_t *p)
Definition llb1Matrix.c:115
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Llb_ManDeriveConstraints()

Vec_Int_t * Llb_ManDeriveConstraints ( Aig_Man_t * p)
extern

FUNCTION DECLARATIONS ///.

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

Synopsis [Derives inductive constraints.]

Description []

SideEffects []

SeeAlso []

Definition at line 267 of file llb1Constr.c.

268{
269 DdManager * dd;
270 Vec_Int_t * vNodes;
271 if ( Saig_ManPoNum(p) != 1 )
272 {
273 printf( "The AIG has %d property outputs.\n", Saig_ManPoNum(p) );
274 return NULL;
275 }
276 assert( Saig_ManPoNum(p) == 1 );
278 vNodes = Llb_ManComputeBaseCase( p, dd );
279 if ( Llb_ManCountEntries(vNodes) > 0 )
280 Llb_ManComputeIndCase( p, dd, vNodes );
281 if ( Llb_ManCountEntries(vNodes) == 0 )
282 Vec_IntFreeP( &vNodes );
283 Llb_ManDerefenceBdds( p, dd );
284 Extra_StopManager( dd );
285 return vNodes;
286}
void Llb_ManDerefenceBdds(Aig_Man_t *p, DdManager *dd)
Definition llb1Constr.c:96
Vec_Int_t * Llb_ManComputeBaseCase(Aig_Man_t *p, DdManager *dd)
Definition llb1Constr.c:199
ABC_NAMESPACE_IMPL_START int Llb_ManCountEntries(Vec_Int_t *vCands)
DECLARATIONS ///.
Definition llb1Constr.c:45
DdManager * Llb_ManConstructGlobalBdds(Aig_Man_t *p)
Definition llb1Constr.c:229
void Llb_ManComputeIndCase(Aig_Man_t *p, DdManager *dd, Vec_Int_t *vNodes)
Definition llb1Constr.c:142
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Llb_ManDumpReached()

void Llb_ManDumpReached ( DdManager * ddG,
DdNode * bReached,
char * pModel,
char * pFileName )
extern

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

Synopsis [Writes reached state BDD into a BLIF file.]

Description []

SideEffects []

SeeAlso []

Definition at line 63 of file llb2Dump.c.

64{
65 FILE * pFile;
66 Vec_Ptr_t * vNamesIn, * vNamesOut;
67 char * pName;
68 int i, nDigits;
69 // reorder the BDD
70 Cudd_ReduceHeap( ddG, CUDD_REORDER_SYMM_SIFT, 1 );
71
72 // create input names
73 nDigits = Abc_Base10Log( Cudd_ReadSize(ddG) );
74 vNamesIn = Vec_PtrAlloc( Cudd_ReadSize(ddG) );
75 for ( i = 0; i < Cudd_ReadSize(ddG); i++ )
76 {
77 pName = Llb_ManGetDummyName( "ff", i, nDigits );
78 Vec_PtrPush( vNamesIn, Extra_UtilStrsav(pName) );
79 }
80 // create output names
81 vNamesOut = Vec_PtrAlloc( 1 );
82 Vec_PtrPush( vNamesOut, Extra_UtilStrsav("Reached") );
83
84 // write the file
85 pFile = fopen( pFileName, "wb" );
86 Cudd_DumpBlif( ddG, 1, &bReached, (char **)Vec_PtrArray(vNamesIn), (char **)Vec_PtrArray(vNamesOut), pModel, pFile, 0 );
87 fclose( pFile );
88
89 // cleanup
90 Vec_PtrForEachEntry( char *, vNamesIn, pName, i )
91 ABC_FREE( pName );
92 Vec_PtrForEachEntry( char *, vNamesOut, pName, i )
93 ABC_FREE( pName );
94 Vec_PtrFree( vNamesIn );
95 Vec_PtrFree( vNamesOut );
96}
char * Extra_UtilStrsav(const char *s)
ABC_NAMESPACE_IMPL_START char * Llb_ManGetDummyName(char *pPrefix, int Num, int nDigits)
DECLARATIONS ///.
Definition llb2Dump.c:45
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Llb_ManFlow()

Vec_Ptr_t * Llb_ManFlow ( Aig_Man_t * p,
Vec_Ptr_t * vSources,
int * pnFlow )
extern

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

Synopsis [Implementation of max-flow/min-cut computation.]

Description []

SideEffects []

SeeAlso []

Definition at line 762 of file llb2Flow.c.

763{
764 Vec_Ptr_t * vMinCut;
765 Aig_Obj_t * pObj;
766 int Flow, FlowCur, RetValue, i;
767 // find the max-flow
768 Flow = 0;
771 Vec_PtrForEachEntry( Aig_Obj_t *, vSources, pObj, i )
772 {
773 assert( !pObj->fMarkA && pObj->fMarkB );
774 if ( !Aig_ObjFanin0(pObj)->fMarkB )
775 {
776 FlowCur = Llb_ManFlowBwdPath2_rec( p, Aig_ObjFanin0(pObj) );
777 Flow += FlowCur;
778 if ( FlowCur )
780 }
781 if ( Aig_ObjIsNode(pObj) && !Aig_ObjFanin1(pObj)->fMarkB )
782 {
783 FlowCur = Llb_ManFlowBwdPath2_rec( p, Aig_ObjFanin1(pObj) );
784 Flow += FlowCur;
785 if ( FlowCur )
787 }
788 }
789 if ( pnFlow )
790 *pnFlow = Flow;
791
792 // mark the nodes reachable from the latches
794 Vec_PtrForEachEntry( Aig_Obj_t *, vSources, pObj, i )
795 {
796 assert( !pObj->fMarkA && pObj->fMarkB );
797 if ( !Aig_ObjFanin0(pObj)->fMarkB )
798 {
799 RetValue = Llb_ManFlowBwdPath2_rec( p, Aig_ObjFanin0(pObj) );
800 assert( RetValue == 0 );
801 }
802 if ( Aig_ObjIsNode(pObj) && !Aig_ObjFanin1(pObj)->fMarkB )
803 {
804 RetValue = Llb_ManFlowBwdPath2_rec( p, Aig_ObjFanin1(pObj) );
805 assert( RetValue == 0 );
806 }
807 }
808
809 // find the min-cut with the smallest volume
810 vMinCut = Llb_ManFlowMinCut( p );
811 assert( Vec_PtrSize(vMinCut) == Flow );
812 // verify the cut
813 if ( !Llb_ManFlowVerifyCut(p, vMinCut) )
814 printf( "Llb_ManFlow() error! The computed min-cut is not a cut!\n" );
815// Llb_ManFlowPrintCut( p, vMinCut );
816 return vMinCut;
817}
void Aig_ManIncrementTravId(Aig_Man_t *p)
DECLARATIONS ///.
Definition aigUtil.c:44
void Aig_ManCleanData(Aig_Man_t *p)
Definition aigUtil.c:205
int Llb_ManFlowVerifyCut(Aig_Man_t *p, Vec_Ptr_t *vMinCut)
Definition llb2Flow.c:734
Vec_Ptr_t * Llb_ManFlowMinCut(Aig_Man_t *p)
Definition llb2Flow.c:670
int Llb_ManFlowBwdPath2_rec(Aig_Man_t *p, Aig_Obj_t *pObj)
Definition llb2Flow.c:548
unsigned int fMarkB
Definition aig.h:80
unsigned int fMarkA
Definition aig.h:79
Here is the call graph for this function:

◆ Llb_ManGroupAlloc()

Llb_Grp_t * Llb_ManGroupAlloc ( Llb_Man_t * pMan)
extern

DECLARATIONS ///.

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

FileName [llb1Group.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [BDD based reachability.]

Synopsis [Initial partition computation.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

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

Revision [

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

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 45 of file llb1Group.c.

46{
47 Llb_Grp_t * p;
48 p = ABC_CALLOC( Llb_Grp_t, 1 );
49 p->pMan = pMan;
50 p->vIns = Vec_PtrAlloc( 8 );
51 p->vOuts = Vec_PtrAlloc( 8 );
52 p->Id = Vec_PtrSize( pMan->vGroups );
53 Vec_PtrPush( pMan->vGroups, p );
54 return p;
55}
#define ABC_CALLOC(type, num)
Definition abc_global.h:265
struct Llb_Grp_t_ Llb_Grp_t
Definition llbInt.h:49
Here is the caller graph for this function:

◆ Llb_ManGroupCreateFromCuts()

Llb_Grp_t * Llb_ManGroupCreateFromCuts ( Llb_Man_t * pMan,
Vec_Int_t * vCut1,
Vec_Int_t * vCut2 )
extern

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

Synopsis [Creates group from two cuts derived by the flow computation.]

Description []

SideEffects []

SeeAlso []

Definition at line 312 of file llb1Group.c.

313{
314 Llb_Grp_t * p;
315 Aig_Obj_t * pObj;
316 int i;
317 p = Llb_ManGroupAlloc( pMan );
318
319 // mark Cut1
320 Aig_ManIncrementTravId( pMan->pAig );
321 Aig_ManForEachObjVec( vCut1, pMan->pAig, pObj, i )
322 Aig_ObjSetTravIdCurrent( pMan->pAig, pObj );
323 // collect unmarked Cut2
324 Aig_ManForEachObjVec( vCut2, pMan->pAig, pObj, i )
325 if ( !Aig_ObjIsTravIdCurrent( pMan->pAig, pObj ) )
326 Vec_PtrPush( p->vOuts, pObj );
327
328 // mark nodes reachable from Cut2
329 Aig_ManIncrementTravId( pMan->pAig );
330 Aig_ManForEachObjVec( vCut2, pMan->pAig, pObj, i )
331 Llb_ManGroupMarkNodes_rec( pMan->pAig, pObj );
332 // collect marked Cut1
333 Aig_ManForEachObjVec( vCut1, pMan->pAig, pObj, i )
334 if ( Aig_ObjIsTravIdCurrent( pMan->pAig, pObj ) )
335 Vec_PtrPush( p->vIns, pObj );
336
337 // derive internal objects
338 assert( p->vNodes == NULL );
339 p->vNodes = Llb_ManGroupCollect( p );
340 return p;
341}
Vec_Ptr_t * Llb_ManGroupCollect(Llb_Grp_t *pGroup)
Definition llb1Group.c:120
void Llb_ManGroupMarkNodes_rec(Aig_Man_t *p, Aig_Obj_t *pObj)
Definition llb1Group.c:286
ABC_NAMESPACE_IMPL_START Llb_Grp_t * Llb_ManGroupAlloc(Llb_Man_t *pMan)
DECLARATIONS ///.
Definition llb1Group.c:45
Here is the call graph for this function:

◆ Llb_ManGroupsCombine()

Llb_Grp_t * Llb_ManGroupsCombine ( Llb_Grp_t * p1,
Llb_Grp_t * p2 )
extern

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 251 of file llb1Group.c.

252{
253 Llb_Grp_t * p;
254 Aig_Obj_t * pObj;
255 int i;
256 p = Llb_ManGroupAlloc( p1->pMan );
257 // create inputs
258 Vec_PtrForEachEntry( Aig_Obj_t *, p1->vIns, pObj, i )
259 Vec_PtrPush( p->vIns, pObj );
260 Vec_PtrForEachEntry( Aig_Obj_t *, p2->vIns, pObj, i )
261 Vec_PtrPushUnique( p->vIns, pObj );
262 // create outputs
263 Vec_PtrForEachEntry( Aig_Obj_t *, p1->vOuts, pObj, i )
264 Vec_PtrPush( p->vOuts, pObj );
265 Vec_PtrForEachEntry( Aig_Obj_t *, p2->vOuts, pObj, i )
266 Vec_PtrPushUnique( p->vOuts, pObj );
267
268 // derive internal objects
269 assert( p->vNodes == NULL );
270 p->vNodes = Llb_ManGroupCollect( p );
271 return p;
272}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Llb_ManGroupStop()

void Llb_ManGroupStop ( Llb_Grp_t * p)
extern

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 68 of file llb1Group.c.

69{
70 if ( p == NULL )
71 return;
72 Vec_PtrWriteEntry( p->pMan->vGroups, p->Id, NULL );
73 Vec_PtrFreeP( &p->vIns );
74 Vec_PtrFreeP( &p->vOuts );
75 Vec_PtrFreeP( &p->vNodes );
76 ABC_FREE( p );
77}
Here is the caller graph for this function:

◆ Llb_ManMarkPivotNodes()

Vec_Int_t * Llb_ManMarkPivotNodes ( Aig_Man_t * p,
int fUseInternal )
extern

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

Synopsis [Determine starting cut-points.]

Description []

SideEffects []

SeeAlso []

Definition at line 220 of file llb1Pivot.c.

221{
222 Vec_Int_t * vVar2Obj;
223 Aig_Obj_t * pObj;
224 int i;
225 // mark inputs/outputs
226 Aig_ManForEachCi( p, pObj, i )
227 pObj->fMarkA = 1;
228 Saig_ManForEachLi( p, pObj, i )
229 pObj->fMarkA = 1;
230
231 // mark internal pivot nodes
232 if ( fUseInternal )
234
235 // assign variable numbers
236 Aig_ManConst1(p)->fMarkA = 0;
237 vVar2Obj = Vec_IntAlloc( 100 );
238 Aig_ManForEachCi( p, pObj, i )
239 Vec_IntPush( vVar2Obj, Aig_ObjId(pObj) );
240 Aig_ManForEachNode( p, pObj, i )
241 if ( pObj->fMarkA )
242 Vec_IntPush( vVar2Obj, Aig_ObjId(pObj) );
243 Saig_ManForEachLi( p, pObj, i )
244 Vec_IntPush( vVar2Obj, Aig_ObjId(pObj) );
245 return vVar2Obj;
246}
#define Aig_ManForEachCi(p, pObj, i)
ITERATORS ///.
Definition aig.h:393
#define Aig_ManForEachNode(p, pObj, i)
Definition aig.h:413
void Llb_ManMarkInternalPivots(Aig_Man_t *p)
Definition llb1Pivot.c:175
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Llb_ManModelCheckAig()

int Llb_ManModelCheckAig ( Aig_Man_t * pAigGlo,
Gia_ParLlb_t * pPars,
Vec_Int_t * vHints,
DdManager ** pddGlo )
extern

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 112 of file llb1Core.c.

113{
114 Llb_Man_t * p = NULL;
115 Aig_Man_t * pAig;
116 int RetValue = -1;
117 abctime clk = Abc_Clock();
118
119 if ( pPars->fIndConstr )
120 {
121 assert( vHints == NULL );
122 vHints = Llb_ManDeriveConstraints( pAigGlo );
123 }
124
125 // derive AIG for hints
126 if ( vHints == NULL )
127 pAig = Aig_ManDupSimple( pAigGlo );
128 else
129 {
130 if ( pPars->fVerbose )
131 Llb_ManPrintEntries( pAigGlo, vHints );
132 pAig = Aig_ManDupSimpleWithHints( pAigGlo, vHints );
133 }
134
135
136 if ( pPars->fUseFlow )
137 {
138// p = Llb_ManStartFlow( pAigGlo, pAig, pPars );
139 }
140 else
141 {
142 p = Llb_ManStart( pAigGlo, pAig, pPars );
143 if ( pPars->fVerbose )
144 {
146 printf( "Original matrix: " );
147 Llb_MtrPrintMatrixStats( p->pMatrix );
148 if ( pPars->fVeryVerbose )
149 Llb_MtrPrint( p->pMatrix, 1 );
150 }
151 if ( pPars->fCluster )
152 {
153 Llb_ManCluster( p->pMatrix );
154 if ( pPars->fVerbose )
155 {
156 printf( "Matrix after clustering: " );
157 Llb_MtrPrintMatrixStats( p->pMatrix );
158 if ( pPars->fVeryVerbose )
159 Llb_MtrPrint( p->pMatrix, 1 );
160 }
161 }
162 if ( pPars->fSchedule )
163 {
164 Llb_MtrSchedule( p->pMatrix );
165 if ( pPars->fVerbose )
166 {
167 printf( "Matrix after scheduling: " );
168 Llb_MtrPrintMatrixStats( p->pMatrix );
169 if ( pPars->fVeryVerbose )
170 Llb_MtrPrint( p->pMatrix, 1 );
171 }
172 }
173 }
174
175 if ( !p->pPars->fSkipReach )
176 RetValue = Llb_ManReachability( p, vHints, pddGlo );
177 Llb_ManStop( p );
178
179 Abc_PrintTime( 1, "Time", Abc_Clock() - clk );
180
181 if ( pPars->fIndConstr )
182 Vec_IntFreeP( &vHints );
183 return RetValue;
184}
Aig_Man_t * Aig_ManDupSimple(Aig_Man_t *p)
DECLARATIONS ///.
Definition aigDup.c:46
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Definition aig.h:50
Aig_Man_t * Aig_ManDupSimpleWithHints(Aig_Man_t *p, Vec_Int_t *vHints)
Definition aigDup.c:107
void Llb_ManCluster(Llb_Mtr_t *p)
Vec_Int_t * Llb_ManDeriveConstraints(Aig_Man_t *p)
FUNCTION DECLARATIONS ///.
Definition llb1Constr.c:267
void Llb_ManPrintEntries(Aig_Man_t *p, Vec_Int_t *vCands)
Definition llb1Constr.c:64
void Llb_ManPrintAig(Llb_Man_t *p)
Definition llb1Core.c:87
Llb_Man_t * Llb_ManStart(Aig_Man_t *pAigGlo, Aig_Man_t *pAig, Gia_ParLlb_t *pPars)
Definition llb1Man.c:193
void Llb_ManStop(Llb_Man_t *p)
Definition llb1Man.c:130
void Llb_MtrPrint(Llb_Mtr_t *p, int fOrder)
Definition llb1Matrix.c:206
void Llb_MtrPrintMatrixStats(Llb_Mtr_t *p)
Definition llb1Matrix.c:236
int Llb_ManReachability(Llb_Man_t *p, Vec_Int_t *vHints, DdManager **pddGlo)
Definition llb1Reach.c:582
void Llb_MtrSchedule(Llb_Mtr_t *p)
Definition llb1Sched.c:222
typedefABC_NAMESPACE_HEADER_START struct Llb_Man_t_ Llb_Man_t
INCLUDES ///.
Definition llbInt.h:47
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Llb_ManModelCheckAigWithHints()

int Llb_ManModelCheckAigWithHints ( Aig_Man_t * pAigGlo,
Gia_ParLlb_t * pPars )
extern

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

Synopsis [Derives AIG whose PI is substituted by a constant.]

Description []

SideEffects []

SeeAlso []

Definition at line 162 of file llb1Hint.c.

163{
164 DdManager * ddGlo = NULL;
165 Vec_Int_t * vHints;
166 Vec_Int_t * vHFCands;
167 int i, Entry, RetValue = -1;
168 abctime clk = Abc_Clock();
169 assert( pPars->nHintDepth > 0 );
170/*
171 // perform reachability without hints
172 RetValue = Llb_ManModelCheckAig( pAigGlo, pPars, NULL, NULL );
173 if ( RetValue >= 0 )
174 return RetValue;
175*/
176 // create hints representation
177 vHFCands = Llb_ManCollectHighFanoutObjects( pAigGlo, pPars->nHintDepth+pPars->HintFirst, 1 );
178 vHints = Vec_IntStartFull( Aig_ManObjNumMax(pAigGlo) );
179 // add one hint at a time till the problem is solved
180 Vec_IntForEachEntryStart( vHFCands, Entry, i, pPars->HintFirst )
181 {
182 Vec_IntWriteEntry( vHints, Entry, 1 ); // change to 1 to start from zero cof!!!
183 // solve under hints
184 RetValue = Llb_ManModelCheckAig( pAigGlo, pPars, vHints, &ddGlo );
185 if ( RetValue == 0 )
186 goto Finish;
187 if ( RetValue == 1 )
188 break;
189 }
190 if ( RetValue == -1 )
191 goto Finish;
192 // undo the hints one at a time
193 for ( ; i >= pPars->HintFirst; i-- )
194 {
195 Entry = Vec_IntEntry( vHFCands, i );
196 Vec_IntWriteEntry( vHints, Entry, -1 );
197 // solve under relaxed hints
198 RetValue = Llb_ManModelCheckAig( pAigGlo, pPars, vHints, &ddGlo );
199 if ( RetValue == 0 )
200 goto Finish;
201 if ( RetValue == 1 )
202 continue;
203 break;
204 }
205Finish:
206 if ( ddGlo )
207 {
208 if ( ddGlo->bFunc )
209 Cudd_RecursiveDeref( ddGlo, ddGlo->bFunc );
210 Extra_StopManager( ddGlo );
211 }
212 Vec_IntFreeP( &vHFCands );
213 Vec_IntFreeP( &vHints );
214 if ( pPars->fVerbose )
215 Abc_PrintTime( 1, "Total runtime", Abc_Clock() - clk );
216 return RetValue;
217}
int Llb_ManModelCheckAig(Aig_Man_t *pAigGlo, Gia_ParLlb_t *pPars, Vec_Int_t *vHints, DdManager **pddGlo)
Definition llb1Core.c:112
Vec_Int_t * Llb_ManCollectHighFanoutObjects(Aig_Man_t *pAig, int nCandMax, int fCisOnly)
Definition llb1Hint.c:96
#define Vec_IntForEachEntryStart(vVec, Entry, i, Start)
Definition vecInt.h:56
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Llb_ManPrepareGroups()

void Llb_ManPrepareGroups ( Llb_Man_t * pMan)
extern

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 356 of file llb1Group.c.

357{
358 Aig_Obj_t * pObj;
359 int i;
360 assert( pMan->vGroups == NULL );
361 pMan->vGroups = Vec_PtrAlloc( 1000 );
363 Aig_ManForEachNode( pMan->pAig, pObj, i )
364 {
365 if ( pObj->fMarkA )
366 Llb_ManGroupCreate( pMan, pObj );
367 }
368 Saig_ManForEachLi( pMan->pAig, pObj, i )
369 {
370 if ( pObj->fMarkA )
371 Llb_ManGroupCreate( pMan, pObj );
372 }
374}
Llb_Grp_t * Llb_ManGroupCreate(Llb_Man_t *pMan, Aig_Obj_t *pObj)
Definition llb1Group.c:175
Llb_Grp_t * Llb_ManGroupCreateFirst(Llb_Man_t *pMan)
Definition llb1Group.c:207
Llb_Grp_t * Llb_ManGroupCreateLast(Llb_Man_t *pMan)
Definition llb1Group.c:229
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Llb_ManPrepareVarLimits()

void Llb_ManPrepareVarLimits ( Llb_Man_t * p)
extern

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 88 of file llb1Man.c.

89{
90 Llb_Grp_t * pGroup;
91 Aig_Obj_t * pVar;
92 int i, k;
93 assert( p->vVarBegs == NULL );
94 assert( p->vVarEnds == NULL );
95 p->vVarEnds = Vec_IntStart( Aig_ManObjNumMax(p->pAig) );
96 p->vVarBegs = Vec_IntStart( Aig_ManObjNumMax(p->pAig) );
97 Vec_IntFill( p->vVarBegs, Aig_ManObjNumMax(p->pAig), p->pMatrix->nCols );
98
99 for ( i = 0; i < p->pMatrix->nCols; i++ )
100 {
101 pGroup = p->pMatrix->pColGrps[i];
102
103 Vec_PtrForEachEntry( Aig_Obj_t *, pGroup->vIns, pVar, k )
104 if ( Vec_IntEntry(p->vVarBegs, pVar->Id) > i )
105 Vec_IntWriteEntry( p->vVarBegs, pVar->Id, i );
106 Vec_PtrForEachEntry( Aig_Obj_t *, pGroup->vOuts, pVar, k )
107 if ( Vec_IntEntry(p->vVarBegs, pVar->Id) > i )
108 Vec_IntWriteEntry( p->vVarBegs, pVar->Id, i );
109
110 Vec_PtrForEachEntry( Aig_Obj_t *, pGroup->vIns, pVar, k )
111 if ( Vec_IntEntry(p->vVarEnds, pVar->Id) < i )
112 Vec_IntWriteEntry( p->vVarEnds, pVar->Id, i );
113 Vec_PtrForEachEntry( Aig_Obj_t *, pGroup->vOuts, pVar, k )
114 if ( Vec_IntEntry(p->vVarEnds, pVar->Id) < i )
115 Vec_IntWriteEntry( p->vVarEnds, pVar->Id, i );
116 }
117}
int Id
Definition aig.h:85
Vec_Ptr_t * vIns
Definition llbInt.h:98
Vec_Ptr_t * vOuts
Definition llbInt.h:99
Here is the caller graph for this function:

◆ Llb_ManPrepareVarMap()

void Llb_ManPrepareVarMap ( Llb_Man_t * p)
extern

DECLARATIONS ///.

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

FileName [llb1Man.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [BDD based reachability.]

Synopsis [Reachability manager.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

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

Revision [

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

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 45 of file llb1Man.c.

46{
47 Aig_Obj_t * pObjLi, * pObjLo;
48 int i, iVarLi, iVarLo;
49 assert( p->vNs2Glo == NULL );
50 assert( p->vCs2Glo == NULL );
51 assert( p->vGlo2Cs == NULL );
52 assert( p->vGlo2Ns == NULL );
53 p->vNs2Glo = Vec_IntStartFull( Vec_IntSize(p->vVar2Obj) );
54 p->vCs2Glo = Vec_IntStartFull( Vec_IntSize(p->vVar2Obj) );
55 p->vGlo2Cs = Vec_IntStartFull( Aig_ManRegNum(p->pAig) );
56 p->vGlo2Ns = Vec_IntStartFull( Aig_ManRegNum(p->pAig) );
57 Saig_ManForEachLiLo( p->pAig, pObjLi, pObjLo, i )
58 {
59 iVarLi = Vec_IntEntry(p->vObj2Var, Aig_ObjId(pObjLi));
60 iVarLo = Vec_IntEntry(p->vObj2Var, Aig_ObjId(pObjLo));
61 assert( iVarLi >= 0 && iVarLi < Vec_IntSize(p->vVar2Obj) );
62 assert( iVarLo >= 0 && iVarLo < Vec_IntSize(p->vVar2Obj) );
63 Vec_IntWriteEntry( p->vNs2Glo, iVarLi, i );
64 Vec_IntWriteEntry( p->vCs2Glo, iVarLo, i );
65 Vec_IntWriteEntry( p->vGlo2Cs, i, iVarLo );
66 Vec_IntWriteEntry( p->vGlo2Ns, i, iVarLi );
67 }
68 // add mapping of the PIs
69 Saig_ManForEachPi( p->pAig, pObjLo, i )
70 {
71 iVarLo = Vec_IntEntry(p->vObj2Var, Aig_ObjId(pObjLo));
72 Vec_IntWriteEntry( p->vCs2Glo, iVarLo, Aig_ManRegNum(p->pAig)+i );
73 Vec_IntWriteEntry( p->vNs2Glo, iVarLo, Aig_ManRegNum(p->pAig)+i );
74 }
75}
#define Saig_ManForEachLiLo(p, pObjLi, pObjLo, i)
Definition saig.h:101
Here is the caller graph for this function:

◆ Llb_ManPrintEntries()

void Llb_ManPrintEntries ( Aig_Man_t * p,
Vec_Int_t * vCands )
extern

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

Synopsis [Returns the array of constraint candidates.]

Description []

SideEffects []

SeeAlso []

Definition at line 64 of file llb1Constr.c.

65{
66 int i, Entry;
67 if ( vCands == NULL )
68 {
69 printf( "There is no hints.\n" );
70 return;
71 }
72 Entry = Llb_ManCountEntries(vCands);
73 printf( "\n*** Using %d hint%s:\n", Entry, (Entry != 1 ? "s":"") );
74 Vec_IntForEachEntry( vCands, Entry, i )
75 {
76 if ( Entry != 0 && Entry != 1 )
77 continue;
78 printf( "%c", Entry ? '+' : '-' );
79 printf( "%-6d : ", i );
80 Aig_ObjPrint( p, Aig_ManObj(p, i) );
81 printf( "\n" );
82 }
83}
void Aig_ObjPrint(Aig_Man_t *p, Aig_Obj_t *pObj)
Definition aigObj.c:316
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Llb_ManReachability()

int Llb_ManReachability ( Llb_Man_t * p,
Vec_Int_t * vHints,
DdManager ** pddGlo )
extern

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

Synopsis [Perform reachability with hints and returns reached states in ppGlo.]

Description []

SideEffects []

SeeAlso []

Definition at line 582 of file llb1Reach.c.

583{
584 int * pNs2Glo = Vec_IntArray( p->vNs2Glo );
585 int * pCs2Glo = Vec_IntArray( p->vCs2Glo );
586 int * pGlo2Cs = Vec_IntArray( p->vGlo2Cs );
587 DdNode * bCurrent, * bReached, * bNext, * bTemp, * bCube;
588 DdNode * bConstrCs, * bConstrNs;
589 abctime clk2, clk = Abc_Clock();
590 int nIters, nBddSize = 0;
591// int nThreshold = 10000;
592
593 // compute time to stop
594 p->pPars->TimeTarget = p->pPars->TimeLimit ? p->pPars->TimeLimit * CLOCKS_PER_SEC + Abc_Clock(): 0;
595
596 // define variable limits
598
599 // start the managers
600 assert( p->dd == NULL );
601 assert( p->ddG == NULL );
602 assert( p->ddR == NULL );
603 p->dd = Cudd_Init( Vec_IntSize(p->vVar2Obj), 0, CUDD_UNIQUE_SLOTS, CUDD_CACHE_SLOTS, 0 );
604 p->ddR = Cudd_Init( Aig_ManCiNum(p->pAig), 0, CUDD_UNIQUE_SLOTS, CUDD_CACHE_SLOTS, 0 );
605 if ( pddGlo && *pddGlo )
606 p->ddG = *pddGlo, *pddGlo = NULL;
607 else
608 p->ddG = Cudd_Init( Aig_ManRegNum(p->pAig), 0, CUDD_UNIQUE_SLOTS, CUDD_CACHE_SLOTS, 0 );
609
610 if ( p->pPars->fReorder )
611 {
612 Cudd_AutodynEnable( p->dd, CUDD_REORDER_SYMM_SIFT );
613 Cudd_AutodynEnable( p->ddG, CUDD_REORDER_SYMM_SIFT );
614 Cudd_AutodynEnable( p->ddR, CUDD_REORDER_SYMM_SIFT );
615 }
616 else
617 {
618 Cudd_AutodynDisable( p->dd );
619 Cudd_AutodynDisable( p->ddG );
620 Cudd_AutodynDisable( p->ddR );
621 }
622
623 // set the stop time parameter
624 p->dd->TimeStop = p->pPars->TimeTarget;
625 p->ddG->TimeStop = p->pPars->TimeTarget;
626 p->ddR->TimeStop = p->pPars->TimeTarget;
627
628 // create bad state in the ring manager
629 p->ddR->bFunc = Llb_BddComputeBad( p->pAigGlo, p->ddR, p->pPars->TimeTarget );
630 if ( p->ddR->bFunc == NULL )
631 {
632 if ( !p->pPars->fSilent )
633 printf( "Reached timeout (%d seconds) during constructing the bad states.\n", p->pPars->TimeLimit );
634 p->pPars->iFrame = -1;
635 return -1;
636 }
637 Cudd_Ref( p->ddR->bFunc );
638
639 // derive constraints
640 bConstrCs = Llb_ManCreateConstraints( p, vHints, 0 ); Cudd_Ref( bConstrCs );
641 bConstrNs = Llb_ManCreateConstraints( p, vHints, 1 ); Cudd_Ref( bConstrNs );
642//Extra_bddPrint( p->dd, bConstrCs ); printf( "\n" );
643//Extra_bddPrint( p->dd, bConstrNs ); printf( "\n" );
644
645 // perform reachability analysis
646 // compute the starting set of states
647 if ( p->ddG->bFunc )
648 {
649 bReached = p->ddG->bFunc; p->ddG->bFunc = NULL;
650 bCurrent = Extra_TransferPermute( p->ddG, p->dd, bReached, pGlo2Cs ); Cudd_Ref( bCurrent );
651 }
652 else
653 {
654 bReached = Llb_ManComputeInitState( p, p->ddG ); Cudd_Ref( bReached );
655 bCurrent = Llb_ManComputeInitState( p, p->dd ); Cudd_Ref( bCurrent );
656 }
657//Extra_bddPrintSupport( p->ddG, bReached ); printf( "\n" );
658//Extra_bddPrintSupport( p->dd, bCurrent ); printf( "\n" );
659
660//Extra_bddPrintSupport( p->dd, bCurrent ); printf( "\n" );
661 for ( nIters = 0; nIters < p->pPars->nIterMax; nIters++ )
662 {
663 clk2 = Abc_Clock();
664 // check the runtime limit
665 if ( p->pPars->TimeLimit && Abc_Clock() > p->pPars->TimeTarget )
666 {
667 if ( !p->pPars->fSilent )
668 printf( "Reached timeout during image computation (%d seconds).\n", p->pPars->TimeLimit );
669 p->pPars->iFrame = nIters - 1;
670 Cudd_RecursiveDeref( p->dd, bCurrent ); bCurrent = NULL;
671 Cudd_RecursiveDeref( p->dd, bConstrCs ); bConstrCs = NULL;
672 Cudd_RecursiveDeref( p->dd, bConstrNs ); bConstrNs = NULL;
673 Cudd_RecursiveDeref( p->ddG, bReached ); bReached = NULL;
674 return -1;
675 }
676
677 // save the onion ring
678 bTemp = Extra_TransferPermute( p->dd, p->ddR, bCurrent, pCs2Glo );
679 if ( bTemp == NULL )
680 {
681 if ( !p->pPars->fSilent )
682 printf( "Reached timeout (%d seconds) during ring transfer.\n", p->pPars->TimeLimit );
683 p->pPars->iFrame = nIters - 1;
684 Cudd_RecursiveDeref( p->dd, bCurrent ); bCurrent = NULL;
685 Cudd_RecursiveDeref( p->dd, bConstrCs ); bConstrCs = NULL;
686 Cudd_RecursiveDeref( p->dd, bConstrNs ); bConstrNs = NULL;
687 Cudd_RecursiveDeref( p->ddG, bReached ); bReached = NULL;
688 return -1;
689 }
690 Cudd_Ref( bTemp );
691 Vec_PtrPush( p->vRings, bTemp );
692
693 // check it for bad states
694 if ( !p->pPars->fSkipOutCheck && !Cudd_bddLeq( p->ddR, bTemp, Cudd_Not(p->ddR->bFunc) ) )
695 {
696 assert( p->pAigGlo->pSeqModel == NULL );
697 if ( !p->pPars->fBackward )
698 p->pAigGlo->pSeqModel = Llb_ManReachDeriveCex( p );
699 if ( !p->pPars->fSilent )
700 {
701 if ( !p->pPars->fBackward )
702 Abc_Print( 1, "Output %d of miter \"%s\" was asserted in frame %d. ", p->pAigGlo->pSeqModel->iPo, p->pAigGlo->pName, p->pAigGlo->pName, nIters );
703 else
704 Abc_Print( 1, "Output ??? of miter \"%s\" was asserted in frame %d (counter-example is not produced). ", p->pAigGlo->pName, nIters );
705 Abc_PrintTime( 1, "Time", Abc_Clock() - clk );
706 }
707 p->pPars->iFrame = nIters - 1;
708 Cudd_RecursiveDeref( p->dd, bCurrent ); bCurrent = NULL;
709 Cudd_RecursiveDeref( p->dd, bConstrCs ); bConstrCs = NULL;
710 Cudd_RecursiveDeref( p->dd, bConstrNs ); bConstrNs = NULL;
711 Cudd_RecursiveDeref( p->ddG, bReached ); bReached = NULL;
712 return 0;
713 }
714
715 // restrict reachable states using constraints
716 if ( vHints )
717 {
718 bCurrent = Cudd_bddAnd( p->dd, bTemp = bCurrent, bConstrCs ); Cudd_Ref( bCurrent );
719 Cudd_RecursiveDeref( p->dd, bTemp );
720 }
721
722 // quantify variables appearing only in the init state
723 bCube = Llb_ManConstructQuantCubeIntern( p, (Llb_Grp_t *)Vec_PtrEntry(p->vGroups,0), 0, 0 ); Cudd_Ref( bCube );
724 bCurrent = Cudd_bddExistAbstract( p->dd, bTemp = bCurrent, bCube ); Cudd_Ref( bCurrent );
725 Cudd_RecursiveDeref( p->dd, bTemp );
726 Cudd_RecursiveDeref( p->dd, bCube );
727
728 // compute the next states
729 bNext = Llb_ManComputeImage( p, bCurrent, 0 );
730 if ( bNext == NULL )
731 {
732 if ( !p->pPars->fSilent )
733 printf( "Reached timeout (%d seconds) during image computation.\n", p->pPars->TimeLimit );
734 p->pPars->iFrame = nIters - 1;
735 Cudd_RecursiveDeref( p->dd, bCurrent ); bCurrent = NULL;
736 Cudd_RecursiveDeref( p->dd, bConstrCs ); bConstrCs = NULL;
737 Cudd_RecursiveDeref( p->dd, bConstrNs ); bConstrNs = NULL;
738 Cudd_RecursiveDeref( p->ddG, bReached ); bReached = NULL;
739 return -1;
740 }
741 Cudd_Ref( bNext );
742 Cudd_RecursiveDeref( p->dd, bCurrent ); bCurrent = NULL;
743
744 // restrict reachable states using constraints
745 if ( vHints )
746 {
747 bNext = Cudd_bddAnd( p->dd, bTemp = bNext, bConstrNs ); Cudd_Ref( bNext );
748 Cudd_RecursiveDeref( p->dd, bTemp );
749 }
750//Extra_bddPrintSupport( p->dd, bNext ); printf( "\n" );
751
752 // remap these states into the current state vars
753// bNext = Extra_TransferPermute( p->dd, p->ddG, bTemp = bNext, pNs2Glo ); Cudd_Ref( bNext );
754// Cudd_RecursiveDeref( p->dd, bTemp );
755// bNext = Extra_TransferPermuteTime( p->dd, p->ddG, bTemp = bNext, pNs2Glo, p->pPars->TimeTarget );
756 bNext = Extra_TransferPermute( p->dd, p->ddG, bTemp = bNext, pNs2Glo );
757 if ( bNext == NULL )
758 {
759 if ( !p->pPars->fSilent )
760 printf( "Reached timeout (%d seconds) during image computation in transfer 1.\n", p->pPars->TimeLimit );
761 p->pPars->iFrame = nIters - 1;
762 Cudd_RecursiveDeref( p->dd, bTemp );
763 Cudd_RecursiveDeref( p->dd, bConstrCs ); bConstrCs = NULL;
764 Cudd_RecursiveDeref( p->dd, bConstrNs ); bConstrNs = NULL;
765 Cudd_RecursiveDeref( p->ddG, bReached ); bReached = NULL;
766 return -1;
767 }
768 Cudd_Ref( bNext );
769 Cudd_RecursiveDeref( p->dd, bTemp );
770
771
772 // check if there are any new states
773 if ( Cudd_bddLeq( p->ddG, bNext, bReached ) ) // implication = no new states
774 {
775 Cudd_RecursiveDeref( p->ddG, bNext ); bNext = NULL;
776 break;
777 }
778
779 // check the BDD size
780 nBddSize = Cudd_DagSize(bNext);
781 if ( nBddSize > p->pPars->nBddMax )
782 {
783 Cudd_RecursiveDeref( p->ddG, bNext ); bNext = NULL;
784 break;
785 }
786
787 // get the new states
788 bCurrent = Cudd_bddAnd( p->ddG, bNext, Cudd_Not(bReached) );
789 if ( bCurrent == NULL )
790 {
791 Cudd_RecursiveDeref( p->ddG, bNext ); bNext = NULL;
792 Cudd_RecursiveDeref( p->ddG, bReached ); bReached = NULL;
793 break;
794 }
795 Cudd_Ref( bCurrent );
796 // minimize the new states with the reached states
797// bCurrent = Cudd_bddConstrain( p->ddG, bTemp = bCurrent, Cudd_Not(bReached) ); Cudd_Ref( bCurrent );
798// bCurrent = Cudd_bddRestrict( p->ddG, bTemp = bCurrent, Cudd_Not(bReached) ); Cudd_Ref( bCurrent );
799// Cudd_RecursiveDeref( p->ddG, bTemp );
800//printf( "Initial BDD =%7d. Constrained BDD =%7d.\n", Cudd_DagSize(bTemp), Cudd_DagSize(bCurrent) );
801
802 // remap these states into the current state vars
803// bCurrent = Extra_TransferPermute( p->ddG, p->dd, bTemp = bCurrent, pGlo2Cs ); Cudd_Ref( bCurrent );
804// Cudd_RecursiveDeref( p->ddG, bTemp );
805// bCurrent = Extra_TransferPermuteTime( p->ddG, p->dd, bTemp = bCurrent, pGlo2Cs, p->pPars->TimeTarget );
806 bCurrent = Extra_TransferPermute( p->ddG, p->dd, bTemp = bCurrent, pGlo2Cs );
807 if ( bCurrent == NULL )
808 {
809 if ( !p->pPars->fSilent )
810 printf( "Reached timeout (%d seconds) during image computation in transfer 2.\n", p->pPars->TimeLimit );
811 p->pPars->iFrame = nIters - 1;
812 Cudd_RecursiveDeref( p->ddG, bTemp );
813 Cudd_RecursiveDeref( p->dd, bConstrCs ); bConstrCs = NULL;
814 Cudd_RecursiveDeref( p->dd, bConstrNs ); bConstrNs = NULL;
815 Cudd_RecursiveDeref( p->ddG, bReached ); bReached = NULL;
816 return -1;
817 }
818 Cudd_Ref( bCurrent );
819 Cudd_RecursiveDeref( p->ddG, bTemp );
820
821
822 // add to the reached states
823 bReached = Cudd_bddOr( p->ddG, bTemp = bReached, bNext );
824 if ( bReached == NULL )
825 {
826 Cudd_RecursiveDeref( p->ddG, bTemp ); bTemp = NULL;
827 Cudd_RecursiveDeref( p->ddG, bNext ); bNext = NULL;
828 break;
829 }
830 Cudd_Ref( bReached );
831 Cudd_RecursiveDeref( p->ddG, bTemp );
832 Cudd_RecursiveDeref( p->ddG, bNext );
833 bNext = NULL;
834
835 if ( p->pPars->fVerbose )
836 {
837 fprintf( stdout, "F =%5d : ", nIters );
838 fprintf( stdout, "Im =%6d ", nBddSize );
839 fprintf( stdout, "(%4d %3d) ", Cudd_ReadReorderings(p->dd), Cudd_ReadGarbageCollections(p->dd) );
840 fprintf( stdout, "Rea =%6d ", Cudd_DagSize(bReached) );
841 fprintf( stdout, "(%4d%4d) ", Cudd_ReadReorderings(p->ddG), Cudd_ReadGarbageCollections(p->ddG) );
842 Abc_PrintTime( 1, "Time", Abc_Clock() - clk2 );
843 }
844/*
845 if ( p->pPars->fVerbose )
846 {
847 double nMints = Cudd_CountMinterm(p->ddG, bReached, Saig_ManRegNum(p->pAig) );
848// Extra_bddPrint( p->ddG, bReached );printf( "\n" );
849 fprintf( stdout, "Reachable states = %.0f. (Ratio = %.4f %%)\n", nMints, 100.0*nMints/pow(2.0, Saig_ManRegNum(p->pAig)) );
850 fflush( stdout );
851 }
852*/
853 }
854 Cudd_RecursiveDeref( p->dd, bConstrCs ); bConstrCs = NULL;
855 Cudd_RecursiveDeref( p->dd, bConstrNs ); bConstrNs = NULL;
856 if ( bReached == NULL )
857 {
858 p->pPars->iFrame = nIters - 1;
859 return 0; // reachable
860 }
861// assert( bCurrent == NULL );
862 if ( bCurrent )
863 Cudd_RecursiveDeref( p->dd, bCurrent );
864 // report the stats
865 if ( p->pPars->fVerbose )
866 {
867 double nMints = Cudd_CountMinterm(p->ddG, bReached, Saig_ManRegNum(p->pAig) );
868 if ( nIters >= p->pPars->nIterMax || nBddSize > p->pPars->nBddMax )
869 fprintf( stdout, "Reachability analysis is stopped after %d frames.\n", nIters );
870 else
871 fprintf( stdout, "Reachability analysis completed after %d frames.\n", nIters );
872 fprintf( stdout, "Reachable states = %.0f. (Ratio = %.4f %%)\n", nMints, 100.0*nMints/pow(2.0, Saig_ManRegNum(p->pAig)) );
873 fflush( stdout );
874 }
875 if ( nIters >= p->pPars->nIterMax || nBddSize > p->pPars->nBddMax )
876 {
877 if ( !p->pPars->fSilent )
878 printf( "Verified only for states reachable in %d frames. ", nIters );
879 p->pPars->iFrame = p->pPars->nIterMax;
880 Cudd_RecursiveDeref( p->ddG, bReached );
881 return -1; // undecided
882 }
883 if ( pddGlo )
884 {
885 assert( p->ddG->bFunc == NULL );
886 p->ddG->bFunc = bReached; bReached = NULL;
887 assert( *pddGlo == NULL );
888 *pddGlo = p->ddG; p->ddG = NULL;
889 }
890 else
891 Cudd_RecursiveDeref( p->ddG, bReached );
892 if ( !p->pPars->fSilent )
893 printf( "The miter is proved unreachable after %d iterations. ", nIters );
894 p->pPars->iFrame = nIters - 1;
895 return 1; // unreachable
896}
DdNode * Extra_TransferPermute(DdManager *ddSource, DdManager *ddDestination, DdNode *f, int *Permute)
void Llb_ManPrepareVarLimits(Llb_Man_t *p)
Definition llb1Man.c:88
Abc_Cex_t * Llb_ManReachDeriveCex(Llb_Man_t *p)
Definition llb1Reach.c:469
DdNode * Llb_ManComputeImage(Llb_Man_t *p, DdNode *bInit, int fBackward)
Definition llb1Reach.c:328
DdNode * Llb_ManCreateConstraints(Llb_Man_t *p, Vec_Int_t *vHints, int fUseNsVars)
Definition llb1Reach.c:412
DdNode * Llb_ManComputeInitState(Llb_Man_t *p, DdManager *dd)
Definition llb1Reach.c:297
DdNode * Llb_ManConstructQuantCubeIntern(Llb_Man_t *p, Llb_Grp_t *pGroup, int iGrpPlace, int fBackward)
Definition llb1Reach.c:155
ABC_NAMESPACE_IMPL_START DdNode * Llb_BddComputeBad(Aig_Man_t *pInit, DdManager *dd, abctime TimeOut)
DECLARATIONS ///.
Definition llb2Bad.c:45
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Llb_ManReachabilityWithHints()

int Llb_ManReachabilityWithHints ( Llb_Man_t * p)
extern

◆ Llb_ManStart()

Llb_Man_t * Llb_ManStart ( Aig_Man_t * pAigGlo,
Aig_Man_t * pAig,
Gia_ParLlb_t * pPars )
extern

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 193 of file llb1Man.c.

194{
195 Llb_Man_t * p;
196 Aig_ManCleanMarkA( pAig );
197 p = ABC_CALLOC( Llb_Man_t, 1 );
198 p->pAigGlo = pAigGlo;
199 p->pPars = pPars;
200 p->pAig = pAig;
201 p->vVar2Obj = Llb_ManMarkPivotNodes( p->pAig, pPars->fUsePivots );
202 p->vObj2Var = Vec_IntInvert( p->vVar2Obj, -1 );
203 p->vRings = Vec_PtrAlloc( 100 );
206 Aig_ManCleanMarkA( pAig );
207 p->pMatrix = Llb_MtrCreate( p );
208 p->pMatrix->pMan = p;
209 return p;
210}
void Llb_ManPrepareGroups(Llb_Man_t *pMan)
Definition llb1Group.c:356
ABC_NAMESPACE_IMPL_START void Llb_ManPrepareVarMap(Llb_Man_t *p)
DECLARATIONS ///.
Definition llb1Man.c:45
Llb_Mtr_t * Llb_MtrCreate(Llb_Man_t *p)
Definition llb1Matrix.c:410
Vec_Int_t * Llb_ManMarkPivotNodes(Aig_Man_t *p, int fUseInternal)
Definition llb1Pivot.c:220
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Llb_ManStop()

void Llb_ManStop ( Llb_Man_t * p)
extern

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 130 of file llb1Man.c.

131{
132 Llb_Grp_t * pGrp;
133 DdNode * bTemp;
134 int i;
135
136// Vec_IntFreeP( &p->vMem );
137// Vec_PtrFreeP( &p->vTops );
138// Vec_PtrFreeP( &p->vBots );
139// Vec_VecFreeP( (Vec_Vec_t **)&p->vCuts );
140
141 if ( p->pMatrix )
142 Llb_MtrFree( p->pMatrix );
143 Vec_PtrForEachEntry( Llb_Grp_t *, p->vGroups, pGrp, i )
144 Llb_ManGroupStop( pGrp );
145 if ( p->dd )
146 {
147// printf( "Manager dd\n" );
148 Extra_StopManager( p->dd );
149 }
150 if ( p->ddG )
151 {
152// printf( "Manager ddG\n" );
153 if ( p->ddG->bFunc )
154 Cudd_RecursiveDeref( p->ddG, p->ddG->bFunc );
155 Extra_StopManager( p->ddG );
156 }
157 if ( p->ddR )
158 {
159// printf( "Manager ddR\n" );
160 if ( p->ddR->bFunc )
161 Cudd_RecursiveDeref( p->ddR, p->ddR->bFunc );
162 Vec_PtrForEachEntry( DdNode *, p->vRings, bTemp, i )
163 Cudd_RecursiveDeref( p->ddR, bTemp );
164 Extra_StopManager( p->ddR );
165 }
166 Aig_ManStop( p->pAig );
167 Vec_PtrFreeP( &p->vGroups );
168 Vec_IntFreeP( &p->vVar2Obj );
169 Vec_IntFreeP( &p->vObj2Var );
170 Vec_IntFreeP( &p->vVarBegs );
171 Vec_IntFreeP( &p->vVarEnds );
172 Vec_PtrFreeP( &p->vRings );
173 Vec_IntFreeP( &p->vNs2Glo );
174 Vec_IntFreeP( &p->vCs2Glo );
175 Vec_IntFreeP( &p->vGlo2Cs );
176 Vec_IntFreeP( &p->vGlo2Ns );
177// Vec_IntFreeP( &p->vHints );
178 ABC_FREE( p );
179}
void Aig_ManStop(Aig_Man_t *p)
Definition aigMan.c:187
void Llb_ManGroupStop(Llb_Grp_t *p)
Definition llb1Group.c:68
void Llb_MtrFree(Llb_Mtr_t *p)
Definition llb1Matrix.c:321
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Llb_ManTracePaths()

int Llb_ManTracePaths ( Aig_Man_t * p,
Aig_Obj_t * pPivot )
extern

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 81 of file llb1Pivot.c.

82{
83 Aig_Obj_t * pObj;
84 int i, Counter = 0;
85 Aig_ManIncrementTravId( p ); // prev = visited with path to LI (value 0)
86 Aig_ManIncrementTravId( p ); // cur = visited w/o path to LI (value 1)
87 Saig_ManForEachLo( p, pObj, i )
88 Counter += Llb_ManTracePaths_rec( p, pObj, pPivot );
89 return Counter;
90}
ABC_NAMESPACE_IMPL_START int Llb_ManTracePaths_rec(Aig_Man_t *p, Aig_Obj_t *pObj, Aig_Obj_t *pPivot)
DECLARATIONS ///.
Definition llb1Pivot.c:45
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Llb_MtrCreate()

Llb_Mtr_t * Llb_MtrCreate ( Llb_Man_t * p)
extern

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

Synopsis [Matrix reduce.]

Description []

SideEffects []

SeeAlso []

Definition at line 410 of file llb1Matrix.c.

411{
412 Llb_Mtr_t * pMatrix;
413 Llb_Grp_t * pGroup;
414 int i;
415 pMatrix = Llb_MtrAlloc( Saig_ManPiNum(p->pAig), Saig_ManRegNum(p->pAig),
416 Vec_PtrSize(p->vGroups), Vec_IntSize(p->vVar2Obj) );
417 Vec_PtrForEachEntry( Llb_Grp_t *, p->vGroups, pGroup, i )
418 Llb_MtrAddColumn( pMatrix, pGroup );
419// Llb_MtrRemoveSingletonRows( pMatrix );
420 return pMatrix;
421}
void Llb_MtrAddColumn(Llb_Mtr_t *p, Llb_Grp_t *pGrp)
Definition llb1Matrix.c:346
Llb_Mtr_t * Llb_MtrAlloc(int nPis, int nFfs, int nCols, int nRows)
Definition llb1Matrix.c:289
struct Llb_Mtr_t_ Llb_Mtr_t
Definition llbInt.h:48
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Llb_MtrFree()

void Llb_MtrFree ( Llb_Mtr_t * p)
extern

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

Synopsis [Stops the matrix representation.]

Description []

SideEffects []

SeeAlso []

Definition at line 321 of file llb1Matrix.c.

322{
323 int i;
324 ABC_FREE( p->pProdVars );
325 ABC_FREE( p->pProdNums );
326 for ( i = 0; i < p->nCols; i++ )
327 ABC_FREE( p->pMatrix[i] );
328 ABC_FREE( p->pRowSums );
329 ABC_FREE( p->pColSums );
330 ABC_FREE( p->pMatrix );
331 ABC_FREE( p->pColGrps );
332 ABC_FREE( p );
333}
Here is the caller graph for this function:

◆ Llb_MtrPrint()

void Llb_MtrPrint ( Llb_Mtr_t * p,
int fOrder )
extern

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

Synopsis [Creates one column with vars in the array.]

Description []

SideEffects []

SeeAlso []

Definition at line 206 of file llb1Matrix.c.

207{
208 int * pOrder = NULL;
209 int i, iRow, iCol;
210 if ( fOrder )
211 pOrder = Llb_MtrFindVarOrder( p );
212 for ( i = 0; i < p->nRows; i++ )
213 {
214 iRow = pOrder ? pOrder[i] : i;
215 printf( "%3d : ", iRow );
216 printf( "%3d ", p->pRowSums[iRow] );
217 printf( "%3s ", Llb_MtrVarName(p, iRow) );
218 for ( iCol = 0; iCol < p->nCols; iCol++ )
219 printf( "%c", p->pMatrix[iCol][iRow] ? '*' : ' ' );
220 printf( "\n" );
221 }
222 ABC_FREE( pOrder );
223}
char * Llb_MtrVarName(Llb_Mtr_t *p, int iVar)
Definition llb1Matrix.c:181
int * Llb_MtrFindVarOrder(Llb_Mtr_t *p)
Definition llb1Matrix.c:132
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Llb_MtrPrintMatrixStats()

void Llb_MtrPrintMatrixStats ( Llb_Mtr_t * p)
extern

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

Synopsis [Verify columns.]

Description []

SideEffects []

SeeAlso []

Definition at line 236 of file llb1Matrix.c.

237{
238 int iVar, iGrp, iGrp1, iGrp2, Span = 0, nCutSize = 0, nCutSizeMax = 0;
239 int * pGrp1 = ABC_CALLOC( int, p->nRows );
240 int * pGrp2 = ABC_CALLOC( int, p->nRows );
241 for ( iVar = 0; iVar < p->nRows; iVar++ )
242 {
243 if ( p->pRowSums[iVar] == 0 )
244 continue;
245 for ( iGrp1 = 0; iGrp1 < p->nCols; iGrp1++ )
246 if ( p->pMatrix[iGrp1][iVar] == 1 )
247 break;
248 for ( iGrp2 = p->nCols - 1; iGrp2 >= 0; iGrp2-- )
249 if ( p->pMatrix[iGrp2][iVar] == 1 )
250 break;
251 assert( iGrp1 <= iGrp2 );
252 pGrp1[iVar] = iGrp1;
253 pGrp2[iVar] = iGrp2;
254 Span += iGrp2 - iGrp1;
255 }
256 // compute span
257 for ( iGrp = 0; iGrp < p->nCols; iGrp++ )
258 {
259 for ( iVar = 0; iVar < p->nRows; iVar++ )
260 if ( pGrp1[iVar] == iGrp )
261 nCutSize++;
262 if ( nCutSizeMax < nCutSize )
263 nCutSizeMax = nCutSize;
264 for ( iVar = 0; iVar < p->nRows; iVar++ )
265 if ( pGrp2[iVar] == iGrp )
266 nCutSize--;
267 }
268 ABC_FREE( pGrp1 );
269 ABC_FREE( pGrp2 );
270 printf( "[%4d x %4d] Life-span =%6.2f Max-cut =%5d\n",
271 p->nCols, p->nRows, 1.0*Span/p->nRows, nCutSizeMax );
272 if ( nCutSize )
273 Abc_Print( -1, "Cut size is not zero (%d).\n", nCutSize );
274}
Here is the caller graph for this function:

◆ Llb_MtrSchedule()

void Llb_MtrSchedule ( Llb_Mtr_t * p)
extern

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

Synopsis [Matrix reduce.]

Description []

SideEffects []

SeeAlso []

Definition at line 222 of file llb1Sched.c.

223{
224 int iGrp, iGrpBest, i;
225 // start partial product
226 for ( i = 0; i < p->nRows; i++ )
227 {
228 if ( i >= p->nPis && i < p->nPis + p->nFfs )
229 {
230 p->pProdVars[i] = 1;
231 p->pProdNums[i] = p->pRowSums[i] - 1;
232 }
233 else
234 {
235 p->pProdVars[i] = 0;
236 p->pProdNums[i] = p->pRowSums[i];
237 }
238 }
239 // order the partitions
241 for ( iGrp = 1; iGrp < p->nCols-1; iGrp++ )
242 {
243 Llb_MtrVerifyColumns( p, iGrp );
244 iGrpBest = Llb_MtrFindBestColumn( p, iGrp );
245 Llb_MtrUseSelectedColumn( p, iGrpBest );
246 Llb_MtrSwapColumns( p, iGrp, iGrpBest );
247 }
249}
void Llb_MtrUseSelectedColumn(Llb_Mtr_t *p, int iCol)
Definition llb1Sched.c:157
ABC_NAMESPACE_IMPL_START void Llb_MtrSwapColumns(Llb_Mtr_t *p, int iCol1, int iCol2)
DECLARATIONS ///.
Definition llb1Sched.c:45
int Llb_MtrFindBestColumn(Llb_Mtr_t *p, int iGrpStart)
Definition llb1Sched.c:80
void Llb_MtrVerifyColumns(Llb_Mtr_t *p, int iGrpStart)
Definition llb1Sched.c:194
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Llb_MtrVerifyMatrix()

void Llb_MtrVerifyMatrix ( Llb_Mtr_t * p)
extern

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

Synopsis [Verify columns.]

Description []

SideEffects []

SeeAlso []

Definition at line 115 of file llb1Matrix.c.

116{
119}
ABC_NAMESPACE_IMPL_START void Llb_MtrVerifyRowsAll(Llb_Mtr_t *p)
DECLARATIONS ///.
Definition llb1Matrix.c:67
void Llb_MtrVerifyColumnsAll(Llb_Mtr_t *p)
Definition llb1Matrix.c:91
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Llb_Nonlin4Group()

Vec_Ptr_t * Llb_Nonlin4Group ( DdManager * dd,
Vec_Ptr_t * vParts,
Vec_Int_t * vVars2Q,
int nSizeMax )
extern

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 806 of file llb4Image.c.

807{
808 Vec_Ptr_t * vGroups;
809 Llb_Prt_t * pPart, * pPart1, * pPart2;
810 Llb_Mgr_t * p;
811 int i, nReorders;//, clk = Abc_Clock();
812 // start the manager
813 p = Llb_Nonlin4Alloc( dd, vParts, NULL, vVars2Q, nSizeMax );
814 // remove singles
815 Llb_MgrForEachPart( p, pPart, i )
816 if ( Llb_Nonlin4HasSingletonVars(p, pPart) )
817 Llb_Nonlin4Quantify1( p, pPart );
818 // compute scores
820 // iteratively quantify variables
821 while ( Llb_Nonlin4NextPartitions(p, &pPart1, &pPart2) )
822 {
823 nReorders = Cudd_ReadReorderings(dd);
824 if ( !Llb_Nonlin4Quantify2( p, pPart1, pPart2 ) )
825 {
827 return NULL;
828 }
829 if ( nReorders < Cudd_ReadReorderings(dd) )
831// else
832// Llb_Nonlin4VerifyScores( p );
833 }
834 // load partitions
835 vGroups = Vec_PtrAlloc( 1000 );
836 Llb_MgrForEachPart( p, pPart, i )
837 {
838//printf( "Iteration %d ", pPart->iPart );
839 if ( Cudd_IsConstant(pPart->bFunc) )
840 {
841//printf( "Constant\n" );
842 assert( !Cudd_IsComplement(pPart->bFunc) );
843 continue;
844 }
845//printf( "\n" );
846 Vec_PtrPush( vGroups, pPart->bFunc );
847 Cudd_Ref( pPart->bFunc );
848//printf( "Part %d ", pPart->iPart );
849//Extra_bddPrintSupport( p->dd, pPart->bFunc ); printf( "\n" );
850 }
852//Abc_PrintTime( 1, "Reparametrization time", Abc_Clock() - clk );
853 return vGroups;
854}
struct Llb_Mgr_t_ Llb_Mgr_t
Definition llb3Image.c:46
struct Llb_Prt_t_ Llb_Prt_t
Definition llb3Image.c:37
int Llb_Nonlin4NextPartitions(Llb_Mgr_t *p, Llb_Prt_t **ppPart1, Llb_Prt_t **ppPart2)
Definition llb4Image.c:585
int Llb_Nonlin4Quantify2(Llb_Mgr_t *p, Llb_Prt_t *pPart1, Llb_Prt_t *pPart2)
Definition llb4Image.c:320
void Llb_Nonlin4RecomputeScores(Llb_Mgr_t *p)
Definition llb4Image.c:639
int Llb_Nonlin4HasSingletonVars(Llb_Mgr_t *p, Llb_Prt_t *pPart)
Definition llb4Image.c:207
#define Llb_MgrForEachPart(p, pPart, i)
Definition llb4Image.c:69
int Llb_Nonlin4Quantify1(Llb_Mgr_t *p, Llb_Prt_t *pPart)
Definition llb4Image.c:261
Llb_Mgr_t * Llb_Nonlin4Alloc(DdManager *dd, Vec_Ptr_t *vParts, DdNode *bCurrent, Vec_Int_t *vVars2Q, int nSizeMax)
Definition llb4Image.c:692
void Llb_Nonlin4Free(Llb_Mgr_t *p)
Definition llb4Image.c:726
DdNode * bFunc
Definition llb3Image.c:42
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Llb_Nonlin4Image()

DdNode * Llb_Nonlin4Image ( DdManager * dd,
Vec_Ptr_t * vParts,
DdNode * bCurrent,
Vec_Int_t * vVars2Q )
extern

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 752 of file llb4Image.c.

753{
754 Llb_Prt_t * pPart, * pPart1, * pPart2;
755 Llb_Mgr_t * p;
756 DdNode * bFunc, * bTemp;
757 int i, nReorders;
758 // start the manager
759 p = Llb_Nonlin4Alloc( dd, vParts, bCurrent, vVars2Q, 0 );
760 // remove singles
761 Llb_MgrForEachPart( p, pPart, i )
762 if ( Llb_Nonlin4HasSingletonVars(p, pPart) )
763 Llb_Nonlin4Quantify1( p, pPart );
764 // compute scores
766 // iteratively quantify variables
767 while ( Llb_Nonlin4NextPartitions(p, &pPart1, &pPart2) )
768 {
769 nReorders = Cudd_ReadReorderings(dd);
770 if ( !Llb_Nonlin4Quantify2( p, pPart1, pPart2 ) )
771 {
773 return NULL;
774 }
775 if ( nReorders < Cudd_ReadReorderings(dd) )
777// else
778// Llb_Nonlin4VerifyScores( p );
779 }
780 // load partitions
781 bFunc = Cudd_ReadOne(p->dd); Cudd_Ref( bFunc );
782 Llb_MgrForEachPart( p, pPart, i )
783 {
784 bFunc = Cudd_bddAnd( p->dd, bTemp = bFunc, pPart->bFunc ); Cudd_Ref( bFunc );
785 Cudd_RecursiveDeref( p->dd, bTemp );
786 }
787// nSuppMax = p->nSuppMax;
789//printf( "\n" );
790 // return
791 Cudd_Deref( bFunc );
792 return bFunc;
793}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Llb_NonlinComputeInitState()

DdNode * Llb_NonlinComputeInitState ( Aig_Man_t * pAig,
DdManager * dd )
extern

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 214 of file llb3Nonlin.c.

215{
216 Aig_Obj_t * pObj;
217 DdNode * bRes, * bVar, * bTemp;
218 int i, iVar;
219 abctime TimeStop;
220 TimeStop = dd->TimeStop; dd->TimeStop = 0;
221 bRes = Cudd_ReadOne( dd ); Cudd_Ref( bRes );
222 Saig_ManForEachLo( pAig, pObj, i )
223 {
224 iVar = (Cudd_ReadSize(dd) == Aig_ManRegNum(pAig)) ? i : Aig_ObjId(pObj);
225 bVar = Cudd_bddIthVar( dd, iVar );
226 bRes = Cudd_bddAnd( dd, bTemp = bRes, Cudd_Not(bVar) ); Cudd_Ref( bRes );
227 Cudd_RecursiveDeref( dd, bTemp );
228 }
229 Cudd_Deref( bRes );
230 dd->TimeStop = TimeStop;
231 return bRes;
232}
Here is the caller graph for this function:

◆ Llb_NonlinImage()

DdNode * Llb_NonlinImage ( Aig_Man_t * pAig,
Vec_Ptr_t * vLeaves,
Vec_Ptr_t * vRoots,
int * pVars2Q,
DdManager * dd,
DdNode * bCurrent,
int fReorder,
int fVerbose,
int * pOrder )
extern

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

Synopsis [Performs image computation.]

Description [Computes image of BDDs (vFuncs).]

SideEffects [BDDs in vFuncs are derefed inside. The result is refed.]

SeeAlso []

Definition at line 884 of file llb3Image.c.

886{
887 Llb_Prt_t * pPart, * pPart1, * pPart2;
888 Llb_Mgr_t * p;
889 DdNode * bFunc, * bTemp;
890 int i, nReorders, timeInside;
891 abctime clk = Abc_Clock(), clk2;
892 // start the manager
893 clk2 = Abc_Clock();
894 p = Llb_NonlinAlloc( pAig, vLeaves, vRoots, pVars2Q, dd );
895 if ( !Llb_NonlinStart( p ) )
896 {
897 Llb_NonlinFree( p );
898 return NULL;
899 }
900 // add partition
901 Llb_NonlinAddPartition( p, p->iPartFree++, bCurrent );
902 // remove singles
903 Llb_MgrForEachPart( p, pPart, i )
904 if ( Llb_NonlinHasSingletonVars(p, pPart) )
905 Llb_NonlinQuantify1( p, pPart, 0 );
906 timeBuild += Abc_Clock() - clk2;
907 timeInside = Abc_Clock() - clk2;
908 // compute scores
910 // save permutation
911 if ( pOrder )
912 memcpy( pOrder, dd->invperm, sizeof(int) * dd->size );
913 // iteratively quantify variables
914 while ( Llb_NonlinNextPartitions(p, &pPart1, &pPart2) )
915 {
916 clk2 = Abc_Clock();
917 nReorders = Cudd_ReadReorderings(dd);
918 if ( !Llb_NonlinQuantify2( p, pPart1, pPart2 ) )
919 {
920 Llb_NonlinFree( p );
921 return NULL;
922 }
923 timeAndEx += Abc_Clock() - clk2;
924 timeInside += Abc_Clock() - clk2;
925 if ( nReorders < Cudd_ReadReorderings(dd) )
927// else
928// Llb_NonlinVerifyScores( p );
929 }
930 // load partitions
931 bFunc = Cudd_ReadOne(p->dd); Cudd_Ref( bFunc );
932 Llb_MgrForEachPart( p, pPart, i )
933 {
934 bFunc = Cudd_bddAnd( p->dd, bTemp = bFunc, pPart->bFunc ); Cudd_Ref( bFunc );
935 Cudd_RecursiveDeref( p->dd, bTemp );
936 }
937 nSuppMax = p->nSuppMax;
938 Llb_NonlinFree( p );
939 // reorder variables
940 if ( fReorder )
941 Llb_NonlinReorder( dd, 0, fVerbose );
942 timeOther += Abc_Clock() - clk - timeInside;
943 // return
944 Cudd_Deref( bFunc );
945 return bFunc;
946}
int Llb_NonlinQuantify1(Llb_Mgr_t *p, Llb_Prt_t *pPart, int fSubset)
Definition llb3Image.c:262
abctime timeOther
Definition llb3Image.c:82
abctime timeAndEx
Definition llb3Image.c:82
int Llb_NonlinHasSingletonVars(Llb_Mgr_t *p, Llb_Prt_t *pPart)
Definition llb3Image.c:208
void Llb_NonlinReorder(DdManager *dd, int fTwice, int fVerbose)
Definition llb3Image.c:748
#define Llb_MgrForEachPart(p, pPart, i)
Definition llb3Image.c:71
void Llb_NonlinAddPartition(Llb_Mgr_t *p, int i, DdNode *bFunc)
Definition llb3Image.c:628
void Llb_NonlinRecomputeScores(Llb_Mgr_t *p)
Definition llb3Image.c:777
abctime timeBuild
Definition llb3Image.c:82
void Llb_NonlinFree(Llb_Mgr_t *p)
Definition llb3Image.c:858
Llb_Mgr_t * Llb_NonlinAlloc(Aig_Man_t *pAig, Vec_Ptr_t *vLeaves, Vec_Ptr_t *vRoots, int *pVars2Q, DdManager *dd)
Definition llb3Image.c:830
int Llb_NonlinQuantify2(Llb_Mgr_t *p, Llb_Prt_t *pPart1, Llb_Prt_t *pPart2)
Definition llb3Image.c:342
int nSuppMax
Definition llb3Image.c:83
int Llb_NonlinNextPartitions(Llb_Mgr_t *p, Llb_Prt_t **ppPart1, Llb_Prt_t **ppPart2)
Definition llb3Image.c:705
int Llb_NonlinStart(Llb_Mgr_t *p)
Definition llb3Image.c:660
char * memcpy()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Llb_NonlinImageCompute()

DdNode * Llb_NonlinImageCompute ( DdNode * bCurrent,
int fReorder,
int fDrop,
int fVerbose,
int * pOrder )
extern

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

Synopsis [Performs image computation.]

Description []

SideEffects []

SeeAlso []

Definition at line 999 of file llb3Image.c.

1000{
1001 Llb_Prt_t * pPart, * pPart1, * pPart2;
1002 DdNode * bFunc, * bTemp;
1003 int i, nReorders, timeInside = 0;
1004 abctime clk = Abc_Clock(), clk2;
1005
1006 // add partition
1007 Llb_NonlinAddPartition( p, p->iPartFree++, bCurrent );
1008 // remove singles
1009 Llb_MgrForEachPart( p, pPart, i )
1010 if ( Llb_NonlinHasSingletonVars(p, pPart) )
1011 Llb_NonlinQuantify1( p, pPart, 0 );
1012 // reorder
1013 if ( fReorder )
1014 Llb_NonlinReorder( p->dd, 0, 0 );
1015 // save permutation
1016 memcpy( pOrder, p->dd->invperm, sizeof(int) * p->dd->size );
1017
1018 // compute scores
1020 // iteratively quantify variables
1021 while ( Llb_NonlinNextPartitions(p, &pPart1, &pPart2) )
1022 {
1023 clk2 = Abc_Clock();
1024 nReorders = Cudd_ReadReorderings(p->dd);
1025 if ( !Llb_NonlinQuantify2( p, pPart1, pPart2 ) )
1026 {
1027 Llb_NonlinFree( p );
1028 return NULL;
1029 }
1030 timeAndEx += Abc_Clock() - clk2;
1031 timeInside += Abc_Clock() - clk2;
1032 if ( nReorders < Cudd_ReadReorderings(p->dd) )
1034// else
1035// Llb_NonlinVerifyScores( p );
1036 }
1037 // load partitions
1038 bFunc = Cudd_ReadOne(p->dd); Cudd_Ref( bFunc );
1039 Llb_MgrForEachPart( p, pPart, i )
1040 {
1041 bFunc = Cudd_bddAnd( p->dd, bTemp = bFunc, pPart->bFunc );
1042 if ( bFunc == NULL )
1043 {
1044 Cudd_RecursiveDeref( p->dd, bTemp );
1045 Llb_NonlinFree( p );
1046 return NULL;
1047 }
1048 Cudd_Ref( bFunc );
1049 Cudd_RecursiveDeref( p->dd, bTemp );
1050 }
1051 nSuppMax = p->nSuppMax;
1052 // reorder variables
1053// if ( fReorder )
1054// Llb_NonlinReorder( p->dd, 0, fVerbose );
1055 // save permutation
1056// memcpy( pOrder, p->dd->invperm, sizeof(int) * Cudd_ReadSize(p->dd) );
1057
1058 timeOther += Abc_Clock() - clk - timeInside;
1059 // return
1060 Cudd_Deref( bFunc );
1061 return bFunc;
1062}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Llb_NonlinImageQuit()

void Llb_NonlinImageQuit ( )
extern

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

Synopsis [Quits image computation manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 1075 of file llb3Image.c.

1076{
1077 DdManager * dd;
1078 if ( p == NULL )
1079 return;
1080 dd = p->dd;
1081 Llb_NonlinFree( p );
1082 if ( dd->bFunc )
1083 Cudd_RecursiveDeref( dd, dd->bFunc );
1084 Extra_StopManager( dd );
1085// Cudd_Quit ( dd );
1086 p = NULL;
1087}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Llb_NonlinImageStart()

DdManager * Llb_NonlinImageStart ( Aig_Man_t * pAig,
Vec_Ptr_t * vLeaves,
Vec_Ptr_t * vRoots,
int * pVars2Q,
int * pOrder,
int fFirst,
abctime TimeTarget )
extern

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

Synopsis [Starts image computation manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 963 of file llb3Image.c.

964{
965 DdManager * dd;
966 abctime clk = Abc_Clock();
967 assert( p == NULL );
968 // start a new manager (disable reordering)
969 dd = Cudd_Init( Aig_ManObjNumMax(pAig), 0, CUDD_UNIQUE_SLOTS, CUDD_CACHE_SLOTS, 0 );
970 dd->TimeStop = TimeTarget;
971 Cudd_ShuffleHeap( dd, pOrder );
972// if ( fFirst )
973 Cudd_AutodynEnable( dd, CUDD_REORDER_SYMM_SIFT );
974 // start the manager
975 p = Llb_NonlinAlloc( pAig, vLeaves, vRoots, pVars2Q, dd );
976 if ( !Llb_NonlinStart( p ) )
977 {
978 Llb_NonlinFree( p );
979 p = NULL;
980 return NULL;
981 }
982 timeBuild += Abc_Clock() - clk;
983// if ( !fFirst )
984// Cudd_AutodynEnable( dd, CUDD_REORDER_SYMM_SIFT );
985 return dd;
986}
Here is the call graph for this function:
Here is the caller graph for this function: