abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
sscInt.h
Go to the documentation of this file.
1 /**CFile****************************************************************
2 
3  FileName [sscInt.h]
4 
5  SystemName [ABC: Logic synthesis and verification system.]
6 
7  PackageName [Choice computation for tech-mapping.]
8 
9  Synopsis [Internal declarations.]
10 
11  Author [Alan Mishchenko]
12 
13  Affiliation [UC Berkeley]
14 
15  Date [Ver. 1.0. Started - June 29, 2008.]
16 
17  Revision [$Id: sscInt.h,v 1.00 2008/07/29 00:00:00 alanmi Exp $]
18 
19 ***********************************************************************/
20 
21 #ifndef ABC__aig__ssc__sscInt_h
22 #define ABC__aig__ssc__sscInt_h
23 
24 
25 ////////////////////////////////////////////////////////////////////////
26 /// INCLUDES ///
27 ////////////////////////////////////////////////////////////////////////
28 
29 #include "aig/gia/gia.h"
30 #include "sat/bsat/satSolver.h"
31 #include "ssc.h"
32 
33 ////////////////////////////////////////////////////////////////////////
34 /// PARAMETERS ///
35 ////////////////////////////////////////////////////////////////////////
36 
37 
39 
40 
41 ////////////////////////////////////////////////////////////////////////
42 /// BASIC TYPES ///
43 ////////////////////////////////////////////////////////////////////////
44 
45 // choicing manager
46 typedef struct Ssc_Man_t_ Ssc_Man_t;
47 struct Ssc_Man_t_
48 {
49  // user data
50  Ssc_Pars_t * pPars; // choicing parameters
51  Gia_Man_t * pAig; // subject AIG
52  Gia_Man_t * pCare; // care set AIG
53  // internal data
54  Gia_Man_t * pFraig; // resulting AIG
55  sat_solver * pSat; // recyclable SAT solver
56  Vec_Int_t * vId2Var; // mapping of each node into its SAT var
57  Vec_Int_t * vVar2Id; // mapping of each SAT var into its node
58  Vec_Int_t * vPivot; // one SAT pattern
59  int nSatVarsPivot; // the number of variables for constraints
60  int nSatVars; // the current number of variables
61  // temporary storage
62  Vec_Int_t * vFront; // supergate fanins
63  Vec_Int_t * vFanins; // supergate fanins
64  Vec_Int_t * vPattern; // counter-example
65  Vec_Int_t * vDisPairs; // disproved pairs
66  // SAT calls statistics
67  int nSimRounds; // the number of simulation rounds
68  int nRecycles; // the number of times SAT solver was recycled
69  int nCallsSince; // the number of calls since the last recycle
70  int nSatCalls; // the number of SAT calls
71  int nSatCallsUnsat; // the number of unsat SAT calls
72  int nSatCallsSat; // the number of sat SAT calls
73  int nSatCallsUndec; // the number of undec SAT calls
74  // runtime stats
75  abctime timeSimInit; // simulation and class computation
76  abctime timeSimSat; // simulation of the counter-examples
77  abctime timeCnfGen; // generation of CNF
78  abctime timeSat; // total SAT time
81  abctime timeSatUndec; // undecided
82  abctime timeOther; // other runtime
83  abctime timeTotal; // total runtime
84 };
85 
86 ////////////////////////////////////////////////////////////////////////
87 /// MACRO DEFINITIONS ///
88 ////////////////////////////////////////////////////////////////////////
89 
90 static inline int Ssc_ObjSatVar( Ssc_Man_t * p, int iObj ) { return Vec_IntEntry(p->vId2Var, iObj); }
91 static inline void Ssc_ObjSetSatVar( Ssc_Man_t * p, int iObj, int Num ) { Vec_IntWriteEntry(p->vId2Var, iObj, Num); Vec_IntWriteEntry(p->vVar2Id, Num, iObj); }
92 static inline void Ssc_ObjCleanSatVar( Ssc_Man_t * p, int Num ) { Vec_IntWriteEntry(p->vId2Var, Vec_IntEntry(p->vVar2Id, Num), Num); Vec_IntWriteEntry(p->vVar2Id, Num, 0); }
93 
94 static inline int Ssc_ObjFraig( Ssc_Man_t * p, Gia_Obj_t * pObj ) { return pObj->Value; }
95 static inline void Ssc_ObjSetFraig( Gia_Obj_t * pObj, int iNode ) { pObj->Value = iNode; }
96 
97 ////////////////////////////////////////////////////////////////////////
98 /// FUNCTION DECLARATIONS ///
99 ////////////////////////////////////////////////////////////////////////
100 
101 /*=== sscClass.c =================================================*/
102 extern void Ssc_GiaClassesInit( Gia_Man_t * p );
103 extern int Ssc_GiaClassesRefine( Gia_Man_t * p );
104 extern void Ssc_GiaClassesCheckPairs( Gia_Man_t * p, Vec_Int_t * vDisPairs );
105 extern int Ssc_GiaSimClassRefineOneBit( Gia_Man_t * p, int i );
106 /*=== sscCnf.c ===================================================*/
107 extern void Ssc_CnfNodeAddToSolver( Ssc_Man_t * p, Gia_Obj_t * pObj );
108 /*=== sscCore.c ==================================================*/
109 /*=== sscSat.c ===================================================*/
110 extern void Ssc_ManSatSolverRecycle( Ssc_Man_t * p );
111 extern void Ssc_ManStartSolver( Ssc_Man_t * p );
113 extern int Ssc_ManCheckEquivalence( Ssc_Man_t * p, int iRepr, int iObj, int fCompl );
114 /*=== sscSim.c ===================================================*/
115 extern void Ssc_GiaResetPiPattern( Gia_Man_t * p, int nWords );
116 extern void Ssc_GiaRandomPiPattern( Gia_Man_t * p, int nWords, Vec_Int_t * vPivot );
117 extern int Ssc_GiaTransferPiPattern( Gia_Man_t * pAig, Gia_Man_t * pCare, Vec_Int_t * vPivot );
118 extern void Ssc_GiaSavePiPattern( Gia_Man_t * p, Vec_Int_t * vPat );
119 extern void Ssc_GiaSimRound( Gia_Man_t * p );
121 extern int Ssc_GiaEstimateCare( Gia_Man_t * p, int nWords );
122 /*=== sscUtil.c ===================================================*/
123 extern Gia_Man_t * Ssc_GenerateOneHot( int nVars );
124 
125 
127 
128 
129 
130 #endif
131 
132 ////////////////////////////////////////////////////////////////////////
133 /// END OF FILE ///
134 ////////////////////////////////////////////////////////////////////////
135 
void Ssc_GiaClassesInit(Gia_Man_t *p)
FUNCTION DECLARATIONS ///.
Definition: sscClass.c:265
static void Ssc_ObjCleanSatVar(Ssc_Man_t *p, int Num)
Definition: sscInt.h:92
void Ssc_CnfNodeAddToSolver(Ssc_Man_t *p, Gia_Obj_t *pObj)
static int Ssc_ObjSatVar(Ssc_Man_t *p, int iObj)
MACRO DEFINITIONS ///.
Definition: sscInt.h:90
abctime timeSatUnsat
Definition: sscInt.h:80
void Ssc_ManSatSolverRecycle(Ssc_Man_t *p)
static Llb_Mgr_t * p
Definition: llb3Image.c:950
abctime timeCnfGen
Definition: sscInt.h:77
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
void Ssc_GiaResetPiPattern(Gia_Man_t *p, int nWords)
Definition: sscSim.c:141
Gia_Man_t * Ssc_GenerateOneHot(int nVars)
Vec_Int_t * vFanins
Definition: sscInt.h:63
typedefABC_NAMESPACE_HEADER_START struct Ssc_Man_t_ Ssc_Man_t
INCLUDES ///.
Definition: sscInt.h:46
int nSatCallsUndec
Definition: sscInt.h:73
Vec_Int_t * vId2Var
Definition: sscInt.h:56
typedefABC_NAMESPACE_HEADER_START struct Ssc_Pars_t_ Ssc_Pars_t
INCLUDES ///.
Definition: ssc.h:43
abctime timeOther
Definition: sscInt.h:82
abctime timeSat
Definition: sscInt.h:78
Gia_Man_t * pAig
Definition: sscInt.h:51
int nSatVars
Definition: sscInt.h:60
Vec_Int_t * vPattern
Definition: sscInt.h:64
sat_solver * pSat
Definition: sscInt.h:55
int nWords
Definition: abcNpn.c:127
abctime timeSatSat
Definition: sscInt.h:79
Definition: gia.h:75
int Ssc_GiaClassesRefine(Gia_Man_t *p)
Definition: sscClass.c:279
Gia_Man_t * pFraig
Definition: sscInt.h:54
void Ssc_GiaClassesCheckPairs(Gia_Man_t *p, Vec_Int_t *vDisPairs)
Definition: sscClass.c:309
void Ssc_GiaSavePiPattern(Gia_Man_t *p, Vec_Int_t *vPat)
Definition: sscSim.c:149
static void Vec_IntWriteEntry(Vec_Int_t *p, int i, int Entry)
Definition: bblif.c:285
abctime timeSimSat
Definition: sscInt.h:76
abctime timeTotal
Definition: sscInt.h:83
int nCallsSince
Definition: sscInt.h:69
Vec_Int_t * vFront
Definition: sscInt.h:62
void Ssc_ManStartSolver(Ssc_Man_t *p)
Definition: sscSat.c:261
int Ssc_GiaTransferPiPattern(Gia_Man_t *pAig, Gia_Man_t *pCare, Vec_Int_t *vPivot)
Definition: sscSim.c:201
int nRecycles
Definition: sscInt.h:68
Vec_Int_t * Ssc_ManFindPivotSat(Ssc_Man_t *p)
Definition: sscSat.c:323
static int Ssc_ObjFraig(Ssc_Man_t *p, Gia_Obj_t *pObj)
Definition: sscInt.h:94
static int Vec_IntEntry(Vec_Int_t *p, int i)
Definition: bblif.c:268
int nSatCallsSat
Definition: sscInt.h:72
static void Ssc_ObjSetSatVar(Ssc_Man_t *p, int iObj, int Num)
Definition: sscInt.h:91
#define ABC_NAMESPACE_HEADER_START
NAMESPACES ///.
Definition: abc_global.h:105
Vec_Int_t * vVar2Id
Definition: sscInt.h:57
int nSimRounds
Definition: sscInt.h:67
#define ABC_NAMESPACE_HEADER_END
Definition: abc_global.h:106
int nSatCalls
Definition: sscInt.h:70
Gia_Man_t * pCare
Definition: sscInt.h:52
Ssc_Pars_t * pPars
Definition: sscInt.h:50
int Ssc_GiaEstimateCare(Gia_Man_t *p, int nWords)
Definition: sscSim.c:351
Definition: gia.h:95
abctime timeSatUndec
Definition: sscInt.h:81
Vec_Int_t * vPivot
Definition: sscInt.h:58
int Ssc_ManCheckEquivalence(Ssc_Man_t *p, int iRepr, int iObj, int fCompl)
Definition: sscSat.c:348
void Ssc_GiaRandomPiPattern(Gia_Man_t *p, int nWords, Vec_Int_t *vPivot)
Definition: sscSim.c:163
void Ssc_GiaSimRound(Gia_Man_t *p)
Definition: sscSim.c:247
static void Ssc_ObjSetFraig(Gia_Obj_t *pObj, int iNode)
Definition: sscInt.h:95
unsigned Value
Definition: gia.h:87
Vec_Int_t * vDisPairs
Definition: sscInt.h:65
int nSatCallsUnsat
Definition: sscInt.h:71
ABC_INT64_T abctime
Definition: abc_global.h:278
Vec_Int_t * Ssc_GiaFindPivotSim(Gia_Man_t *p)
Definition: sscSim.c:323
int nSatVarsPivot
Definition: sscInt.h:59
abctime timeSimInit
Definition: sscInt.h:75
int Ssc_GiaSimClassRefineOneBit(Gia_Man_t *p, int i)
Definition: sscClass.c:162