ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
absUtil.c
Go to the documentation of this file.
1
20
21#include "abs.h"
22
24
28
32
45{
46 memset( p, 0, sizeof(Abs_Par_t) );
47 p->nFramesMax = 0; // maximum frames
48 p->nFramesStart = 0; // starting frame
49 p->nFramesPast = 4; // overlap frames
50 p->nConfLimit = 0; // conflict limit
51 p->nLearnedMax = 1000; // max number of learned clauses
52 p->nLearnedStart = 1000; // max number of learned clauses
53 p->nLearnedDelta = 200; // max number of learned clauses
54 p->nLearnedPerce = 70; // max number of learned clauses
55 p->nTimeOut = 0; // timeout in seconds
56 p->nRatioMin = 0; // stop when less than this % of object is abstracted
57 p->nRatioMax = 30; // restart when more than this % of object is abstracted
58 p->fUseTermVars = 0; // use terminal variables
59 p->fUseRollback = 0; // use rollback to the starting number of frames
60 p->fPropFanout = 1; // propagate fanouts during refinement
61 p->fVerbose = 0; // verbose flag
62 p->iFrame = -1; // the number of frames covered
63 p->iFrameProved = -1; // the number of frames proved
64 p->nFramesNoChangeLim = 2; // the number of frames without change to dump abstraction
65}
66
79{
80 Gia_Obj_t * pObj;
81 Vec_Int_t * vGla;
82 int nObjMask, nObjs = Gia_ManObjNum(p);
83 int i, Entry, nFrames = Vec_IntEntry( vVta, 0 );
84 assert( Vec_IntEntry(vVta, nFrames+1) == Vec_IntSize(vVta) );
85 // get the bitmask
86 nObjMask = (1 << Abc_Base2Log(nObjs)) - 1;
87 assert( nObjs <= nObjMask );
88 // go through objects
89 vGla = Vec_IntStart( nObjs );
90 Vec_IntForEachEntryStart( vVta, Entry, i, nFrames+2 )
91 {
92 pObj = Gia_ManObj( p, (Entry & nObjMask) );
93 assert( Gia_ObjIsRo(p, pObj) || Gia_ObjIsAnd(pObj) || Gia_ObjIsConst0(pObj) );
94 Vec_IntAddToEntry( vGla, (Entry & nObjMask), 1 );
95 }
96 Vec_IntWriteEntry( vGla, 0, nFrames );
97 return vGla;
98}
99
112{
113 Vec_Int_t * vVta;
114 int nObjBits, nObjMask, nObjs = Gia_ManObjNum(p);
115 int i, k, j, Entry, Counter, nGlaSize;
116 //. get the GLA size
117 nGlaSize = Vec_IntSum(vGla);
118 // get the bitmask
119 nObjBits = Abc_Base2Log(nObjs);
120 nObjMask = (1 << Abc_Base2Log(nObjs)) - 1;
121 assert( nObjs <= nObjMask );
122 // go through objects
123 vVta = Vec_IntAlloc( 1000 );
124 Vec_IntPush( vVta, nFrames );
125 Counter = nFrames + 2;
126 for ( i = 0; i <= nFrames; i++, Counter += i * nGlaSize )
127 Vec_IntPush( vVta, Counter );
128 for ( i = 0; i < nFrames; i++ )
129 for ( k = 0; k <= i; k++ )
130 Vec_IntForEachEntry( vGla, Entry, j )
131 if ( Entry )
132 Vec_IntPush( vVta, (k << nObjBits) | j );
133 Counter = Vec_IntEntry(vVta, nFrames+1);
134 assert( Vec_IntEntry(vVta, nFrames+1) == Vec_IntSize(vVta) );
135 return vVta;
136}
137
150{
151 if ( Gia_ObjIsTravIdCurrent(p, pObj) )
152 return;
153 Gia_ObjSetTravIdCurrent(p, pObj);
154 Vec_IntWriteEntry( vGla, Gia_ObjId(p, pObj), 1 );
155 if ( Gia_ObjIsRo(p, pObj) )
156 return;
157 assert( Gia_ObjIsAnd(pObj) );
158 Gia_FlaConvertToGla_rec( p, Gia_ObjFanin0(pObj), vGla );
159 Gia_FlaConvertToGla_rec( p, Gia_ObjFanin1(pObj), vGla );
160}
161
174{
175 Vec_Int_t * vGla;
176 Gia_Obj_t * pObj;
177 int i;
178 // mark const0 and relevant CI objects
180 Gia_ObjSetTravIdCurrent(p, Gia_ManConst0(p));
181 Gia_ManForEachPi( p, pObj, i )
182 Gia_ObjSetTravIdCurrent(p, pObj);
183 Gia_ManForEachRo( p, pObj, i )
184 if ( !Vec_IntEntry(vFla, i) )
185 Gia_ObjSetTravIdCurrent(p, pObj);
186 // label all objects reachable from the PO and selected flops
187 vGla = Vec_IntStart( Gia_ManObjNum(p) );
188 Vec_IntWriteEntry( vGla, 0, 1 );
189 Gia_ManForEachPo( p, pObj, i )
190 Gia_FlaConvertToGla_rec( p, Gia_ObjFanin0(pObj), vGla );
191 Gia_ManForEachRi( p, pObj, i )
192 if ( Vec_IntEntry(vFla, i) )
193 Gia_FlaConvertToGla_rec( p, Gia_ObjFanin0(pObj), vGla );
194 return vGla;
195}
196
209{
210 Vec_Int_t * vFla;
211 Gia_Obj_t * pObj;
212 int i;
213 vFla = Vec_IntStart( Gia_ManRegNum(p) );
214 Gia_ManForEachRo( p, pObj, i )
215 if ( Vec_IntEntry(vGla, Gia_ObjId(p, pObj)) )
216 Vec_IntWriteEntry( vFla, i, 1 );
217 return vFla;
218}
219
232{
233 Gia_Obj_t * pObj;
234 int i, Count = 0;
235 Gia_ManForEachRo( p, pObj, i )
236 if ( Vec_IntEntry(vGla, Gia_ObjId(p, pObj)) )
237 Count++;
238 return Count;
239}
241{
242 Gia_Obj_t * pObj;
243 int i, Count = 0;
244 Gia_ManForEachAnd( p, pObj, i )
245 if ( Vec_IntEntry(vGla, Gia_ObjId(p, pObj)) )
246 Count++;
247 return Count;
248}
249
250
254
255
257
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
Vec_Int_t * Gia_VtaConvertFromGla(Gia_Man_t *p, Vec_Int_t *vGla, int nFrames)
Definition absUtil.c:111
int Gia_GlaCountNodes(Gia_Man_t *p, Vec_Int_t *vGla)
Definition absUtil.c:240
void Gia_FlaConvertToGla_rec(Gia_Man_t *p, Gia_Obj_t *pObj, Vec_Int_t *vGla)
Definition absUtil.c:149
Vec_Int_t * Gia_VtaConvertToGla(Gia_Man_t *p, Vec_Int_t *vVta)
Definition absUtil.c:78
Vec_Int_t * Gia_FlaConvertToGla(Gia_Man_t *p, Vec_Int_t *vFla)
Definition absUtil.c:173
ABC_NAMESPACE_IMPL_START void Abs_ParSetDefaults(Abs_Par_t *p)
DECLARATIONS ///.
Definition absUtil.c:44
Vec_Int_t * Gia_GlaConvertToFla(Gia_Man_t *p, Vec_Int_t *vGla)
Definition absUtil.c:208
int Gia_GlaCountFlops(Gia_Man_t *p, Vec_Int_t *vGla)
Definition absUtil.c:231
typedefABC_NAMESPACE_HEADER_START struct Abs_Par_t_ Abs_Par_t
INCLUDES ///.
Definition abs.h:46
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition bblif.c:37
Cube * p
Definition exorList.c:222
#define Gia_ManForEachRo(p, pObj, i)
Definition gia.h:1252
#define Gia_ManForEachPo(p, pObj, i)
Definition gia.h:1250
#define Gia_ManForEachAnd(p, pObj, i)
Definition gia.h:1214
#define Gia_ManForEachPi(p, pObj, i)
Definition gia.h:1248
struct Gia_Obj_t_ Gia_Obj_t
Definition gia.h:76
struct Gia_Man_t_ Gia_Man_t
Definition gia.h:96
void Gia_ManIncrementTravId(Gia_Man_t *p)
Definition giaUtil.c:190
#define Gia_ManForEachRi(p, pObj, i)
Definition gia.h:1254
#define assert(ex)
Definition util_old.h:213
char * memset()
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
Definition vecInt.h:54
#define Vec_IntForEachEntryStart(vVec, Entry, i, Start)
Definition vecInt.h:56