ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
sswSimSat.c
Go to the documentation of this file.
1
20
21#include "sswInt.h"
22
24
25
29
33
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 }
78p->timeSimSat += Abc_Clock() - clk;
79}
80
92void Ssw_ManResimulateWord( Ssw_Man_t * p, Aig_Obj_t * pCand, Aig_Obj_t * pRepr, int f )
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 }
116p->timeSimSat += Abc_Clock() - clk;
117}
118
122
123
ABC_INT64_T abctime
Definition abc_global.h:332
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
#define Aig_ManForEachCi(p, pObj, i)
ITERATORS ///.
Definition aig.h:393
struct Aig_Obj_t_ Aig_Obj_t
Definition aig.h:51
#define Aig_ManForEachNode(p, pObj, i)
Definition aig.h:413
Cube * p
Definition exorList.c:222
int Ssw_ClassesRefineConst1(Ssw_Cla_t *p, int fRecursive)
Definition sswClass.c:1119
int Ssw_ClassesRefine(Ssw_Cla_t *p, int fRecursive)
Definition sswClass.c:1034
typedefABC_NAMESPACE_HEADER_START struct Ssw_Man_t_ Ssw_Man_t
INCLUDES ///.
Definition sswInt.h:47
void Ssw_SmlSimulateOne(Ssw_Sml_t *p)
Definition sswSim.c:1005
void Ssw_SmlAssignDist1Plus(Ssw_Sml_t *p, unsigned *pPat)
Definition sswSim.c:674
ABC_NAMESPACE_IMPL_START void Ssw_ManResimulateBit(Ssw_Man_t *p, Aig_Obj_t *pCand, Aig_Obj_t *pRepr)
DECLARATIONS ///.
Definition sswSimSat.c:45
void Ssw_ManResimulateWord(Ssw_Man_t *p, Aig_Obj_t *pCand, Aig_Obj_t *pRepr, int f)
Definition sswSimSat.c:92
unsigned int fMarkB
Definition aig.h:80
#define assert(ex)
Definition util_old.h:213