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

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START void Ssw_ManResimulateBit (Ssw_Man_t *p, Aig_Obj_t *pCand, Aig_Obj_t *pRepr)
 DECLARATIONS ///. More...
 
void Ssw_ManResimulateWord (Ssw_Man_t *p, Aig_Obj_t *pCand, Aig_Obj_t *pRepr, int f)
 

Function Documentation

ABC_NAMESPACE_IMPL_START void Ssw_ManResimulateBit ( Ssw_Man_t p,
Aig_Obj_t pCand,
Aig_Obj_t pRepr 
)

DECLARATIONS ///.

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

FileName [sswSimSat.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Inductive prover with constraints.]

Synopsis [Performs resimulation using counter-examples.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - September 1, 2008.]

Revision [

Id:
sswSimSat.c,v 1.00 2008/09/01 00:00:00 alanmi Exp

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

Synopsis [Handle the counter-example.]

Description []

SideEffects []

SeeAlso []

Definition at line 45 of file sswSimSat.c.

46 {
47  Aig_Obj_t * pObj;
48  int i, RetValue1, RetValue2;
49  abctime clk = Abc_Clock();
50  // set the PI simulation information
51  Aig_ManConst1(p->pAig)->fMarkB = 1;
52  Aig_ManForEachCi( p->pAig, pObj, i )
53  pObj->fMarkB = Abc_InfoHasBit( p->pPatWords, i );
54  // simulate internal nodes
55  Aig_ManForEachNode( p->pAig, pObj, i )
56  pObj->fMarkB = ( Aig_ObjFanin0(pObj)->fMarkB ^ Aig_ObjFaninC0(pObj) )
57  & ( Aig_ObjFanin1(pObj)->fMarkB ^ Aig_ObjFaninC1(pObj) );
58  // if repr is given, perform refinement
59  if ( pRepr )
60  {
61  // check equivalence classes
62  RetValue1 = Ssw_ClassesRefineConst1( p->ppClasses, 0 );
63  RetValue2 = Ssw_ClassesRefine( p->ppClasses, 0 );
64  // make sure refinement happened
65  if ( Aig_ObjIsConst1(pRepr) )
66  {
67  assert( RetValue1 );
68  if ( RetValue1 == 0 )
69  Abc_Print( 1, "\nSsw_ManResimulateBit() Error: RetValue1 does not hold.\n" );
70  }
71  else
72  {
73  assert( RetValue2 );
74  if ( RetValue2 == 0 )
75  Abc_Print( 1, "\nSsw_ManResimulateBit() Error: RetValue2 does not hold.\n" );
76  }
77  }
78 p->timeSimSat += Abc_Clock() - clk;
79 }
Aig_Man_t * pAig
Definition: llb3Image.c:49
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static int Abc_InfoHasBit(unsigned *p, int i)
Definition: abc_global.h:258
unsigned int fMarkB
Definition: aig.h:80
static Aig_Obj_t * Aig_ObjFanin0(Aig_Obj_t *pObj)
Definition: aig.h:308
#define Aig_ManForEachCi(p, pObj, i)
ITERATORS ///.
Definition: aig.h:393
int Ssw_ClassesRefine(Ssw_Cla_t *p, int fRecursive)
Definition: sswClass.c:1034
static abctime Abc_Clock()
Definition: abc_global.h:279
static Aig_Obj_t * Aig_ObjFanin1(Aig_Obj_t *pObj)
Definition: aig.h:309
#define Aig_ManForEachNode(p, pObj, i)
Definition: aig.h:413
if(last==0)
Definition: sparse_int.h:34
static int Aig_ObjIsConst1(Aig_Obj_t *pObj)
Definition: aig.h:274
Definition: aig.h:69
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
static int Aig_ObjFaninC0(Aig_Obj_t *pObj)
Definition: aig.h:306
static Aig_Obj_t * Aig_ManConst1(Aig_Man_t *p)
Definition: aig.h:264
static int Aig_ObjFaninC1(Aig_Obj_t *pObj)
Definition: aig.h:307
#define assert(ex)
Definition: util_old.h:213
ABC_INT64_T abctime
Definition: abc_global.h:278
int Ssw_ClassesRefineConst1(Ssw_Cla_t *p, int fRecursive)
Definition: sswClass.c:1119
void Ssw_ManResimulateWord ( Ssw_Man_t p,
Aig_Obj_t pCand,
Aig_Obj_t pRepr,
int  f 
)

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

Synopsis [Handle the counter-example.]

Description []

SideEffects []

SeeAlso []

Definition at line 92 of file sswSimSat.c.

93 {
94  int RetValue1, RetValue2;
95  abctime clk = Abc_Clock();
96  // set the PI simulation information
97  Ssw_SmlAssignDist1Plus( p->pSml, p->pPatWords );
98  // simulate internal nodes
99  Ssw_SmlSimulateOne( p->pSml );
100  // check equivalence classes
101  RetValue1 = Ssw_ClassesRefineConst1( p->ppClasses, 1 );
102  RetValue2 = Ssw_ClassesRefine( p->ppClasses, 1 );
103  // make sure refinement happened
104  if ( Aig_ObjIsConst1(pRepr) )
105  {
106  assert( RetValue1 );
107  if ( RetValue1 == 0 )
108  Abc_Print( 1, "\nSsw_ManResimulateWord() Error: RetValue1 does not hold.\n" );
109  }
110  else
111  {
112  assert( RetValue2 );
113  if ( RetValue2 == 0 )
114  Abc_Print( 1, "\nSsw_ManResimulateWord() Error: RetValue2 does not hold.\n" );
115  }
116 p->timeSimSat += Abc_Clock() - clk;
117 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
void Ssw_SmlAssignDist1Plus(Ssw_Sml_t *p, unsigned *pPat)
Definition: sswSim.c:674
int Ssw_ClassesRefine(Ssw_Cla_t *p, int fRecursive)
Definition: sswClass.c:1034
static abctime Abc_Clock()
Definition: abc_global.h:279
static int Aig_ObjIsConst1(Aig_Obj_t *pObj)
Definition: aig.h:274
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
void Ssw_SmlSimulateOne(Ssw_Sml_t *p)
Definition: sswSim.c:1005
#define assert(ex)
Definition: util_old.h:213
ABC_INT64_T abctime
Definition: abc_global.h:278
int Ssw_ClassesRefineConst1(Ssw_Cla_t *p, int fRecursive)
Definition: sswClass.c:1119