abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
bmcChain.c File Reference
#include "bmc.h"
#include "aig/gia/giaAig.h"
#include "sat/cnf/cnf.h"
#include "sat/bsat/satSolver.h"

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START
Abc_Cex_t
Bmc_ChainFailOneOutput (Gia_Man_t *p, int nFrameMax, int nConfMax, int fVerbose, int fVeryVerbose)
 DECLARATIONS ///. More...
 
Gia_Man_tGia_ManDupWithInit (Gia_Man_t *p)
 
Gia_Man_tGia_ManVerifyCexAndMove (Gia_Man_t *pGia, Abc_Cex_t *p)
 
Gia_Man_tGia_ManDupPosAndPropagateInit (Gia_Man_t *p)
 
sat_solverGia_ManDeriveSatSolver (Gia_Man_t *p)
 
Vec_Int_tBmc_ChainFindFailedOutputs (Gia_Man_t *p)
 
static void Gia_ObjMakePoConst0 (Gia_Man_t *p, Gia_Obj_t *pObj)
 
int Gia_ManCountNonConst0 (Gia_Man_t *p)
 
Gia_Man_tBmc_ChainCleanup (Gia_Man_t *p, Vec_Int_t *vOutputs)
 
int Bmc_ChainTest (Gia_Man_t *p, int nFrameMax, int nConfMax, int fVerbose, int fVeryVerbose)
 

Function Documentation

Gia_Man_t* Bmc_ChainCleanup ( Gia_Man_t p,
Vec_Int_t vOutputs 
)

Definition at line 250 of file bmcChain.c.

251 {
252  int i, iOut;
253  Vec_IntForEachEntry( vOutputs, iOut, i )
254  {
255  Gia_Obj_t * pObj = Gia_ManPo( p, iOut );
256  assert( Gia_ObjFaninLit0p(p, pObj) != 0 );
257  Gia_ObjMakePoConst0( p, pObj );
258  assert( Gia_ObjFaninLit0p(p, pObj) == 0 );
259  }
260  return Gia_ManCleanup( p );
261 }
static Gia_Obj_t * Gia_ManPo(Gia_Man_t *p, int v)
Definition: gia.h:406
static int Gia_ObjFaninLit0p(Gia_Man_t *p, Gia_Obj_t *pObj)
Definition: gia.h:469
Definition: gia.h:75
static void Gia_ObjMakePoConst0(Gia_Man_t *p, Gia_Obj_t *pObj)
Definition: bmcChain.c:236
#define assert(ex)
Definition: util_old.h:213
Gia_Man_t * Gia_ManCleanup(Gia_Man_t *p)
Definition: giaScl.c:84
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
Definition: vecInt.h:54
ABC_NAMESPACE_IMPL_START Abc_Cex_t* Bmc_ChainFailOneOutput ( Gia_Man_t p,
int  nFrameMax,
int  nConfMax,
int  fVerbose,
int  fVeryVerbose 
)

DECLARATIONS ///.

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

FileName [bmcChain.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [SAT-based bounded model checking.]

Synopsis [Implementation of chain BMC.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

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

Revision [

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

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

Synopsis [Find the first failure.]

Description []

SideEffects []

SeeAlso []

Definition at line 48 of file bmcChain.c.

49 {
50  int RetValue;
51  Abc_Cex_t * pCex = NULL;
52  Aig_Man_t * pAig = Gia_ManToAigSimple( p );
53  Saig_ParBmc_t Pars, * pPars = &Pars;
55  pPars->nFramesMax = nFrameMax;
56  pPars->nConfLimit = nConfMax;
57  pPars->fVerbose = fVeryVerbose;
58  RetValue = Saig_ManBmcScalable( pAig, pPars );
59  if ( RetValue == 0 ) // SAT
60  {
61  pCex = pAig->pSeqModel, pAig->pSeqModel = NULL;
62  if ( fVeryVerbose )
63  Abc_Print( 1, "Output %d of miter \"%s\" was asserted in frame %d.\n", pCex->iPo, p->pName, pCex->iFrame );
64  }
65  else if ( fVeryVerbose )
66  Abc_Print( 1, "No output asserted in %d frames. Resource limit reached.\n", pPars->iFrame+2 );
67  Aig_ManStop( pAig );
68  return pCex;
69 }
void Saig_ParBmcSetDefaultParams(Saig_ParBmc_t *p)
Definition: bmcBmc3.c:1284
int Saig_ManBmcScalable(Aig_Man_t *pAig, Saig_ParBmc_t *pPars)
Definition: bmcBmc3.c:1390
Aig_Man_t * Gia_ManToAigSimple(Gia_Man_t *p)
Definition: giaAig.c:367
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
int fVerbose
Definition: bmc.h:66
int iFrame
Definition: bmc.h:70
int nConfLimit
Definition: bmc.h:50
int nFramesMax
Definition: bmc.h:49
char * pName
Definition: gia.h:97
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
typedefABC_NAMESPACE_HEADER_START struct Abc_Cex_t_ Abc_Cex_t
INCLUDES ///.
Definition: utilCex.h:39
Vec_Int_t* Bmc_ChainFindFailedOutputs ( Gia_Man_t p)

Definition at line 199 of file bmcChain.c.

200 {
201  Vec_Int_t * vOutputs;
202  Gia_Man_t * pInit;
203  Gia_Obj_t * pObj;
204  sat_solver * pSat;
205  int i, Lit, status = 0;
206  // derive output logic cones
207  pInit = Gia_ManDupPosAndPropagateInit( p );
208  // derive SAT solver and test
209  pSat = Gia_ManDeriveSatSolver( pInit );
210  vOutputs = Vec_IntAlloc( 100 );
211  Gia_ManForEachPo( pInit, pObj, i )
212  {
213  if ( Gia_ObjFaninLit0p(pInit, pObj) == 0 )
214  continue;
215  Lit = Abc_Var2Lit( i+1, 0 );
216  status = sat_solver_solve( pSat, &Lit, &Lit + 1, 0, 0, 0, 0 );
217  if ( status == l_True )
218  Vec_IntPush( vOutputs, i );
219  }
220  Gia_ManStop( pInit );
221  sat_solver_delete( pSat );
222  return vOutputs;
223 }
void Gia_ManStop(Gia_Man_t *p)
Definition: giaMan.c:77
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
static int Gia_ObjFaninLit0p(Gia_Man_t *p, Gia_Obj_t *pObj)
Definition: gia.h:469
int sat_solver_solve(sat_solver *s, lit *begin, lit *end, ABC_INT64_T nConfLimit, ABC_INT64_T nInsLimit, ABC_INT64_T nConfLimitGlobal, ABC_INT64_T nInsLimitGlobal)
Definition: satSolver.c:1700
void sat_solver_delete(sat_solver *s)
Definition: satSolver.c:1141
static int Abc_Var2Lit(int Var, int fCompl)
Definition: abc_global.h:263
sat_solver * Gia_ManDeriveSatSolver(Gia_Man_t *p)
Definition: bmcChain.c:186
#define l_True
Definition: SolverTypes.h:84
Definition: gia.h:75
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: bblif.c:149
Gia_Man_t * Gia_ManDupPosAndPropagateInit(Gia_Man_t *p)
Definition: bmcChain.c:159
static void Vec_IntPush(Vec_Int_t *p, int Entry)
Definition: bblif.c:468
Definition: gia.h:95
#define Gia_ManForEachPo(p, pObj, i)
Definition: gia.h:1036
int Bmc_ChainTest ( Gia_Man_t p,
int  nFrameMax,
int  nConfMax,
int  fVerbose,
int  fVeryVerbose 
)

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 274 of file bmcChain.c.

275 {
276  int Iter, IterMax = 10000;
277  Gia_Man_t * pTemp, * pNew = Gia_ManDup(p);
278  Abc_Cex_t * pCex = NULL;
279  Vec_Int_t * vOutputs;
280  abctime clk2, clk = Abc_Clock();
281  abctime clkBmc = 0;
282  abctime clkMov = 0;
283  abctime clkSat = 0;
284  abctime clkCln = 0;
285  abctime clkSwp = 0;
286  int DepthTotal = 0;
287  for ( Iter = 0; Iter < IterMax; Iter++ )
288  {
289  if ( Gia_ManPoNum(pNew) == 0 )
290  {
291  if ( fVerbose )
292  printf( "Finished all POs.\n" );
293  break;
294  }
295  // run BMC till the first failure
296  clk2 = Abc_Clock();
297  pCex = Bmc_ChainFailOneOutput( pNew, nFrameMax, nConfMax, fVerbose, fVeryVerbose );
298  clkBmc += Abc_Clock() - clk2;
299  if ( pCex == NULL )
300  {
301  if ( fVerbose )
302  printf( "BMC could not detect a failed output in %d frames with %d conflicts.\n", nFrameMax, nConfMax );
303  break;
304  }
305  assert( !Iter || pCex->iFrame > 0 );
306  // move the AIG to the failure state
307  clk2 = Abc_Clock();
308  pNew = Gia_ManVerifyCexAndMove( pTemp = pNew, pCex );
309  Gia_ManStop( pTemp );
310  DepthTotal += pCex->iFrame;
311  clkMov += Abc_Clock() - clk2;
312  // find outputs that fail in this state
313  clk2 = Abc_Clock();
314  vOutputs = Bmc_ChainFindFailedOutputs( pNew );
315  assert( Vec_IntFind(vOutputs, pCex->iPo) >= 0 );
316  Abc_CexFree( pCex );
317  clkSat += Abc_Clock() - clk2;
318  // remove them from the AIG
319  clk2 = Abc_Clock();
320  pNew = Bmc_ChainCleanup( pTemp = pNew, vOutputs );
321  Gia_ManStop( pTemp );
322  clkCln += Abc_Clock() - clk2;
323  // perform sequential cleanup
324  clk2 = Abc_Clock();
325 // pNew = Gia_ManSeqStructSweep( pTemp = pNew, 0, 1, 0 );
326 // Gia_ManStop( pTemp );
327  clkSwp += Abc_Clock() - clk2;
328  // printout
329  if ( fVerbose )
330  {
331  int nNonConst = Gia_ManCountNonConst0(pNew);
332  printf( "Iter %4d : ", Iter+1 );
333  printf( "Depth =%5d ", DepthTotal );
334  printf( "FailPo =%5d ", Vec_IntSize(vOutputs) );
335  printf( "UndecPo =%5d ", nNonConst );
336  printf( "(%6.2f %%) ", 100.0 * nNonConst / Gia_ManPoNum(pNew) );
337  printf( "AIG =%8d ", Gia_ManAndNum(pNew) );
338  Abc_PrintTime( 1, "Time", Abc_Clock() - clk );
339  }
340  Vec_IntFree( vOutputs );
341  }
342  printf( "Completed a CEX chain with %d segments, %d frames, and %d failed POs (out of %d). ",
343  Iter, DepthTotal, Gia_ManPoNum(pNew) - Gia_ManCountNonConst0(pNew), Gia_ManPoNum(pNew) );
344  if ( fVerbose )
345  {
346  Abc_PrintTime( 1, "Time", Abc_Clock() - clk );
347  Abc_PrintTimeP( 1, "BMC ", clkBmc, Abc_Clock() - clk );
348  Abc_PrintTimeP( 1, "Init ", clkMov, Abc_Clock() - clk );
349  Abc_PrintTimeP( 1, "SAT ", clkSat, Abc_Clock() - clk );
350  Abc_PrintTimeP( 1, "Clean", clkCln, Abc_Clock() - clk );
351 // Abc_PrintTimeP( 1, "Sweep", clkSwp, Abc_Clock() - clk );
352  }
353  Gia_ManStop( pNew );
354  return 0;
355 }
Gia_Man_t * Gia_ManDup(Gia_Man_t *p)
Definition: giaDup.c:552
Gia_Man_t * Gia_ManVerifyCexAndMove(Gia_Man_t *pGia, Abc_Cex_t *p)
Definition: bmcChain.c:110
void Gia_ManStop(Gia_Man_t *p)
Definition: giaMan.c:77
static int Gia_ManPoNum(Gia_Man_t *p)
Definition: gia.h:386
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
static int Vec_IntFind(Vec_Int_t *p, int Entry)
Definition: vecInt.h:895
static abctime Abc_Clock()
Definition: abc_global.h:279
static void Abc_PrintTimeP(int level, const char *pStr, abctime time, abctime Time)
Definition: abc_global.h:372
Vec_Int_t * Bmc_ChainFindFailedOutputs(Gia_Man_t *p)
Definition: bmcChain.c:199
static void Abc_PrintTime(int level, const char *pStr, abctime time)
Definition: abc_global.h:367
static int Gia_ManAndNum(Gia_Man_t *p)
Definition: gia.h:389
ABC_NAMESPACE_IMPL_START Abc_Cex_t * Bmc_ChainFailOneOutput(Gia_Man_t *p, int nFrameMax, int nConfMax, int fVerbose, int fVeryVerbose)
DECLARATIONS ///.
Definition: bmcChain.c:48
Gia_Man_t * Bmc_ChainCleanup(Gia_Man_t *p, Vec_Int_t *vOutputs)
Definition: bmcChain.c:250
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
Definition: gia.h:95
int Gia_ManCountNonConst0(Gia_Man_t *p)
Definition: bmcChain.c:242
#define assert(ex)
Definition: util_old.h:213
typedefABC_NAMESPACE_HEADER_START struct Abc_Cex_t_ Abc_Cex_t
INCLUDES ///.
Definition: utilCex.h:39
static void Vec_IntFree(Vec_Int_t *p)
Definition: bblif.c:235
void Abc_CexFree(Abc_Cex_t *p)
Definition: utilCex.c:371
ABC_INT64_T abctime
Definition: abc_global.h:278
int Gia_ManCountNonConst0 ( Gia_Man_t p)

Definition at line 242 of file bmcChain.c.

243 {
244  Gia_Obj_t * pObj;
245  int i, Count = 0;
246  Gia_ManForEachPo( p, pObj, i )
247  Count += (Gia_ObjFaninLit0p(p, pObj) != 0);
248  return Count;
249 }
static int Gia_ObjFaninLit0p(Gia_Man_t *p, Gia_Obj_t *pObj)
Definition: gia.h:469
Definition: gia.h:75
#define Gia_ManForEachPo(p, pObj, i)
Definition: gia.h:1036
sat_solver* Gia_ManDeriveSatSolver ( Gia_Man_t p)

Definition at line 186 of file bmcChain.c.

187 {
188 // extern Cnf_Dat_t * Mf_ManGenerateCnf( Gia_Man_t * pGia, int nLutSize, int fCnfObjIds, int fAddOrCla, int fVerbose );
189  sat_solver * pSat;
190  Aig_Man_t * pAig = Gia_ManToAigSimple( p );
191  Cnf_Dat_t * pCnf = Cnf_Derive( pAig, Aig_ManCoNum(pAig) );
192  Aig_ManStop( pAig );
193 // Cnf_Dat_t * pCnf = Mf_ManGenerateCnf( p, 8, 0, 0, 0 );
194  pSat = (sat_solver *)Cnf_DataWriteIntoSolver( pCnf, 1, 0 );
195  Cnf_DataFree( pCnf );
196  assert( p->nRegs == 0 );
197  return pSat;
198 }
Aig_Man_t * Gia_ManToAigSimple(Gia_Man_t *p)
Definition: giaAig.c:367
Cnf_Dat_t * Cnf_Derive(Aig_Man_t *pAig, int nOutputs)
Definition: cnfCore.c:165
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
Definition: cnf.h:56
static int Aig_ManCoNum(Aig_Man_t *p)
Definition: aig.h:252
int nRegs
Definition: gia.h:99
void * Cnf_DataWriteIntoSolver(Cnf_Dat_t *p, int nFrames, int fInit)
Definition: cnfMan.c:463
void Cnf_DataFree(Cnf_Dat_t *p)
Definition: cnfMan.c:180
#define assert(ex)
Definition: util_old.h:213
Gia_Man_t* Gia_ManDupPosAndPropagateInit ( Gia_Man_t p)

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

Synopsis [Find what outputs fail in this state.]

Description []

SideEffects []

SeeAlso []

Definition at line 159 of file bmcChain.c.

160 {
161  Gia_Man_t * pNew, * pTemp;
162  Gia_Obj_t * pObj; int i;
163  pNew = Gia_ManStart( Gia_ManObjNum(p) );
164  pNew->pName = Abc_UtilStrsav( p->pName );
165  pNew->pSpec = Abc_UtilStrsav( p->pSpec );
166  Gia_ManConst0(p)->Value = 0;
167  Gia_ManHashAlloc( pNew );
168  Gia_ManForEachObj1( p, pObj, i )
169  {
170  if ( Gia_ObjIsAnd(pObj) )
171  pObj->Value = Gia_ManHashAnd( pNew, Gia_ObjFanin0Copy(pObj), Gia_ObjFanin1Copy(pObj) );
172  else if ( Gia_ObjIsPi(p, pObj) )
173  pObj->Value = Gia_ManAppendCi( pNew );
174  else if ( Gia_ObjIsCi(pObj) )
175  pObj->Value = 0;
176  else if ( Gia_ObjIsPo(p, pObj) )
177  Gia_ManAppendCo( pNew, Gia_ObjFanin0Copy(pObj) );
178  }
179  Gia_ManHashStop( pNew );
180  assert( Gia_ManPiNum(p) == Gia_ManPiNum(pNew) );
181  assert( Gia_ManPoNum(p) == Gia_ManPoNum(pNew) );
182  pNew = Gia_ManCleanup( pTemp = pNew );
183  Gia_ManStop( pTemp );
184  return pNew;
185 }
void Gia_ManStop(Gia_Man_t *p)
Definition: giaMan.c:77
static int Gia_ManPoNum(Gia_Man_t *p)
Definition: gia.h:386
static int Gia_ManAppendCo(Gia_Man_t *p, int iLit0)
Definition: gia.h:703
static int Gia_ManAppendCi(Gia_Man_t *p)
Definition: gia.h:583
Definition: gia.h:75
char * pName
Definition: gia.h:97
static int Gia_ObjFanin1Copy(Gia_Obj_t *pObj)
Definition: gia.h:482
char * pSpec
Definition: gia.h:98
Gia_Man_t * Gia_ManStart(int nObjsMax)
DECLARATIONS ///.
Definition: giaMan.c:52
static int Gia_ObjFanin0Copy(Gia_Obj_t *pObj)
Definition: gia.h:481
Definition: gia.h:95
static int Gia_ObjIsAnd(Gia_Obj_t *pObj)
Definition: gia.h:422
static Gia_Obj_t * Gia_ManConst0(Gia_Man_t *p)
Definition: gia.h:400
static int Gia_ObjIsPo(Gia_Man_t *p, Gia_Obj_t *pObj)
Definition: gia.h:442
#define assert(ex)
Definition: util_old.h:213
unsigned Value
Definition: gia.h:87
void Gia_ManHashAlloc(Gia_Man_t *p)
Definition: giaHash.c:99
#define Gia_ManForEachObj1(p, pObj, i)
Definition: gia.h:986
static int Gia_ManPiNum(Gia_Man_t *p)
Definition: gia.h:385
static int Gia_ObjIsCi(Gia_Obj_t *pObj)
Definition: gia.h:420
Gia_Man_t * Gia_ManCleanup(Gia_Man_t *p)
Definition: giaScl.c:84
char * Abc_UtilStrsav(char *s)
Definition: starter.c:47
int Gia_ManHashAnd(Gia_Man_t *p, int iLit0, int iLit1)
Definition: giaHash.c:572
static int Gia_ManObjNum(Gia_Man_t *p)
Definition: gia.h:388
void Gia_ManHashStop(Gia_Man_t *p)
Definition: giaHash.c:142
static int Gia_ObjIsPi(Gia_Man_t *p, Gia_Obj_t *pObj)
Definition: gia.h:441
Gia_Man_t* Gia_ManDupWithInit ( Gia_Man_t p)

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

Synopsis [Move GIA into the failing state.]

Description []

SideEffects []

SeeAlso []

Definition at line 82 of file bmcChain.c.

83 {
84  Gia_Man_t * pNew;
85  Gia_Obj_t * pObj;
86  int i;
87  pNew = Gia_ManStart( Gia_ManObjNum(p) );
88  pNew->pName = Abc_UtilStrsav( p->pName );
89  pNew->pSpec = Abc_UtilStrsav( p->pSpec );
90  Gia_ManConst0(p)->Value = 0;
91  Gia_ManForEachObj1( p, pObj, i )
92  {
93  if ( Gia_ObjIsAnd(pObj) )
94  pObj->Value = Gia_ManAppendAnd( pNew, Gia_ObjFanin0Copy(pObj), Gia_ObjFanin1Copy(pObj) );
95  else if ( Gia_ObjIsCi(pObj) )
96  {
97  pObj->Value = Gia_ManAppendCi( pNew );
98  pObj->Value = Abc_LitNotCond( pObj->Value, pObj->fMark0 );
99  }
100  else if ( Gia_ObjIsCo(pObj) )
101  {
102  pObj->Value = Gia_ObjFanin0Copy(pObj);
103  pObj->Value = Abc_LitNotCond( pObj->Value, pObj->fMark0 );
104  pObj->Value = Gia_ManAppendCo( pNew, pObj->Value );
105  }
106  }
107  Gia_ManSetRegNum( pNew, Gia_ManRegNum(p) );
108  return pNew;
109 }
static int Gia_ManAppendAnd(Gia_Man_t *p, int iLit0, int iLit1)
Definition: gia.h:592
static int Gia_ManAppendCo(Gia_Man_t *p, int iLit0)
Definition: gia.h:703
static int Gia_ManAppendCi(Gia_Man_t *p)
Definition: gia.h:583
void Gia_ManSetRegNum(Gia_Man_t *p, int nRegs)
Definition: giaMan.c:628
static int Abc_LitNotCond(int Lit, int c)
Definition: abc_global.h:267
Definition: gia.h:75
char * pName
Definition: gia.h:97
static int Gia_ObjFanin1Copy(Gia_Obj_t *pObj)
Definition: gia.h:482
char * pSpec
Definition: gia.h:98
Gia_Man_t * Gia_ManStart(int nObjsMax)
DECLARATIONS ///.
Definition: giaMan.c:52
static int Gia_ObjFanin0Copy(Gia_Obj_t *pObj)
Definition: gia.h:481
static int Gia_ObjIsCo(Gia_Obj_t *pObj)
Definition: gia.h:421
unsigned fMark0
Definition: gia.h:79
Definition: gia.h:95
static int Gia_ObjIsAnd(Gia_Obj_t *pObj)
Definition: gia.h:422
static Gia_Obj_t * Gia_ManConst0(Gia_Man_t *p)
Definition: gia.h:400
unsigned Value
Definition: gia.h:87
#define Gia_ManForEachObj1(p, pObj, i)
Definition: gia.h:986
static int Gia_ObjIsCi(Gia_Obj_t *pObj)
Definition: gia.h:420
char * Abc_UtilStrsav(char *s)
Definition: starter.c:47
static int Gia_ManObjNum(Gia_Man_t *p)
Definition: gia.h:388
static int Gia_ManRegNum(Gia_Man_t *p)
Definition: gia.h:387
Gia_Man_t* Gia_ManVerifyCexAndMove ( Gia_Man_t pGia,
Abc_Cex_t p 
)

Definition at line 110 of file bmcChain.c.

111 {
112  Gia_Man_t * pNew;
113  Gia_Obj_t * pObj, * pObjRi, * pObjRo;
114  int RetValue, i, k, iBit = 0;
115  Gia_ManCleanMark0(pGia);
116  Gia_ManForEachRo( pGia, pObj, i )
117  pObj->fMark0 = Abc_InfoHasBit(p->pData, iBit++);
118  for ( i = 0; i <= p->iFrame; i++ )
119  {
120  Gia_ManForEachPi( pGia, pObj, k )
121  pObj->fMark0 = Abc_InfoHasBit(p->pData, iBit++);
122  Gia_ManForEachAnd( pGia, pObj, k )
123  pObj->fMark0 = (Gia_ObjFanin0(pObj)->fMark0 ^ Gia_ObjFaninC0(pObj)) &
124  (Gia_ObjFanin1(pObj)->fMark0 ^ Gia_ObjFaninC1(pObj));
125  Gia_ManForEachCo( pGia, pObj, k )
126  pObj->fMark0 = Gia_ObjFanin0(pObj)->fMark0 ^ Gia_ObjFaninC0(pObj);
127  if ( i == p->iFrame )
128  break;
129  Gia_ManForEachRiRo( pGia, pObjRi, pObjRo, k )
130  pObjRo->fMark0 = pObjRi->fMark0;
131  }
132  assert( iBit == p->nBits );
133  RetValue = Gia_ManPo(pGia, p->iPo)->fMark0;
134  assert( RetValue );
135  // set PI/PO values to zero and transfer RO values to RI
136  Gia_ManForEachPi( pGia, pObj, k )
137  pObj->fMark0 = 0;
138  Gia_ManForEachPo( pGia, pObj, k )
139  pObj->fMark0 = 0;
140  Gia_ManForEachRiRo( pGia, pObjRi, pObjRo, k )
141  pObjRi->fMark0 = pObjRo->fMark0;
142  // duplicate assuming CI/CO marks are set correctly
143  pNew = Gia_ManDupWithInit( pGia );
144  Gia_ManCleanMark0(pGia);
145  return pNew;
146 }
#define Gia_ManForEachCo(p, pObj, i)
Definition: gia.h:1022
static int Gia_ObjFaninC1(Gia_Obj_t *pObj)
Definition: gia.h:452
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static int Abc_InfoHasBit(unsigned *p, int i)
Definition: abc_global.h:258
static Gia_Obj_t * Gia_ManPo(Gia_Man_t *p, int v)
Definition: gia.h:406
void Gia_ManCleanMark0(Gia_Man_t *p)
Definition: giaUtil.c:215
for(p=first;p->value< newval;p=p->next)
Definition: gia.h:75
#define Gia_ManForEachRiRo(p, pObjRi, pObjRo, i)
Definition: gia.h:1042
static Gia_Obj_t * Gia_ObjFanin0(Gia_Obj_t *pObj)
Definition: gia.h:454
if(last==0)
Definition: sparse_int.h:34
#define Gia_ManForEachAnd(p, pObj, i)
Definition: gia.h:1002
#define Gia_ManForEachPi(p, pObj, i)
Definition: gia.h:1034
Definition: gia.h:95
static Gia_Obj_t * Gia_ObjFanin1(Gia_Obj_t *pObj)
Definition: gia.h:455
#define Gia_ManForEachRo(p, pObj, i)
Definition: gia.h:1038
#define assert(ex)
Definition: util_old.h:213
static int Gia_ObjFaninC0(Gia_Obj_t *pObj)
Definition: gia.h:451
#define Gia_ManForEachPo(p, pObj, i)
Definition: gia.h:1036
Gia_Man_t * Gia_ManDupWithInit(Gia_Man_t *p)
Definition: bmcChain.c:82
static void Gia_ObjMakePoConst0 ( Gia_Man_t p,
Gia_Obj_t pObj 
)
inlinestatic

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

Synopsis [Cleanup AIG by removing COs replacing failed out by const0.]

Description []

SideEffects []

SeeAlso []

Definition at line 236 of file bmcChain.c.

237 {
238  assert( Gia_ObjIsCo(pObj) );
239  pObj->iDiff0 = Gia_ObjId( p, pObj );
240  pObj->fCompl0 = 0;
241 }
unsigned iDiff0
Definition: gia.h:77
static int Gia_ObjId(Gia_Man_t *p, Gia_Obj_t *pObj)
Definition: gia.h:410
static int Gia_ObjIsCo(Gia_Obj_t *pObj)
Definition: gia.h:421
#define assert(ex)
Definition: util_old.h:213
unsigned fCompl0
Definition: gia.h:78