abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
int2Int.h
Go to the documentation of this file.
1 /**CFile****************************************************************
2 
3  FileName [int2Int.h]
4 
5  SystemName [ABC: Logic synthesis and verification system.]
6 
7  PackageName [Interpolation engine.]
8 
9  Synopsis [Internal declarations.]
10 
11  Author [Alan Mishchenko]
12 
13  Affiliation [UC Berkeley]
14 
15  Date [Ver. 1.0. Started - Dec 1, 2013.]
16 
17  Revision [$Id: int2Int.h,v 1.00 2013/12/01 00:00:00 alanmi Exp $]
18 
19 ***********************************************************************/
20 
21 #ifndef ABC__Gia__int2__intInt_h
22 #define ABC__Gia__int2__intInt_h
23 
24 
25 ////////////////////////////////////////////////////////////////////////
26 /// INCLUDES ///
27 ////////////////////////////////////////////////////////////////////////
28 
29 #include "aig/gia/gia.h"
30 #include "sat/bsat/satSolver.h"
31 #include "sat/cnf/cnf.h"
32 #include "int2.h"
33 
34 ////////////////////////////////////////////////////////////////////////
35 /// PARAMETERS ///
36 ////////////////////////////////////////////////////////////////////////
37 
39 
40 ////////////////////////////////////////////////////////////////////////
41 /// BASIC TYPES ///
42 ////////////////////////////////////////////////////////////////////////
43 
44 // interpolation manager
45 typedef struct Int2_Man_t_ Int2_Man_t;
47 {
48  // parameters
49  Int2_ManPars_t * pPars; // parameters
50  // GIA managers
51  Gia_Man_t * pGia; // original manager
52  Gia_Man_t * pGiaPref; // prefix manager
53  Gia_Man_t * pGiaSuff; // suffix manager
54  // subset of the manager
55  Vec_Int_t * vSuffCis; // suffix CIs
56  Vec_Int_t * vSuffCos; // suffix COs
57  Vec_Int_t * vPrefCos; // suffix POs
58  Vec_Int_t * vStack; // temporary stack
59  // preimages
60  Vec_Int_t * vImageOne; // latest preimage
61  Vec_Int_t * vImagesAll; // cumulative preimage
62  // variable maps
63  Vec_Ptr_t * vMapFrames; // mapping of GIA IDs into frame IDs
64  Vec_Int_t * vMapPref; // mapping of flop inputs into SAT variables
65  Vec_Int_t * vMapSuff; // mapping of flop outputs into SAT variables
66  // initial minimization
67  Vec_Int_t * vAssign; // assignment of PIs in pGiaSuff
68  Vec_Int_t * vPrio; // priority of PIs in pGiaSuff
69  // SAT solving
70  sat_solver * pSatPref; // prefix solver
71  sat_solver * pSatSuff; // suffix solver
72  // runtime
77 };
78 
79 static inline Int2_Man_t * Int2_ManCreate( Gia_Man_t * pGia, Int2_ManPars_t * pPars )
80 {
81  Int2_Man_t * p;
82  p = ABC_CALLOC( Int2_Man_t, 1 );
83  p->pPars = pPars;
84  p->pGia = pGia;
85  p->pGiaPref = Gia_ManStart( 10000 );
86  // perform structural hashing
87  Gia_ManHashAlloc( pFrames );
88  // subset of the manager
89  p->vSuffCis = Vec_IntAlloc( Gia_ManCiNum(pGia) );
90  p->vSuffCos = Vec_IntAlloc( Gia_ManCoNum(pGia) );
91  p->vPrefCos = Vec_IntAlloc( Gia_ManCoNum(pGia) );
92  p->vStack = Vec_IntAlloc( 10000 );
93  // preimages
94  p->vImageOne = Vec_IntAlloc( 1000 );
95  p->vImagesAll = Vec_IntAlloc( 1000 );
96  // variable maps
97  p->vMapFrames = Vec_PtrAlloc( 100 );
98  p->vMapPref = Vec_IntAlloc( Gia_ManRegNum(pGia) );
99  p->vMapSuff = Vec_IntAlloc( Gia_ManRegNum(pGia) );
100  // initial minimization
101  p->vAssign = Vec_IntAlloc( Gia_ManCiNum(pGia) );
102  p->vPrio = Vec_IntAlloc( Gia_ManCiNum(pGia) );
103  return p;
104 }
105 static inline void Int2_ManStop( Int2_Man_t * p )
106 {
107  // GIA managers
108  Gia_ManStopP( &p->pGiaPref );
109  Gia_ManStopP( &p->pGiaSuff );
110  // subset of the manager
111  Vec_IntFreeP( &p->vSuffCis );
112  Vec_IntFreeP( &p->vSuffCos );
113  Vec_IntFreeP( &p->vPrefCos );
114  Vec_IntFreeP( &p->vStack );
115  // preimages
116  Vec_IntFreeP( &p->vImageOne );
117  Vec_IntFreeP( &p->vImagesAll );
118  // variable maps
119  Vec_VecFree( (Vec_Vec_t *)p->vMapFrames );
120  Vec_IntFreeP( &p->vMapPref );
121  Vec_IntFreeP( &p->vMapSuff );
122  // initial minimization
123  Vec_IntFreeP( &p->vAssign );
124  Vec_IntFreeP( &p->vPrio );
125  // SAT solving
126  if ( p->pSatPref )
127  sat_solver_delete( p->pSatPref );
128  if ( p->timeSatSuff )
129  sat_solver_delete( p->pSatSuff );
130  ABC_FREE( p );
131 }
132 
133 ////////////////////////////////////////////////////////////////////////
134 /// MACRO DEFINITIONS ///
135 ////////////////////////////////////////////////////////////////////////
136 
137 ////////////////////////////////////////////////////////////////////////
138 /// FUNCTION DECLARATIONS ///
139 ////////////////////////////////////////////////////////////////////////
140 
141 /*=== int2Bmc.c =============================================================*/
142 extern int Int2_ManCheckInit( Gia_Man_t * p );
143 extern Gia_Man_t * Int2_ManDupInit( Gia_Man_t * p, int fVerbose );
144 extern sat_solver * Int2_ManSetupBmcSolver( Gia_Man_t * p, int nFrames );
145 extern void Int2_ManCreateFrames( Int2_Man_t * p, int iFrame, Vec_Int_t * vPrefCos );
146 extern int Int2_ManCheckBmc( Int2_Man_t * p, Vec_Int_t * vCube );
147 
148 /*=== int2Refine.c =============================================================*/
149 extern Vec_Int_t * Int2_ManRefineCube( Gia_Man_t * p, Vec_Int_t * vAssign, Vec_Int_t * vPrio );
150 
151 /*=== int2Util.c ============================================================*/
152 extern Gia_Man_t * Int2_ManProbToGia( Gia_Man_t * p, Vec_Int_t * vSop );
153 
154 
156 
157 
158 
159 #endif
160 
161 ////////////////////////////////////////////////////////////////////////
162 /// END OF FILE ///
163 ////////////////////////////////////////////////////////////////////////
164 
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
DECLARATIONS ///.
Definition: int2Int.h:46
Vec_Int_t * vStack
Definition: int2Int.h:58
typedefABC_NAMESPACE_HEADER_START struct Vec_Vec_t_ Vec_Vec_t
INCLUDES ///.
Definition: vecVec.h:42
Vec_Int_t * Int2_ManRefineCube(Gia_Man_t *p, Vec_Int_t *vAssign, Vec_Int_t *vPrio)
Definition: int2Refine.c:104
static Llb_Mgr_t * p
Definition: llb3Image.c:950
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
abctime timeOther
Definition: int2Int.h:75
Vec_Int_t * vMapPref
Definition: int2Int.h:64
void sat_solver_delete(sat_solver *s)
Definition: satSolver.c:1141
void Int2_ManCreateFrames(Int2_Man_t *p, int iFrame, Vec_Int_t *vPrefCos)
Definition: int2Bmc.c:219
Vec_Int_t * vPrefCos
Definition: int2Int.h:57
abctime timeTotal
Definition: int2Int.h:76
static void Vec_VecFree(Vec_Vec_t *p)
Definition: vecVec.h:347
Gia_Man_t * pGiaPref
Definition: int2Int.h:52
Vec_Int_t * vAssign
Definition: int2Int.h:67
void Gia_ManStopP(Gia_Man_t **p)
Definition: giaMan.c:177
Vec_Int_t * vImageOne
Definition: int2Int.h:60
int Int2_ManCheckBmc(Int2_Man_t *p, Vec_Int_t *vCube)
Definition: int2Bmc.c:318
typedefABC_NAMESPACE_HEADER_START struct Int2_Man_t_ Int2_Man_t
INCLUDES ///.
Definition: int2Int.h:45
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: bblif.c:149
Gia_Man_t * Int2_ManDupInit(Gia_Man_t *p, int fVerbose)
DECLARATIONS ///.
Definition: int2Bmc.c:46
Vec_Ptr_t * vMapFrames
Definition: int2Int.h:63
Gia_Man_t * pGia
Definition: int2Int.h:51
Gia_Man_t * Gia_ManStart(int nObjsMax)
DECLARATIONS ///.
Definition: giaMan.c:52
int Int2_ManCheckInit(Gia_Man_t *p)
MACRO DEFINITIONS ///.
Definition: int2Bmc.c:92
static void Int2_ManStop(Int2_Man_t *p)
Definition: int2Int.h:105
#define ABC_NAMESPACE_HEADER_START
NAMESPACES ///.
Definition: abc_global.h:105
Int2_ManPars_t * pPars
Definition: int2Int.h:49
Vec_Int_t * vSuffCis
Definition: int2Int.h:55
static void Vec_IntFreeP(Vec_Int_t **p)
Definition: vecInt.h:289
static Int2_Man_t * Int2_ManCreate(Gia_Man_t *pGia, Int2_ManPars_t *pPars)
Definition: int2Int.h:79
#define ABC_NAMESPACE_HEADER_END
Definition: abc_global.h:106
Gia_Man_t * Int2_ManProbToGia(Gia_Man_t *p, Vec_Int_t *vSop)
Definition: int2Util.c:98
Vec_Int_t * vPrio
Definition: int2Int.h:68
static int Gia_ManCiNum(Gia_Man_t *p)
Definition: gia.h:383
Vec_Int_t * vImagesAll
Definition: int2Int.h:61
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: vecPtr.h:83
sat_solver * pSatPref
Definition: int2Int.h:70
#define ABC_FREE(obj)
Definition: abc_global.h:232
sat_solver * Int2_ManSetupBmcSolver(Gia_Man_t *p, int nFrames)
Definition: int2Bmc.c:170
Definition: gia.h:95
abctime timeSatPref
Definition: int2Int.h:73
sat_solver * pSatSuff
Definition: int2Int.h:71
Vec_Int_t * vMapSuff
Definition: int2Int.h:65
#define ABC_CALLOC(type, num)
Definition: abc_global.h:230
void Gia_ManHashAlloc(Gia_Man_t *p)
Definition: giaHash.c:99
typedefABC_NAMESPACE_HEADER_START struct Int2_ManPars_t_ Int2_ManPars_t
INCLUDES ///.
Definition: int2.h:50
ABC_INT64_T abctime
Definition: abc_global.h:278
Vec_Int_t * vSuffCos
Definition: int2Int.h:56
abctime timeSatSuff
Definition: int2Int.h:74
static int Gia_ManCoNum(Gia_Man_t *p)
Definition: gia.h:384
Gia_Man_t * pGiaSuff
Definition: int2Int.h:53
static int Gia_ManRegNum(Gia_Man_t *p)
Definition: gia.h:387