ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
cecInt.h File Reference
#include "sat/bsat/satSolver.h"
#include "sat/glucose2/AbcGlucose2.h"
#include "misc/bar/bar.h"
#include "aig/gia/gia.h"
#include "cec.h"
Include dependency graph for cecInt.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  Cec_ManPat_t_
 
struct  Cec_ManSat_t_
 
struct  Cec_ManSim_t_
 
struct  Cec_ManFra_t_
 

Typedefs

typedef typedefABC_NAMESPACE_HEADER_START struct Cec_ManPat_t_ Cec_ManPat_t
 INCLUDES ///.
 
typedef struct Cec_ManSat_t_ Cec_ManSat_t
 
typedef struct Cec_ManSim_t_ Cec_ManSim_t
 
typedef struct Cec_ManFra_t_ Cec_ManFra_t
 

Functions

void Cec_ManRefinedClassPrintStats (Gia_Man_t *p, Vec_Str_t *vStatus, int iIter, abctime Time)
 MACRO DEFINITIONS ///.
 
int Cec_ManSimClassRemoveOne (Cec_ManSim_t *p, int i)
 
int Cec_ManSimClassesPrepare (Cec_ManSim_t *p, int LevelMax)
 
int Cec_ManSimClassesRefine (Cec_ManSim_t *p)
 
int Cec_ManSimSimulateRound (Cec_ManSim_t *p, Vec_Ptr_t *vInfoCis, Vec_Ptr_t *vInfoCos)
 
int * Cec_ManDetectIsomorphism (Gia_Man_t *p)
 
Cec_ManSat_tCec_ManSatCreate (Gia_Man_t *pAig, Cec_ParSat_t *pPars)
 DECLARATIONS ///.
 
void Cec_ManSatPrintStats (Cec_ManSat_t *p)
 
void Cec_ManSatStop (Cec_ManSat_t *p)
 
Cec_ManPat_tCec_ManPatStart ()
 
void Cec_ManPatPrintStats (Cec_ManPat_t *p)
 
void Cec_ManPatStop (Cec_ManPat_t *p)
 
Cec_ManSim_tCec_ManSimStart (Gia_Man_t *pAig, Cec_ParSim_t *pPars)
 
void Cec_ManSimStop (Cec_ManSim_t *p)
 
Cec_ManFra_tCec_ManFraStart (Gia_Man_t *pAig, Cec_ParFra_t *pPars)
 
void Cec_ManFraStop (Cec_ManFra_t *p)
 
void Cec_ManPatSavePattern (Cec_ManPat_t *pPat, Cec_ManSat_t *p, Gia_Obj_t *pObj)
 
void Cec_ManPatSavePatternCSat (Cec_ManPat_t *pMan, Vec_Int_t *vPat)
 
Vec_Ptr_tCec_ManPatCollectPatterns (Cec_ManPat_t *pMan, int nInputs, int nWords)
 
Vec_Ptr_tCec_ManPatPackPatterns (Vec_Int_t *vCexStore, int nInputs, int nRegs, int nWordsInit)
 
int Cec_ManSeqResimulate (Cec_ManSim_t *p, Vec_Ptr_t *vInfo)
 
int Cec_ManSeqResimulateInfo (Gia_Man_t *pAig, Vec_Ptr_t *vSimInfo, Abc_Cex_t *pBestState, int fCheckMiter)
 
void Cec_ManSeqDeriveInfoInitRandom (Vec_Ptr_t *vInfo, Gia_Man_t *pAig, Abc_Cex_t *pCex)
 
int Cec_ManCountNonConstOutputs (Gia_Man_t *pAig)
 
int Cec_ManCheckNonTrivialCands (Gia_Man_t *pAig)
 
int Cec_ObjSatVarValue (Cec_ManSat_t *p, Gia_Obj_t *pObj)
 FUNCTION DEFINITIONS ///.
 
void Cec_ManSatSolve (Cec_ManPat_t *pPat, Gia_Man_t *pAig, Cec_ParSat_t *pPars, Vec_Int_t *vIdsOrig, Vec_Int_t *vMiterPairs, Vec_Int_t *vEquivPairs, int f0Proved)
 
void Cec_ManSatSolveCSat (Cec_ManPat_t *pPat, Gia_Man_t *pAig, Cec_ParSat_t *pPars)
 
Vec_Str_tCec_ManSatSolveSeq (Vec_Ptr_t *vPatts, Gia_Man_t *pAig, Cec_ParSat_t *pPars, int nRegs, int *pnPats)
 
Vec_Int_tCec_ManSatSolveMiter (Gia_Man_t *pAig, Cec_ParSat_t *pPars, Vec_Str_t **pvStatus)
 
int Cec_ManSatCheckNode (Cec_ManSat_t *p, Gia_Obj_t *pObj)
 
int Cec_ManSatCheckNodeTwo (Cec_ManSat_t *p, Gia_Obj_t *pObj1, Gia_Obj_t *pObj2)
 
void Cec_ManSavePattern (Cec_ManSat_t *p, Gia_Obj_t *pObj1, Gia_Obj_t *pObj2)
 
Vec_Int_tCec_ManSatReadCex (Cec_ManSat_t *p)
 
void CecG_ManSatSolve (Cec_ManPat_t *pPat, Gia_Man_t *pAig, Cec_ParSat_t *pPars, int f0Proved)
 
Gia_Man_tCec_ManFraSpecReduction (Cec_ManFra_t *p)
 DECLARATIONS ///.
 
int Cec_ManFraClassesUpdate (Cec_ManFra_t *p, Cec_ManSim_t *pSim, Cec_ManPat_t *pPat, Gia_Man_t *pNew)
 

Typedef Documentation

◆ Cec_ManFra_t

typedef struct Cec_ManFra_t_ Cec_ManFra_t

Definition at line 147 of file cecInt.h.

◆ Cec_ManPat_t

typedef typedefABC_NAMESPACE_HEADER_START struct Cec_ManPat_t_ Cec_ManPat_t

INCLUDES ///.

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

FileName [cecInt.h]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Combinational equivalence checking.]

Synopsis [External declarations.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - June 20, 2005.]

Revision [

Id
cecInt.h,v 1.00 2005/06/20 00:00:00 alanmi Exp

] PARAMETERS /// BASIC TYPES ///

Definition at line 49 of file cecInt.h.

◆ Cec_ManSat_t

typedef struct Cec_ManSat_t_ Cec_ManSat_t

Definition at line 75 of file cecInt.h.

◆ Cec_ManSim_t

typedef struct Cec_ManSim_t_ Cec_ManSim_t

Definition at line 113 of file cecInt.h.

Function Documentation

◆ Cec_ManCheckNonTrivialCands()

int Cec_ManCheckNonTrivialCands ( Gia_Man_t * pAig)
extern

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

Synopsis [Returns the number of POs that are not const0 cands.]

Description []

SideEffects []

SeeAlso []

Definition at line 295 of file cecSeq.c.

296{
297 Gia_Obj_t * pObj;
298 int i, RetValue = 0;
299 if ( pAig->pReprs == NULL )
300 return 0;
301 // label internal nodes driving POs
302 Gia_ManForEachPo( pAig, pObj, i )
303 Gia_ObjFanin0(pObj)->fMark0 = 1;
304 // check if there are non-labled equivs
305 Gia_ManForEachObj( pAig, pObj, i )
306 if ( Gia_ObjIsCand(pObj) && !pObj->fMark0 && Gia_ObjRepr(pAig, i) != GIA_VOID )
307 {
308 RetValue = 1;
309 break;
310 }
311 // clean internal nodes driving POs
312 Gia_ManForEachPo( pAig, pObj, i )
313 Gia_ObjFanin0(pObj)->fMark0 = 0;
314 return RetValue;
315}
#define Gia_ManForEachPo(p, pObj, i)
Definition gia.h:1250
struct Gia_Obj_t_ Gia_Obj_t
Definition gia.h:76
#define Gia_ManForEachObj(p, pObj, i)
MACRO DEFINITIONS ///.
Definition gia.h:1190
#define GIA_VOID
Definition gia.h:46
Gia_Rpr_t * pReprs
Definition gia.h:126
unsigned fMark0
Definition gia.h:81
Here is the caller graph for this function:

◆ Cec_ManCountNonConstOutputs()

int Cec_ManCountNonConstOutputs ( Gia_Man_t * pAig)
extern

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

Synopsis [Returns the number of POs that are not const0 cands.]

Description []

SideEffects []

SeeAlso []

Definition at line 272 of file cecSeq.c.

273{
274 Gia_Obj_t * pObj;
275 int i, Counter = 0;
276 if ( pAig->pReprs == NULL )
277 return -1;
278 Gia_ManForEachPo( pAig, pObj, i )
279 if ( !Gia_ObjIsConst( pAig, Gia_ObjFaninId0p(pAig, pObj) ) )
280 Counter++;
281 return Counter;
282}
Here is the caller graph for this function:

◆ Cec_ManDetectIsomorphism()

int * Cec_ManDetectIsomorphism ( Gia_Man_t * p)
extern

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

Synopsis [Finds node correspondences in the miter.]

Description [Assumes that the colors are assigned.]

SideEffects []

SeeAlso []

Definition at line 297 of file cecIso.c.

298{
299 int nWords = 2;
300 Gia_Obj_t * pObj;
301 Vec_Int_t * vNodesA, * vNodesB;
302 unsigned * pStore, Counter;
303 int i, * pIso, * pTable, nTableSize;
304 // start equivalence classes
305 pIso = ABC_CALLOC( int, Gia_ManObjNum(p) );
306 Gia_ManForEachObj( p, pObj, i )
307 {
308 if ( Gia_ObjIsCo(pObj) )
309 {
310 assert( Gia_ObjColors(p, i) == 0 );
311 continue;
312 }
313 assert( Gia_ObjColors(p, i) );
314 if ( Gia_ObjColors(p, i) == 3 )
315 pIso[i] = i;
316 }
317 // start simulation info
318 pStore = ABC_ALLOC( unsigned, Gia_ManObjNum(p) * nWords );
319 // simulate and create table
320 nTableSize = Abc_PrimeCudd( 100 + Gia_ManObjNum(p)/2 );
321 pTable = ABC_CALLOC( int, nTableSize );
323 Gia_ManForEachObj1( p, pObj, i )
324 {
325 if ( Gia_ObjIsCo(pObj) )
326 continue;
327 if ( pIso[i] == 0 ) // simulate
328 Gia_ManIsoSimulate( pObj, i, pStore, nWords );
329 else if ( pIso[i] < i ) // copy
330 Gia_ManIsoCopy( i, pIso[i], pStore, nWords );
331 else // generate
332 Gia_ManIsoRandom( i, pStore, nWords );
333 if ( pIso[i] == 0 )
334 Gia_ManIsoTableAdd( p, i, pStore, nWords, pTable, nTableSize );
335 }
336 // create equivalence classes
337 vNodesA = Vec_IntAlloc( 100 );
338 vNodesB = Vec_IntAlloc( 100 );
339 for ( i = 0; i < nTableSize; i++ )
340 if ( Gia_ManIsoExtractClasses( p, pTable[i], pStore, nWords, vNodesA, vNodesB ) )
341 Gia_ManIsoMatchNodes( pIso, pStore, nWords, vNodesA, vNodesB );
342 Vec_IntFree( vNodesA );
343 Vec_IntFree( vNodesB );
344 // collect info
345 Counter = 0;
346 Gia_ManForEachObj1( p, pObj, i )
347 {
348 Counter += (pIso[i] && pIso[i] < i);
349/*
350 if ( pIso[i] && pIso[i] < i )
351 {
352 if ( (Gia_ObjIsHead(p,pIso[i]) && Gia_ObjRepr(p,i)==pIso[i]) ||
353 (Gia_ObjIsClass(p,pIso[i]) && Gia_ObjRepr(p,i)==Gia_ObjRepr(p,pIso[i])) )
354 Abc_Print( 1, "1" );
355 else
356 Abc_Print( 1, "0" );
357 }
358*/
359 }
360 Abc_Print( 1, "Computed %d pairs of structurally equivalent nodes.\n", Counter );
361// p->pIso = pIso;
362// Cec_ManTransformClasses( p );
363
364 ABC_FREE( pTable );
365 ABC_FREE( pStore );
366 return pIso;
367}
int nWords
Definition abcNpn.c:127
#define ABC_ALLOC(type, num)
Definition abc_global.h:264
#define ABC_CALLOC(type, num)
Definition abc_global.h:265
#define ABC_FREE(obj)
Definition abc_global.h:267
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition bblif.c:37
Cube * p
Definition exorList.c:222
#define Gia_ManForEachObj1(p, pObj, i)
Definition gia.h:1192
void Gia_ManCleanValue(Gia_Man_t *p)
Definition giaUtil.c:351
#define assert(ex)
Definition util_old.h:213
Here is the call graph for this function:

◆ Cec_ManFraClassesUpdate()

int Cec_ManFraClassesUpdate ( Cec_ManFra_t * p,
Cec_ManSim_t * pSim,
Cec_ManPat_t * pPat,
Gia_Man_t * pNew )
extern

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

Synopsis [Updates equivalence classes using the patterns.]

Description []

SideEffects []

SeeAlso []

Definition at line 188 of file cecSweep.c.

189{
190 Vec_Ptr_t * vInfo;
191 Gia_Obj_t * pObj, * pObjOld, * pReprOld;
192 int i, k, iRepr, iNode;
193 abctime clk;
194clk = Abc_Clock();
195 vInfo = Cec_ManPatCollectPatterns( pPat, Gia_ManCiNum(p->pAig), pSim->nWords );
196p->timePat += Abc_Clock() - clk;
197clk = Abc_Clock();
198 if ( vInfo != NULL )
199 {
200 Gia_ManCreateValueRefs( p->pAig );
201 for ( i = 0; i < pPat->nSeries; i++ )
202 {
203 Cec_ManFraCreateInfo( pSim, pSim->vCiSimInfo, vInfo, i );
204 if ( Cec_ManSimSimulateRound( pSim, pSim->vCiSimInfo, pSim->vCoSimInfo ) )
205 {
206 Vec_PtrFree( vInfo );
207 return 1;
208 }
209 }
210 Vec_PtrFree( vInfo );
211 }
212p->timeSim += Abc_Clock() - clk;
213 assert( Vec_IntSize(p->vXorNodes) == 2*Gia_ManCoNum(pNew) );
214 // mark the transitive fanout of failed nodes
215 if ( p->pPars->nDepthMax != 1 )
216 {
217 Gia_ManCleanMark0( p->pAig );
218 Gia_ManCleanMark1( p->pAig );
219 Gia_ManForEachCo( pNew, pObj, k )
220 {
221 iRepr = Vec_IntEntry( p->vXorNodes, 2*k );
222 iNode = Vec_IntEntry( p->vXorNodes, 2*k+1 );
223 if ( pObj->fMark0 == 0 && pObj->fMark1 == 1 ) // proved
224 continue;
225// Gia_ManObj(p->pAig, iRepr)->fMark0 = 1;
226 Gia_ManObj(p->pAig, iNode)->fMark0 = 1;
227 }
228 // mark the nodes reachable through the failed nodes
229 Gia_ManForEachAnd( p->pAig, pObjOld, k )
230 pObjOld->fMark0 |= (Gia_ObjFanin0(pObjOld)->fMark0 | Gia_ObjFanin1(pObjOld)->fMark0);
231 // unmark the disproved nodes
232 Gia_ManForEachCo( pNew, pObj, k )
233 {
234 iRepr = Vec_IntEntry( p->vXorNodes, 2*k );
235 iNode = Vec_IntEntry( p->vXorNodes, 2*k+1 );
236 if ( pObj->fMark0 == 0 && pObj->fMark1 == 1 ) // proved
237 continue;
238 pObjOld = Gia_ManObj(p->pAig, iNode);
239 assert( pObjOld->fMark0 == 1 );
240 if ( Gia_ObjFanin0(pObjOld)->fMark0 == 0 && Gia_ObjFanin1(pObjOld)->fMark0 == 0 )
241 pObjOld->fMark1 = 1;
242 }
243 // clean marks
244 Gia_ManForEachAnd( p->pAig, pObjOld, k )
245 if ( pObjOld->fMark1 )
246 {
247 pObjOld->fMark0 = 0;
248 pObjOld->fMark1 = 0;
249 }
250 }
251 // set the results
252 p->nAllProved = p->nAllDisproved = p->nAllFailed = 0;
253 Gia_ManForEachCo( pNew, pObj, k )
254 {
255 iRepr = Vec_IntEntry( p->vXorNodes, 2*k );
256 iNode = Vec_IntEntry( p->vXorNodes, 2*k+1 );
257 pReprOld = Gia_ManObj(p->pAig, iRepr);
258 pObjOld = Gia_ManObj(p->pAig, iNode);
259 if ( pObj->fMark1 )
260 { // proved
261 assert( pObj->fMark0 == 0 );
262 assert( !Gia_ObjProved(p->pAig, iNode) );
263 if ( pReprOld->fMark0 == 0 && pObjOld->fMark0 == 0 )
264// if ( pObjOld->fMark0 == 0 )
265 {
266 assert( iRepr == Gia_ObjRepr(p->pAig, iNode) );
267 Gia_ObjSetProved( p->pAig, iNode );
268 p->nAllProved++;
269 }
270 }
271 else if ( pObj->fMark0 )
272 { // disproved
273 assert( pObj->fMark1 == 0 );
274 if ( pReprOld->fMark0 == 0 && pObjOld->fMark0 == 0 )
275// if ( pObjOld->fMark0 == 0 )
276 {
277 if ( iRepr == Gia_ObjRepr(p->pAig, iNode) )
278 Abc_Print( 1, "Cec_ManFraClassesUpdate(): Error! Node is not refined!\n" );
279 p->nAllDisproved++;
280 }
281 }
282 else
283 { // failed
284 assert( pObj->fMark0 == 0 );
285 assert( pObj->fMark1 == 0 );
286 assert( !Gia_ObjFailed(p->pAig, iNode) );
287 assert( !Gia_ObjProved(p->pAig, iNode) );
288 Gia_ObjSetFailed( p->pAig, iNode );
289 p->nAllFailed++;
290 }
291 }
292 p->nAllProvedS += p->nAllProved;
293 p->nAllDisprovedS += p->nAllDisproved;
294 p->nAllFailedS += p->nAllFailed;
295 return 0;
296}
ABC_INT64_T abctime
Definition abc_global.h:332
int Cec_ManSimSimulateRound(Cec_ManSim_t *p, Vec_Ptr_t *vInfoCis, Vec_Ptr_t *vInfoCos)
Definition cecClass.c:668
Vec_Ptr_t * Cec_ManPatCollectPatterns(Cec_ManPat_t *pMan, int nInputs, int nWords)
Definition cecPat.c:455
void Cec_ManFraCreateInfo(Cec_ManSim_t *p, Vec_Ptr_t *vCiInfo, Vec_Ptr_t *vInfo, int nSeries)
Definition cecSweep.c:163
#define Gia_ManForEachAnd(p, pObj, i)
Definition gia.h:1214
void Gia_ManCreateValueRefs(Gia_Man_t *p)
Definition giaUtil.c:750
void Gia_ManCleanMark0(Gia_Man_t *p)
Definition giaUtil.c:256
#define Gia_ManForEachCo(p, pObj, i)
Definition gia.h:1236
void Gia_ManCleanMark1(Gia_Man_t *p)
Definition giaUtil.c:313
Vec_Ptr_t * vCoSimInfo
Definition cecInt.h:130
Vec_Ptr_t * vCiSimInfo
Definition cecInt.h:129
unsigned fMark1
Definition gia.h:86
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition vecPtr.h:42
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Cec_ManFraSpecReduction()

Gia_Man_t * Cec_ManFraSpecReduction ( Cec_ManFra_t * p)
extern

DECLARATIONS ///.

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

FileName [cecSweep.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Combinational equivalence checking.]

Synopsis [SAT sweeping manager.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - June 20, 2005.]

Revision [

Id
cecSweep.c,v 1.00 2005/06/20 00:00:00 alanmi Exp

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

Synopsis [Performs limited speculative reduction.]

Description []

SideEffects []

SeeAlso []

Definition at line 45 of file cecSweep.c.

46{
47 Gia_Man_t * pNew, * pTemp;
48 Gia_Obj_t * pObj, * pRepr = NULL;
49 int iRes0, iRes1, iRepr, iNode, iMiter;
50 int i, fCompl, * piCopies, * pDepths;
51 Gia_ManSetPhase( p->pAig );
52 Vec_IntClear( p->vXorNodes );
53 if ( p->pPars->nLevelMax )
54 Gia_ManLevelNum( p->pAig );
55 pNew = Gia_ManStart( Gia_ManObjNum(p->pAig) );
56 pNew->pName = Abc_UtilStrsav( p->pAig->pName );
57 pNew->pSpec = Abc_UtilStrsav( p->pAig->pName );
58 Gia_ManHashAlloc( pNew );
59 piCopies = ABC_FALLOC( int, Gia_ManObjNum(p->pAig) );
60 pDepths = ABC_CALLOC( int, Gia_ManObjNum(p->pAig) );
61 piCopies[0] = 0;
62 Gia_ManForEachObj1( p->pAig, pObj, i )
63 {
64 if ( Gia_ObjIsCi(pObj) )
65 {
66 piCopies[i] = Gia_ManAppendCi( pNew );
67 continue;
68 }
69 if ( Gia_ObjIsCo(pObj) )
70 continue;
71 if ( piCopies[Gia_ObjFaninId0(pObj,i)] == -1 ||
72 piCopies[Gia_ObjFaninId1(pObj,i)] == -1 )
73 continue;
74 iRes0 = Abc_LitNotCond( piCopies[Gia_ObjFaninId0(pObj,i)], Gia_ObjFaninC0(pObj) );
75 iRes1 = Abc_LitNotCond( piCopies[Gia_ObjFaninId1(pObj,i)], Gia_ObjFaninC1(pObj) );
76 iNode = piCopies[i] = Gia_ManHashAnd( pNew, iRes0, iRes1 );
77 pDepths[i] = Abc_MaxInt( pDepths[Gia_ObjFaninId0(pObj,i)], pDepths[Gia_ObjFaninId1(pObj,i)] );
78 if ( Gia_ObjRepr(p->pAig, i) == GIA_VOID || Gia_ObjFailed(p->pAig, i) )
79 continue;
80 assert( Gia_ObjRepr(p->pAig, i) < i );
81 iRepr = piCopies[Gia_ObjRepr(p->pAig, i)];
82 if ( iRepr == -1 )
83 continue;
84 if ( Abc_LitRegular(iNode) == Abc_LitRegular(iRepr) )
85 continue;
86 if ( p->pPars->nLevelMax &&
87 (Gia_ObjLevelId(p->pAig, i) > p->pPars->nLevelMax ||
88 Gia_ObjLevelId(p->pAig, Abc_Lit2Var(iRepr)) > p->pPars->nLevelMax) )
89 continue;
90 if ( p->pPars->fDualOut )
91 {
92// if ( i % 1000 == 0 && Gia_ObjRepr(p->pAig, i) )
93// Gia_ManEquivPrintOne( p->pAig, Gia_ObjRepr(p->pAig, i), 0 );
94 if ( p->pPars->fColorDiff )
95 {
96 if ( !Gia_ObjDiffColors( p->pAig, Gia_ObjRepr(p->pAig, i), i ) )
97 continue;
98 }
99 else
100 {
101 if ( !Gia_ObjDiffColors2( p->pAig, Gia_ObjRepr(p->pAig, i), i ) )
102 continue;
103 }
104 }
105 pRepr = Gia_ManObj( p->pAig, Gia_ObjRepr(p->pAig, i) );
106 fCompl = Gia_ObjPhaseReal(pObj) ^ Gia_ObjPhaseReal(pRepr);
107 piCopies[i] = Abc_LitNotCond( iRepr, fCompl );
108 if ( Gia_ObjProved(p->pAig, i) )
109 continue;
110 // produce speculative miter
111 iMiter = Gia_ManHashXor( pNew, iNode, piCopies[i] );
112 Gia_ManAppendCo( pNew, iMiter );
113 Vec_IntPush( p->vXorNodes, Gia_ObjRepr(p->pAig, i) );
114 Vec_IntPush( p->vXorNodes, i );
115 // add to the depth of this node
116 pDepths[i] = 1 + Abc_MaxInt( pDepths[i], pDepths[Gia_ObjRepr(p->pAig, i)] );
117 if ( p->pPars->nDepthMax && pDepths[i] >= p->pPars->nDepthMax )
118 piCopies[i] = -1;
119 }
120 ABC_FREE( piCopies );
121 ABC_FREE( pDepths );
122 Gia_ManHashStop( pNew );
123 Gia_ManSetRegNum( pNew, 0 );
124 pNew = Gia_ManCleanup( pTemp = pNew );
125 Gia_ManStop( pTemp );
126 return pNew;
127}
#define ABC_FALLOC(type, num)
Definition abc_global.h:266
void Gia_ManStop(Gia_Man_t *p)
Definition giaMan.c:82
void Gia_ManSetRegNum(Gia_Man_t *p, int nRegs)
Definition giaMan.c:764
void Gia_ManHashAlloc(Gia_Man_t *p)
Definition giaHash.c:105
Gia_Man_t * Gia_ManStart(int nObjsMax)
FUNCTION DEFINITIONS ///.
Definition giaMan.c:57
int Gia_ManHashXor(Gia_Man_t *p, int iLit0, int iLit1)
Definition giaHash.c:668
struct Gia_Man_t_ Gia_Man_t
Definition gia.h:96
Gia_Man_t * Gia_ManCleanup(Gia_Man_t *p)
Definition giaScl.c:84
int Gia_ManHashAnd(Gia_Man_t *p, int iLit0, int iLit1)
Definition giaHash.c:576
void Gia_ManSetPhase(Gia_Man_t *p)
Definition giaUtil.c:420
void Gia_ManHashStop(Gia_Man_t *p)
Definition giaHash.c:149
int Gia_ManLevelNum(Gia_Man_t *p)
Definition giaUtil.c:546
char * pSpec
Definition gia.h:100
char * pName
Definition gia.h:99
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Cec_ManFraStart()

Cec_ManFra_t * Cec_ManFraStart ( Gia_Man_t * pAig,
Cec_ParFra_t * pPars )
extern

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

Synopsis [Creates AIG.]

Description []

SideEffects []

SeeAlso []

Definition at line 263 of file cecMan.c.

264{
265 Cec_ManFra_t * p;
266 p = ABC_ALLOC( Cec_ManFra_t, 1 );
267 memset( p, 0, sizeof(Cec_ManFra_t) );
268 p->pAig = pAig;
269 p->pPars = pPars;
270 p->vXorNodes = Vec_IntAlloc( 1000 );
271 return p;
272}
struct Cec_ManFra_t_ Cec_ManFra_t
Definition cecInt.h:147
char * memset()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Cec_ManFraStop()

void Cec_ManFraStop ( Cec_ManFra_t * p)
extern

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

Synopsis [Deletes AIG.]

Description []

SideEffects []

SeeAlso []

Definition at line 285 of file cecMan.c.

286{
287 Vec_IntFree( p->vXorNodes );
288 ABC_FREE( p );
289}
Here is the caller graph for this function:

◆ Cec_ManPatCollectPatterns()

Vec_Ptr_t * Cec_ManPatCollectPatterns ( Cec_ManPat_t * pMan,
int nInputs,
int nWordsInit )
extern

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

Synopsis [Packs patterns into array of simulation info.]

Description []

SideEffects []

SeeAlso []

Definition at line 455 of file cecPat.c.

456{
457 Vec_Int_t * vPat = pMan->vPattern1;
458 Vec_Ptr_t * vInfo, * vPres;
459 int k, kMax = -1, nPatterns = 0;
460 int iStartOld = pMan->iStart;
461 int nWords = nWordsInit;
462 int nBits = 32 * nWords;
463 abctime clk = Abc_Clock();
464 vInfo = Vec_PtrAllocSimInfo( nInputs, nWords );
465 Gia_ManRandomInfo( vInfo, 0, 0, nWords );
466 vPres = Vec_PtrAllocSimInfo( nInputs, nWords );
467 Vec_PtrCleanSimInfo( vPres, 0, nWords );
468 while ( pMan->iStart < Vec_StrSize(pMan->vStorage) )
469 {
470 nPatterns++;
471 Cec_ManPatRestore( pMan, vPat );
472 for ( k = 1; k < nBits; k++, k += ((k % (32 * nWordsInit)) == 0) )
473 if ( Cec_ManPatCollectTry( vInfo, vPres, k, (int *)Vec_IntArray(vPat), Vec_IntSize(vPat) ) )
474 break;
475 kMax = Abc_MaxInt( kMax, k );
476 if ( k == nBits-1 )
477 {
478 Vec_PtrReallocSimInfo( vInfo );
479 Gia_ManRandomInfo( vInfo, 0, nWords, 2*nWords );
480 Vec_PtrReallocSimInfo( vPres );
481 Vec_PtrCleanSimInfo( vPres, nWords, 2*nWords );
482 nWords *= 2;
483 nBits *= 2;
484 }
485 }
486 Vec_PtrFree( vPres );
487 pMan->nSeries = Vec_PtrReadWordsSimInfo(vInfo) / nWordsInit;
488 pMan->timePack += Abc_Clock() - clk;
489 pMan->timeTotal += Abc_Clock() - clk;
490 pMan->iStart = iStartOld;
491 if ( pMan->fVerbose )
492 {
493 Abc_Print( 1, "Total = %5d. Max used = %5d. Full = %5d. Series = %d. ",
494 nPatterns, kMax, nWordsInit*32, pMan->nSeries );
495 ABC_PRT( "Time", Abc_Clock() - clk );
496 Cec_ManPatPrintStats( pMan );
497 }
498 return vInfo;
499}
#define ABC_PRT(a, t)
Definition abc_global.h:255
void Cec_ManPatPrintStats(Cec_ManPat_t *p)
Definition cecMan.c:151
int Cec_ManPatCollectTry(Vec_Ptr_t *vInfo, Vec_Ptr_t *vPres, int iBit, int *pLits, int nLits)
Definition cecPat.c:421
void Gia_ManRandomInfo(Vec_Ptr_t *vInfo, int iInputStart, int iWordStart, int iWordStop)
Definition giaUtil.c:85
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Cec_ManPatPackPatterns()

Vec_Ptr_t * Cec_ManPatPackPatterns ( Vec_Int_t * vCexStore,
int nInputs,
int nRegs,
int nWordsInit )
extern

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

Synopsis [Packs patterns into array of simulation info.]

Description []

SideEffects []

SeeAlso []

Definition at line 513 of file cecPat.c.

514{
515 Vec_Int_t * vPat;
516 Vec_Ptr_t * vInfo, * vPres;
517 int k, nSize, iStart, kMax = 0, nPatterns = 0;
518 int nWords = nWordsInit;
519 int nBits = 32 * nWords;
520// int RetValue;
521 assert( nRegs <= nInputs );
522 vPat = Vec_IntAlloc( 100 );
523
524 vInfo = Vec_PtrAllocSimInfo( nInputs, nWords );
525 Vec_PtrCleanSimInfo( vInfo, 0, nWords );
526 Gia_ManRandomInfo( vInfo, nRegs, 0, nWords );
527
528 vPres = Vec_PtrAllocSimInfo( nInputs, nWords );
529 Vec_PtrCleanSimInfo( vPres, 0, nWords );
530 iStart = 0;
531 while ( iStart < Vec_IntSize(vCexStore) )
532 {
533 nPatterns++;
534 // skip the output number
535 iStart++;
536 // get the number of items
537 nSize = Vec_IntEntry( vCexStore, iStart++ );
538 if ( nSize <= 0 )
539 continue;
540 // extract pattern
541 Vec_IntClear( vPat );
542 for ( k = 0; k < nSize; k++ )
543 Vec_IntPush( vPat, Vec_IntEntry( vCexStore, iStart++ ) );
544 // add pattern to storage
545 for ( k = 1; k < nBits; k++, k += ((k % (32 * nWordsInit)) == 0) )
546 if ( Cec_ManPatCollectTry( vInfo, vPres, k, (int *)Vec_IntArray(vPat), Vec_IntSize(vPat) ) )
547 break;
548
549// k = kMax + 1;
550// RetValue = Cec_ManPatCollectTry( vInfo, vPres, k, (int *)Vec_IntArray(vPat), Vec_IntSize(vPat) );
551// assert( RetValue == 1 );
552
553 kMax = Abc_MaxInt( kMax, k );
554 if ( k == nBits-1 )
555 {
556 Vec_PtrReallocSimInfo( vInfo );
557 Vec_PtrCleanSimInfo( vInfo, nWords, 2*nWords );
558 Gia_ManRandomInfo( vInfo, nRegs, nWords, 2*nWords );
559
560 Vec_PtrReallocSimInfo( vPres );
561 Vec_PtrCleanSimInfo( vPres, nWords, 2*nWords );
562 nWords *= 2;
563 nBits *= 2;
564 }
565 }
566// Abc_Print( 1, "packed %d patterns into %d vectors (out of %d)\n", nPatterns, kMax, nBits );
567 Vec_PtrFree( vPres );
568 Vec_IntFree( vPat );
569 return vInfo;
570}
Here is the call graph for this function:

◆ Cec_ManPatPrintStats()

void Cec_ManPatPrintStats ( Cec_ManPat_t * p)
extern

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

Synopsis [Creates AIG.]

Description []

SideEffects []

SeeAlso []

Definition at line 151 of file cecMan.c.

152{
153 Abc_Print( 1, "Latest: P = %8d. L = %10d. Lm = %10d. Ave = %6.1f. MEM =%6.2f MB\n",
154 p->nPats, p->nPatLits, p->nPatLitsMin, 1.0 * p->nPatLitsMin/p->nPats,
155 1.0*(Vec_StrSize(p->vStorage)-p->iStart)/(1<<20) );
156 Abc_Print( 1, "Total: P = %8d. L = %10d. Lm = %10d. Ave = %6.1f. MEM =%6.2f MB\n",
157 p->nPatsAll, p->nPatLitsAll, p->nPatLitsMinAll, 1.0 * p->nPatLitsMinAll/p->nPatsAll,
158 1.0*Vec_StrSize(p->vStorage)/(1<<20) );
159 Abc_PrintTimeP( 1, "Finding ", p->timeFind, p->timeTotal );
160 Abc_PrintTimeP( 1, "Shrinking", p->timeShrink, p->timeTotal );
161 Abc_PrintTimeP( 1, "Verifying", p->timeVerify, p->timeTotal );
162 Abc_PrintTimeP( 1, "Sorting ", p->timeSort, p->timeTotal );
163 Abc_PrintTimeP( 1, "Packing ", p->timePack, p->timeTotal );
164 Abc_PrintTime( 1, "TOTAL ", p->timeTotal );
165}
Here is the caller graph for this function:

◆ Cec_ManPatSavePattern()

void Cec_ManPatSavePattern ( Cec_ManPat_t * pMan,
Cec_ManSat_t * p,
Gia_Obj_t * pObj )
extern

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 359 of file cecPat.c.

360{
361 Vec_Int_t * vPat;
362 int nPatLits;
363 abctime clkTotal = Abc_Clock();
364// abctime clk;
365 assert( Gia_ObjIsCo(pObj) );
366 pMan->nPats++;
367 pMan->nPatsAll++;
368 // compute values in the cone of influence
369//clk = Abc_Clock();
370 Gia_ManIncrementTravId( p->pAig );
371 nPatLits = Cec_ManPatComputePattern_rec( p, p->pAig, Gia_ObjFanin0(pObj) );
372 assert( (Gia_ObjFanin0(pObj)->fMark1 ^ Gia_ObjFaninC0(pObj)) == 1 );
373 pMan->nPatLits += nPatLits;
374 pMan->nPatLitsAll += nPatLits;
375//pMan->timeFind += Abc_Clock() - clk;
376 // compute sensitizing path
377//clk = Abc_Clock();
378 Vec_IntClear( pMan->vPattern1 );
379 Gia_ManIncrementTravId( p->pAig );
380 Cec_ManPatComputePattern1_rec( p->pAig, Gia_ObjFanin0(pObj), pMan->vPattern1 );
381 // compute sensitizing path
382 Vec_IntClear( pMan->vPattern2 );
383 Gia_ManIncrementTravId( p->pAig );
384 Cec_ManPatComputePattern2_rec( p->pAig, Gia_ObjFanin0(pObj), pMan->vPattern2 );
385 // compare patterns
386 vPat = Vec_IntSize(pMan->vPattern1) < Vec_IntSize(pMan->vPattern2) ? pMan->vPattern1 : pMan->vPattern2;
387 pMan->nPatLitsMin += Vec_IntSize(vPat);
388 pMan->nPatLitsMinAll += Vec_IntSize(vPat);
389//pMan->timeShrink += Abc_Clock() - clk;
390 // verify pattern using ternary simulation
391//clk = Abc_Clock();
392// Cec_ManPatVerifyPattern( p->pAig, pObj, vPat );
393//pMan->timeVerify += Abc_Clock() - clk;
394 // sort pattern
395//clk = Abc_Clock();
396 Vec_IntSort( vPat, 0 );
397//pMan->timeSort += Abc_Clock() - clk;
398 // save pattern
399 Cec_ManPatStore( pMan, vPat );
400 pMan->timeTotal += Abc_Clock() - clkTotal;
401}
void Cec_ManPatComputePattern1_rec(Gia_Man_t *p, Gia_Obj_t *pObj, Vec_Int_t *vPat)
Definition cecPat.c:170
void Cec_ManPatComputePattern2_rec(Gia_Man_t *p, Gia_Obj_t *pObj, Vec_Int_t *vPat)
Definition cecPat.c:208
int Cec_ManPatComputePattern_rec(Cec_ManSat_t *pSat, Gia_Man_t *p, Gia_Obj_t *pObj)
Definition cecPat.c:140
void Gia_ManIncrementTravId(Gia_Man_t *p)
Definition giaUtil.c:190
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Cec_ManPatSavePatternCSat()

void Cec_ManPatSavePatternCSat ( Cec_ManPat_t * pMan,
Vec_Int_t * vPat )
extern

Definition at line 402 of file cecPat.c.

403{
404 // sort pattern
405 Vec_IntSort( vPat, 0 );
406 // save pattern
407 Cec_ManPatStore( pMan, vPat );
408}
Here is the caller graph for this function:

◆ Cec_ManPatStart()

Cec_ManPat_t * Cec_ManPatStart ( )
extern

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

Synopsis [Creates AIG.]

Description []

SideEffects []

SeeAlso []

Definition at line 130 of file cecMan.c.

131{
132 Cec_ManPat_t * p;
133 p = ABC_CALLOC( Cec_ManPat_t, 1 );
134 p->vStorage = Vec_StrAlloc( 1<<20 );
135 p->vPattern1 = Vec_IntAlloc( 1000 );
136 p->vPattern2 = Vec_IntAlloc( 1000 );
137 return p;
138}
typedefABC_NAMESPACE_HEADER_START struct Cec_ManPat_t_ Cec_ManPat_t
INCLUDES ///.
Definition cecInt.h:49
Here is the caller graph for this function:

◆ Cec_ManPatStop()

void Cec_ManPatStop ( Cec_ManPat_t * p)
extern

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

Synopsis [Deletes AIG.]

Description []

SideEffects []

SeeAlso []

Definition at line 178 of file cecMan.c.

179{
180 Vec_StrFree( p->vStorage );
181 Vec_IntFree( p->vPattern1 );
182 Vec_IntFree( p->vPattern2 );
183 ABC_FREE( p );
184}
Here is the caller graph for this function:

◆ Cec_ManRefinedClassPrintStats()

void Cec_ManRefinedClassPrintStats ( Gia_Man_t * p,
Vec_Str_t * vStatus,
int iIter,
abctime Time )
extern

MACRO DEFINITIONS ///.

FUNCTION DECLARATIONS ///

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

Synopsis [Prints statistics during solving.]

Description []

SideEffects []

SeeAlso []

Definition at line 725 of file cecCorr.c.

726{
727 int nLits, CounterX = 0, Counter0 = 0, Counter = 0;
728 int i, Entry, nProve = 0, nDispr = 0, nFail = 0;
729 for ( i = 1; i < Gia_ManObjNum(p); i++ )
730 {
731 if ( Gia_ObjIsNone(p, i) )
732 CounterX++;
733 else if ( Gia_ObjIsConst(p, i) )
734 Counter0++;
735 else if ( Gia_ObjIsHead(p, i) )
736 Counter++;
737 }
738 CounterX -= Gia_ManCoNum(p);
739 nLits = Gia_ManCiNum(p) + Gia_ManAndNum(p) - Counter - CounterX;
740 if ( iIter == -1 )
741 Abc_Print( 1, "BMC : " );
742 else
743 Abc_Print( 1, "%3d : ", iIter );
744 Abc_Print( 1, "c =%8d cl =%7d lit =%8d ", Counter0, Counter, nLits );
745 if ( vStatus )
746 Vec_StrForEachEntry( vStatus, Entry, i )
747 {
748 if ( Entry == 1 )
749 nProve++;
750 else if ( Entry == 0 )
751 nDispr++;
752 else if ( Entry == -1 )
753 nFail++;
754 }
755 Abc_Print( 1, "p =%6d d =%6d f =%6d ", nProve, nDispr, nFail );
756 Abc_Print( 1, "%c ", Gia_ObjIsConst( p, Gia_ObjFaninId0p(p, Gia_ManPo(p, 0)) ) ? '+' : '-' );
757 Abc_PrintTime( 1, "T", Time );
758}
#define Vec_StrForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
Definition vecStr.h:54
Here is the caller graph for this function:

◆ Cec_ManSatCheckNode()

int Cec_ManSatCheckNode ( Cec_ManSat_t * p,
Gia_Obj_t * pObj )
extern

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

Synopsis [Runs equivalence test for the two nodes.]

Description []

SideEffects []

SeeAlso []

Definition at line 470 of file cecSolve.c.

471{
472 Gia_Obj_t * pObjR = Gia_Regular(pObj);
473 int nBTLimit = p->pPars->nBTLimit;
474 int Lit, RetValue, status, nConflicts;
475 abctime clk, clk2;
476
477 if ( pObj == Gia_ManConst0(p->pAig) )
478 return 1;
479 if ( pObj == Gia_ManConst1(p->pAig) )
480 {
481 assert( 0 );
482 return 0;
483 }
484
485 p->nCallsSince++; // experiment with this!!!
486 p->nSatTotal++;
487
488 // check if SAT solver needs recycling
489 if ( p->pSat == NULL ||
490 (p->pPars->nSatVarMax &&
491 p->nSatVars > p->pPars->nSatVarMax &&
492 p->nCallsSince > p->pPars->nCallsRecycle) )
494
495 // if the nodes do not have SAT variables, allocate them
496clk2 = Abc_Clock();
497 Cec_CnfNodeAddToSolver( p, pObjR );
498//ABC_PRT( "cnf", Abc_Clock() - clk2 );
499//Abc_Print( 1, "%d \n", p->pSat->size );
500
501clk2 = Abc_Clock();
502// Cec_SetActivityFactors( p, pObjR );
503//ABC_PRT( "act", Abc_Clock() - clk2 );
504
505 // propage unit clauses
506 if ( p->pSat->qtail != p->pSat->qhead )
507 {
508 status = sat_solver_simplify(p->pSat);
509 assert( status != 0 );
510 assert( p->pSat->qtail == p->pSat->qhead );
511 }
512
513 // solve under assumptions
514 // A = 1; B = 0 OR A = 1; B = 1
515 Lit = toLitCond( Cec_ObjSatNum(p,pObjR), Gia_IsComplement(pObj) );
516 if ( p->pPars->fPolarFlip )
517 {
518 if ( pObjR->fPhase ) Lit = lit_neg( Lit );
519 }
520//Sat_SolverWriteDimacs( p->pSat, "temp.cnf", pLits, pLits + 2, 1 );
521clk = Abc_Clock();
522 nConflicts = p->pSat->stats.conflicts;
523
524clk2 = Abc_Clock();
525 RetValue = sat_solver_solve( p->pSat, &Lit, &Lit + 1,
526 (ABC_INT64_T)nBTLimit, (ABC_INT64_T)0, (ABC_INT64_T)0, (ABC_INT64_T)0 );
527//ABC_PRT( "sat", Abc_Clock() - clk2 );
528
529 if ( RetValue == l_False )
530 {
531p->timeSatUnsat += Abc_Clock() - clk;
532 Lit = lit_neg( Lit );
533 RetValue = sat_solver_addclause( p->pSat, &Lit, &Lit + 1 );
534 assert( RetValue );
535 p->nSatUnsat++;
536 p->nConfUnsat += p->pSat->stats.conflicts - nConflicts;
537//Abc_Print( 1, "UNSAT after %d conflicts\n", p->pSat->stats.conflicts - nConflicts );
538 return 1;
539 }
540 else if ( RetValue == l_True )
541 {
542p->timeSatSat += Abc_Clock() - clk;
543 p->nSatSat++;
544 p->nConfSat += p->pSat->stats.conflicts - nConflicts;
545//Abc_Print( 1, "SAT after %d conflicts\n", p->pSat->stats.conflicts - nConflicts );
546 return 0;
547 }
548 else // if ( RetValue == l_Undef )
549 {
550p->timeSatUndec += Abc_Clock() - clk;
551 p->nSatUndec++;
552 p->nConfUndec += p->pSat->stats.conflicts - nConflicts;
553//Abc_Print( 1, "UNDEC after %d conflicts\n", p->pSat->stats.conflicts - nConflicts );
554 return -1;
555 }
556}
#define l_True
Definition bmcBmcS.c:35
#define l_False
Definition bmcBmcS.c:36
#define sat_solver_addclause
Definition cecSatG2.c:37
#define sat_solver_solve
Definition cecSatG2.c:45
void Cec_CnfNodeAddToSolver(Cec_ManSat_t *p, Gia_Obj_t *pObj)
Definition cecSolve.c:306
void Cec_ManSatSolverRecycle(Cec_ManSat_t *p)
Definition cecSolve.c:365
int sat_solver_simplify(sat_solver *s)
Definition satSolver.c:1515
unsigned fPhase
Definition gia.h:87
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Cec_ManSatCheckNodeTwo()

int Cec_ManSatCheckNodeTwo ( Cec_ManSat_t * p,
Gia_Obj_t * pObj1,
Gia_Obj_t * pObj2 )
extern

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

Synopsis [Runs equivalence test for the two nodes.]

Description []

SideEffects []

SeeAlso []

Definition at line 569 of file cecSolve.c.

570{
571 Gia_Obj_t * pObjR1 = Gia_Regular(pObj1);
572 Gia_Obj_t * pObjR2 = Gia_Regular(pObj2);
573 int nBTLimit = p->pPars->nBTLimit;
574 int Lits[2], RetValue, status, nConflicts;
575 abctime clk, clk2;
576
577 if ( pObj1 == Gia_ManConst0(p->pAig) || pObj2 == Gia_ManConst0(p->pAig) || pObj1 == Gia_Not(pObj2) )
578 return 1;
579 if ( pObj1 == Gia_ManConst1(p->pAig) && (pObj2 == NULL || pObj2 == Gia_ManConst1(p->pAig)) )
580 {
581 assert( 0 );
582 return 0;
583 }
584
585 p->nCallsSince++; // experiment with this!!!
586 p->nSatTotal++;
587
588 // check if SAT solver needs recycling
589 if ( p->pSat == NULL ||
590 (p->pPars->nSatVarMax &&
591 p->nSatVars > p->pPars->nSatVarMax &&
592 p->nCallsSince > p->pPars->nCallsRecycle) )
594
595 // if the nodes do not have SAT variables, allocate them
596clk2 = Abc_Clock();
597 Cec_CnfNodeAddToSolver( p, pObjR1 );
598 Cec_CnfNodeAddToSolver( p, pObjR2 );
599//ABC_PRT( "cnf", Abc_Clock() - clk2 );
600//Abc_Print( 1, "%d \n", p->pSat->size );
601
602clk2 = Abc_Clock();
603// Cec_SetActivityFactors( p, pObjR1 );
604// Cec_SetActivityFactors( p, pObjR2 );
605//ABC_PRT( "act", Abc_Clock() - clk2 );
606
607 // propage unit clauses
608 if ( p->pSat->qtail != p->pSat->qhead )
609 {
610 status = sat_solver_simplify(p->pSat);
611 assert( status != 0 );
612 assert( p->pSat->qtail == p->pSat->qhead );
613 }
614
615 // solve under assumptions
616 // A = 1; B = 0 OR A = 1; B = 1
617 Lits[0] = toLitCond( Cec_ObjSatNum(p,pObjR1), Gia_IsComplement(pObj1) );
618 Lits[1] = toLitCond( Cec_ObjSatNum(p,pObjR2), Gia_IsComplement(pObj2) );
619 if ( p->pPars->fPolarFlip )
620 {
621 if ( pObjR1->fPhase ) Lits[0] = lit_neg( Lits[0] );
622 if ( pObjR2->fPhase ) Lits[1] = lit_neg( Lits[1] );
623 }
624//Sat_SolverWriteDimacs( p->pSat, "temp.cnf", pLits, pLits + 2, 1 );
625clk = Abc_Clock();
626 nConflicts = p->pSat->stats.conflicts;
627
628clk2 = Abc_Clock();
629 RetValue = sat_solver_solve( p->pSat, Lits, Lits + 2,
630 (ABC_INT64_T)nBTLimit, (ABC_INT64_T)0, (ABC_INT64_T)0, (ABC_INT64_T)0 );
631//ABC_PRT( "sat", Abc_Clock() - clk2 );
632
633 if ( RetValue == l_False )
634 {
635p->timeSatUnsat += Abc_Clock() - clk;
636 Lits[0] = lit_neg( Lits[0] );
637 Lits[1] = lit_neg( Lits[1] );
638 RetValue = sat_solver_addclause( p->pSat, Lits, Lits + 2 );
639 assert( RetValue );
640 p->nSatUnsat++;
641 p->nConfUnsat += p->pSat->stats.conflicts - nConflicts;
642//Abc_Print( 1, "UNSAT after %d conflicts\n", p->pSat->stats.conflicts - nConflicts );
643 return 1;
644 }
645 else if ( RetValue == l_True )
646 {
647p->timeSatSat += Abc_Clock() - clk;
648 p->nSatSat++;
649 p->nConfSat += p->pSat->stats.conflicts - nConflicts;
650//Abc_Print( 1, "SAT after %d conflicts\n", p->pSat->stats.conflicts - nConflicts );
651 return 0;
652 }
653 else // if ( RetValue == l_Undef )
654 {
655p->timeSatUndec += Abc_Clock() - clk;
656 p->nSatUndec++;
657 p->nConfUndec += p->pSat->stats.conflicts - nConflicts;
658//Abc_Print( 1, "UNDEC after %d conflicts\n", p->pSat->stats.conflicts - nConflicts );
659 return -1;
660 }
661}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Cec_ManSatCreate()

Cec_ManSat_t * Cec_ManSatCreate ( Gia_Man_t * pAig,
Cec_ParSat_t * pPars )
extern

DECLARATIONS ///.

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

FileName [cecMan.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Combinational equivalence checking.]

Synopsis [Manager procedures.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - June 20, 2005.]

Revision [

Id
cecMan.c,v 1.00 2005/06/20 00:00:00 alanmi Exp

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

Synopsis [Creates the manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 45 of file cecMan.c.

46{
48 // create interpolation manager
49 p = ABC_ALLOC( Cec_ManSat_t, 1 );
50 memset( p, 0, sizeof(Cec_ManSat_t) );
51 p->pPars = pPars;
52 p->pAig = pAig;
53 // SAT solving
54 p->nSatVars = 1;
55 p->pSatVars = ABC_CALLOC( int, Gia_ManObjNum(pAig) );
56 p->vUsedNodes = Vec_PtrAlloc( 1000 );
57 p->vFanins = Vec_PtrAlloc( 100 );
58 p->vCex = Vec_IntAlloc( 100 );
59 p->vVisits = Vec_IntAlloc( 100 );
60 return p;
61}
struct Cec_ManSat_t_ Cec_ManSat_t
Definition cecInt.h:75
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Cec_ManSatPrintStats()

void Cec_ManSatPrintStats ( Cec_ManSat_t * p)
extern

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

Synopsis [Prints statistics of the manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 74 of file cecMan.c.

75{
76 printf( "SAT solver statistics:\n" );
77 Abc_Print( 1, "CO = %8d ", Gia_ManCoNum(p->pAig) );
78 Abc_Print( 1, "AND = %8d ", Gia_ManAndNum(p->pAig) );
79 Abc_Print( 1, "Conf = %5d ", p->pPars->nBTLimit );
80 Abc_Print( 1, "MinVar = %5d ", p->pPars->nSatVarMax );
81 Abc_Print( 1, "MinCalls = %5d\n", p->pPars->nCallsRecycle );
82 Abc_Print( 1, "Unsat calls %6d (%6.2f %%) Ave conf = %8.1f ",
83 p->nSatUnsat, p->nSatTotal? 100.0*p->nSatUnsat/p->nSatTotal : 0.0, p->nSatUnsat? 1.0*p->nConfUnsat/p->nSatUnsat :0.0 );
84 Abc_PrintTimeP( 1, "Time", p->timeSatUnsat, p->timeTotal );
85 Abc_Print( 1, "Sat calls %6d (%6.2f %%) Ave conf = %8.1f ",
86 p->nSatSat, p->nSatTotal? 100.0*p->nSatSat/p->nSatTotal : 0.0, p->nSatSat? 1.0*p->nConfSat/p->nSatSat : 0.0 );
87 Abc_PrintTimeP( 1, "Time", p->timeSatSat, p->timeTotal );
88 Abc_Print( 1, "Undef calls %6d (%6.2f %%) Ave conf = %8.1f ",
89 p->nSatUndec, p->nSatTotal? 100.0*p->nSatUndec/p->nSatTotal : 0.0, p->nSatUndec? 1.0*p->nConfUndec/p->nSatUndec : 0.0 );
90 Abc_PrintTimeP( 1, "Time", p->timeSatUndec, p->timeTotal );
91 Abc_PrintTime( 1, "Total time", p->timeTotal );
92}
Here is the caller graph for this function:

◆ Cec_ManSatReadCex()

Vec_Int_t * Cec_ManSatReadCex ( Cec_ManSat_t * pSat)
extern

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

Synopsis [Returns the pattern stored.]

Description []

SideEffects []

SeeAlso []

Definition at line 864 of file cecSolve.c.

865{
866 return pSat->vCex;
867}
Vec_Int_t * vCex
Definition cecInt.h:93
Here is the caller graph for this function:

◆ Cec_ManSatSolve()

void Cec_ManSatSolve ( Cec_ManPat_t * pPat,
Gia_Man_t * pAig,
Cec_ParSat_t * pPars,
Vec_Int_t * vIdsOrig,
Vec_Int_t * vMiterPairs,
Vec_Int_t * vEquivPairs,
int f0Proved )
extern

Definition at line 699 of file cecSolve.c.

700{
701 Bar_Progress_t * pProgress = NULL;
702 Cec_ManSat_t * p;
703 Gia_Obj_t * pObj;
704 int i, status;
705 abctime clk = Abc_Clock(), clk2;
706 Vec_PtrFreeP( &pAig->vSeqModelVec );
707 if ( pPars->fSaveCexes )
708 pAig->vSeqModelVec = Vec_PtrStart( Gia_ManCoNum(pAig) );
709 // reset the manager
710 if ( pPat )
711 {
712 pPat->iStart = Vec_StrSize(pPat->vStorage);
713 pPat->nPats = 0;
714 pPat->nPatLits = 0;
715 pPat->nPatLitsMin = 0;
716 }
717 Gia_ManSetPhase( pAig );
718 Gia_ManLevelNum( pAig );
720 p = Cec_ManSatCreate( pAig, pPars );
721 pProgress = Bar_ProgressStart( stdout, Gia_ManPoNum(pAig) );
722 Gia_ManForEachCo( pAig, pObj, i )
723 {
724 if ( Gia_ObjIsConst0(Gia_ObjFanin0(pObj)) )
725 {
726 status = !Gia_ObjFaninC0(pObj);
727 pObj->fMark0 = (status == 0);
728 pObj->fMark1 = (status == 1);
729 if ( pPars->fSaveCexes )
730 Vec_PtrWriteEntry( pAig->vSeqModelVec, i, status ? (Abc_Cex_t *)(ABC_PTRINT_T)1 : Cex_ManGenSimple(p, i) );
731 continue;
732 }
733 Bar_ProgressUpdate( pProgress, i, "SAT..." );
734clk2 = Abc_Clock();
735 status = Cec_ManSatCheckNode( p, Gia_ObjChild0(pObj) );
736 pObj->fMark0 = (status == 0);
737 pObj->fMark1 = (status == 1);
738 if ( status == 1 && vIdsOrig )
739 {
740 int iObj1 = Vec_IntEntry(vMiterPairs, 2*i);
741 int iObj2 = Vec_IntEntry(vMiterPairs, 2*i+1);
742 int OrigId1 = Vec_IntEntry(vIdsOrig, iObj1);
743 int OrigId2 = Vec_IntEntry(vIdsOrig, iObj2);
744 assert( OrigId1 >= 0 && OrigId2 >= 0 );
745 Vec_IntPushTwo( vEquivPairs, OrigId1, OrigId2 );
746 }
747 if ( pPars->fSaveCexes && status != -1 )
748 Vec_PtrWriteEntry( pAig->vSeqModelVec, i, status ? (Abc_Cex_t *)(ABC_PTRINT_T)1 : Cex_ManGenCex(p, i) );
749
750 if ( f0Proved && status == 1 )
751 Gia_ManPatchCoDriver( pAig, i, 0 );
752
753/*
754 if ( status == -1 )
755 {
756 Gia_Man_t * pTemp = Gia_ManDupDfsCone( pAig, pObj );
757 Gia_AigerWrite( pTemp, "gia_hard.aig", 0, 0, 0 );
758 Gia_ManStop( pTemp );
759 Abc_Print( 1, "Dumping hard cone into file \"%s\".\n", "gia_hard.aig" );
760 }
761*/
762 if ( status != 0 )
763 continue;
764 // save the pattern
765 if ( pPat )
766 {
767 abctime clk3 = Abc_Clock();
768 Cec_ManPatSavePattern( pPat, p, pObj );
769 pPat->timeTotalSave += Abc_Clock() - clk3;
770 }
771 // quit if one of them is solved
772 if ( pPars->fCheckMiter )
773 break;
774 }
775 p->timeTotal = Abc_Clock() - clk;
776 Bar_ProgressStop( pProgress );
777 if ( pPars->fVerbose )
779 Cec_ManSatStop( p );
780}
void Bar_ProgressStop(Bar_Progress_t *p)
Definition bar.c:126
Bar_Progress_t * Bar_ProgressStart(FILE *pFile, int nItemsTotal)
FUNCTION DEFINITIONS ///.
Definition bar.c:66
struct Bar_Progress_t_ Bar_Progress_t
BASIC TYPES ///.
Definition bar.h:48
void Cec_ManPatSavePattern(Cec_ManPat_t *pPat, Cec_ManSat_t *p, Gia_Obj_t *pObj)
Definition cecPat.c:359
void Cec_ManSatPrintStats(Cec_ManSat_t *p)
Definition cecMan.c:74
void Cec_ManSatStop(Cec_ManSat_t *p)
Definition cecMan.c:105
Cec_ManSat_t * Cec_ManSatCreate(Gia_Man_t *pAig, Cec_ParSat_t *pPars)
DECLARATIONS ///.
Definition cecMan.c:45
int Cec_ManSatCheckNode(Cec_ManSat_t *p, Gia_Obj_t *pObj)
Definition cecSolve.c:470
Abc_Cex_t * Cex_ManGenSimple(Cec_ManSat_t *p, int iOut)
Definition cecSolve.c:676
Abc_Cex_t * Cex_ManGenCex(Cec_ManSat_t *p, int iOut)
Definition cecSolve.c:684
Vec_Ptr_t * vSeqModelVec
Definition gia.h:151
typedefABC_NAMESPACE_HEADER_START struct Abc_Cex_t_ Abc_Cex_t
INCLUDES ///.
Definition utilCex.h:39
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Cec_ManSatSolveCSat()

void Cec_ManSatSolveCSat ( Cec_ManPat_t * pPat,
Gia_Man_t * pAig,
Cec_ParSat_t * pPars )
extern

Definition at line 809 of file cecSolve.c.

810{
811 Vec_Str_t * vStatus;
812 Vec_Int_t * vPat = Vec_IntAlloc( 1000 );
813 Vec_Int_t * vCexStore = Cbs_ManSolveMiterNc( pAig, pPars->nBTLimit, &vStatus, 0, 0 );
814 Gia_Obj_t * pObj;
815 int i, status, iStart = 0;
816 assert( Vec_StrSize(vStatus) == Gia_ManCoNum(pAig) );
817 // reset the manager
818 if ( pPat )
819 {
820 pPat->iStart = Vec_StrSize(pPat->vStorage);
821 pPat->nPats = 0;
822 pPat->nPatLits = 0;
823 pPat->nPatLitsMin = 0;
824 }
825 Gia_ManForEachCo( pAig, pObj, i )
826 {
827 status = (int)Vec_StrEntry(vStatus, i);
828 pObj->fMark0 = (status == 0);
829 pObj->fMark1 = (status == 1);
830 if ( Vec_IntSize(vCexStore) > 0 && status != 1 )
831 iStart = Cec_ManSatSolveExractPattern( vCexStore, iStart, vPat );
832 if ( status != 0 )
833 continue;
834 // save the pattern
835 if ( pPat && Vec_IntSize(vPat) > 0 )
836 {
837 abctime clk3 = Abc_Clock();
838 Cec_ManPatSavePatternCSat( pPat, vPat );
839 pPat->timeTotalSave += Abc_Clock() - clk3;
840 }
841 // quit if one of them is solved
842 if ( pPars->fCheckMiter )
843 break;
844 }
845 assert( iStart == Vec_IntSize(vCexStore) );
846 Vec_IntFree( vPat );
847 Vec_StrFree( vStatus );
848 Vec_IntFree( vCexStore );
849}
struct Vec_Str_t_ Vec_Str_t
Definition bblif.c:46
void Cec_ManPatSavePatternCSat(Cec_ManPat_t *pMan, Vec_Int_t *vPat)
Definition cecPat.c:402
int Cec_ManSatSolveExractPattern(Vec_Int_t *vCexStore, int iStart, Vec_Int_t *vPat)
Definition cecSolve.c:794
Vec_Int_t * Cbs_ManSolveMiterNc(Gia_Man_t *pGia, int nConfs, Vec_Str_t **pvStatus, int f0Proved, int fVerbose)
Definition giaCSat.c:1037
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Cec_ManSatSolveMiter()

Vec_Int_t * Cec_ManSatSolveMiter ( Gia_Man_t * pAig,
Cec_ParSat_t * pPars,
Vec_Str_t ** pvStatus )
extern

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

Synopsis [Performs one round of solving for the POs of the AIG.]

Description [Labels the nodes that have been proved (pObj->fMark1) and returns the set of satisfying assignments.]

SideEffects []

SeeAlso []

Definition at line 1070 of file cecSolve.c.

1071{
1072 Bar_Progress_t * pProgress = NULL;
1073 Vec_Int_t * vCexStore;
1074 Vec_Str_t * vStatus;
1075 Cec_ManSat_t * p;
1076 Gia_Obj_t * pObj;
1077 int i, status;
1078 abctime clk = Abc_Clock();
1079 // prepare AIG
1080 Gia_ManSetPhase( pAig );
1081 Gia_ManLevelNum( pAig );
1082 Gia_ManIncrementTravId( pAig );
1083 // create resulting data-structures
1084 vStatus = Vec_StrAlloc( Gia_ManPoNum(pAig) );
1085 vCexStore = Vec_IntAlloc( 10000 );
1086 // perform solving
1087 p = Cec_ManSatCreate( pAig, pPars );
1088 pProgress = Bar_ProgressStart( stdout, Gia_ManPoNum(pAig) );
1089 Gia_ManForEachCo( pAig, pObj, i )
1090 {
1091 Vec_IntClear( p->vCex );
1092 Bar_ProgressUpdate( pProgress, i, "SAT..." );
1093 if ( Gia_ObjIsConst0(Gia_ObjFanin0(pObj)) )
1094 {
1095 if ( Gia_ObjFaninC0(pObj) )
1096 {
1097// Abc_Print( 1, "Constant 1 output of SRM!!!\n" );
1098 Cec_ManSatAddToStore( vCexStore, p->vCex, i ); // trivial counter-example
1099 Vec_StrPush( vStatus, 0 );
1100 }
1101 else
1102 {
1103// Abc_Print( 1, "Constant 0 output of SRM!!!\n" );
1104 Vec_StrPush( vStatus, 1 );
1105 }
1106 continue;
1107 }
1108 status = Cec_ManSatCheckNode( p, Gia_ObjChild0(pObj) );
1109 Vec_StrPush( vStatus, (char)status );
1110 if ( status == -1 )
1111 {
1112 Cec_ManSatAddToStore( vCexStore, NULL, i ); // timeout
1113 continue;
1114 }
1115 if ( status == 1 )
1116 continue;
1117 assert( status == 0 );
1118 // save the pattern
1119// Gia_ManIncrementTravId( pAig );
1120// Cec_ManSatSolveMiter_rec( p, pAig, Gia_ObjFanin0(pObj) );
1121 Cec_ManSavePattern( p, Gia_ObjFanin0(pObj), NULL );
1122// Gia_SatVerifyPattern( pAig, pObj, p->vCex, p->vVisits );
1123 Cec_ManSatAddToStore( vCexStore, p->vCex, i );
1124 }
1125 p->timeTotal = Abc_Clock() - clk;
1126 Bar_ProgressStop( pProgress );
1127// if ( pPars->fVerbose )
1128// Cec_ManSatPrintStats( p );
1129 Cec_ManSatStop( p );
1130 *pvStatus = vStatus;
1131 return vCexStore;
1132}
void Cec_ManSatAddToStore(Vec_Int_t *vCexStore, Vec_Int_t *vCex, int Out)
Definition cecSolve.c:996
void Cec_ManSavePattern(Cec_ManSat_t *p, Gia_Obj_t *pObj1, Gia_Obj_t *pObj2)
Definition cecSolve.c:1049
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Cec_ManSatSolveSeq()

Vec_Str_t * Cec_ManSatSolveSeq ( Vec_Ptr_t * vPatts,
Gia_Man_t * pAig,
Cec_ParSat_t * pPars,
int nRegs,
int * pnPats )
extern

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

Synopsis [Performs one round of solving for the POs of the AIG.]

Description [Labels the nodes that have been proved (pObj->fMark1) and returns the set of satisfying assignments.]

SideEffects []

SeeAlso []

Definition at line 911 of file cecSolve.c.

912{
913 Bar_Progress_t * pProgress = NULL;
914 Vec_Str_t * vStatus;
915 Cec_ManSat_t * p;
916 Gia_Obj_t * pObj;
917 int iPat = 0, nPatsInit, nPats;
918 int i, status;
919 abctime clk = Abc_Clock();
920 nPatsInit = nPats = 32 * Vec_PtrReadWordsSimInfo(vPatts);
921 Gia_ManSetPhase( pAig );
922 Gia_ManLevelNum( pAig );
924 p = Cec_ManSatCreate( pAig, pPars );
925 vStatus = Vec_StrAlloc( Gia_ManPoNum(pAig) );
926 pProgress = Bar_ProgressStart( stdout, Gia_ManPoNum(pAig) );
927 Gia_ManForEachCo( pAig, pObj, i )
928 {
929 Bar_ProgressUpdate( pProgress, i, "SAT..." );
930 if ( Gia_ObjIsConst0(Gia_ObjFanin0(pObj)) )
931 {
932 if ( Gia_ObjFaninC0(pObj) )
933 {
934// Abc_Print( 1, "Constant 1 output of SRM!!!\n" );
935 Vec_StrPush( vStatus, 0 );
936 }
937 else
938 {
939// Abc_Print( 1, "Constant 0 output of SRM!!!\n" );
940 Vec_StrPush( vStatus, 1 );
941 }
942 continue;
943 }
944 status = Cec_ManSatCheckNode( p, Gia_ObjChild0(pObj) );
945//Abc_Print( 1, "output %d status = %d\n", i, status );
946 Vec_StrPush( vStatus, (char)status );
947 if ( status != 0 )
948 continue;
949 // resize storage
950 if ( iPat == nPats )
951 {
952 int nWords = Vec_PtrReadWordsSimInfo(vPatts);
953 Vec_PtrReallocSimInfo( vPatts );
954 Vec_PtrCleanSimInfo( vPatts, nWords, 2*nWords );
955 nPats = 32 * Vec_PtrReadWordsSimInfo(vPatts);
956 }
957 if ( iPat % nPatsInit == 0 )
958 iPat++;
959 // save the pattern
961// Vec_IntClear( p->vCex );
962 Cec_ManSatSolveSeq_rec( p, pAig, Gia_ObjFanin0(pObj), vPatts, iPat++, nRegs );
963// Gia_SatVerifyPattern( pAig, pObj, p->vCex, p->vVisits );
964// Cec_ManSatAddToStore( p->vCexStore, p->vCex );
965// if ( iPat == nPats )
966// break;
967 // quit if one of them is solved
968// if ( pPars->fFirstStop )
969// break;
970// if ( iPat == 32 * 15 * 16 - 1 )
971// break;
972 }
973 p->timeTotal = Abc_Clock() - clk;
974 Bar_ProgressStop( pProgress );
975 if ( pPars->fVerbose )
977// Abc_Print( 1, "Total number of cex literals = %d. (Ave = %d)\n", p->nCexLits, p->nCexLits/p->nSatSat );
978 Cec_ManSatStop( p );
979 if ( pnPats )
980 *pnPats = iPat-1;
981 return vStatus;
982}
void Cec_ManSatSolveSeq_rec(Cec_ManSat_t *pSat, Gia_Man_t *p, Gia_Obj_t *pObj, Vec_Ptr_t *vInfo, int iPat, int nRegs)
Definition cecSolve.c:880
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Cec_ManSatStop()

void Cec_ManSatStop ( Cec_ManSat_t * p)
extern

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

Synopsis [Frees the manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 105 of file cecMan.c.

106{
107 if ( p->pSat )
108 sat_solver_delete( p->pSat );
109 Vec_IntFree( p->vCex );
110 Vec_IntFree( p->vVisits );
111 Vec_PtrFree( p->vUsedNodes );
112 Vec_PtrFree( p->vFanins );
113 ABC_FREE( p->pSatVars );
114 ABC_FREE( p );
115}
void sat_solver_delete(sat_solver *s)
Definition satSolver.c:1341
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Cec_ManSavePattern()

void Cec_ManSavePattern ( Cec_ManSat_t * p,
Gia_Obj_t * pObj1,
Gia_Obj_t * pObj2 )
extern

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

Synopsis [Save patterns.]

Description []

SideEffects []

SeeAlso []

Definition at line 1049 of file cecSolve.c.

1050{
1051 Vec_IntClear( p->vCex );
1052 Gia_ManIncrementTravId( p->pAig );
1053 Cec_ManSatSolveMiter_rec( p, p->pAig, Gia_Regular(pObj1) );
1054 if ( pObj2 )
1055 Cec_ManSatSolveMiter_rec( p, p->pAig, Gia_Regular(pObj2) );
1056}
void Cec_ManSatSolveMiter_rec(Cec_ManSat_t *pSat, Gia_Man_t *p, Gia_Obj_t *pObj)
Definition cecSolve.c:1022
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Cec_ManSeqDeriveInfoInitRandom()

void Cec_ManSeqDeriveInfoInitRandom ( Vec_Ptr_t * vInfo,
Gia_Man_t * pAig,
Abc_Cex_t * pCex )
extern

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

Synopsis [Sets register values from the counter-example.]

Description []

SideEffects []

SeeAlso []

Definition at line 104 of file cecSeq.c.

105{
106 unsigned * pInfo;
107 int k, w, nWords;
108 nWords = Vec_PtrReadWordsSimInfo( vInfo );
109 assert( pCex == NULL || Gia_ManRegNum(pAig) == pCex->nRegs );
110 assert( Gia_ManRegNum(pAig) <= Vec_PtrSize(vInfo) );
111 for ( k = 0; k < Gia_ManRegNum(pAig); k++ )
112 {
113 pInfo = (unsigned *)Vec_PtrEntry( vInfo, k );
114 for ( w = 0; w < nWords; w++ )
115 pInfo[w] = (pCex && Abc_InfoHasBit(pCex->pData, k))? ~0 : 0;
116 }
117
118 for ( ; k < Vec_PtrSize(vInfo); k++ )
119 {
120 pInfo = (unsigned *)Vec_PtrEntry( vInfo, k );
121 for ( w = 0; w < nWords; w++ )
122 pInfo[w] = Gia_ManRandom( 0 );
123 }
124}
unsigned Gia_ManRandom(int fReset)
FUNCTION DEFINITIONS ///.
Definition giaUtil.c:49
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Cec_ManSeqResimulate()

int Cec_ManSeqResimulate ( Cec_ManSim_t * p,
Vec_Ptr_t * vInfo )
extern

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

Synopsis [Resimulates the classes using sequential simulation info.]

Description []

SideEffects []

SeeAlso []

Definition at line 137 of file cecSeq.c.

138{
139 unsigned * pInfo0, * pInfo1;
140 int f, i, k, w;
141// assert( Gia_ManRegNum(p->pAig) > 0 );
142 assert( Vec_PtrSize(vInfo) == Gia_ManRegNum(p->pAig) + Gia_ManPiNum(p->pAig) * p->pPars->nFrames );
143 for ( k = 0; k < Gia_ManRegNum(p->pAig); k++ )
144 {
145 pInfo0 = (unsigned *)Vec_PtrEntry( vInfo, k );
146 pInfo1 = (unsigned *)Vec_PtrEntry( p->vCoSimInfo, Gia_ManPoNum(p->pAig) + k );
147 for ( w = 0; w < p->nWords; w++ )
148 pInfo1[w] = pInfo0[w];
149 }
150 for ( f = 0; f < p->pPars->nFrames; f++ )
151 {
152 for ( i = 0; i < Gia_ManPiNum(p->pAig); i++ )
153 {
154 pInfo0 = (unsigned *)Vec_PtrEntry( vInfo, k++ );
155 pInfo1 = (unsigned *)Vec_PtrEntry( p->vCiSimInfo, i );
156 for ( w = 0; w < p->nWords; w++ )
157 pInfo1[w] = pInfo0[w];
158 }
159 for ( i = 0; i < Gia_ManRegNum(p->pAig); i++ )
160 {
161 pInfo0 = (unsigned *)Vec_PtrEntry( p->vCoSimInfo, Gia_ManPoNum(p->pAig) + i );
162 pInfo1 = (unsigned *)Vec_PtrEntry( p->vCiSimInfo, Gia_ManPiNum(p->pAig) + i );
163 for ( w = 0; w < p->nWords; w++ )
164 pInfo1[w] = pInfo0[w];
165 }
166 if ( Cec_ManSimSimulateRound( p, p->vCiSimInfo, p->vCoSimInfo ) )
167 return 1;
168 }
169 assert( k == Vec_PtrSize(vInfo) );
170 return 0;
171}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Cec_ManSeqResimulateInfo()

int Cec_ManSeqResimulateInfo ( Gia_Man_t * pAig,
Vec_Ptr_t * vSimInfo,
Abc_Cex_t * pBestState,
int fCheckMiter )
extern

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

Synopsis [Resimulates information to refine equivalence classes.]

Description []

SideEffects []

SeeAlso []

Definition at line 184 of file cecSeq.c.

185{
186 Cec_ParSim_t ParsSim, * pParsSim = &ParsSim;
187 Cec_ManSim_t * pSim;
188 int RetValue;//, clkTotal = Abc_Clock();
189 assert( (Vec_PtrSize(vSimInfo) - Gia_ManRegNum(pAig)) % Gia_ManPiNum(pAig) == 0 );
190 Cec_ManSimSetDefaultParams( pParsSim );
191 pParsSim->nFrames = (Vec_PtrSize(vSimInfo) - Gia_ManRegNum(pAig)) / Gia_ManPiNum(pAig);
192 pParsSim->nWords = Vec_PtrReadWordsSimInfo( vSimInfo );
193 pParsSim->fCheckMiter = fCheckMiter;
195 pSim = Cec_ManSimStart( pAig, pParsSim );
196 if ( pBestState )
197 pSim->pBestState = pBestState;
198 RetValue = Cec_ManSeqResimulate( pSim, vSimInfo );
199 pSim->pBestState = NULL;
200 Cec_ManSimStop( pSim );
201 return RetValue;
202}
void Cec_ManSimStop(Cec_ManSim_t *p)
Definition cecMan.c:233
Cec_ManSim_t * Cec_ManSimStart(Gia_Man_t *pAig, Cec_ParSim_t *pPars)
Definition cecMan.c:199
struct Cec_ManSim_t_ Cec_ManSim_t
Definition cecInt.h:113
int Cec_ManSeqResimulate(Cec_ManSim_t *p, Vec_Ptr_t *vInfo)
Definition cecSeq.c:137
void Cec_ManSimSetDefaultParams(Cec_ParSim_t *p)
Definition cecCore.c:71
struct Cec_ParSim_t_ Cec_ParSim_t
Definition cec.h:60
Abc_Cex_t * pBestState
Definition cecInt.h:136
int nFrames
Definition cec.h:64
int fCheckMiter
Definition cec.h:69
int nWords
Definition cec.h:63
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Cec_ManSimClassesPrepare()

int Cec_ManSimClassesPrepare ( Cec_ManSim_t * p,
int LevelMax )
extern

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

Synopsis [Returns 1 if the bug is found.]

Description []

SideEffects []

SeeAlso []

Definition at line 867 of file cecClass.c.

868{
869 Gia_Obj_t * pObj;
870 int i;
871 assert( p->pAig->pReprs == NULL );
872 // allocate representation
873 p->pAig->pReprs = ABC_CALLOC( Gia_Rpr_t, Gia_ManObjNum(p->pAig) );
874 p->pAig->pNexts = ABC_CALLOC( int, Gia_ManObjNum(p->pAig) );
875 // create references
876 Gia_ManCreateValueRefs( p->pAig );
877 // set starting representative of internal nodes to be constant 0
878 if ( p->pPars->fLatchCorr )
879 Gia_ManForEachObj( p->pAig, pObj, i )
880 Gia_ObjSetRepr( p->pAig, i, GIA_VOID );
881 else if ( LevelMax == -1 )
882 Gia_ManForEachObj( p->pAig, pObj, i )
883 Gia_ObjSetRepr( p->pAig, i, Gia_ObjIsAnd(pObj) ? 0 : GIA_VOID );
884 else
885 {
886 Gia_ManLevelNum( p->pAig );
887 Gia_ManForEachObj( p->pAig, pObj, i )
888 Gia_ObjSetRepr( p->pAig, i, (Gia_ObjIsAnd(pObj) && Gia_ObjLevel(p->pAig,pObj) <= LevelMax) ? 0 : GIA_VOID );
889 Vec_IntFreeP( &p->pAig->vLevels );
890 }
891 // if sequential simulation, set starting representative of ROs to be constant 0
892 if ( p->pPars->fSeqSimulate )
893 Gia_ManForEachRo( p->pAig, pObj, i )
894 if ( pObj->Value )
895 Gia_ObjSetRepr( p->pAig, Gia_ObjId(p->pAig, pObj), 0 );
896 // perform simulation
897 if ( p->pAig->nSimWords )
898 {
899 p->nWords = 2*p->pAig->nSimWords;
900 assert( Vec_WrdSize(p->pAig->vSimsPi) == Gia_ManCiNum(p->pAig) * p->pAig->nSimWords );
901 //Cec_ManSimCreateInfo( p, p->vCiSimInfo, p->vCoSimInfo );
902 for ( i = 0; i < Gia_ManCiNum(p->pAig); i++ )
903 memmove( Vec_PtrEntry(p->vCiSimInfo, i), Vec_WrdEntryP(p->pAig->vSimsPi, i*p->pAig->nSimWords), sizeof(word)*p->pAig->nSimWords );
904 if ( Cec_ManSimSimulateRound( p, p->vCiSimInfo, p->vCoSimInfo ) )
905 return 1;
906 if ( p->pPars->fVerbose )
907 Gia_ManEquivPrintClasses( p->pAig, 0, Cec_MemUsage(p) );
908 }
909 else
910 {
911 p->nWords = 1;
912 do {
913 if ( p->pPars->fVerbose )
914 Gia_ManEquivPrintClasses( p->pAig, 0, Cec_MemUsage(p) );
915 for ( i = 0; i < 4; i++ )
916 {
917 Cec_ManSimCreateInfo( p, p->vCiSimInfo, p->vCoSimInfo );
918 if ( Cec_ManSimSimulateRound( p, p->vCiSimInfo, p->vCoSimInfo ) )
919 return 1;
920 }
921 p->nWords = 2 * p->nWords + 1;
922 }
923 while ( p->nWords <= p->pPars->nWords );
924 }
925 return 0;
926}
void Cec_ManSimCreateInfo(Cec_ManSim_t *p, Vec_Ptr_t *vInfoCis, Vec_Ptr_t *vInfoCos)
Definition cecClass.c:824
struct Gia_Rpr_t_ Gia_Rpr_t
Definition gia.h:57
#define Gia_ManForEachRo(p, pObj, i)
Definition gia.h:1252
void Gia_ManEquivPrintClasses(Gia_Man_t *p, int fVerbose, float Mem)
Definition giaEquiv.c:501
unsigned __int64 word
DECLARATIONS ///.
Definition kitPerm.c:36
unsigned Value
Definition gia.h:89
char * memmove()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Cec_ManSimClassesRefine()

int Cec_ManSimClassesRefine ( Cec_ManSim_t * p)
extern

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

Synopsis [Returns 1 if the bug is found.]

Description []

SideEffects []

SeeAlso []

Definition at line 939 of file cecClass.c.

940{
941 int i;
942 Gia_ManCreateValueRefs( p->pAig );
943 p->nWords = p->pPars->nWords;
944 for ( i = 0; i < p->pPars->nRounds; i++ )
945 {
946 if ( (i % (p->pPars->nRounds / 5)) == 0 && p->pPars->fVerbose )
947 Gia_ManEquivPrintClasses( p->pAig, 0, Cec_MemUsage(p) );
948 Cec_ManSimCreateInfo( p, p->vCiSimInfo, p->vCoSimInfo );
949 if ( Cec_ManSimSimulateRound( p, p->vCiSimInfo, p->vCoSimInfo ) )
950 return 1;
951 }
952 if ( p->pPars->fVerbose )
953 Gia_ManEquivPrintClasses( p->pAig, 0, Cec_MemUsage(p) );
954 return 0;
955}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Cec_ManSimClassRemoveOne()

int Cec_ManSimClassRemoveOne ( Cec_ManSim_t * p,
int i )
extern

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

Synopsis [Refines one equivalence class.]

Description []

SideEffects []

SeeAlso []

Definition at line 324 of file cecClass.c.

325{
326 int iRepr, Ent;
327 if ( Gia_ObjIsConst(p->pAig, i) )
328 {
329 Gia_ObjSetRepr( p->pAig, i, GIA_VOID );
330 return 1;
331 }
332 if ( !Gia_ObjIsClass(p->pAig, i) )
333 return 0;
334 assert( Gia_ObjIsClass(p->pAig, i) );
335 iRepr = Gia_ObjRepr( p->pAig, i );
336 if ( iRepr == GIA_VOID )
337 iRepr = i;
338 // collect nodes
339 Vec_IntClear( p->vClassOld );
340 Vec_IntClear( p->vClassNew );
341 Gia_ClassForEachObj( p->pAig, iRepr, Ent )
342 {
343 if ( Ent == i )
344 Vec_IntPush( p->vClassNew, Ent );
345 else
346 Vec_IntPush( p->vClassOld, Ent );
347 }
348 assert( Vec_IntSize( p->vClassNew ) == 1 );
349 Cec_ManSimClassCreate( p->pAig, p->vClassOld );
350 Cec_ManSimClassCreate( p->pAig, p->vClassNew );
351 assert( !Gia_ObjIsClass(p->pAig, i) );
352 return 1;
353}
void Cec_ManSimClassCreate(Gia_Man_t *p, Vec_Int_t *vClass)
Definition cecClass.c:234
#define Gia_ClassForEachObj(p, i, iObj)
Definition gia.h:1107
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Cec_ManSimSimulateRound()

int Cec_ManSimSimulateRound ( Cec_ManSim_t * p,
Vec_Ptr_t * vInfoCis,
Vec_Ptr_t * vInfoCos )
extern

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

Synopsis [Simulates one round.]

Description [Returns the number of PO entry if failed; 0 otherwise.]

SideEffects []

SeeAlso []

Definition at line 668 of file cecClass.c.

669{
670 Gia_Obj_t * pObj;
671 unsigned * pRes0, * pRes1, * pRes;
672 int i, k, w, Ent, iCiId = 0, iCoId = 0;
673 // prepare internal storage
674 if ( p->nWordsOld != p->nWords )
676 p->nMemsMax = 0;
677 // allocate score counters
678 ABC_FREE( p->pScores );
679 if ( p->pBestState )
680 p->pScores = ABC_CALLOC( int, 32 * p->nWords );
681 // simulate nodes
682 Vec_IntClear( p->vRefinedC );
683 if ( Gia_ObjValue(Gia_ManConst0(p->pAig)) )
684 {
685 pRes = Cec_ManSimSimRef( p, 0 );
686 for ( w = 1; w <= p->nWords; w++ )
687 pRes[w] = 0;
688 }
689 Gia_ManForEachObj1( p->pAig, pObj, i )
690 {
691 if ( Gia_ObjIsCi(pObj) )
692 {
693 if ( Gia_ObjValue(pObj) == 0 )
694 {
695 iCiId++;
696 continue;
697 }
698 pRes = Cec_ManSimSimRef( p, i );
699 if ( vInfoCis )
700 {
701 pRes0 = (unsigned *)Vec_PtrEntry( vInfoCis, iCiId++ );
702 for ( w = 1; w <= p->nWords; w++ )
703 pRes[w] = pRes0[w-1];
704 }
705 else
706 {
707 for ( w = 1; w <= p->nWords; w++ )
708 pRes[w] = Gia_ManRandom( 0 );
709 }
710 // make sure the first pattern is always zero
711 pRes[1] ^= (pRes[1] & 1);
712 goto references;
713 }
714 if ( Gia_ObjIsCo(pObj) ) // co always has non-zero 1st fanin and zero 2nd fanin
715 {
716 pRes0 = Cec_ManSimSimDeref( p, Gia_ObjFaninId0(pObj,i) );
717 if ( vInfoCos )
718 {
719 pRes = (unsigned *)Vec_PtrEntry( vInfoCos, iCoId++ );
720 if ( Gia_ObjFaninC0(pObj) )
721 for ( w = 1; w <= p->nWords; w++ )
722 pRes[w-1] = ~pRes0[w];
723 else
724 for ( w = 1; w <= p->nWords; w++ )
725 pRes[w-1] = pRes0[w];
726 }
727 continue;
728 }
729 assert( Gia_ObjValue(pObj) );
730 pRes = Cec_ManSimSimRef( p, i );
731 pRes0 = Cec_ManSimSimDeref( p, Gia_ObjFaninId0(pObj,i) );
732 pRes1 = Cec_ManSimSimDeref( p, Gia_ObjFaninId1(pObj,i) );
733
734// Abc_Print( 1, "%d,%d ", Gia_ObjValue( Gia_ObjFanin0(pObj) ), Gia_ObjValue( Gia_ObjFanin1(pObj) ) );
735
736 if ( Gia_ObjFaninC0(pObj) )
737 {
738 if ( Gia_ObjFaninC1(pObj) )
739 for ( w = 1; w <= p->nWords; w++ )
740 pRes[w] = ~(pRes0[w] | pRes1[w]);
741 else
742 for ( w = 1; w <= p->nWords; w++ )
743 pRes[w] = ~pRes0[w] & pRes1[w];
744 }
745 else
746 {
747 if ( Gia_ObjFaninC1(pObj) )
748 for ( w = 1; w <= p->nWords; w++ )
749 pRes[w] = pRes0[w] & ~pRes1[w];
750 else
751 for ( w = 1; w <= p->nWords; w++ )
752 pRes[w] = pRes0[w] & pRes1[w];
753 }
754
755references:
756 // if this node is candidate constant, collect it
757 if ( Gia_ObjIsConst(p->pAig, i) && !Cec_ManSimCompareConst(pRes + 1, p->nWords) )
758 {
759 pRes[0]++;
760 Vec_IntPush( p->vRefinedC, i );
761 if ( p->pBestState )
762 Cec_ManSimCompareConstScore( pRes + 1, p->nWords, p->pScores );
763 }
764 // if the node belongs to a class, save it
765 if ( Gia_ObjIsClass(p->pAig, i) )
766 pRes[0]++;
767 // if this is the last node of the class, process it
768 if ( Gia_ObjIsTail(p->pAig, i) )
769 {
770 Vec_IntClear( p->vClassTemp );
771 Gia_ClassForEachObj( p->pAig, Gia_ObjRepr(p->pAig, i), Ent )
772 Vec_IntPush( p->vClassTemp, Ent );
773 Cec_ManSimClassRefineOne( p, Gia_ObjRepr(p->pAig, i) );
774 Vec_IntForEachEntry( p->vClassTemp, Ent, k )
775 Cec_ManSimSimDeref( p, Ent );
776 }
777 }
778
779 if ( p->pPars->fConstCorr )
780 {
781 Vec_IntForEachEntry( p->vRefinedC, i, k )
782 {
783 Gia_ObjSetRepr( p->pAig, i, GIA_VOID );
784 Cec_ManSimSimDeref( p, i );
785 }
786 Vec_IntClear( p->vRefinedC );
787 }
788
789 if ( Vec_IntSize(p->vRefinedC) > 0 )
790 Cec_ManSimProcessRefined( p, p->vRefinedC );
791 assert( vInfoCis == NULL || iCiId == Gia_ManCiNum(p->pAig) );
792 assert( vInfoCos == NULL || iCoId == Gia_ManCoNum(p->pAig) );
793 assert( p->nMems == 1 );
794 if ( p->nMems != 1 )
795 Abc_Print( 1, "Cec_ManSimSimulateRound(): Memory management error!\n" );
796 if ( p->pPars->fVeryVerbose )
797 Gia_ManEquivPrintClasses( p->pAig, 0, Cec_MemUsage(p) );
798 if ( p->pBestState )
800/*
801 if ( p->nMems > 1 ) {
802 for ( i = 1; i < p->nObjs; i++ )
803 if ( p->pSims[i] ) {
804 int x = 0;
805 }
806 }
807*/
808 return Cec_ManSimAnalyzeOutputs( p );
809}
unsigned * Cec_ManSimSimRef(Cec_ManSim_t *p, int i)
Definition cecClass.c:420
int Cec_ManSimAnalyzeOutputs(Cec_ManSim_t *p)
Definition cecClass.c:600
unsigned * Cec_ManSimSimDeref(Cec_ManSim_t *p, int i)
Definition cecClass.c:457
int Cec_ManSimClassRefineOne(Cec_ManSim_t *p, int i)
Definition cecClass.c:308
void Cec_ManSimProcessRefined(Cec_ManSim_t *p, Vec_Int_t *vRefined)
Definition cecClass.c:483
void Cec_ManSimFindBestPattern(Cec_ManSim_t *p)
Definition cecClass.c:564
void Cec_ManSimCompareConstScore(unsigned *p, int nWords, int *pScores)
Definition cecClass.c:170
void Cec_ManSimMemRelink(Cec_ManSim_t *p)
Definition cecClass.c:394
int Cec_ManSimCompareConst(unsigned *p, int nWords)
FUNCTION DEFINITIONS ///.
Definition cecClass.c:50
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
Definition vecInt.h:54
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Cec_ManSimStart()

Cec_ManSim_t * Cec_ManSimStart ( Gia_Man_t * pAig,
Cec_ParSim_t * pPars )
extern

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

Synopsis [Creates AIG.]

Description []

SideEffects []

SeeAlso []

Definition at line 199 of file cecMan.c.

200{
201 Cec_ManSim_t * p;
202 p = ABC_ALLOC( Cec_ManSim_t, 1 );
203 memset( p, 0, sizeof(Cec_ManSim_t) );
204 p->pAig = pAig;
205 p->pPars = pPars;
206 p->nWords = pPars->nWords;
207 p->pSimInfo = ABC_CALLOC( int, Gia_ManObjNum(pAig) );
208 p->vClassOld = Vec_IntAlloc( 1000 );
209 p->vClassNew = Vec_IntAlloc( 1000 );
210 p->vClassTemp = Vec_IntAlloc( 1000 );
211 p->vRefinedC = Vec_IntAlloc( 10000 );
212 p->vCiSimInfo = Vec_PtrAllocSimInfo( Gia_ManCiNum(p->pAig), pPars->nWords );
213 if ( pPars->fCheckMiter || Gia_ManRegNum(p->pAig) )
214 {
215 p->vCoSimInfo = Vec_PtrAllocSimInfo( Gia_ManCoNum(p->pAig), pPars->nWords );
216 Vec_PtrCleanSimInfo( p->vCoSimInfo, 0, pPars->nWords );
217 }
218 p->iOut = -1;
219 return p;
220}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Cec_ManSimStop()

void Cec_ManSimStop ( Cec_ManSim_t * p)
extern

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

Synopsis [Deletes AIG.]

Description []

SideEffects []

SeeAlso []

Definition at line 233 of file cecMan.c.

234{
235 Vec_IntFree( p->vClassOld );
236 Vec_IntFree( p->vClassNew );
237 Vec_IntFree( p->vClassTemp );
238 Vec_IntFree( p->vRefinedC );
239 if ( p->vCiSimInfo )
240 Vec_PtrFree( p->vCiSimInfo );
241 if ( p->vCoSimInfo )
242 Vec_PtrFree( p->vCoSimInfo );
243 ABC_FREE( p->pScores );
244 ABC_FREE( p->pCexComb );
245 ABC_FREE( p->pCexes );
246 ABC_FREE( p->pMems );
247 ABC_FREE( p->pSimInfo );
248 ABC_FREE( p );
249}
Here is the caller graph for this function:

◆ Cec_ObjSatVarValue()

int Cec_ObjSatVarValue ( Cec_ManSat_t * p,
Gia_Obj_t * pObj )
extern

FUNCTION DEFINITIONS ///.

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

Synopsis [Returns value of the SAT variable.]

Description []

SideEffects []

SeeAlso []

Definition at line 48 of file cecSolve.c.

49{
50 return sat_solver_var_value( p->pSat, Cec_ObjSatNum(p, pObj) );
51}
Here is the caller graph for this function:

◆ CecG_ManSatSolve()

void CecG_ManSatSolve ( Cec_ManPat_t * pPat,
Gia_Man_t * pAig,
Cec_ParSat_t * pPars,
int f0Proved )
extern

Definition at line 562 of file cecSolveG.c.

563{
564 Bar_Progress_t * pProgress = NULL;
565 Cec_ManSat_t * p;
566 Gia_Obj_t * pObj;
567 int i, status;
568 abctime clk = Abc_Clock(), clk2;
569 Vec_PtrFreeP( &pAig->vSeqModelVec );
570 if( pPars->SolverType )
571 pPars->fPolarFlip = 0;
572 // reset the manager
573 if ( pPat )
574 {
575 pPat->iStart = Vec_StrSize(pPat->vStorage);
576 pPat->nPats = 0;
577 pPat->nPatLits = 0;
578 pPat->nPatLitsMin = 0;
579 }
580 Gia_ManSetPhase( pAig );
581 Gia_ManLevelNum( pAig );
583 p = Cec_ManSatCreate( pAig, pPars );
584 pProgress = Bar_ProgressStart( stdout, Gia_ManPoNum(pAig) );
585 Gia_ManForEachCo( pAig, pObj, i )
586 {
587 if ( Gia_ObjIsConst0(Gia_ObjFanin0(pObj)) )
588 {
589 status = !Gia_ObjFaninC0(pObj);
590 pObj->fMark0 = (status == 0);
591 pObj->fMark1 = (status == 1);
592 continue;
593 }
594 Bar_ProgressUpdate( pProgress, i, "SAT..." );
595clk2 = Abc_Clock();
596 status = CecG_ManSatCheckNode( p, Gia_ObjChild0(pObj) );
597 pObj->fMark0 = (status == 0);
598 pObj->fMark1 = (status == 1);
599
600 if ( f0Proved && status == 1 )
601 Gia_ManPatchCoDriver( pAig, i, 0 );
602/*
603 if ( status == -1 )
604 {
605 Gia_Man_t * pTemp = Gia_ManDupDfsCone( pAig, pObj );
606 Gia_AigerWrite( pTemp, "gia_hard.aig", 0, 0, 0 );
607 Gia_ManStop( pTemp );
608 Abc_Print( 1, "Dumping hard cone into file \"%s\".\n", "gia_hard.aig" );
609 }
610*/
611 if ( status != 0 )
612 continue;
613 // save the pattern
614 //if ( pPat )
615 //{
616 // abctime clk3 = Abc_Clock();
617 // Cec_ManPatSavePattern( pPat, p, pObj );
618 // pPat->timeTotalSave += Abc_Clock() - clk3;
619 //}
620 // quit if one of them is solved
621 if ( pPars->fCheckMiter )
622 break;
623 }
624 p->timeTotal = Abc_Clock() - clk;
625 printf("Recycles %d\n", p->nRecycles);
626 Bar_ProgressStop( pProgress );
627 if ( pPars->fVerbose )
629 if( p->pSat )
630 sat_solver_stop( p->pSat );
631 p->pSat = NULL;
632 Cec_ManSatStop( p );
633}
int CecG_ManSatCheckNode(Cec_ManSat_t *p, Gia_Obj_t *pObj)
Definition cecSolveG.c:479
#define sat_solver_stop
Definition cecSolveG.c:32
Here is the call graph for this function:
Here is the caller graph for this function: