abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
fraBmc.c File Reference
#include "fra.h"

Go to the source code of this file.

Data Structures

struct  Fra_Bmc_t_
 DECLARATIONS ///. More...
 

Functions

static Aig_Obj_tBmc_ObjFrames (Aig_Obj_t *pObj, int i)
 
static void Bmc_ObjSetFrames (Aig_Obj_t *pObj, int i, Aig_Obj_t *pNode)
 
static Aig_Obj_tBmc_ObjFraig (Aig_Obj_t *pObj)
 
static void Bmc_ObjSetFraig (Aig_Obj_t *pObj, Aig_Obj_t *pNode)
 
static Aig_Obj_tBmc_ObjChild0Frames (Aig_Obj_t *pObj, int i)
 
static Aig_Obj_tBmc_ObjChild1Frames (Aig_Obj_t *pObj, int i)
 
int Fra_BmcNodesAreEqual (Aig_Obj_t *pObj0, Aig_Obj_t *pObj1)
 FUNCTION DEFINITIONS ///. More...
 
int Fra_BmcNodeIsConst (Aig_Obj_t *pObj)
 
void Fra_BmcFilterImplications (Fra_Man_t *p, Fra_Bmc_t *pBmc)
 
Fra_Bmc_tFra_BmcStart (Aig_Man_t *pAig, int nPref, int nDepth)
 
void Fra_BmcStop (Fra_Bmc_t *p)
 
Aig_Man_tFra_BmcFrames (Fra_Bmc_t *p, int fKeepPos)
 
void Fra_BmcPerform (Fra_Man_t *p, int nPref, int nDepth)
 
void Fra_BmcPerformSimple (Aig_Man_t *pAig, int nFrames, int nBTLimit, int fRewrite, int fVerbose)
 

Function Documentation

static Aig_Obj_t* Bmc_ObjChild0Frames ( Aig_Obj_t pObj,
int  i 
)
inlinestatic

Definition at line 54 of file fraBmc.c.

54 { assert( !Aig_IsComplement(pObj) ); return Aig_ObjFanin0(pObj)? Aig_NotCond(Bmc_ObjFrames(Aig_ObjFanin0(pObj),i), Aig_ObjFaninC0(pObj)) : NULL; }
static Aig_Obj_t * Aig_ObjFanin0(Aig_Obj_t *pObj)
Definition: aig.h:308
static int Aig_IsComplement(Aig_Obj_t *p)
Definition: aig.h:249
static Aig_Obj_t * Bmc_ObjFrames(Aig_Obj_t *pObj, int i)
Definition: fraBmc.c:48
static int Aig_ObjFaninC0(Aig_Obj_t *pObj)
Definition: aig.h:306
#define assert(ex)
Definition: util_old.h:213
static Aig_Obj_t * Aig_NotCond(Aig_Obj_t *p, int c)
Definition: aig.h:248
static Aig_Obj_t* Bmc_ObjChild1Frames ( Aig_Obj_t pObj,
int  i 
)
inlinestatic

Definition at line 55 of file fraBmc.c.

55 { assert( !Aig_IsComplement(pObj) ); return Aig_ObjFanin1(pObj)? Aig_NotCond(Bmc_ObjFrames(Aig_ObjFanin1(pObj),i), Aig_ObjFaninC1(pObj)) : NULL; }
static int Aig_IsComplement(Aig_Obj_t *p)
Definition: aig.h:249
static Aig_Obj_t * Aig_ObjFanin1(Aig_Obj_t *pObj)
Definition: aig.h:309
static Aig_Obj_t * Bmc_ObjFrames(Aig_Obj_t *pObj, int i)
Definition: fraBmc.c:48
static int Aig_ObjFaninC1(Aig_Obj_t *pObj)
Definition: aig.h:307
#define assert(ex)
Definition: util_old.h:213
static Aig_Obj_t * Aig_NotCond(Aig_Obj_t *p, int c)
Definition: aig.h:248
static Aig_Obj_t* Bmc_ObjFraig ( Aig_Obj_t pObj)
inlinestatic

Definition at line 51 of file fraBmc.c.

51 { return ((Fra_Man_t *)pObj->pData)->pBmc->pObjToFraig[pObj->Id]; }
void * pData
Definition: aig.h:87
int Id
Definition: aig.h:85
static Aig_Obj_t* Bmc_ObjFrames ( Aig_Obj_t pObj,
int  i 
)
inlinestatic

Definition at line 48 of file fraBmc.c.

48 { return ((Fra_Man_t *)pObj->pData)->pBmc->pObjToFrames[((Fra_Man_t *)pObj->pData)->pBmc->nFramesAll*pObj->Id + i]; }
void * pData
Definition: aig.h:87
int Id
Definition: aig.h:85
static void Bmc_ObjSetFraig ( Aig_Obj_t pObj,
Aig_Obj_t pNode 
)
inlinestatic

Definition at line 52 of file fraBmc.c.

52 { ((Fra_Man_t *)pObj->pData)->pBmc->pObjToFraig[pObj->Id] = pNode; }
void * pData
Definition: aig.h:87
int Id
Definition: aig.h:85
static void Bmc_ObjSetFrames ( Aig_Obj_t pObj,
int  i,
Aig_Obj_t pNode 
)
inlinestatic

Definition at line 49 of file fraBmc.c.

49 { ((Fra_Man_t *)pObj->pData)->pBmc->pObjToFrames[((Fra_Man_t *)pObj->pData)->pBmc->nFramesAll*pObj->Id + i] = pNode; }
void * pData
Definition: aig.h:87
int Id
Definition: aig.h:85
void Fra_BmcFilterImplications ( Fra_Man_t p,
Fra_Bmc_t pBmc 
)

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

Synopsis [Refines implications using BMC.]

Description [The input is the combinational FRAIG manager, which is used to FRAIG the timeframes. ]

SideEffects []

SeeAlso []

Definition at line 121 of file fraBmc.c.

122 {
123  Aig_Obj_t * pLeft, * pRight;
124  Aig_Obj_t * pLeftT, * pRightT;
125  Aig_Obj_t * pLeftF, * pRightF;
126  int i, f, Imp, Left, Right;
127  int fComplL, fComplR;
128  assert( p->nFramesAll == 1 );
129  assert( p->pManAig == pBmc->pAigFrames );
130  Vec_IntForEachEntry( pBmc->vImps, Imp, i )
131  {
132  if ( Imp == 0 )
133  continue;
134  Left = Fra_ImpLeft(Imp);
135  Right = Fra_ImpRight(Imp);
136  // get the corresponding nodes
137  pLeft = Aig_ManObj( pBmc->pAig, Left );
138  pRight = Aig_ManObj( pBmc->pAig, Right );
139  // iterate through the timeframes
140  for ( f = pBmc->nPref; f < pBmc->nFramesAll; f++ )
141  {
142  // get timeframe nodes
143  pLeftT = Bmc_ObjFrames( pLeft, f );
144  pRightT = Bmc_ObjFrames( pRight, f );
145  // get the corresponding FRAIG nodes
146  pLeftF = Fra_ObjFraig( Aig_Regular(pLeftT), 0 );
147  pRightF = Fra_ObjFraig( Aig_Regular(pRightT), 0 );
148  // get the complemented attributes
149  fComplL = pLeft->fPhase ^ Aig_IsComplement(pLeftF) ^ Aig_IsComplement(pLeftT);
150  fComplR = pRight->fPhase ^ Aig_IsComplement(pRightF) ^ Aig_IsComplement(pRightT);
151  // check equality
152  if ( Aig_Regular(pLeftF) == Aig_Regular(pRightF) )
153  {
154  if ( fComplL == fComplR ) // x => x - always true
155  continue;
156  assert( fComplL != fComplR );
157  // consider 4 possibilities:
158  // NOT(1) => 1 or 0 => 1 - always true
159  // 1 => NOT(1) or 1 => 0 - never true
160  // NOT(x) => x or x - not always true
161  // x => NOT(x) or NOT(x) - not always true
162  if ( Aig_ObjIsConst1(Aig_Regular(pLeftF)) && fComplL ) // proved implication
163  continue;
164  // disproved implication
165  Vec_IntWriteEntry( pBmc->vImps, i, 0 );
166  break;
167  }
168  // check the implication
169  if ( Fra_NodesAreImp( p, Aig_Regular(pLeftF), Aig_Regular(pRightF), fComplL, fComplR ) != 1 )
170  {
171  Vec_IntWriteEntry( pBmc->vImps, i, 0 );
172  break;
173  }
174  }
175  }
176  Fra_ImpCompactArray( pBmc->vImps );
177 }
Aig_Man_t * pAig
Definition: fraBmc.c:40
Aig_Man_t * pManAig
Definition: fra.h:191
Vec_Int_t * vImps
Definition: fraBmc.c:38
void Fra_ImpCompactArray(Vec_Int_t *vImps)
Definition: fraImp.c:607
static int Aig_IsComplement(Aig_Obj_t *p)
Definition: aig.h:249
static Aig_Obj_t * Aig_Regular(Aig_Obj_t *p)
Definition: aig.h:246
static Aig_Obj_t * Aig_ManObj(Aig_Man_t *p, int i)
Definition: aig.h:270
int nFramesAll
Definition: fra.h:194
static void Vec_IntWriteEntry(Vec_Int_t *p, int i, int Entry)
Definition: bblif.c:285
static Aig_Obj_t * Fra_ObjFraig(Aig_Obj_t *pObj, int i)
Definition: fra.h:260
static Aig_Obj_t * Bmc_ObjFrames(Aig_Obj_t *pObj, int i)
Definition: fraBmc.c:48
static int Aig_ObjIsConst1(Aig_Obj_t *pObj)
Definition: aig.h:274
Definition: aig.h:69
unsigned int fPhase
Definition: aig.h:78
static int Fra_ImpRight(int Imp)
Definition: fra.h:276
static int Fra_ImpLeft(int Imp)
Definition: fra.h:275
int Fra_NodesAreImp(Fra_Man_t *p, Aig_Obj_t *pOld, Aig_Obj_t *pNew, int fComplL, int fComplR)
Definition: fraSat.c:209
Aig_Man_t * pAigFrames
Definition: fraBmc.c:41
#define assert(ex)
Definition: util_old.h:213
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
Definition: vecInt.h:54
int nPref
Definition: fraBmc.c:34
Aig_Man_t* Fra_BmcFrames ( Fra_Bmc_t p,
int  fKeepPos 
)

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

Synopsis [Constructs initialized timeframes of the AIG.]

Description []

SideEffects []

SeeAlso []

Definition at line 237 of file fraBmc.c.

238 {
239  Aig_Man_t * pAigFrames;
240  Aig_Obj_t * pObj, * pObjNew;
241  Aig_Obj_t ** pLatches;
242  int i, k, f;
243 
244  // start the fraig package
245  pAigFrames = Aig_ManStart( Aig_ManObjNumMax(p->pAig) * p->nFramesAll );
246  pAigFrames->pName = Abc_UtilStrsav( p->pAig->pName );
247  pAigFrames->pSpec = Abc_UtilStrsav( p->pAig->pSpec );
248  // create PI nodes for the frames
249  for ( f = 0; f < p->nFramesAll; f++ )
250  Bmc_ObjSetFrames( Aig_ManConst1(p->pAig), f, Aig_ManConst1(pAigFrames) );
251  for ( f = 0; f < p->nFramesAll; f++ )
252  Aig_ManForEachPiSeq( p->pAig, pObj, i )
253  Bmc_ObjSetFrames( pObj, f, Aig_ObjCreateCi(pAigFrames) );
254  // set initial state for the latches
255  Aig_ManForEachLoSeq( p->pAig, pObj, i )
256  Bmc_ObjSetFrames( pObj, 0, Aig_ManConst0(pAigFrames) );
257 
258  // add timeframes
259  pLatches = ABC_ALLOC( Aig_Obj_t *, Aig_ManRegNum(p->pAig) );
260  for ( f = 0; f < p->nFramesAll; f++ )
261  {
262  // add internal nodes of this frame
263  Aig_ManForEachNode( p->pAig, pObj, i )
264  {
265  pObjNew = Aig_And( pAigFrames, Bmc_ObjChild0Frames(pObj,f), Bmc_ObjChild1Frames(pObj,f) );
266  Bmc_ObjSetFrames( pObj, f, pObjNew );
267  }
268  if ( f == p->nFramesAll - 1 )
269  break;
270  // save the latch input values
271  k = 0;
272  Aig_ManForEachLiSeq( p->pAig, pObj, i )
273  pLatches[k++] = Bmc_ObjChild0Frames(pObj,f);
274  assert( k == Aig_ManRegNum(p->pAig) );
275  // insert them to the latch output values
276  k = 0;
277  Aig_ManForEachLoSeq( p->pAig, pObj, i )
278  Bmc_ObjSetFrames( pObj, f+1, pLatches[k++] );
279  assert( k == Aig_ManRegNum(p->pAig) );
280  }
281  ABC_FREE( pLatches );
282  if ( fKeepPos )
283  {
284  for ( f = 0; f < p->nFramesAll; f++ )
285  Aig_ManForEachPoSeq( p->pAig, pObj, i )
286  Aig_ObjCreateCo( pAigFrames, Bmc_ObjChild0Frames(pObj,f) );
287  Aig_ManCleanup( pAigFrames );
288  }
289  else
290  {
291  // add POs to all the dangling nodes
292  Aig_ManForEachObj( pAigFrames, pObjNew, i )
293  if ( Aig_ObjIsNode(pObjNew) && pObjNew->nRefs == 0 )
294  Aig_ObjCreateCo( pAigFrames, pObjNew );
295  }
296  // return the new manager
297  return pAigFrames;
298 }
Aig_Obj_t * Aig_ObjCreateCo(Aig_Man_t *p, Aig_Obj_t *pDriver)
Definition: aigObj.c:66
Aig_Man_t * pAig
Definition: fraBmc.c:40
static Aig_Obj_t * Bmc_ObjChild1Frames(Aig_Obj_t *pObj, int i)
Definition: fraBmc.c:55
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Definition: aig.h:50
Aig_Man_t * Aig_ManStart(int nNodesMax)
DECLARATIONS ///.
Definition: aigMan.c:47
static Aig_Obj_t * Bmc_ObjChild0Frames(Aig_Obj_t *pObj, int i)
Definition: fraBmc.c:54
Aig_Obj_t * Aig_ObjCreateCi(Aig_Man_t *p)
DECLARATIONS ///.
Definition: aigObj.c:45
static Aig_Obj_t * Aig_ManConst0(Aig_Man_t *p)
Definition: aig.h:263
#define ABC_ALLOC(type, num)
Definition: abc_global.h:229
for(p=first;p->value< newval;p=p->next)
static void Bmc_ObjSetFrames(Aig_Obj_t *pObj, int i, Aig_Obj_t *pNode)
Definition: fraBmc.c:49
Aig_Obj_t * Aig_And(Aig_Man_t *p, Aig_Obj_t *p0, Aig_Obj_t *p1)
Definition: aigOper.c:104
static int Aig_ObjIsNode(Aig_Obj_t *pObj)
Definition: aig.h:280
#define Aig_ManForEachNode(p, pObj, i)
Definition: aig.h:413
if(last==0)
Definition: sparse_int.h:34
Definition: aig.h:69
static int Aig_ManObjNumMax(Aig_Man_t *p)
Definition: aig.h:259
static Aig_Obj_t * Aig_ManConst1(Aig_Man_t *p)
Definition: aig.h:264
static int Aig_ManRegNum(Aig_Man_t *p)
Definition: aig.h:260
#define Aig_ManForEachObj(p, pObj, i)
Definition: aig.h:403
#define ABC_FREE(obj)
Definition: abc_global.h:232
#define Aig_ManForEachLoSeq(p, pObj, i)
Definition: aig.h:441
#define assert(ex)
Definition: util_old.h:213
#define Aig_ManForEachLiSeq(p, pObj, i)
Definition: aig.h:447
#define Aig_ManForEachPoSeq(p, pObj, i)
Definition: aig.h:444
char * Abc_UtilStrsav(char *s)
Definition: starter.c:47
int Aig_ManCleanup(Aig_Man_t *p)
Definition: aigMan.c:265
#define Aig_ManForEachPiSeq(p, pObj, i)
SEQUENTIAL ITERATORS ///.
Definition: aig.h:438
int nFramesAll
Definition: fraBmc.c:36
int Fra_BmcNodeIsConst ( Aig_Obj_t pObj)

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

Synopsis [Returns 1 if the node is costant.]

Description []

SideEffects []

SeeAlso []

Definition at line 103 of file fraBmc.c.

104 {
105  Fra_Man_t * p = (Fra_Man_t *)pObj->pData;
106  return Fra_BmcNodesAreEqual( pObj, Aig_ManConst1(p->pManAig) );
107 }
Aig_Man_t * pManAig
Definition: fra.h:191
static Llb_Mgr_t * p
Definition: llb3Image.c:950
void * pData
Definition: aig.h:87
static Aig_Obj_t * Aig_ManConst1(Aig_Man_t *p)
Definition: aig.h:264
int Fra_BmcNodesAreEqual(Aig_Obj_t *pObj0, Aig_Obj_t *pObj1)
FUNCTION DEFINITIONS ///.
Definition: fraBmc.c:72
int Fra_BmcNodesAreEqual ( Aig_Obj_t pObj0,
Aig_Obj_t pObj1 
)

FUNCTION DEFINITIONS ///.

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

Synopsis [Returns 1 if the nodes are equivalent.]

Description []

SideEffects []

SeeAlso []

Definition at line 72 of file fraBmc.c.

73 {
74  Fra_Man_t * p = (Fra_Man_t *)pObj0->pData;
75  Aig_Obj_t * pObjFrames0, * pObjFrames1;
76  Aig_Obj_t * pObjFraig0, * pObjFraig1;
77  int i;
78  for ( i = p->pBmc->nPref; i < p->pBmc->nFramesAll; i++ )
79  {
80  pObjFrames0 = Aig_Regular( Bmc_ObjFrames(pObj0, i) );
81  pObjFrames1 = Aig_Regular( Bmc_ObjFrames(pObj1, i) );
82  if ( pObjFrames0 == pObjFrames1 )
83  continue;
84  pObjFraig0 = Aig_Regular( Bmc_ObjFraig(pObjFrames0) );
85  pObjFraig1 = Aig_Regular( Bmc_ObjFraig(pObjFrames1) );
86  if ( pObjFraig0 != pObjFraig1 )
87  return 0;
88  }
89  return 1;
90 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
void * pData
Definition: aig.h:87
static Aig_Obj_t * Aig_Regular(Aig_Obj_t *p)
Definition: aig.h:246
for(p=first;p->value< newval;p=p->next)
Fra_Bmc_t * pBmc
Definition: fra.h:202
static Aig_Obj_t * Bmc_ObjFrames(Aig_Obj_t *pObj, int i)
Definition: fraBmc.c:48
Definition: aig.h:69
static Aig_Obj_t * Bmc_ObjFraig(Aig_Obj_t *pObj)
Definition: fraBmc.c:51
int nPref
Definition: fraBmc.c:34
void Fra_BmcPerform ( Fra_Man_t p,
int  nPref,
int  nDepth 
)

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

Synopsis [Performs BMC for the given AIG.]

Description []

SideEffects []

SeeAlso []

Definition at line 311 of file fraBmc.c.

312 {
313  Aig_Obj_t * pObj;
314  int i, nImpsOld = 0;
315  abctime clk = Abc_Clock();
316  assert( p->pBmc == NULL );
317  // derive and fraig the frames
318  p->pBmc = Fra_BmcStart( p->pManAig, nPref, nDepth );
319  p->pBmc->pAigFrames = Fra_BmcFrames( p->pBmc, 0 );
320  // if implications are present, configure the AIG manager to check them
321  if ( p->pCla->vImps )
322  {
323  p->pBmc->pAigFrames->pImpFunc = (void (*) (void*, void*))Fra_BmcFilterImplications;
324  p->pBmc->pAigFrames->pImpData = p->pBmc;
325  p->pBmc->vImps = p->pCla->vImps;
326  nImpsOld = Vec_IntSize(p->pCla->vImps);
327  }
328  p->pBmc->pAigFraig = Fra_FraigEquivence( p->pBmc->pAigFrames, 1000000, 0 );
329  p->pBmc->pObjToFraig = p->pBmc->pAigFrames->pObjCopies;
330  p->pBmc->pAigFrames->pObjCopies = NULL;
331  // annotate frames nodes with pointers to the manager
332  Aig_ManForEachObj( p->pBmc->pAigFrames, pObj, i )
333  pObj->pData = p;
334  // report the results
335  if ( p->pPars->fVerbose )
336  {
337  printf( "Original AIG = %d. Init %d frames = %d. Fraig = %d. ",
338  Aig_ManNodeNum(p->pBmc->pAig), p->pBmc->nFramesAll,
339  Aig_ManNodeNum(p->pBmc->pAigFrames), Aig_ManNodeNum(p->pBmc->pAigFraig) );
340  ABC_PRT( "Time", Abc_Clock() - clk );
341  printf( "Before BMC: " );
342 // Fra_ClassesPrint( p->pCla, 0 );
343  printf( "Const = %5d. Class = %5d. Lit = %5d. ",
344  Vec_PtrSize(p->pCla->vClasses1), Vec_PtrSize(p->pCla->vClasses), Fra_ClassesCountLits(p->pCla) );
345  if ( p->pCla->vImps )
346  printf( "Imp = %5d. ", nImpsOld );
347  printf( "\n" );
348  }
349  // refine the classes
350  p->pCla->pFuncNodeIsConst = Fra_BmcNodeIsConst;
351  p->pCla->pFuncNodesAreEqual = Fra_BmcNodesAreEqual;
352  Fra_ClassesRefine( p->pCla );
353  Fra_ClassesRefine1( p->pCla, 1, NULL );
354  p->pCla->pFuncNodeIsConst = Fra_SmlNodeIsConst;
355  p->pCla->pFuncNodesAreEqual = Fra_SmlNodesAreEqual;
356  // report the results
357  if ( p->pPars->fVerbose )
358  {
359  printf( "After BMC: " );
360 // Fra_ClassesPrint( p->pCla, 0 );
361  printf( "Const = %5d. Class = %5d. Lit = %5d. ",
362  Vec_PtrSize(p->pCla->vClasses1), Vec_PtrSize(p->pCla->vClasses), Fra_ClassesCountLits(p->pCla) );
363  if ( p->pCla->vImps )
364  printf( "Imp = %5d. ", Vec_IntSize(p->pCla->vImps) );
365  printf( "\n" );
366  }
367  // free the BMC manager
368  Fra_BmcStop( p->pBmc );
369  p->pBmc = NULL;
370 }
int Fra_ClassesRefine1(Fra_Cla_t *p, int fRefineNewClass, int *pSkipped)
Definition: fraClass.c:527
Aig_Man_t * pManAig
Definition: fra.h:191
int Fra_SmlNodeIsConst(Aig_Obj_t *pObj)
Definition: fraSim.c:86
Vec_Int_t * vImps
Definition: fraBmc.c:38
Fra_Cla_t * pCla
Definition: fra.h:198
Aig_Man_t * Fra_FraigEquivence(Aig_Man_t *pManAig, int nConfMax, int fProve)
Definition: fraCore.c:468
int Fra_ClassesCountLits(Fra_Cla_t *p)
Definition: fraClass.c:164
void Fra_BmcFilterImplications(Fra_Man_t *p, Fra_Bmc_t *pBmc)
Definition: fraBmc.c:121
Aig_Man_t * Fra_BmcFrames(Fra_Bmc_t *p, int fKeepPos)
Definition: fraBmc.c:237
static abctime Abc_Clock()
Definition: abc_global.h:279
static int Vec_PtrSize(Vec_Ptr_t *p)
Definition: vecPtr.h:295
static int Aig_ManNodeNum(Aig_Man_t *p)
Definition: aig.h:256
Fra_Bmc_t * pBmc
Definition: fra.h:202
int Fra_BmcNodeIsConst(Aig_Obj_t *pObj)
Definition: fraBmc.c:103
Aig_Man_t * pAigFraig
Definition: fraBmc.c:42
if(last==0)
Definition: sparse_int.h:34
Definition: aig.h:69
Vec_Int_t * vImps
Definition: fra.h:163
Aig_Obj_t ** pObjToFraig
Definition: fraBmc.c:45
void Fra_BmcStop(Fra_Bmc_t *p)
Definition: fraBmc.c:216
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
Fra_Bmc_t * Fra_BmcStart(Aig_Man_t *pAig, int nPref, int nDepth)
Definition: fraBmc.c:191
#define Aig_ManForEachObj(p, pObj, i)
Definition: aig.h:403
int Fra_ClassesRefine(Fra_Cla_t *p)
Definition: fraClass.c:493
#define ABC_PRT(a, t)
Definition: abc_global.h:220
int Fra_SmlNodesAreEqual(Aig_Obj_t *pObj0, Aig_Obj_t *pObj1)
Definition: fraSim.c:109
Aig_Man_t * pAigFrames
Definition: fraBmc.c:41
#define assert(ex)
Definition: util_old.h:213
int Fra_BmcNodesAreEqual(Aig_Obj_t *pObj0, Aig_Obj_t *pObj1)
FUNCTION DEFINITIONS ///.
Definition: fraBmc.c:72
ABC_INT64_T abctime
Definition: abc_global.h:278
void Fra_BmcPerformSimple ( Aig_Man_t pAig,
int  nFrames,
int  nBTLimit,
int  fRewrite,
int  fVerbose 
)

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

Synopsis [Performs BMC for the given AIG.]

Description []

SideEffects []

SeeAlso []

Definition at line 383 of file fraBmc.c.

384 {
385  extern Fra_Man_t * Fra_LcrAigPrepare( Aig_Man_t * pAig );
386  Fra_Man_t * pTemp;
387  Fra_Bmc_t * pBmc;
388  Aig_Man_t * pAigTemp;
389  abctime clk;
390  int iOutput;
391  // derive and fraig the frames
392  clk = Abc_Clock();
393  pBmc = Fra_BmcStart( pAig, 0, nFrames );
394  pTemp = Fra_LcrAigPrepare( pAig );
395  pTemp->pBmc = pBmc;
396  pBmc->pAigFrames = Fra_BmcFrames( pBmc, 1 );
397  if ( fVerbose )
398  {
399  printf( "AIG: PI/PO/Reg = %d/%d/%d. Node = %6d. Lev = %5d.\n",
400  Aig_ManCiNum(pAig)-Aig_ManRegNum(pAig), Aig_ManCoNum(pAig)-Aig_ManRegNum(pAig), Aig_ManRegNum(pAig),
401  Aig_ManNodeNum(pAig), Aig_ManLevelNum(pAig) );
402  printf( "Time-frames (%d): PI/PO = %d/%d. Node = %6d. Lev = %5d. ",
403  nFrames, Aig_ManCiNum(pBmc->pAigFrames), Aig_ManCoNum(pBmc->pAigFrames),
405  ABC_PRT( "Time", Abc_Clock() - clk );
406  }
407  if ( fRewrite )
408  {
409  clk = Abc_Clock();
410  pBmc->pAigFrames = Dar_ManRwsat( pAigTemp = pBmc->pAigFrames, 1, 0 );
411  Aig_ManStop( pAigTemp );
412  if ( fVerbose )
413  {
414  printf( "Time-frames after rewriting: Node = %6d. Lev = %5d. ",
416  ABC_PRT( "Time", Abc_Clock() - clk );
417  }
418  }
419  clk = Abc_Clock();
420  iOutput = Fra_FraigMiterAssertedOutput( pBmc->pAigFrames );
421  if ( iOutput >= 0 )
422  pAig->pSeqModel = Abc_CexMakeTriv( Aig_ManRegNum(pAig), Aig_ManCiNum(pAig)-Aig_ManRegNum(pAig), Aig_ManCoNum(pAig)-Aig_ManRegNum(pAig), iOutput );
423  else
424  {
425  pBmc->pAigFraig = Fra_FraigEquivence( pBmc->pAigFrames, nBTLimit, 1 );
426  iOutput = Fra_FraigMiterAssertedOutput( pBmc->pAigFraig );
427  if ( pBmc->pAigFraig->pData )
428  {
429  pAig->pSeqModel = Fra_SmlCopyCounterExample( pAig, pBmc->pAigFrames, (int *)pBmc->pAigFraig->pData );
430  ABC_FREE( pBmc->pAigFraig->pData );
431  }
432  else if ( iOutput >= 0 )
433  pAig->pSeqModel = Abc_CexMakeTriv( Aig_ManRegNum(pAig), Aig_ManCiNum(pAig)-Aig_ManRegNum(pAig), Aig_ManCoNum(pAig)-Aig_ManRegNum(pAig), iOutput );
434  }
435  if ( fVerbose )
436  {
437  printf( "Fraiged init frames: Node = %6d. Lev = %5d. ",
438  pBmc->pAigFraig? Aig_ManNodeNum(pBmc->pAigFraig) : -1,
439  pBmc->pAigFraig? Aig_ManLevelNum(pBmc->pAigFraig) : -1 );
440  ABC_PRT( "Time", Abc_Clock() - clk );
441  }
442  Fra_BmcStop( pBmc );
443  ABC_FREE( pTemp );
444 }
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Definition: aig.h:50
void Aig_ManStop(Aig_Man_t *p)
Definition: aigMan.c:187
Aig_Man_t * Fra_FraigEquivence(Aig_Man_t *pManAig, int nConfMax, int fProve)
Definition: fraCore.c:468
Aig_Man_t * Fra_BmcFrames(Fra_Bmc_t *p, int fKeepPos)
Definition: fraBmc.c:237
Abc_Cex_t * Fra_SmlCopyCounterExample(Aig_Man_t *pAig, Aig_Man_t *pFrames, int *pModel)
Definition: fraSim.c:1117
static abctime Abc_Clock()
Definition: abc_global.h:279
DECLARATIONS ///.
Definition: fraBmc.c:31
ABC_NAMESPACE_IMPL_START Aig_Man_t * Dar_ManRwsat(Aig_Man_t *pAig, int fBalance, int fVerbose)
DECLARATIONS ///.
Definition: darScript.c:71
static int Aig_ManNodeNum(Aig_Man_t *p)
Definition: aig.h:256
Fra_Bmc_t * pBmc
Definition: fra.h:202
Abc_Cex_t * Abc_CexMakeTriv(int nRegs, int nTruePis, int nTruePos, int iFrameOut)
Definition: utilCex.c:85
static int Aig_ManCoNum(Aig_Man_t *p)
Definition: aig.h:252
Fra_Man_t * Fra_LcrAigPrepare(Aig_Man_t *pAig)
Definition: fraLcr.c:158
static int Aig_ManCiNum(Aig_Man_t *p)
Definition: aig.h:251
Aig_Man_t * pAigFraig
Definition: fraBmc.c:42
int Fra_FraigMiterAssertedOutput(Aig_Man_t *p)
Definition: fraCore.c:125
int Aig_ManLevelNum(Aig_Man_t *p)
Definition: aigDfs.c:486
static int Aig_ManRegNum(Aig_Man_t *p)
Definition: aig.h:260
void Fra_BmcStop(Fra_Bmc_t *p)
Definition: fraBmc.c:216
Fra_Bmc_t * Fra_BmcStart(Aig_Man_t *pAig, int nPref, int nDepth)
Definition: fraBmc.c:191
#define ABC_FREE(obj)
Definition: abc_global.h:232
#define ABC_PRT(a, t)
Definition: abc_global.h:220
Aig_Man_t * pAigFrames
Definition: fraBmc.c:41
ABC_INT64_T abctime
Definition: abc_global.h:278
Fra_Bmc_t* Fra_BmcStart ( Aig_Man_t pAig,
int  nPref,
int  nDepth 
)

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

Synopsis [Starts the BMC manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 191 of file fraBmc.c.

192 {
193  Fra_Bmc_t * p;
194  p = ABC_ALLOC( Fra_Bmc_t, 1 );
195  memset( p, 0, sizeof(Fra_Bmc_t) );
196  p->pAig = pAig;
197  p->nPref = nPref;
198  p->nDepth = nDepth;
199  p->nFramesAll = nPref + nDepth;
201  memset( p->pObjToFrames, 0, sizeof(Aig_Obj_t *) * p->nFramesAll * Aig_ManObjNumMax(pAig) );
202  return p;
203 }
char * memset()
Aig_Man_t * pAig
Definition: fraBmc.c:40
static Llb_Mgr_t * p
Definition: llb3Image.c:950
#define ABC_ALLOC(type, num)
Definition: abc_global.h:229
DECLARATIONS ///.
Definition: fraBmc.c:31
Definition: aig.h:69
static int Aig_ManObjNumMax(Aig_Man_t *p)
Definition: aig.h:259
int nDepth
Definition: fraBmc.c:35
Aig_Obj_t ** pObjToFrames
Definition: fraBmc.c:44
int nPref
Definition: fraBmc.c:34
int nFramesAll
Definition: fraBmc.c:36
void Fra_BmcStop ( Fra_Bmc_t p)

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

Synopsis [Stops the BMC manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 216 of file fraBmc.c.

217 {
218  Aig_ManStop( p->pAigFrames );
219  if ( p->pAigFraig )
220  Aig_ManStop( p->pAigFraig );
221  ABC_FREE( p->pObjToFrames );
222  ABC_FREE( p->pObjToFraig );
223  ABC_FREE( p );
224 }
void Aig_ManStop(Aig_Man_t *p)
Definition: aigMan.c:187
Aig_Man_t * pAigFraig
Definition: fraBmc.c:42
Aig_Obj_t ** pObjToFraig
Definition: fraBmc.c:45
#define ABC_FREE(obj)
Definition: abc_global.h:232
Aig_Obj_t ** pObjToFrames
Definition: fraBmc.c:44
Aig_Man_t * pAigFrames
Definition: fraBmc.c:41