ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
abs.h File Reference
#include "aig/gia/gia.h"
#include "aig/gia/giaAig.h"
#include "aig/saig/saig.h"
Include dependency graph for abs.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  Abs_Par_t_
 
struct  Gia_ParAbs_t_
 

Typedefs

typedef typedefABC_NAMESPACE_HEADER_START struct Abs_Par_t_ Abs_Par_t
 INCLUDES ///.
 
typedef struct Gia_ParAbs_t_ Gia_ParAbs_t
 

Functions

Gia_Man_tGia_ManDupAbsFlops (Gia_Man_t *p, Vec_Int_t *vFlopClasses)
 FUNCTION DECLARATIONS ///.
 
Gia_Man_tGia_ManDupAbsGates (Gia_Man_t *p, Vec_Int_t *vGateClasses)
 
void Gia_ManGlaCollect (Gia_Man_t *p, Vec_Int_t *vGateClasses, Vec_Int_t **pvPis, Vec_Int_t **pvPPis, Vec_Int_t **pvFlops, Vec_Int_t **pvNodes)
 
void Gia_ManPrintFlopClasses (Gia_Man_t *p)
 
void Gia_ManPrintObjClasses (Gia_Man_t *p)
 
void Gia_ManPrintGateClasses (Gia_Man_t *p)
 
int Gia_ManPerformGla (Gia_Man_t *p, Abs_Par_t *pPars)
 
int Gia_ManPerformGlaOld (Gia_Man_t *p, Abs_Par_t *pPars, int fStartVta)
 
Gia_Man_tGia_ManShrinkGla (Gia_Man_t *p, int nFrameMax, int nTimeOut, int fUsePdr, int fUseSat, int fUseBdd, int fVerbose)
 
void Gia_GlaProveAbsracted (Gia_Man_t *p, int fSimpProver, int fVerbose)
 DECLARATIONS ///.
 
void Gia_GlaProveCancel (int fVerbose)
 
int Gia_GlaProveCheck (int fVerbose)
 
int Gia_VtaPerform (Gia_Man_t *pAig, Abs_Par_t *pPars)
 
void Abs_ParSetDefaults (Abs_Par_t *p)
 DECLARATIONS ///.
 
Vec_Int_tGia_VtaConvertToGla (Gia_Man_t *p, Vec_Int_t *vVta)
 
Vec_Int_tGia_VtaConvertFromGla (Gia_Man_t *p, Vec_Int_t *vGla, int nFrames)
 
Vec_Int_tGia_FlaConvertToGla (Gia_Man_t *p, Vec_Int_t *vFla)
 
Vec_Int_tGia_GlaConvertToFla (Gia_Man_t *p, Vec_Int_t *vGla)
 
int Gia_GlaCountFlops (Gia_Man_t *p, Vec_Int_t *vGla)
 
int Gia_GlaCountNodes (Gia_Man_t *p, Vec_Int_t *vGla)
 
Gia_Man_tAbs_RpmPerform (Gia_Man_t *p, int nCutMax, int fVerbose, int fVeryVerbose)
 
Gia_Man_tAbs_RpmPerformOld (Gia_Man_t *p, int fVerbose)
 
void Gia_ManAbsSetDefaultParams (Gia_ParAbs_t *p)
 DECLARATIONS ///.
 
Vec_Int_tSaig_ManCexAbstractionFlops (Aig_Man_t *p, Gia_ParAbs_t *pPars)
 
Vec_Int_tSaig_ManCbaFilterFlops (Aig_Man_t *pAig, Abc_Cex_t *pAbsCex, Vec_Int_t *vFlopClasses, Vec_Int_t *vAbsFfsToAdd, int nFfsToSelect)
 FUNCTION DEFINITIONS ///.
 
Abc_Cex_tSaig_ManCbaFindCexCareBits (Aig_Man_t *pAig, Abc_Cex_t *pCex, int nInputs, int fVerbose)
 
int Gia_ManCexAbstractionRefine (Gia_Man_t *pGia, Abc_Cex_t *pCex, int nFfToAddMax, int fTryFour, int fSensePath, int fVerbose)
 
Vec_Int_tSaig_ManExtendCounterExampleTest3 (Aig_Man_t *pAig, int iFirstFlopPi, Abc_Cex_t *pCex, int fVerbose)
 
Vec_Int_tSaig_ManExtendCounterExampleTest2 (Aig_Man_t *p, int iFirstPi, Abc_Cex_t *pCex, int fVerbose)
 

Typedef Documentation

◆ Abs_Par_t

typedef typedefABC_NAMESPACE_HEADER_START struct Abs_Par_t_ Abs_Par_t

INCLUDES ///.

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

FileName [abs.h]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Abstraction package.]

Synopsis [External declarations.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

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

Revision [

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

] PARAMETERS /// BASIC TYPES ///

Definition at line 46 of file abs.h.

◆ Gia_ParAbs_t

typedef struct Gia_ParAbs_t_ Gia_ParAbs_t

Definition at line 84 of file abs.h.

Function Documentation

◆ Abs_ParSetDefaults()

void Abs_ParSetDefaults ( Abs_Par_t * p)
extern

DECLARATIONS ///.

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

FileName [absUtil.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Abstraction package.]

Synopsis [Interface to pthreads.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

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

Revision [

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

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

Synopsis [This procedure sets default parameters.]

Description []

SideEffects []

SeeAlso []

Definition at line 44 of file absUtil.c.

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}
typedefABC_NAMESPACE_HEADER_START struct Abs_Par_t_ Abs_Par_t
INCLUDES ///.
Definition abs.h:46
Cube * p
Definition exorList.c:222
char * memset()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abs_RpmPerform()

Gia_Man_t * Abs_RpmPerform ( Gia_Man_t * p,
int nCutMax,
int fVerbose,
int fVeryVerbose )
extern

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

Synopsis [Performs structural reparametrization.]

Description []

SideEffects []

SeeAlso []

Definition at line 853 of file absRpm.c.

854{
855 Gia_Man_t * pNew;
856// Gia_ManTestDoms( p );
857// return NULL;
858 // perform structural analysis
860 Abs_RpmPerformMark( p, nCutMax, fVerbose, fVeryVerbose );
862 // derive new AIG
863 pNew = Gia_ManDupRpm( p );
865 return pNew;
866}
void Abs_RpmPerformMark(Gia_Man_t *p, int nCutMax, int fVerbose, int fVeryVerbose)
Definition absRpm.c:680
Gia_Man_t * Gia_ManDupRpm(Gia_Man_t *p)
Definition absRpm.c:805
struct Gia_Man_t_ Gia_Man_t
Definition gia.h:96
void Gia_ObjComputeTruthTableStart(Gia_Man_t *p, int nVarsMax)
Definition giaTruth.c:552
void Gia_ObjComputeTruthTableStop(Gia_Man_t *p)
Definition giaTruth.c:568
void Gia_ManCleanMark1(Gia_Man_t *p)
Definition giaUtil.c:313
Here is the call graph for this function:

◆ Abs_RpmPerformOld()

Gia_Man_t * Abs_RpmPerformOld ( Gia_Man_t * p,
int fVerbose )
extern

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

Synopsis [Reparameterized to get rid of useless primary inputs.]

Description []

SideEffects []

SeeAlso []

Definition at line 141 of file absRpmOld.c.

142{
143// extern Aig_Man_t * Saig_ManRetimeMinArea( Aig_Man_t * p, int nMaxIters, int fForwardOnly, int fBackwardOnly, int fInitial, int fVerbose );
144 Aig_Man_t * pMan, * pTemp;
145 Gia_Man_t * pNew, * pTmp;
146 int nFlopsOld = Gia_ManRegNum(p);
147 if ( fVerbose )
148 {
149 printf( "Original AIG:\n" );
150 Gia_ManPrintStats( p, NULL );
151 }
152
153 // perform input trimming
154 pNew = Gia_ManDupTrimmed( p, 1, 0, 0, -1 );
155 if ( fVerbose )
156 {
157 printf( "After PI trimming:\n" );
158 Gia_ManPrintStats( pNew, NULL );
159 }
160 // transform GIA
161 pNew = Gia_ManDupIn2Ff( pTmp = pNew );
162 Gia_ManStop( pTmp );
163 if ( fVerbose )
164 {
165 printf( "After PI-2-FF transformation:\n" );
166 Gia_ManPrintStats( pNew, NULL );
167 }
168
169 // derive AIG
170 pMan = Gia_ManToAigSimple( pNew );
171 Gia_ManStop( pNew );
172 // perform min-reg retiming
173 pMan = Saig_ManRetimeMinArea( pTemp = pMan, 10, 0, 0, 1, 0 );
174 Aig_ManStop( pTemp );
175 // derive GIA
176 pNew = Gia_ManFromAigSimple( pMan );
177 Aig_ManStop( pMan );
178 if ( fVerbose )
179 {
180 printf( "After min-area retiming:\n" );
181 Gia_ManPrintStats( pNew, NULL );
182 }
183
184 // transform back
185 pNew = Gia_ManDupFf2In( pTmp = pNew, nFlopsOld );
186 Gia_ManStop( pTmp );
187 if ( fVerbose )
188 {
189 printf( "After FF-2-PI transformation:\n" );
190 Gia_ManPrintStats( pNew, NULL );
191 }
192 return pNew;
193}
Gia_Man_t * Gia_ManDupFf2In(Gia_Man_t *p, int nFlopsOld)
Definition absRpmOld.c:108
ABC_NAMESPACE_IMPL_START Gia_Man_t * Gia_ManDupIn2Ff(Gia_Man_t *p)
DECLARATIONS ///.
Definition absRpmOld.c:45
void Aig_ManStop(Aig_Man_t *p)
Definition aigMan.c:187
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Definition aig.h:50
Aig_Man_t * Gia_ManToAigSimple(Gia_Man_t *p)
Definition giaAig.c:408
Gia_Man_t * Gia_ManFromAigSimple(Aig_Man_t *p)
Definition giaAig.c:212
void Gia_ManStop(Gia_Man_t *p)
Definition giaMan.c:82
Gia_Man_t * Gia_ManDupTrimmed(Gia_Man_t *p, int fTrimCis, int fTrimCos, int fDualOut, int OutValue)
Definition giaDup.c:2431
void Gia_ManPrintStats(Gia_Man_t *p, Gps_Par_t *pPars)
Definition giaMan.c:495
Aig_Man_t * Saig_ManRetimeMinArea(Aig_Man_t *p, int nMaxIters, int fForwardOnly, int fBackwardOnly, int fInitial, int fVerbose)
Definition saigRetMin.c:623
Here is the call graph for this function:

◆ Gia_FlaConvertToGla()

Vec_Int_t * Gia_FlaConvertToGla ( Gia_Man_t * p,
Vec_Int_t * vFla )
extern

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

Synopsis [Converting FLA vector to GLA vector.]

Description []

SideEffects []

SeeAlso []

Definition at line 173 of file absUtil.c.

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}
void Gia_FlaConvertToGla_rec(Gia_Man_t *p, Gia_Obj_t *pObj, Vec_Int_t *vGla)
Definition absUtil.c:149
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition bblif.c:37
#define Gia_ManForEachRo(p, pObj, i)
Definition gia.h:1252
#define Gia_ManForEachPo(p, pObj, i)
Definition gia.h:1250
#define Gia_ManForEachPi(p, pObj, i)
Definition gia.h:1248
struct Gia_Obj_t_ Gia_Obj_t
Definition gia.h:76
void Gia_ManIncrementTravId(Gia_Man_t *p)
Definition giaUtil.c:190
#define Gia_ManForEachRi(p, pObj, i)
Definition gia.h:1254
Here is the call graph for this function:

◆ Gia_GlaConvertToFla()

Vec_Int_t * Gia_GlaConvertToFla ( Gia_Man_t * p,
Vec_Int_t * vGla )
extern

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

Synopsis [Converting GLA vector to FLA vector.]

Description []

SideEffects []

SeeAlso []

Definition at line 208 of file absUtil.c.

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}

◆ Gia_GlaCountFlops()

int Gia_GlaCountFlops ( Gia_Man_t * p,
Vec_Int_t * vGla )
extern

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 231 of file absUtil.c.

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}
Here is the caller graph for this function:

◆ Gia_GlaCountNodes()

int Gia_GlaCountNodes ( Gia_Man_t * p,
Vec_Int_t * vGla )
extern

Definition at line 240 of file absUtil.c.

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}
#define Gia_ManForEachAnd(p, pObj, i)
Definition gia.h:1214
Here is the caller graph for this function:

◆ Gia_GlaProveAbsracted()

void Gia_GlaProveAbsracted ( Gia_Man_t * p,
int fSimpProver,
int fVerbose )
extern

DECLARATIONS ///.

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

FileName [absPth.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Abstraction package.]

Synopsis [Interface to pthreads.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

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

Revision [

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

]

Definition at line 45 of file absPth.c.

45{}
Here is the caller graph for this function:

◆ Gia_GlaProveCancel()

void Gia_GlaProveCancel ( int fVerbose)
extern

Definition at line 46 of file absPth.c.

46{}
Here is the caller graph for this function:

◆ Gia_GlaProveCheck()

int Gia_GlaProveCheck ( int fVerbose)
extern

Definition at line 47 of file absPth.c.

47{ return 0; }
Here is the caller graph for this function:

◆ Gia_ManAbsSetDefaultParams()

void Gia_ManAbsSetDefaultParams ( Gia_ParAbs_t * p)
extern

DECLARATIONS ///.

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

FileName [saigAbsStart.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Sequential AIG package.]

Synopsis [Counter-example-based abstraction.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

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

Revision [

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

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

Synopsis [This procedure sets default parameters.]

Description []

SideEffects []

SeeAlso []

Definition at line 50 of file absOldRef.c.

51{
52 memset( p, 0, sizeof(Gia_ParAbs_t) );
53 p->Algo = 0; // algorithm: CBA
54 p->nFramesMax = 10; // timeframes for PBA
55 p->nConfMax = 10000; // conflicts for PBA
56 p->fDynamic = 1; // dynamic unfolding for PBA
57 p->fConstr = 0; // use constraints
58 p->nFramesBmc = 250; // timeframes for BMC
59 p->nConfMaxBmc = 5000; // conflicts for BMC
60 p->nStableMax = 1000000; // the number of stable frames to quit
61 p->nRatio = 10; // ratio of flops to quit
62 p->nBobPar = 1000000; // the number of frames before trying to quit
63 p->fUseBdds = 0; // use BDDs to refine abstraction
64 p->fUseDprove = 0; // use 'dprove' to refine abstraction
65 p->fUseStart = 1; // use starting frame
66 p->fVerbose = 0; // verbose output
67 p->fVeryVerbose= 0; // printing additional information
68 p->Status = -1; // the problem status
69 p->nFramesDone = -1; // the number of rames covered
70}
struct Gia_ParAbs_t_ Gia_ParAbs_t
Definition abs.h:84
Here is the call graph for this function:

◆ Gia_ManCexAbstractionRefine()

int Gia_ManCexAbstractionRefine ( Gia_Man_t * pGia,
Abc_Cex_t * pCex,
int nFfToAddMax,
int fTryFour,
int fSensePath,
int fVerbose )
extern

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

Synopsis [Refines abstraction using the latch map.]

Description []

SideEffects []

SeeAlso []

Definition at line 372 of file absOldRef.c.

373{
374 Aig_Man_t * pNew;
375 Vec_Int_t * vFlops;
376 if ( pGia->vFlopClasses == NULL )
377 {
378 printf( "Gia_ManCexAbstractionRefine(): Abstraction latch map is missing.\n" );
379 return -1;
380 }
381 pNew = Gia_ManToAig( pGia, 0 );
382 vFlops = Gia_ManClasses2Flops( pGia->vFlopClasses );
383 if ( !Saig_ManCexRefineStep( pNew, vFlops, pGia->vFlopClasses, pCex, nFfToAddMax, fTryFour, fSensePath, fVerbose ) )
384 {
385 pGia->pCexSeq = pNew->pSeqModel; pNew->pSeqModel = NULL;
386 Vec_IntFree( vFlops );
387 Aig_ManStop( pNew );
388 return 0;
389 }
390 Vec_IntFree( pGia->vFlopClasses );
391 pGia->vFlopClasses = Gia_ManFlops2Classes( pGia, vFlops );
392 Vec_IntFree( vFlops );
393 Aig_ManStop( pNew );
394 return -1;
395}
Vec_Int_t * Gia_ManClasses2Flops(Vec_Int_t *vFlopClasses)
Definition absOldRef.c:329
int Saig_ManCexRefineStep(Aig_Man_t *p, Vec_Int_t *vFlops, Vec_Int_t *vFlopClasses, Abc_Cex_t *pCex, int nFfToAddMax, int fTryFour, int fSensePath, int fVerbose)
Definition absOldRef.c:255
Vec_Int_t * Gia_ManFlops2Classes(Gia_Man_t *pGia, Vec_Int_t *vFlops)
Definition absOldRef.c:351
Aig_Man_t * Gia_ManToAig(Gia_Man_t *p, int fChoices)
Definition giaAig.c:318
Abc_Cex_t * pCexSeq
Definition gia.h:150
Vec_Int_t * vFlopClasses
Definition gia.h:156
Here is the call graph for this function:

◆ Gia_ManDupAbsFlops()

Gia_Man_t * Gia_ManDupAbsFlops ( Gia_Man_t * p,
Vec_Int_t * vFlopClasses )
extern

FUNCTION DECLARATIONS ///.

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

Synopsis [Extractes a flop-level abstraction given a flop map.]

Description []

SideEffects []

SeeAlso []

Definition at line 65 of file absDup.c.

66{
67 Gia_Man_t * pNew, * pTemp;
68 Gia_Obj_t * pObj;
69 int i, nFlops = 0;
71 // start the new manager
72 pNew = Gia_ManStart( 5000 );
73 pNew->pName = Abc_UtilStrsav( p->pName );
74 pNew->pSpec = Abc_UtilStrsav( p->pSpec );
75 // create PIs
76 Gia_ManConst0(p)->Value = 0;
77 Gia_ManForEachPi( p, pObj, i )
78 pObj->Value = Gia_ManAppendCi(pNew);
79 // create additional PIs
80 Gia_ManForEachRo( p, pObj, i )
81 if ( !Vec_IntEntry(vFlopClasses, i) )
82 pObj->Value = Gia_ManAppendCi(pNew);
83 // create ROs
84 Gia_ManForEachRo( p, pObj, i )
85 if ( Vec_IntEntry(vFlopClasses, i) )
86 pObj->Value = Gia_ManAppendCi(pNew);
87 // create POs
88 Gia_ManHashAlloc( pNew );
89 Gia_ManForEachPo( p, pObj, i )
90 {
91 Gia_ManDupAbsFlops_rec( pNew, Gia_ObjFanin0(pObj) );
92 Gia_ManAppendCo( pNew, Gia_ObjFanin0Copy(pObj) );
93 }
94 // create RIs
95 Gia_ManForEachRi( p, pObj, i )
96 if ( Vec_IntEntry(vFlopClasses, i) )
97 {
98 Gia_ManDupAbsFlops_rec( pNew, Gia_ObjFanin0(pObj) );
99 Gia_ManAppendCo( pNew, Gia_ObjFanin0Copy(pObj) );
100 nFlops++;
101 }
102 Gia_ManHashStop( pNew );
103 Gia_ManSetRegNum( pNew, nFlops );
104 // clean up
105 pNew = Gia_ManSeqCleanup( pTemp = pNew );
106 Gia_ManStop( pTemp );
107 return pNew;
108}
ABC_NAMESPACE_IMPL_START void Gia_ManDupAbsFlops_rec(Gia_Man_t *pNew, Gia_Obj_t *pObj)
DECLARATIONS ///.
Definition absDup.c:44
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
void Gia_ManFillValue(Gia_Man_t *p)
Definition giaUtil.c:369
void Gia_ManHashStop(Gia_Man_t *p)
Definition giaHash.c:149
Gia_Man_t * Gia_ManSeqCleanup(Gia_Man_t *p)
Definition giaScl.c:183
char * pSpec
Definition gia.h:100
char * pName
Definition gia.h:99
unsigned Value
Definition gia.h:89
Here is the call graph for this function:

◆ Gia_ManDupAbsGates()

Gia_Man_t * Gia_ManDupAbsGates ( Gia_Man_t * p,
Vec_Int_t * vGateClasses )
extern

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

Synopsis [Extractes a gate-level abstraction given a gate map.]

Description [The array contains 1 for those objects (const, RO, AND) that are included in the abstraction; 0, otherwise.]

SideEffects []

SeeAlso []

Definition at line 220 of file absDup.c.

221{
222 Vec_Int_t * vPis, * vPPis, * vFlops, * vNodes;
223 Gia_Man_t * pNew, * pTemp;
224 Gia_Obj_t * pObj, * pCopy;
225 int i;//, nFlops = 0;
226 assert( Gia_ManPoNum(p) == 1 );
227 assert( Vec_IntSize(vGateClasses) == Gia_ManObjNum(p) );
228
229 // create additional arrays
230 Gia_ManGlaCollect( p, vGateClasses, &vPis, &vPPis, &vFlops, &vNodes );
231
232 // start the new manager
233 pNew = Gia_ManStart( 5000 );
234 pNew->pName = Abc_UtilStrsav( p->pName );
235 pNew->pSpec = Abc_UtilStrsav( p->pSpec );
236 // create constant
238 Gia_ManConst0(p)->Value = 0;
239 // create PIs
240 Gia_ManForEachObjVec( vPis, p, pObj, i )
241 pObj->Value = Gia_ManAppendCi(pNew);
242 // create additional PIs
243 Gia_ManForEachObjVec( vPPis, p, pObj, i )
244 pObj->Value = Gia_ManAppendCi(pNew);
245 // create ROs
246 Gia_ManForEachObjVec( vFlops, p, pObj, i )
247 pObj->Value = Gia_ManAppendCi(pNew);
248 // create internal nodes
249 Gia_ManForEachObjVec( vNodes, p, pObj, i )
250 pObj->Value = Gia_ManAppendAnd( pNew, Gia_ObjFanin0Copy(pObj), Gia_ObjFanin1Copy(pObj) );
251// Gia_ManDupAbsGates_rec( pNew, pObj );
252 // create PO
253 Gia_ManForEachPo( p, pObj, i )
254 pObj->Value = Gia_ManAppendCo( pNew, Gia_ObjFanin0Copy(pObj) );
255 // create RIs
256 Gia_ManForEachObjVec( vFlops, p, pObj, i )
257 Gia_ObjRoToRi(p, pObj)->Value = Gia_ManAppendCo( pNew, Gia_ObjFanin0Copy(Gia_ObjRoToRi(p, pObj)) );
258 Gia_ManSetRegNum( pNew, Vec_IntSize(vFlops) );
259 // clean up
260 pNew = Gia_ManSeqCleanup( pTemp = pNew );
261 // transfer copy values: (p -> pTemp -> pNew) => (p -> pNew)
262 if ( Gia_ManObjNum(pTemp) != Gia_ManObjNum(pNew) )
263 {
264// printf( "Gia_ManDupAbsGates() Internal error: object mismatch.\n" );
265 Gia_ManForEachObj( p, pObj, i )
266 {
267 if ( !~pObj->Value )
268 continue;
269 assert( !Abc_LitIsCompl(pObj->Value) );
270 pCopy = Gia_ObjCopy( pTemp, pObj );
271 if ( !~pCopy->Value )
272 {
273 Vec_IntWriteEntry( vGateClasses, i, 0 );
274 pObj->Value = ~0;
275 continue;
276 }
277 assert( !Abc_LitIsCompl(pCopy->Value) );
278 pObj->Value = pCopy->Value;
279 }
280 }
281 Gia_ManStop( pTemp );
282
283 Vec_IntFree( vPis );
284 Vec_IntFree( vPPis );
285 Vec_IntFree( vFlops );
286 Vec_IntFree( vNodes );
287 return pNew;
288}
void Gia_ManGlaCollect(Gia_Man_t *p, Vec_Int_t *vGateClasses, Vec_Int_t **pvPis, Vec_Int_t **pvPPis, Vec_Int_t **pvFlops, Vec_Int_t **pvNodes)
Definition absDup.c:158
#define Gia_ManForEachObjVec(vVec, p, pObj, i)
Definition gia.h:1194
#define Gia_ManForEachObj(p, pObj, i)
MACRO DEFINITIONS ///.
Definition gia.h:1190
#define assert(ex)
Definition util_old.h:213
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Gia_ManGlaCollect()

void Gia_ManGlaCollect ( Gia_Man_t * p,
Vec_Int_t * vGateClasses,
Vec_Int_t ** pvPis,
Vec_Int_t ** pvPPis,
Vec_Int_t ** pvFlops,
Vec_Int_t ** pvNodes )
extern

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

Synopsis [Collects PIs and PPIs of the abstraction.]

Description []

SideEffects []

SeeAlso []

Definition at line 158 of file absDup.c.

159{
160 Vec_Int_t * vAssigned;
161 Gia_Obj_t * pObj;
162 int i;
163 assert( Gia_ManPoNum(p) == 1 );
164 assert( Vec_IntSize(vGateClasses) == Gia_ManObjNum(p) );
165 // create included objects and their fanins
166 vAssigned = Gia_GlaCollectAssigned( p, vGateClasses );
167 // create additional arrays
168 if ( pvPis ) *pvPis = Vec_IntAlloc( 100 );
169 if ( pvPPis ) *pvPPis = Vec_IntAlloc( 100 );
170 if ( pvFlops ) *pvFlops = Vec_IntAlloc( 100 );
171 if ( pvNodes ) *pvNodes = Vec_IntAlloc( 1000 );
172 Gia_ManForEachObjVec( vAssigned, p, pObj, i )
173 {
174 if ( Gia_ObjIsPi(p, pObj) )
175 { if ( pvPis ) Vec_IntPush( *pvPis, Gia_ObjId(p,pObj) ); }
176 else if ( !Vec_IntEntry(vGateClasses, Gia_ObjId(p,pObj)) )
177 { if ( pvPPis ) Vec_IntPush( *pvPPis, Gia_ObjId(p,pObj) ); }
178 else if ( Gia_ObjIsRo(p, pObj) )
179 { if ( pvFlops ) Vec_IntPush( *pvFlops, Gia_ObjId(p,pObj) ); }
180 else if ( Gia_ObjIsAnd(pObj) )
181 { if ( pvNodes ) Vec_IntPush( *pvNodes, Gia_ObjId(p,pObj) ); }
182 else assert( Gia_ObjIsConst0(pObj) );
183 }
184 Vec_IntFree( vAssigned );
185}
Vec_Int_t * Gia_GlaCollectAssigned(Gia_Man_t *p, Vec_Int_t *vGateClasses)
Definition absDup.c:121
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Gia_ManPerformGla()

int Gia_ManPerformGla ( Gia_Man_t * pAig,
Abs_Par_t * pPars )
extern

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

Synopsis [Performs gate-level abstraction.]

Description []

SideEffects []

SeeAlso []

Definition at line 1500 of file absGla.c.

1501{
1502 int fUseSecondCore = 1;
1503 Ga2_Man_t * p;
1504 Vec_Int_t * vCore, * vPPis;
1505 abctime clk2, clk = Abc_Clock();
1506 int Status = l_Undef, RetValue = -1, iFrameTryToProve = -1, fOneIsSent = 0;
1507 int i, c, f, Lit;
1508 pPars->iFrame = -1;
1509 // check trivial case
1510 assert( Gia_ManPoNum(pAig) == 1 );
1511 ABC_FREE( pAig->pCexSeq );
1512 if ( Gia_ObjIsConst0(Gia_ObjFanin0(Gia_ManPo(pAig,0))) )
1513 {
1514 if ( !Gia_ObjFaninC0(Gia_ManPo(pAig,0)) )
1515 {
1516 Abc_Print( 1, "Sequential miter is trivially UNSAT.\n" );
1517 return 1;
1518 }
1519 pAig->pCexSeq = Abc_CexMakeTriv( Gia_ManRegNum(pAig), Gia_ManPiNum(pAig), 1, 0 );
1520 Abc_Print( 1, "Sequential miter is trivially SAT.\n" );
1521 return 0;
1522 }
1523 // create gate classes if not given
1524 if ( pAig->vGateClasses == NULL )
1525 {
1526 pAig->vGateClasses = Vec_IntStart( Gia_ManObjNum(pAig) );
1527 Vec_IntWriteEntry( pAig->vGateClasses, 0, 1 );
1528 Vec_IntWriteEntry( pAig->vGateClasses, Gia_ObjFaninId0p(pAig, Gia_ManPo(pAig, 0)), 1 );
1529 }
1530 // start the manager
1531 p = Ga2_ManStart( pAig, pPars );
1532 p->timeInit = Abc_Clock() - clk;
1533 // perform initial abstraction
1534 if ( p->pPars->fVerbose )
1535 {
1536 Abc_Print( 1, "Running gate-level abstraction (GLA) with the following parameters:\n" );
1537 Abc_Print( 1, "FrameMax = %d ConfMax = %d Timeout = %d Limit = %d %% Limit2 = %d %% RatioMax = %d %%\n",
1538 pPars->nFramesMax, pPars->nConfLimit, pPars->nTimeOut, pPars->nRatioMin, pPars->nRatioMin2, pPars->nRatioMax );
1539 Abc_Print( 1, "LrnStart = %d LrnDelta = %d LrnRatio = %d %% Skip = %d SimpleCNF = %d Dump = %d\n",
1540 pPars->nLearnedStart, pPars->nLearnedDelta, pPars->nLearnedPerce, pPars->fUseSkip, pPars->fUseSimple, pPars->fDumpVabs|pPars->fDumpMabs );
1541 if ( pPars->fDumpVabs || pPars->fDumpMabs )
1542 Abc_Print( 1, "%s will be continuously dumped into file \"%s\".\n",
1543 pPars->fDumpVabs ? "Abstracted model" : "Miter with abstraction map",
1544 Ga2_GlaGetFileName(p, pPars->fDumpVabs) );
1545 if ( pPars->fDumpMabs )
1546 {
1547 {
1548 char Command[1000];
1549 Abc_FrameSetStatus( -1 );
1550 Abc_FrameSetCex( NULL );
1551 Abc_FrameSetNFrames( -1 );
1552 sprintf( Command, "write_status %s", Extra_FileNameGenericAppend((char *)(p->pPars->pFileVabs ? p->pPars->pFileVabs : "glabs.aig"), ".status"));
1554 }
1555 {
1556 // create trivial abstraction map
1557 Gia_Obj_t * pObj;
1558 char * pFileName = Ga2_GlaGetFileName(p, 0);
1559 Vec_Int_t * vMap = pAig->vGateClasses; pAig->vGateClasses = NULL;
1560 pAig->vGateClasses = Vec_IntStart( Gia_ManObjNum(pAig) );
1561 Vec_IntWriteEntry( pAig->vGateClasses, 0, 1 );
1562 Gia_ManForEachAnd( pAig, pObj, i )
1563 Vec_IntWriteEntry( pAig->vGateClasses, i, 1 );
1564 Gia_ManForEachRo( pAig, pObj, i )
1565 Vec_IntWriteEntry( pAig->vGateClasses, Gia_ObjId(pAig, pObj), 1 );
1566 Gia_AigerWrite( pAig, pFileName, 0, 0, 0 );
1567 Vec_IntFree( pAig->vGateClasses );
1568 pAig->vGateClasses = vMap;
1569 if ( p->pPars->fVerbose )
1570 Abc_Print( 1, "Dumping miter with abstraction map into file \"%s\"...\n", pFileName );
1571 }
1572 }
1573 Abc_Print( 1, " Frame %% Abs PPI FF LUT Confl Cex Vars Clas Lrns Time Mem\n" );
1574 }
1575 // iterate unrolling
1576 for ( i = f = 0; !pPars->nFramesMax || f < pPars->nFramesMax; i++ )
1577 {
1578 int nAbsOld;
1579 // remember the timeframe
1580 p->pPars->iFrame = -1;
1581 // create new SAT solver
1582 Ga2_ManRestart( p );
1583 // remember abstraction size after the last restart
1584 nAbsOld = Vec_IntSize(p->vAbs);
1585 // unroll the circuit
1586 for ( f = 0; !pPars->nFramesMax || f < pPars->nFramesMax; f++ )
1587 {
1588 // remember current limits
1589 int nConflsBeg = sat_solver2_nconflicts(p->pSat);
1590 int nAbs = Vec_IntSize(p->vAbs);
1591 int nValues = Vec_IntSize(p->vValues);
1592 int nVarsOld;
1593 // remember the timeframe
1594 p->pPars->iFrame = f;
1595 // extend and clear storage
1596 if ( f == Vec_PtrSize(p->vId2Lit) )
1597 Vec_PtrPush( p->vId2Lit, Vec_IntAlloc(0) );
1598 Vec_IntFillExtra( Ga2_MapFrameMap(p, f), Vec_IntSize(p->vValues), -1 );
1599 // add static clauses to this timeframe
1600 Ga2_ManAddAbsClauses( p, f );
1601 // skip checking if skipcheck is enabled (&gla -s)
1602 if ( p->pPars->fUseSkip && f <= p->pPars->iFrameProved )
1603 continue;
1604 // skip checking if we need to skip several starting frames (&gla -S <num>)
1605 if ( p->pPars->nFramesStart && f <= p->pPars->nFramesStart )
1606 continue;
1607 // get the output literal
1608// Lit = Ga2_ManUnroll_rec( p, Gia_ManPo(pAig,0), f );
1609 Lit = Ga2_ObjFindLit( p, Gia_ObjFanin0(Gia_ManPo(pAig,0)), f );
1610 assert( Lit >= 0 );
1611 Lit = Abc_LitNotCond( Lit, Gia_ObjFaninC0(Gia_ManPo(pAig,0)) );
1612 if ( Lit == 0 )
1613 continue;
1614 assert( Lit > 1 );
1615 // check for counter-examples
1616 if ( p->nSatVars > sat_solver2_nvars(p->pSat) )
1617 sat_solver2_setnvars( p->pSat, p->nSatVars );
1618 nVarsOld = p->nSatVars;
1619 for ( c = 0; ; c++ )
1620 {
1621 // consider the special case when the target literal is implied false
1622 // by implications which happened as a result of previous refinements
1623 // note that incremental UNSAT core cannot be computed because there is no learned clauses
1624 // in this case, we will assume that UNSAT core cannot reduce the problem
1625 if ( var_is_assigned(p->pSat, Abc_Lit2Var(Lit)) )
1626 {
1627 Prf_ManStopP( &p->pSat->pPrf2 );
1628 break;
1629 }
1630 // perform SAT solving
1631 clk2 = Abc_Clock();
1632 Status = sat_solver2_solve( p->pSat, &Lit, &Lit+1, (ABC_INT64_T)pPars->nConfLimit, (ABC_INT64_T)0, (ABC_INT64_T)0, (ABC_INT64_T)0 );
1633 if ( Status == l_True ) // perform refinement
1634 {
1635 p->nCexes++;
1636 p->timeSat += Abc_Clock() - clk2;
1637
1638 // cancel old one if it was sent
1639 if ( Abc_FrameIsBridgeMode() && fOneIsSent )
1640 {
1641 Gia_Ga2SendCancel( p, pPars->fVerbose );
1642 fOneIsSent = 0;
1643 }
1644 if ( iFrameTryToProve >= 0 )
1645 {
1646 Gia_GlaProveCancel( pPars->fVerbose );
1647 iFrameTryToProve = -1;
1648 }
1649
1650 // perform refinement
1651 clk2 = Abc_Clock();
1652 Rnm_ManSetRefId( p->pRnm, c );
1653 vPPis = Ga2_ManRefine( p );
1654 p->timeCex += Abc_Clock() - clk2;
1655 if ( vPPis == NULL )
1656 {
1657 if ( pPars->fVerbose )
1658 Ga2_ManAbsPrintFrame( p, f, sat_solver2_nconflicts(p->pSat)-nConflsBeg, c, Abc_Clock() - clk, 1 );
1659 goto finish;
1660 }
1661
1662 if ( c == 0 )
1663 {
1664// Ga2_ManRefinePrintPPis( p );
1665 // create bookmark to be used for rollback
1666 assert( nVarsOld == p->pSat->size );
1667 sat_solver2_bookmark( p->pSat );
1668 // start incremental proof manager
1669 assert( p->pSat->pPrf2 == NULL );
1670 p->pSat->pPrf2 = Prf_ManAlloc();
1671 if ( p->pSat->pPrf2 )
1672 {
1673 p->nProofIds = 0;
1674 Vec_IntFill( p->vProofIds, Gia_ManObjNum(p->pGia), -1 );
1675 Prf_ManRestart( p->pSat->pPrf2, p->vProofIds, sat_solver2_nlearnts(p->pSat), Vec_IntSize(vPPis) );
1676 }
1677 }
1678 else
1679 {
1680 // resize the proof logger
1681 if ( p->pSat->pPrf2 )
1682 Prf_ManGrow( p->pSat->pPrf2, p->nProofIds + Vec_IntSize(vPPis) );
1683 }
1684
1685 Ga2_ManAddToAbs( p, vPPis );
1686 Vec_IntFree( vPPis );
1687 if ( pPars->fVerbose )
1688 Ga2_ManAbsPrintFrame( p, f, sat_solver2_nconflicts(p->pSat)-nConflsBeg, c+1, Abc_Clock() - clk, 0 );
1689 // check if the number of objects is below limit
1690 if ( pPars->nRatioMin2 && Vec_IntSize(p->vAbs) >= p->nMarked * pPars->nRatioMin2 / 100 )
1691 {
1692 Status = l_Undef;
1693 goto finish;
1694 }
1695 continue;
1696 }
1697 p->timeUnsat += Abc_Clock() - clk2;
1698 if ( Status == l_Undef ) // ran out of resources
1699 goto finish;
1700 if ( p->pSat->nRuntimeLimit && Abc_Clock() > p->pSat->nRuntimeLimit ) // timeout
1701 goto finish;
1702 if ( c == 0 )
1703 {
1704 if ( f > p->pPars->iFrameProved )
1705 p->pPars->nFramesNoChange++;
1706 break;
1707 }
1708 if ( f > p->pPars->iFrameProved )
1709 p->pPars->nFramesNoChange = 0;
1710
1711 // derive the core
1712 assert( p->pSat->pPrf2 != NULL );
1713 vCore = (Vec_Int_t *)Sat_ProofCore( p->pSat );
1714 Prf_ManStopP( &p->pSat->pPrf2 );
1715 // update the SAT solver
1716 sat_solver2_rollback( p->pSat );
1717 // reduce abstraction
1718 Ga2_ManShrinkAbs( p, nAbs, nValues, nVarsOld );
1719
1720 // purify UNSAT core
1721 if ( fUseSecondCore )
1722 {
1723// int nOldCore = Vec_IntSize(vCore);
1724 // reverse the order of objects in the core
1725// Vec_IntSort( vCore, 0 );
1726// Vec_IntPrint( vCore );
1727 // create bookmark to be used for rollback
1728 assert( nVarsOld == p->pSat->size );
1729 sat_solver2_bookmark( p->pSat );
1730 // start incremental proof manager
1731 assert( p->pSat->pPrf2 == NULL );
1732 p->pSat->pPrf2 = Prf_ManAlloc();
1733 if ( p->pSat->pPrf2 )
1734 {
1735 p->nProofIds = 0;
1736 Vec_IntFill( p->vProofIds, Gia_ManObjNum(p->pGia), -1 );
1737 Prf_ManRestart( p->pSat->pPrf2, p->vProofIds, sat_solver2_nlearnts(p->pSat), Vec_IntSize(vCore) );
1738
1739 Ga2_ManAddToAbs( p, vCore );
1740 Vec_IntFree( vCore );
1741 }
1742 // run SAT solver
1743 clk2 = Abc_Clock();
1744 Status = sat_solver2_solve( p->pSat, &Lit, &Lit+1, (ABC_INT64_T)pPars->nConfLimit, (ABC_INT64_T)0, (ABC_INT64_T)0, (ABC_INT64_T)0 );
1745 if ( Status == l_Undef )
1746 goto finish;
1747 assert( Status == l_False );
1748 p->timeUnsat += Abc_Clock() - clk2;
1749
1750 // derive the core
1751 assert( p->pSat->pPrf2 != NULL );
1752 vCore = (Vec_Int_t *)Sat_ProofCore( p->pSat );
1753 Prf_ManStopP( &p->pSat->pPrf2 );
1754 // update the SAT solver
1755 sat_solver2_rollback( p->pSat );
1756 // reduce abstraction
1757 Ga2_ManShrinkAbs( p, nAbs, nValues, nVarsOld );
1758// printf( "\n%4d -> %4d\n", nOldCore, Vec_IntSize(vCore) );
1759 }
1760
1761 Ga2_ManAddToAbs( p, vCore );
1762// Ga2_ManRefinePrint( p, vCore );
1763 Vec_IntFree( vCore );
1764 break;
1765 }
1766 // remember the last proved frame
1767 if ( p->pPars->iFrameProved < f )
1768 p->pPars->iFrameProved = f;
1769 // print statistics
1770 if ( pPars->fVerbose )
1771 Ga2_ManAbsPrintFrame( p, f, sat_solver2_nconflicts(p->pSat)-nConflsBeg, c, Abc_Clock() - clk, 1 );
1772 // check if abstraction was proved
1773 if ( Gia_GlaProveCheck( pPars->fVerbose ) )
1774 {
1775 RetValue = 1;
1776 goto finish;
1777 }
1778 if ( c > 0 )
1779 {
1780 if ( p->pPars->fVeryVerbose )
1781 Abc_Print( 1, "\n" );
1782 // recompute the abstraction
1783 Vec_IntFreeP( &pAig->vGateClasses );
1785 // check if the number of objects is below limit
1786 if ( pPars->nRatioMin && Vec_IntSize(p->vAbs) >= p->nMarked * pPars->nRatioMin / 100 )
1787 {
1788 Status = l_Undef;
1789 goto finish;
1790 }
1791 }
1792 // check the number of stable frames
1793 if ( p->pPars->nFramesNoChange == p->pPars->nFramesNoChangeLim )
1794 {
1795 // dump the model into file
1796 if ( p->pPars->fDumpVabs || p->pPars->fDumpMabs )
1797 {
1798 char Command[1000];
1799 Abc_FrameSetStatus( -1 );
1800 Abc_FrameSetCex( NULL );
1802 sprintf( Command, "write_status %s", Extra_FileNameGenericAppend((char *)(p->pPars->pFileVabs ? p->pPars->pFileVabs : "glabs.aig"), ".status"));
1804 Ga2_GlaDumpAbsracted( p, pPars->fVerbose );
1805 }
1806 // call the prover
1807 if ( p->pPars->fCallProver )
1808 {
1809 // cancel old one if it is proving
1810 if ( iFrameTryToProve >= 0 )
1811 Gia_GlaProveCancel( pPars->fVerbose );
1812 // prove new one
1813 Gia_GlaProveAbsracted( pAig, pPars->fSimpProver, pPars->fVeryVerbose );
1814 iFrameTryToProve = f;
1815 p->nPdrCalls++;
1816 }
1817 // speak to the bridge
1818 if ( Abc_FrameIsBridgeMode() )
1819 {
1820 // cancel old one if it was sent
1821 if ( fOneIsSent )
1822 Gia_Ga2SendCancel( p, pPars->fVerbose );
1823 // send new one
1824 Gia_Ga2SendAbsracted( p, pPars->fVerbose );
1825 fOneIsSent = 1;
1826 }
1827 }
1828 // if abstraction grew more than a certain percentage, force a restart
1829 if ( pPars->nRatioMax == 0 )
1830 continue;
1831 if ( c > 0 && (f > 20 || Vec_IntSize(p->vAbs) > 100) && Vec_IntSize(p->vAbs) - nAbsOld >= nAbsOld * pPars->nRatioMax / 100 )
1832 {
1833 if ( p->pPars->fVerbose )
1834 Abc_Print( 1, "Forcing restart because abstraction grew from %d to %d (more than %d %%).\n",
1835 nAbsOld, Vec_IntSize(p->vAbs), pPars->nRatioMax );
1836 break;
1837 }
1838 }
1839 }
1840finish:
1841 Prf_ManStopP( &p->pSat->pPrf2 );
1842 // cancel old one if it is proving
1843 if ( iFrameTryToProve >= 0 )
1844 Gia_GlaProveCancel( pPars->fVerbose );
1845 // analize the results
1846 if ( !p->fUseNewLine )
1847 Abc_Print( 1, "\n" );
1848 if ( RetValue == 1 )
1849 Abc_Print( 1, "GLA completed %d frames and proved abstraction derived in frame %d ", p->pPars->iFrameProved+1, iFrameTryToProve );
1850 else if ( pAig->pCexSeq == NULL )
1851 {
1852 Vec_IntFreeP( &pAig->vGateClasses );
1854 if ( p->pPars->nTimeOut && Abc_Clock() >= p->pSat->nRuntimeLimit )
1855 Abc_Print( 1, "GLA reached timeout %d sec in frame %d with a %d-stable abstraction. ", p->pPars->nTimeOut, p->pPars->iFrameProved+1, p->pPars->nFramesNoChange );
1856 else if ( pPars->nConfLimit && sat_solver2_nconflicts(p->pSat) >= pPars->nConfLimit )
1857 Abc_Print( 1, "GLA exceeded %d conflicts in frame %d with a %d-stable abstraction. ", pPars->nConfLimit, p->pPars->iFrameProved+1, p->pPars->nFramesNoChange );
1858 else if ( pPars->nRatioMin2 && Vec_IntSize(p->vAbs) >= p->nMarked * pPars->nRatioMin2 / 100 )
1859 Abc_Print( 1, "GLA found that the size of abstraction exceeds %d %% in frame %d during refinement. ", pPars->nRatioMin2, p->pPars->iFrameProved+1 );
1860 else if ( pPars->nRatioMin && Vec_IntSize(p->vAbs) >= p->nMarked * pPars->nRatioMin / 100 )
1861 Abc_Print( 1, "GLA found that the size of abstraction exceeds %d %% in frame %d. ", pPars->nRatioMin, p->pPars->iFrameProved+1 );
1862 else
1863 Abc_Print( 1, "GLA finished %d frames and produced a %d-stable abstraction. ", p->pPars->iFrameProved+1, p->pPars->nFramesNoChange );
1864 p->pPars->iFrame = p->pPars->iFrameProved;
1865 }
1866 else
1867 {
1868 if ( p->pPars->fVerbose )
1869 Abc_Print( 1, "\n" );
1870 if ( !Gia_ManVerifyCex( pAig, pAig->pCexSeq, 0 ) )
1871 Abc_Print( 1, " Gia_ManPerformGlaOld(): CEX verification has failed!\n" );
1872 Abc_Print( 1, "True counter-example detected in frame %d. ", f );
1873 p->pPars->iFrame = f - 1;
1874 Vec_IntFreeP( &pAig->vGateClasses );
1875 RetValue = 0;
1876 }
1877 Abc_PrintTime( 1, "Time", Abc_Clock() - clk );
1878 if ( p->pPars->fVerbose )
1879 {
1880 p->timeOther = (Abc_Clock() - clk) - p->timeUnsat - p->timeSat - p->timeCex - p->timeInit;
1881 ABC_PRTP( "Runtime: Initializing", p->timeInit, Abc_Clock() - clk );
1882 ABC_PRTP( "Runtime: Solver UNSAT", p->timeUnsat, Abc_Clock() - clk );
1883 ABC_PRTP( "Runtime: Solver SAT ", p->timeSat, Abc_Clock() - clk );
1884 ABC_PRTP( "Runtime: Refinement ", p->timeCex, Abc_Clock() - clk );
1885 ABC_PRTP( "Runtime: Other ", p->timeOther, Abc_Clock() - clk );
1886 ABC_PRTP( "Runtime: TOTAL ", Abc_Clock() - clk, Abc_Clock() - clk );
1888 }
1889// Ga2_ManDumpStats( p->pGia, p->pPars, p->pSat, p->pPars->iFrameProved, 0 );
1890 Ga2_ManStop( p );
1891 fflush( stdout );
1892 return RetValue;
1893}
ABC_INT64_T abctime
Definition abc_global.h:332
#define ABC_PRTP(a, t, T)
Definition abc_global.h:258
#define ABC_FREE(obj)
Definition abc_global.h:267
ABC_DLL Abc_Frame_t * Abc_FrameGetGlobalFrame()
Definition mainFrame.c:643
void Ga2_ManReportMemory(Ga2_Man_t *p)
Definition absGla.c:432
void Ga2_ManRestart(Ga2_Man_t *p)
Definition absGla.c:1112
struct Ga2_Man_t_ Ga2_Man_t
Definition absGla.c:37
void Ga2_ManAddToAbs(Ga2_Man_t *p, Vec_Int_t *vToAdd)
Definition absGla.c:979
void Ga2_GlaDumpAbsracted(Ga2_Man_t *p, int fVerbose)
Definition absGla.c:1421
Vec_Int_t * Ga2_ManAbsTranslate(Ga2_Man_t *p)
Definition absGla.c:1077
void Gia_Ga2SendAbsracted(Ga2_Man_t *p, int fVerbose)
Definition absGla.c:1464
void Ga2_ManAddAbsClauses(Ga2_Man_t *p, int f)
Definition absGla.c:959
void Ga2_ManShrinkAbs(Ga2_Man_t *p, int nAbs, int nValues, int nSatVars)
Definition absGla.c:1009
char * Ga2_GlaGetFileName(Ga2_Man_t *p, int fAbs)
Definition absGla.c:1406
Ga2_Man_t * Ga2_ManStart(Gia_Man_t *pGia, Abs_Par_t *pPars)
Definition absGla.c:372
void Ga2_ManStop(Ga2_Man_t *p)
Definition absGla.c:460
void Gia_Ga2SendCancel(Ga2_Man_t *p, int fVerbose)
Definition absGla.c:1480
void Ga2_ManAbsPrintFrame(Ga2_Man_t *p, int nFrames, int nConfls, int nCexes, abctime Time, int fFinal)
Definition absGla.c:1369
Vec_Int_t * Ga2_ManRefine(Ga2_Man_t *p)
Definition absGla.c:1280
void Gia_GlaProveCancel(int fVerbose)
Definition absPth.c:46
void Gia_GlaProveAbsracted(Gia_Man_t *p, int fSimpProver, int fVerbose)
DECLARATIONS ///.
Definition absPth.c:45
int Gia_GlaProveCheck(int fVerbose)
Definition absPth.c:47
ABC_DLL void Abc_FrameSetNFrames(int nFrames)
Definition mainFrame.c:100
ABC_DLL void Abc_FrameSetStatus(int Status)
Definition mainFrame.c:101
ABC_DLL void Abc_FrameSetCex(Abc_Cex_t *pCex)
Definition mainFrame.c:99
ABC_DLL int Abc_FrameIsBridgeMode()
Definition mainFrame.c:113
#define l_True
Definition bmcBmcS.c:35
#define l_Undef
Definition bmcBmcS.c:34
#define l_False
Definition bmcBmcS.c:36
ABC_DLL int Cmd_CommandExecute(Abc_Frame_t *pAbc, const char *sCommand)
Definition cmdApi.c:193
char * Extra_FileNameGenericAppend(char *pBase, char *pSuffix)
int Gia_ManVerifyCex(Gia_Man_t *pAig, Abc_Cex_t *p, int fDualOut)
DECLARATIONS ///.
Definition giaCex.c:48
void Gia_AigerWrite(Gia_Man_t *p, char *pFileName, int fWriteSymbols, int fCompact, int fWriteNewLine)
Definition giaAiger.c:1595
int var_is_assigned(sat_solver2 *s, int v)
Definition satSolver2.c:83
void sat_solver2_rollback(sat_solver2 *s)
int sat_solver2_solve(sat_solver2 *s, lit *begin, lit *end, ABC_INT64_T nConfLimit, ABC_INT64_T nInsLimit, ABC_INT64_T nConfLimitGlobal, ABC_INT64_T nInsLimitGlobal)
void sat_solver2_setnvars(sat_solver2 *s, int n)
void * Sat_ProofCore(sat_solver2 *s)
Vec_Int_t * vGateClasses
Definition gia.h:157
Abc_Cex_t * Abc_CexMakeTriv(int nRegs, int nTruePis, int nTruePos, int iFrameOut)
Definition utilCex.c:85
char * sprintf()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Gia_ManPerformGlaOld()

int Gia_ManPerformGlaOld ( Gia_Man_t * pAig,
Abs_Par_t * pPars,
int fStartVta )
extern

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

Synopsis [Performs gate-level abstraction]

Description []

SideEffects []

SeeAlso []

Definition at line 1638 of file absGlaOld.c.

1639{
1640 extern int Gia_VtaPerformInt( Gia_Man_t * pAig, Abs_Par_t * pPars );
1641 extern void Ga2_ManDumpStats( Gia_Man_t * pGia, Abs_Par_t * pPars, sat_solver2 * pSat, int iFrame, int fUseN );
1642 Gla_Man_t * p;
1643 Vec_Int_t * vPPis, * vCore;//, * vCore2 = NULL;
1644 Abc_Cex_t * pCex = NULL;
1645 int f, i, iPrev, nConfls, Status, nVarsOld = 0, nCoreSize, fOneIsSent = 0, RetValue = -1;
1646 abctime clk2, clk = Abc_Clock();
1647 // preconditions
1648 assert( Gia_ManPoNum(pAig) == 1 );
1649 assert( pPars->nFramesMax == 0 || pPars->nFramesStart <= pPars->nFramesMax );
1650 if ( Gia_ObjIsConst0(Gia_ObjFanin0(Gia_ManPo(pAig,0))) )
1651 {
1652 if ( !Gia_ObjFaninC0(Gia_ManPo(pAig,0)) )
1653 {
1654 printf( "Sequential miter is trivially UNSAT.\n" );
1655 return 1;
1656 }
1657 ABC_FREE( pAig->pCexSeq );
1658 pAig->pCexSeq = Abc_CexMakeTriv( Gia_ManRegNum(pAig), Gia_ManPiNum(pAig), 1, 0 );
1659 printf( "Sequential miter is trivially SAT.\n" );
1660 return 0;
1661 }
1662
1663 // compute intial abstraction
1664 if ( pAig->vGateClasses == NULL )
1665 {
1666 if ( fStartVta )
1667 {
1668 int nFramesMaxOld = pPars->nFramesMax;
1669 int nFramesStartOld = pPars->nFramesStart;
1670 int nTimeOutOld = pPars->nTimeOut;
1671 int nDumpOld = pPars->fDumpVabs;
1672 pPars->nFramesMax = pPars->nFramesStart;
1673 pPars->nFramesStart = Abc_MinInt( pPars->nFramesStart/2 + 1, 3 );
1674 pPars->nTimeOut = 20;
1675 pPars->fDumpVabs = 0;
1676 RetValue = Gia_VtaPerformInt( pAig, pPars );
1677 pPars->nFramesMax = nFramesMaxOld;
1678 pPars->nFramesStart = nFramesStartOld;
1679 pPars->nTimeOut = nTimeOutOld;
1680 pPars->fDumpVabs = nDumpOld;
1681 // create gate classes
1682 Vec_IntFreeP( &pAig->vGateClasses );
1683 if ( pAig->vObjClasses )
1684 pAig->vGateClasses = Gia_VtaConvertToGla( pAig, pAig->vObjClasses );
1685 Vec_IntFreeP( &pAig->vObjClasses );
1686 // return if VTA solve the problem if could not start
1687 if ( RetValue == 0 || pAig->vGateClasses == NULL )
1688 return RetValue;
1689 }
1690 else
1691 {
1692 pAig->vGateClasses = Vec_IntStart( Gia_ManObjNum(pAig) );
1693 Vec_IntWriteEntry( pAig->vGateClasses, 0, 1 );
1694 Vec_IntWriteEntry( pAig->vGateClasses, Gia_ObjFaninId0p(pAig, Gia_ManPo(pAig, 0)), 1 );
1695 }
1696 }
1697 // start the manager
1698 p = Gla_ManStart( pAig, pPars );
1699 p->timeInit = Abc_Clock() - clk;
1700 // set runtime limit
1701 if ( p->pPars->nTimeOut )
1702 sat_solver2_set_runtime_limit( p->pSat, p->pPars->nTimeOut * CLOCKS_PER_SEC + Abc_Clock() );
1703 // perform initial abstraction
1704 if ( p->pPars->fVerbose )
1705 {
1706 Abc_Print( 1, "Running gate-level abstraction (GLA) with the following parameters:\n" );
1707 Abc_Print( 1, "FrameMax = %d ConfMax = %d Timeout = %d RatioMin = %d %%.\n",
1708 pPars->nFramesMax, pPars->nConfLimit, pPars->nTimeOut, pPars->nRatioMin );
1709 Abc_Print( 1, "LearnStart = %d LearnDelta = %d LearnRatio = %d %%.\n",
1710 pPars->nLearnedStart, pPars->nLearnedDelta, pPars->nLearnedPerce );
1711 Abc_Print( 1, " Frame %% Abs PPI FF LUT Confl Cex Vars Clas Lrns Time Mem\n" );
1712 }
1713 for ( f = i = iPrev = 0; !p->pPars->nFramesMax || f < p->pPars->nFramesMax; f++, iPrev = i )
1714 {
1715 int nConflsBeg = sat_solver2_nconflicts(p->pSat);
1716 p->pPars->iFrame = f;
1717
1718 // load timeframe
1719 Gia_GlaAddTimeFrame( p, f );
1720
1721 // iterate as long as there are counter-examples
1722 for ( i = 0; ; i++ )
1723 {
1724 clk2 = Abc_Clock();
1725 vCore = Gla_ManUnsatCore( p, f, p->pSat, pPars->nConfLimit, pPars->fVerbose, &Status, &nConfls );
1726// assert( (vCore != NULL) == (Status == 1) );
1727 if ( Status == -1 || (p->pSat->nRuntimeLimit && Abc_Clock() > p->pSat->nRuntimeLimit) ) // resource limit is reached
1728 {
1729 Prf_ManStopP( &p->pSat->pPrf2 );
1730// if ( Gia_ManRegNum(p->pGia) > 1 ) // for comb cases, return the abstraction
1731// Vec_IntShrink( p->vAbs, p->nAbsOld );
1732 goto finish;
1733 }
1734 if ( Status == 1 )
1735 {
1736 Prf_ManStopP( &p->pSat->pPrf2 );
1737 p->timeUnsat += Abc_Clock() - clk2;
1738 break;
1739 }
1740 p->timeSat += Abc_Clock() - clk2;
1741 assert( Status == 0 );
1742 p->nCexes++;
1743
1744 // cancel old one if it was sent
1745 if ( Abc_FrameIsBridgeMode() && fOneIsSent )
1746 {
1747 Gia_GlaSendCancel( p, pPars->fVerbose );
1748 fOneIsSent = 0;
1749 }
1750
1751 // perform the refinement
1752 clk2 = Abc_Clock();
1753 if ( pPars->fAddLayer )
1754 {
1755 vPPis = Gla_ManCollectPPis( p, NULL );
1756// Gla_ManExplorePPis( p, vPPis );
1757 }
1758 else
1759 {
1760 vPPis = Gla_ManRefinement( p );
1761 if ( vPPis == NULL )
1762 {
1763 Prf_ManStopP( &p->pSat->pPrf2 );
1764 pCex = p->pGia->pCexSeq; p->pGia->pCexSeq = NULL;
1765 break;
1766 }
1767 }
1768 assert( pCex == NULL );
1769
1770 // start proof logging
1771 if ( i == 0 )
1772 {
1773 // create bookmark to be used for rollback
1774 sat_solver2_bookmark( p->pSat );
1775 Vec_IntClear( p->vAddedNew );
1776 p->nAbsOld = Vec_IntSize( p->vAbs );
1777 nVarsOld = p->nSatVars;
1778// p->nLrnOld = sat_solver2_nlearnts( p->pSat );
1779// p->nAbsNew = 0;
1780// p->nLrnNew = 0;
1781
1782 // start incremental proof manager
1783 assert( p->pSat->pPrf2 == NULL );
1784 if ( p->pSat->pPrf1 == NULL )
1785 p->pSat->pPrf2 = Prf_ManAlloc();
1786 if ( p->pSat->pPrf2 )
1787 {
1788 p->nProofIds = 0;
1789 Vec_IntFill( p->vProofIds, Gia_ManObjNum(p->pGia), -1 );
1790 Prf_ManRestart( p->pSat->pPrf2, p->vProofIds, sat_solver2_nlearnts(p->pSat), Vec_IntSize(vPPis) );
1791 }
1792 }
1793 else
1794 {
1795 // resize the proof logger
1796 if ( p->pSat->pPrf2 )
1797 Prf_ManGrow( p->pSat->pPrf2, p->nProofIds + Vec_IntSize(vPPis) );
1798 }
1799
1800 Gia_GlaAddToAbs( p, vPPis, 1 );
1801 Gia_GlaAddOneSlice( p, f, vPPis );
1802 Vec_IntFree( vPPis );
1803
1804 // print the result (do not count it towards change)
1805 if ( p->pPars->fVerbose )
1806 Gla_ManAbsPrintFrame( p, -1, f+1, sat_solver2_nconflicts(p->pSat)-nConflsBeg, i, Abc_Clock() - clk );
1807 }
1808 if ( pCex != NULL )
1809 break;
1810 assert( Status == 1 );
1811
1812 // valid core is obtained
1813 nCoreSize = 1;
1814 if ( vCore )
1815 {
1816 nCoreSize += Vec_IntSize( vCore );
1817 Gia_GlaAddToCounters( p, vCore );
1818 }
1819 if ( i == 0 )
1820 {
1821 p->pPars->nFramesNoChange++;
1822 Vec_IntFreeP( &vCore );
1823 }
1824 else
1825 {
1826 p->pPars->nFramesNoChange = 0;
1827// p->nAbsNew = Vec_IntSize( p->vAbs ) - p->nAbsOld;
1828// p->nLrnNew = Abc_AbsInt( sat_solver2_nlearnts( p->pSat ) - p->nLrnOld );
1829 // update the SAT solver
1830 sat_solver2_rollback( p->pSat );
1831 // update storage
1832 Gla_ManRollBack( p );
1833 p->nSatVars = nVarsOld;
1834 // load this timeframe
1835 Gia_GlaAddToAbs( p, vCore, 0 );
1836 Gia_GlaAddOneSlice( p, f, vCore );
1837 Vec_IntFree( vCore );
1838 // run SAT solver
1839 clk2 = Abc_Clock();
1840 vCore = Gla_ManUnsatCore( p, f, p->pSat, pPars->nConfLimit, p->pPars->fVerbose, &Status, &nConfls );
1841 p->timeUnsat += Abc_Clock() - clk2;
1842// assert( (vCore != NULL) == (Status == 1) );
1843 Vec_IntFreeP( &vCore );
1844 if ( Status == -1 ) // resource limit is reached
1845 break;
1846 if ( Status == 0 )
1847 {
1848 assert( 0 );
1849 // Vta_ManSatVerify( p );
1850 // make sure, there was no initial abstraction (otherwise, it was invalid)
1851 assert( pAig->vObjClasses == NULL && f < p->pPars->nFramesStart );
1852 // pCex = Vga_ManDeriveCex( p );
1853 break;
1854 }
1855 }
1856 // print the result
1857 if ( p->pPars->fVerbose )
1858 Gla_ManAbsPrintFrame( p, nCoreSize, f+1, sat_solver2_nconflicts(p->pSat)-nConflsBeg, i, Abc_Clock() - clk );
1859
1860 if ( f > 2 && iPrev > 0 && i == 0 ) // change has happened
1861 {
1862 if ( Abc_FrameIsBridgeMode() )
1863 {
1864 // cancel old one if it was sent
1865 if ( fOneIsSent )
1866 Gia_GlaSendCancel( p, pPars->fVerbose );
1867 // send new one
1868 Gia_GlaSendAbsracted( p, pPars->fVerbose );
1869 fOneIsSent = 1;
1870 }
1871
1872 // dump the model into file
1873 if ( p->pPars->fDumpVabs )
1874 {
1875 char Command[1000];
1876 Abc_FrameSetStatus( -1 );
1877 Abc_FrameSetCex( NULL );
1878 Abc_FrameSetNFrames( f+1 );
1879 sprintf( Command, "write_status %s", Extra_FileNameGenericAppend((char *)(p->pPars->pFileVabs ? p->pPars->pFileVabs : "glabs.aig"), ".status") );
1881 Gia_GlaDumpAbsracted( p, pPars->fVerbose );
1882 }
1883 }
1884
1885 // check if the number of objects is below limit
1886 if ( Gia_GlaAbsCount(p,0,0) >= (p->nObjs - 1) * (100 - pPars->nRatioMin) / 100 )
1887 {
1888 Status = -1;
1889 break;
1890 }
1891 }
1892finish:
1893 // analize the results
1894 if ( pCex == NULL )
1895 {
1896 if ( p->pPars->fVerbose && Status == -1 )
1897 printf( "\n" );
1898// if ( pAig->vGateClasses != NULL )
1899// Abc_Print( 1, "Replacing the old abstraction by a new one.\n" );
1900 Vec_IntFreeP( &pAig->vGateClasses );
1901 pAig->vGateClasses = Gla_ManTranslate( p );
1902 if ( Status == -1 )
1903 {
1904 if ( p->pPars->nTimeOut && Abc_Clock() >= p->pSat->nRuntimeLimit )
1905 Abc_Print( 1, "Timeout %d sec in frame %d with a %d-stable abstraction. ", p->pPars->nTimeOut, f, p->pPars->nFramesNoChange );
1906 else if ( pPars->nConfLimit && sat_solver2_nconflicts(p->pSat) >= pPars->nConfLimit )
1907 Abc_Print( 1, "Exceeded %d conflicts in frame %d with a %d-stable abstraction. ", pPars->nConfLimit, f, p->pPars->nFramesNoChange );
1908 else if ( Gia_GlaAbsCount(p,0,0) >= (p->nObjs - 1) * (100 - pPars->nRatioMin) / 100 )
1909 Abc_Print( 1, "The ratio of abstracted objects is less than %d %% in frame %d. ", pPars->nRatioMin, f );
1910 else
1911 Abc_Print( 1, "Abstraction stopped for unknown reason in frame %d. ", f );
1912 }
1913 else
1914 {
1915 p->pPars->iFrame++;
1916 Abc_Print( 1, "GLA completed %d frames with a %d-stable abstraction. ", f, p->pPars->nFramesNoChange );
1917 }
1918 }
1919 else
1920 {
1921 if ( p->pPars->fVerbose )
1922 printf( "\n" );
1923 ABC_FREE( pAig->pCexSeq );
1924 pAig->pCexSeq = pCex;
1925 if ( !Gia_ManVerifyCex( pAig, pCex, 0 ) )
1926 Abc_Print( 1, " Gia_ManPerformGlaOld(): CEX verification has failed!\n" );
1927 Abc_Print( 1, "Counter-example detected in frame %d. ", f );
1928 p->pPars->iFrame = pCex->iFrame - 1;
1929 Vec_IntFreeP( &pAig->vGateClasses );
1930 RetValue = 0;
1931 }
1932 Abc_PrintTime( 1, "Time", Abc_Clock() - clk );
1933 if ( p->pPars->fVerbose )
1934 {
1935 p->timeOther = (Abc_Clock() - clk) - p->timeUnsat - p->timeSat - p->timeCex - p->timeInit;
1936 ABC_PRTP( "Runtime: Initializing", p->timeInit, Abc_Clock() - clk );
1937 ABC_PRTP( "Runtime: Solver UNSAT", p->timeUnsat, Abc_Clock() - clk );
1938 ABC_PRTP( "Runtime: Solver SAT ", p->timeSat, Abc_Clock() - clk );
1939 ABC_PRTP( "Runtime: Refinement ", p->timeCex, Abc_Clock() - clk );
1940 ABC_PRTP( "Runtime: Other ", p->timeOther, Abc_Clock() - clk );
1941 ABC_PRTP( "Runtime: TOTAL ", Abc_Clock() - clk, Abc_Clock() - clk );
1943 }
1944// Ga2_ManDumpStats( pAig, p->pPars, p->pSat, p->pPars->iFrame, 1 );
1945 Gla_ManStop( p );
1946 fflush( stdout );
1947 return RetValue;
1948}
int Gia_GlaAbsCount(Gla_Man_t *p, int fRo, int fAnd)
Definition absGlaOld.c:1141
void Gia_GlaSendAbsracted(Gla_Man_t *p, int fVerbose)
Definition absGlaOld.c:1574
void Gia_GlaAddToCounters(Gla_Man_t *p, Vec_Int_t *vCore)
Definition absGlaOld.c:1361
void Gla_ManReportMemory(Gla_Man_t *p)
Definition absGlaOld.c:1537
void Gia_GlaSendCancel(Gla_Man_t *p, int fVerbose)
Definition absGlaOld.c:1589
void Gla_ManStop(Gla_Man_t *p)
Definition absGlaOld.c:1094
void Gia_GlaAddTimeFrame(Gla_Man_t *p, int f)
Definition absGlaOld.c:1389
void Gia_GlaAddOneSlice(Gla_Man_t *p, int fCur, Vec_Int_t *vCore)
Definition absGlaOld.c:1397
void Gia_GlaDumpAbsracted(Gla_Man_t *p, int fVerbose)
Definition absGlaOld.c:1609
void Gia_GlaAddToAbs(Gla_Man_t *p, Vec_Int_t *vAbsAdd, int fCheck)
Definition absGlaOld.c:1368
Vec_Int_t * Gla_ManTranslate(Gla_Man_t *p)
Definition absGlaOld.c:1184
Gla_Man_t * Gla_ManStart(Gia_Man_t *pGia0, Abs_Par_t *pPars)
Definition absGlaOld.c:825
Vec_Int_t * Gla_ManRefinement(Gla_Man_t *p)
Definition absGlaOld.c:499
void Gla_ManRollBack(Gla_Man_t *p)
Definition absGlaOld.c:1405
struct Gla_Man_t_ Gla_Man_t
Definition absGlaOld.c:61
void Gla_ManAbsPrintFrame(Gla_Man_t *p, int nCoreSize, int nFrames, int nConfls, int nCexes, abctime Time)
Definition absGlaOld.c:1509
Vec_Int_t * Gla_ManUnsatCore(Gla_Man_t *p, int f, sat_solver2 *pSat, int nConfMax, int fVerbose, int *piRetValue, int *pnConfls)
Definition absGlaOld.c:1445
void Ga2_ManDumpStats(Gia_Man_t *pGia, Abs_Par_t *pPars, sat_solver2 *pSat, int iFrame, int fUseN)
Definition absGla.c:410
int Gia_VtaPerformInt(Gia_Man_t *pAig, Abs_Par_t *pPars)
Definition absVta.c:1492
Vec_Int_t * Gia_VtaConvertToGla(Gia_Man_t *p, Vec_Int_t *vVta)
Definition absUtil.c:78
struct sat_solver2_t sat_solver2
Definition satSolver2.h:44
Vec_Int_t * vObjClasses
Definition gia.h:158
typedefABC_NAMESPACE_HEADER_START struct Abc_Cex_t_ Abc_Cex_t
INCLUDES ///.
Definition utilCex.h:39
Here is the call graph for this function:

◆ Gia_ManPrintFlopClasses()

void Gia_ManPrintFlopClasses ( Gia_Man_t * p)
extern

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

Synopsis [Prints stats for the AIG.]

Description []

SideEffects []

SeeAlso []

Definition at line 301 of file absDup.c.

302{
303 int Counter0, Counter1;
304 if ( p->vFlopClasses == NULL )
305 return;
306 if ( Vec_IntSize(p->vFlopClasses) != Gia_ManRegNum(p) )
307 {
308 printf( "Gia_ManPrintFlopClasses(): The number of flop map entries differs from the number of flops.\n" );
309 return;
310 }
311 Counter0 = Vec_IntCountEntry( p->vFlopClasses, 0 );
312 Counter1 = Vec_IntCountEntry( p->vFlopClasses, 1 );
313 printf( "Flop-level abstraction: Excluded FFs = %d Included FFs = %d (%.2f %%) ",
314 Counter0, Counter1, 100.0*Counter1/(Counter0 + Counter1 + 1) );
315 if ( Counter0 + Counter1 < Gia_ManRegNum(p) )
316 printf( "and there are other FF classes..." );
317 printf( "\n" );
318}
Here is the caller graph for this function:

◆ Gia_ManPrintGateClasses()

void Gia_ManPrintGateClasses ( Gia_Man_t * p)
extern

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

Synopsis [Prints stats for the AIG.]

Description []

SideEffects []

SeeAlso []

Definition at line 331 of file absDup.c.

332{
333 Vec_Int_t * vPis, * vPPis, * vFlops, * vNodes;
334 int nTotal;
335 if ( p->vGateClasses == NULL )
336 return;
337 if ( Vec_IntSize(p->vGateClasses) != Gia_ManObjNum(p) )
338 {
339 printf( "Gia_ManPrintGateClasses(): The number of flop map entries differs from the number of flops.\n" );
340 return;
341 }
342 // create additional arrays
343 Gia_ManGlaCollect( p, p->vGateClasses, &vPis, &vPPis, &vFlops, &vNodes );
344 nTotal = 1 + Vec_IntSize(vFlops) + Vec_IntSize(vNodes);
345 printf( "Gate-level abstraction: PI = %d PPI = %d FF = %d (%.2f %%) AND = %d (%.2f %%) Obj = %d (%.2f %%)\n",
346 Vec_IntSize(vPis), Vec_IntSize(vPPis),
347 Vec_IntSize(vFlops), 100.0*Vec_IntSize(vFlops)/(Gia_ManRegNum(p)+1),
348 Vec_IntSize(vNodes), 100.0*Vec_IntSize(vNodes)/(Gia_ManAndNum(p)+1),
349 nTotal, 100.0*nTotal /(Gia_ManRegNum(p)+Gia_ManAndNum(p)+1) );
350 Vec_IntFree( vPis );
351 Vec_IntFree( vPPis );
352 Vec_IntFree( vFlops );
353 Vec_IntFree( vNodes );
354}
int nTotal
DECLARATIONS ///.
Definition cutTruth.c:37
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Gia_ManPrintObjClasses()

void Gia_ManPrintObjClasses ( Gia_Man_t * p)
extern

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

Synopsis [Prints stats for the AIG.]

Description []

SideEffects []

SeeAlso []

Definition at line 367 of file absDup.c.

368{
369 Vec_Int_t * vSeens; // objects seen so far
370 Vec_Int_t * vAbs = p->vObjClasses;
371 int i, k, Entry, iStart, iStop = -1, nFrames;
372 int nObjBits, nObjMask, iObj, iFrame, nWords;
373 unsigned * pInfo;
374 int * pCountAll, * pCountUni;
375 if ( vAbs == NULL )
376 return;
377 nFrames = Vec_IntEntry( vAbs, 0 );
378 assert( Vec_IntEntry(vAbs, nFrames+1) == Vec_IntSize(vAbs) );
379 pCountAll = ABC_ALLOC( int, nFrames + 1 );
380 pCountUni = ABC_ALLOC( int, nFrames + 1 );
381 // start storage for seen objects
382 nWords = Abc_BitWordNum( nFrames );
383 vSeens = Vec_IntStart( Gia_ManObjNum(p) * nWords );
384 // get the bitmasks
385 nObjBits = Abc_Base2Log( Gia_ManObjNum(p) );
386 nObjMask = (1 << nObjBits) - 1;
387 assert( Gia_ManObjNum(p) <= nObjMask );
388 // print info about frames
389 printf( "Frame Core F0 F1 F2 F3 ...\n" );
390 for ( i = 0; i < nFrames; i++ )
391 {
392 iStart = Vec_IntEntry( vAbs, i+1 );
393 iStop = Vec_IntEntry( vAbs, i+2 );
394 memset( pCountAll, 0, sizeof(int) * (nFrames + 1) );
395 memset( pCountUni, 0, sizeof(int) * (nFrames + 1) );
396 Vec_IntForEachEntryStartStop( vAbs, Entry, k, iStart, iStop )
397 {
398 iObj = (Entry & nObjMask);
399 iFrame = (Entry >> nObjBits);
400 pInfo = (unsigned *)Vec_IntEntryP( vSeens, nWords * iObj );
401 if ( Abc_InfoHasBit(pInfo, iFrame) == 0 )
402 {
403 Abc_InfoSetBit( pInfo, iFrame );
404 pCountUni[iFrame+1]++;
405 pCountUni[0]++;
406 }
407 pCountAll[iFrame+1]++;
408 pCountAll[0]++;
409 }
410 assert( pCountAll[0] == (iStop - iStart) );
411// printf( "%5d%5d ", pCountAll[0], pCountUni[0] );
412 printf( "%3d :", i );
413 printf( "%7d", pCountAll[0] );
414 if ( i >= 10 )
415 {
416 for ( k = 0; k < 4; k++ )
417 printf( "%5d", pCountAll[k+1] );
418 printf( " ..." );
419 for ( k = i-4; k <= i; k++ )
420 printf( "%5d", pCountAll[k+1] );
421 }
422 else
423 {
424 for ( k = 0; k <= i; k++ )
425 if ( k <= i )
426 printf( "%5d", pCountAll[k+1] );
427 }
428// for ( k = 0; k < nFrames; k++ )
429// if ( k <= i )
430// printf( "%5d", pCountAll[k+1] );
431 printf( "\n" );
432 }
433 assert( iStop == Vec_IntSize(vAbs) );
434 Vec_IntFree( vSeens );
435 ABC_FREE( pCountAll );
436 ABC_FREE( pCountUni );
437}
int nWords
Definition abcNpn.c:127
#define ABC_ALLOC(type, num)
Definition abc_global.h:264
#define Vec_IntForEachEntryStartStop(vVec, Entry, i, Start, Stop)
Definition vecInt.h:60
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Gia_ManShrinkGla()

Gia_Man_t * Gia_ManShrinkGla ( Gia_Man_t * p,
int nFrameMax,
int nTimeOut,
int fUsePdr,
int fUseSat,
int fUseBdd,
int fVerbose )
extern

Definition at line 67 of file absIter.c.

68{
69 Gia_Obj_t * pObj;
70 int i, iFrame0, iFrame;
71 int nTotal = 0, nRemoved = 0;
72 Vec_Int_t * vGScopy;
73 abctime clk, clkTotal = Abc_Clock();
74 assert( Gia_ManPoNum(p) == 1 );
75 assert( p->vGateClasses != NULL );
76 vGScopy = Vec_IntDup( p->vGateClasses );
77 if ( nFrameMax == 0 )
78 iFrame0 = Gia_IterTryImprove( p, 0, 0 );
79 else
80 iFrame0 = nFrameMax - 1;
81 while ( 1 )
82 {
83 int fChanges = 0;
84 Gia_ManForEachObj1( p, pObj, i )
85 {
86 if ( pObj->fMark0 )
87 continue;
88 if ( !Gia_ObjIsInGla(p, pObj) )
89 continue;
90 if ( pObj == Gia_ObjFanin0( Gia_ManPo(p, 0) ) )
91 continue;
92 if ( Gia_ObjIsAnd(pObj) )
93 {
94 if ( Gia_ObjIsInGla(p, Gia_ObjFanin0(pObj)) && Gia_ObjIsInGla(p, Gia_ObjFanin1(pObj)) )
95 continue;
96 }
97 if ( Gia_ObjIsRo(p, pObj) )
98 {
99 if ( Gia_ObjIsInGla(p, Gia_ObjFanin0(Gia_ObjRoToRi(p, pObj))) )
100 continue;
101 }
102 clk = Abc_Clock();
103 printf( "%5d : ", nTotal );
104 printf( "Obj =%7d ", i );
105 Gia_ObjRemFromGla( p, pObj );
106 iFrame = Gia_IterTryImprove( p, nTimeOut, iFrame0 );
107 if ( nFrameMax )
108 assert( iFrame <= nFrameMax );
109 else
110 assert( iFrame <= iFrame0 );
111 printf( "Frame =%6d ", iFrame );
112 if ( iFrame < iFrame0 )
113 {
114 pObj->fMark0 = 1;
115 Gia_ObjAddToGla( p, pObj );
116 printf( " " );
117 }
118 else
119 {
120 fChanges = 1;
121 nRemoved++;
122 printf( "Removing " );
123 Vec_IntWriteEntry( vGScopy, Gia_ObjId(p, pObj), 0 );
124 }
125 Abc_PrintTime( 1, "Time", Abc_Clock() - clk );
126 nTotal++;
127 // update the classes
128 Vec_IntFreeP( &p->vGateClasses );
129 p->vGateClasses = Vec_IntDup(vGScopy);
130 }
131 if ( !fChanges )
132 break;
133 }
135 Vec_IntFree( vGScopy );
136 printf( "Tried = %d. ", nTotal );
137 printf( "Removed = %d. (%.2f %%) ", nRemoved, 100.0 * nRemoved / Vec_IntCountPositive(p->vGateClasses) );
138 Abc_PrintTime( 1, "Time", Abc_Clock() - clkTotal );
139 return NULL;
140}
int Gia_IterTryImprove(Gia_Man_t *p, int nTimeOut, int iFrame0)
FUNCTION DEFINITIONS ///.
Definition absIter.c:50
#define Gia_ManForEachObj1(p, pObj, i)
Definition gia.h:1192
void Gia_ManCleanMark0(Gia_Man_t *p)
Definition giaUtil.c:256
unsigned fMark0
Definition gia.h:81
Here is the call graph for this function:

◆ Gia_VtaConvertFromGla()

Vec_Int_t * Gia_VtaConvertFromGla ( Gia_Man_t * p,
Vec_Int_t * vGla,
int nFrames )
extern

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

Synopsis [Converting GLA vector to VTA vector.]

Description []

SideEffects []

SeeAlso []

Definition at line 111 of file absUtil.c.

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}
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
Definition vecInt.h:54

◆ Gia_VtaConvertToGla()

Vec_Int_t * Gia_VtaConvertToGla ( Gia_Man_t * p,
Vec_Int_t * vVta )
extern

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

Synopsis [Converting VTA vector to GLA vector.]

Description []

SideEffects []

SeeAlso []

Definition at line 78 of file absUtil.c.

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}
#define Vec_IntForEachEntryStart(vVec, Entry, i, Start)
Definition vecInt.h:56
Here is the caller graph for this function:

◆ Gia_VtaPerform()

int Gia_VtaPerform ( Gia_Man_t * pAig,
Abs_Par_t * pPars )
extern

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

Synopsis [Collect nodes/flops involved in different timeframes.]

Description []

SideEffects []

SeeAlso []

Definition at line 1743 of file absVta.c.

1744{
1745 int RetValue = -1;
1746 if ( pAig->vObjClasses == NULL && pPars->fUseRollback )
1747 {
1748 int nFramesMaxOld = pPars->nFramesMax;
1749 pPars->nFramesMax = pPars->nFramesStart;
1750 RetValue = Gia_VtaPerformInt( pAig, pPars );
1751 pPars->nFramesMax = nFramesMaxOld;
1752 }
1753 if ( RetValue == 0 )
1754 return RetValue;
1755 return Gia_VtaPerformInt( pAig, pPars );
1756}
Here is the call graph for this function:

◆ Saig_ManCbaFilterFlops()

Vec_Int_t * Saig_ManCbaFilterFlops ( Aig_Man_t * pAig,
Abc_Cex_t * pAbsCex,
Vec_Int_t * vFlopClasses,
Vec_Int_t * vAbsFfsToAdd,
int nFfsToSelect )
extern

FUNCTION DEFINITIONS ///.

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

Synopsis [Selects the best flops from the given array.]

Description [Selects the best 'nFfsToSelect' flops among the array 'vAbsFfsToAdd' of flops that should be added to the abstraction. To this end, this procedure simulates the original AIG (pAig) using the given CEX (pAbsCex), which was detected for the abstraction.]

SideEffects []

SeeAlso []

Definition at line 66 of file absOldCex.c.

67{
68 Aig_Obj_t * pObj, * pObjRi, * pObjRo;
69 Vec_Int_t * vMapEntries, * vFlopCosts, * vFlopAddCosts, * vFfsToAddBest;
70 int i, k, f, Entry, iBit, * pPerm;
71 assert( Aig_ManRegNum(pAig) == Vec_IntSize(vFlopClasses) );
72 assert( Vec_IntSize(vAbsFfsToAdd) > nFfsToSelect );
73 // map previously abstracted flops into their original numbers
74 vMapEntries = Vec_IntAlloc( Vec_IntSize(vFlopClasses) );
75 Vec_IntForEachEntry( vFlopClasses, Entry, i )
76 if ( Entry == 0 )
77 Vec_IntPush( vMapEntries, i );
78 // simulate one frame at a time
79 assert( Saig_ManPiNum(pAig) + Vec_IntSize(vMapEntries) == pAbsCex->nPis );
80 vFlopCosts = Vec_IntStart( Vec_IntSize(vMapEntries) );
81 // initialize the flops
83 Aig_ManConst1(pAig)->fMarkB = 1;
84 Saig_ManForEachLo( pAig, pObj, i )
85 pObj->fMarkB = 0;
86 for ( f = 0; f < pAbsCex->iFrame; f++ )
87 {
88 // override the flop values according to the cex
89 iBit = pAbsCex->nRegs + f * pAbsCex->nPis + Saig_ManPiNum(pAig);
90 Vec_IntForEachEntry( vMapEntries, Entry, k )
91 Saig_ManLo(pAig, Entry)->fMarkB = Abc_InfoHasBit(pAbsCex->pData, iBit + k);
92 // simulate
93 Aig_ManForEachNode( pAig, pObj, k )
94 pObj->fMarkB = (Aig_ObjFanin0(pObj)->fMarkB ^ Aig_ObjFaninC0(pObj)) &
95 (Aig_ObjFanin1(pObj)->fMarkB ^ Aig_ObjFaninC1(pObj));
96 Aig_ManForEachCo( pAig, pObj, k )
97 pObj->fMarkB = Aig_ObjFanin0(pObj)->fMarkB ^ Aig_ObjFaninC0(pObj);
98 // transfer
99 Saig_ManForEachLiLo( pAig, pObjRi, pObjRo, k )
100 pObjRo->fMarkB = pObjRi->fMarkB;
101 // compare
102 iBit = pAbsCex->nRegs + (f + 1) * pAbsCex->nPis + Saig_ManPiNum(pAig);
103 Vec_IntForEachEntry( vMapEntries, Entry, k )
104 if ( Saig_ManLi(pAig, Entry)->fMarkB != (unsigned)Abc_InfoHasBit(pAbsCex->pData, iBit + k) )
105 Vec_IntAddToEntry( vFlopCosts, k, 1 );
106 }
107// Vec_IntForEachEntry( vFlopCosts, Entry, i )
108// printf( "%d ", Entry );
109// printf( "\n" );
110 // remap the cost
111 vFlopAddCosts = Vec_IntAlloc( Vec_IntSize(vAbsFfsToAdd) );
112 Vec_IntForEachEntry( vAbsFfsToAdd, Entry, i )
113 Vec_IntPush( vFlopAddCosts, -Vec_IntEntry(vFlopCosts, Entry) );
114 // sort the flops
115 pPerm = Abc_MergeSortCost( Vec_IntArray(vFlopAddCosts), Vec_IntSize(vFlopAddCosts) );
116 // shrink the array
117 vFfsToAddBest = Vec_IntAlloc( nFfsToSelect );
118 for ( i = 0; i < nFfsToSelect; i++ )
119 {
120// printf( "%d ", Vec_IntEntry(vFlopAddCosts, pPerm[i]) );
121 Vec_IntPush( vFfsToAddBest, Vec_IntEntry(vAbsFfsToAdd, pPerm[i]) );
122 }
123// printf( "\n" );
124 // cleanup
125 ABC_FREE( pPerm );
126 Vec_IntFree( vMapEntries );
127 Vec_IntFree( vFlopCosts );
128 Vec_IntFree( vFlopAddCosts );
129 Aig_ManCleanMarkB(pAig);
130 // return the computed flops
131 return vFfsToAddBest;
132}
int * Abc_MergeSortCost(int *pCosts, int nSize)
Definition utilSort.c:442
void Aig_ManCleanMarkB(Aig_Man_t *p)
Definition aigUtil.c:167
struct Aig_Obj_t_ Aig_Obj_t
Definition aig.h:51
#define Aig_ManForEachNode(p, pObj, i)
Definition aig.h:413
#define Aig_ManForEachCo(p, pObj, i)
Definition aig.h:398
#define Saig_ManForEachLiLo(p, pObjLi, pObjLo, i)
Definition saig.h:101
#define Saig_ManForEachLo(p, pObj, i)
Definition saig.h:96
unsigned int fMarkB
Definition aig.h:80
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Saig_ManCbaFindCexCareBits()

Abc_Cex_t * Saig_ManCbaFindCexCareBits ( Aig_Man_t * pAig,
Abc_Cex_t * pCex,
int nInputs,
int fVerbose )
extern

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

Synopsis [SAT-based refinement of the counter-example.]

Description [The first parameter (nInputs) indicates how many first primary inputs to skip without considering as care candidates.]

SideEffects []

SeeAlso []

Definition at line 718 of file absOldCex.c.

719{
721 Vec_Int_t * vReasons;
722 Abc_Cex_t * pCare;
723 abctime clk = Abc_Clock();
724
725 clk = Abc_Clock();
726 p = Saig_ManCbaStart( pAig, pCex, nInputs, fVerbose );
727
728// p->vReg2Frame = Vec_VecStart( pCex->iFrame );
729// p->vReg2Value = Vec_VecStart( pCex->iFrame );
730 p->pFrames = Saig_ManCbaUnrollWithCex( pAig, pCex, nInputs, &p->vMapPiF2A, &p->vReg2Frame );
731 vReasons = Saig_ManCbaFindReason( p );
732 if ( p->vReg2Frame )
734
735
736//if ( fVerbose )
737//Aig_ManPrintStats( p->pFrames );
738
739 if ( fVerbose )
740 {
741 Vec_Int_t * vRes = Saig_ManCbaReason2Inputs( p, vReasons );
742 printf( "Frame PIs = %4d (essential = %4d) AIG PIs = %4d (essential = %4d) ",
743 Aig_ManCiNum(p->pFrames), Vec_IntSize(vReasons),
744 Saig_ManPiNum(p->pAig) - p->nInputs, Vec_IntSize(vRes) );
745 Vec_IntFree( vRes );
746ABC_PRT( "Time", Abc_Clock() - clk );
747 }
748
749 pCare = Saig_ManCbaReason2Cex( p, vReasons );
750 Vec_IntFree( vReasons );
752
753if ( fVerbose )
754{
755printf( "Real " );
756Abc_CexPrintStats( pCex );
757}
758if ( fVerbose )
759{
760printf( "Care " );
761Abc_CexPrintStats( pCare );
762}
763/*
764 // verify the reduced counter-example using ternary simulation
765 if ( !Saig_ManCexVerifyUsingTernary( pAig, pCex, pCare ) )
766 printf( "Saig_ManCbaFindCexCareBits(): Minimized counter-example verification has failed!!!\n" );
767 else if ( fVerbose )
768 printf( "Saig_ManCbaFindCexCareBits(): Minimized counter-example verification is successful.\n" );
769*/
770 Aig_ManCleanMarkAB( pAig );
771 return pCare;
772}
#define ABC_PRT(a, t)
Definition abc_global.h:255
Aig_Man_t * Saig_ManCbaUnrollWithCex(Aig_Man_t *pAig, Abc_Cex_t *pCex, int nInputs, Vec_Int_t **pvMapPiF2A, Vec_Vec_t **pvReg2Frame)
Definition absOldCex.c:399
Vec_Int_t * Saig_ManCbaReason2Inputs(Saig_ManCba_t *p, Vec_Int_t *vReasons)
Definition absOldCex.c:195
void Saig_ManCbaStop(Saig_ManCba_t *p)
Definition absOldCex.c:535
Abc_Cex_t * Saig_ManCbaReason2Cex(Saig_ManCba_t *p, Vec_Int_t *vReasons)
Definition absOldCex.c:224
Saig_ManCba_t * Saig_ManCbaStart(Aig_Man_t *pAig, Abc_Cex_t *pCex, int nInputs, int fVerbose)
Definition absOldCex.c:513
void Saig_ManCbaShrink(Saig_ManCba_t *p)
Definition absOldCex.c:555
Vec_Int_t * Saig_ManCbaFindReason(Saig_ManCba_t *p)
Definition absOldCex.c:311
typedefABC_NAMESPACE_IMPL_START struct Saig_ManCba_t_ Saig_ManCba_t
DECLARATIONS ///.
Definition absOldCex.c:31
void Aig_ManCleanMarkAB(Aig_Man_t *p)
Definition aigUtil.c:186
void Abc_CexPrintStats(Abc_Cex_t *p)
Definition utilCex.c:256
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Saig_ManCexAbstractionFlops()

Vec_Int_t * Saig_ManCexAbstractionFlops ( Aig_Man_t * p,
Gia_ParAbs_t * pPars )
extern

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

Synopsis [Computes the flops to remain after abstraction.]

Description []

SideEffects []

SeeAlso []

Definition at line 409 of file absOldRef.c.

410{
411 int nUseStart = 0;
412 Aig_Man_t * pAbs, * pTemp;
413 Vec_Int_t * vFlops;
414 int Iter;//, clk = Abc_Clock(), clk2 = Abc_Clock();//, iFlop;
415 assert( Aig_ManRegNum(p) > 0 );
416 if ( pPars->fVerbose )
417 printf( "Performing counter-example-based refinement.\n" );
419 vFlops = Vec_IntStartNatural( 1 );
420/*
421 iFlop = Saig_ManFindFirstFlop( p );
422 assert( iFlop >= 0 );
423 vFlops = Vec_IntAlloc( 1 );
424 Vec_IntPush( vFlops, iFlop );
425*/
426 // create the resulting AIG
427 pAbs = Saig_ManDupAbstraction( p, vFlops );
428 if ( !pPars->fVerbose )
429 {
430 printf( "Init : " );
431 Aig_ManPrintStats( pAbs );
432 }
433 printf( "Refining abstraction...\n" );
434 for ( Iter = 0; ; Iter++ )
435 {
436 pTemp = Saig_ManCexRefine( p, pAbs, vFlops, pPars->nFramesBmc, pPars->nConfMaxBmc, pPars->fUseBdds, pPars->fUseDprove, pPars->fVerbose, pPars->fUseStart?&nUseStart:NULL, &pPars->Status, &pPars->nFramesDone );
437 if ( pTemp == NULL )
438 {
439 ABC_FREE( p->pSeqModel );
440 p->pSeqModel = pAbs->pSeqModel;
441 pAbs->pSeqModel = NULL;
442 Aig_ManStop( pAbs );
443 break;
444 }
445 Aig_ManStop( pAbs );
446 pAbs = pTemp;
447 printf( "ITER %4d : ", Iter );
448 if ( !pPars->fVerbose )
449 Aig_ManPrintStats( pAbs );
450 // output the intermediate result of abstraction
451 Ioa_WriteAiger( pAbs, "gabs.aig", 0, 0 );
452// printf( "Intermediate abstracted model was written into file \"%s\".\n", "gabs.aig" );
453 // check if the ratio is reached
454 if ( 100.0*(Aig_ManRegNum(p)-Aig_ManRegNum(pAbs))/Aig_ManRegNum(p) < 1.0*pPars->nRatio )
455 {
456 printf( "Refinements is stopped because flop reduction is less than %d%%\n", pPars->nRatio );
457 Aig_ManStop( pAbs );
458 pAbs = NULL;
459 Vec_IntFree( vFlops );
460 vFlops = NULL;
461 break;
462 }
463 }
464 return vFlops;
465}
Aig_Man_t * Saig_ManCexRefine(Aig_Man_t *p, Aig_Man_t *pAbs, Vec_Int_t *vFlops, int nFrames, int nConfMaxOne, int fUseBdds, int fUseDprove, int fVerbose, int *pnUseStart, int *piRetValue, int *pnFrames)
Definition absOldRef.c:158
void Aig_ManSetCioIds(Aig_Man_t *p)
Definition aigUtil.c:978
void Aig_ManPrintStats(Aig_Man_t *p)
Definition aigMan.c:379
void Ioa_WriteAiger(Aig_Man_t *pMan, char *pFileName, int fWriteSymbols, int fCompact)
Aig_Man_t * Saig_ManDupAbstraction(Aig_Man_t *pAig, Vec_Int_t *vFlops)
Definition saigDup.c:207
int nRatio
Definition abs.h:95
int Status
Definition abs.h:104
int fUseBdds
Definition abs.h:99
int nFramesBmc
Definition abs.h:92
int nFramesDone
Definition abs.h:105
int fUseStart
Definition abs.h:101
int fVerbose
Definition abs.h:102
int nConfMaxBmc
Definition abs.h:93
int fUseDprove
Definition abs.h:100
Here is the call graph for this function:

◆ Saig_ManExtendCounterExampleTest2()

Vec_Int_t * Saig_ManExtendCounterExampleTest2 ( Aig_Man_t * p,
int iFirstFlopPi,
Abc_Cex_t * pCex,
int fVerbose )
extern

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

Synopsis [Returns the array of PIs for flops that should not be absracted.]

Description []

SideEffects []

SeeAlso []

Definition at line 443 of file absOldSim.c.

444{
445 Vec_Int_t * vRes;
446 Vec_Ptr_t * vSimInfo;
447 abctime clk;
448 if ( Saig_ManPiNum(p) != pCex->nPis )
449 {
450 printf( "Saig_ManExtendCounterExampleTest2(): The PI count of AIG (%d) does not match that of cex (%d).\n",
451 Aig_ManCiNum(p), pCex->nPis );
452 return NULL;
453 }
455 vSimInfo = Vec_PtrAllocSimInfo( Aig_ManObjNumMax(p), Abc_BitWordNum(2*(pCex->iFrame+1)) );
456 Vec_PtrCleanSimInfo( vSimInfo, 0, Abc_BitWordNum(2*(pCex->iFrame+1)) );
457
458clk = Abc_Clock();
459 vRes = Saig_ManProcessCex( p, iFirstFlopPi, pCex, vSimInfo, fVerbose );
460 if ( fVerbose )
461 {
462 printf( "Total new PIs = %3d. Non-removable PIs = %3d. ", Saig_ManPiNum(p)-iFirstFlopPi, Vec_IntSize(vRes) );
463ABC_PRT( "Time", Abc_Clock() - clk );
464 }
465 Vec_PtrFree( vSimInfo );
467 return vRes;
468}
Vec_Int_t * Saig_ManProcessCex(Aig_Man_t *p, int iFirstFlopPi, Abc_Cex_t *pCex, Vec_Ptr_t *vSimInfo, int fVerbose)
Definition absOldSim.c:388
void Aig_ManFanoutStart(Aig_Man_t *p)
FUNCTION DEFINITIONS ///.
Definition aigFanout.c:56
void Aig_ManFanoutStop(Aig_Man_t *p)
Definition aigFanout.c:89
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:

◆ Saig_ManExtendCounterExampleTest3()

Vec_Int_t * Saig_ManExtendCounterExampleTest3 ( Aig_Man_t * pAig,
int iFirstFlopPi,
Abc_Cex_t * pCex,
int fVerbose )
extern

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

Synopsis [Returns the array of PIs for flops that should not be absracted.]

Description []

SideEffects []

SeeAlso []

Definition at line 930 of file saigRefSat.c.

931{
933 Vec_Int_t * vRes, * vReasons;
934 clock_t clk;
935 if ( Saig_ManPiNum(pAig) != pCex->nPis )
936 {
937 printf( "Saig_ManExtendCounterExampleTest3(): The PI count of AIG (%d) does not match that of cex (%d).\n",
938 Aig_ManCiNum(pAig), pCex->nPis );
939 return NULL;
940 }
941
942clk = clock();
943
944 p = Saig_RefManStart( pAig, pCex, iFirstFlopPi, fVerbose );
945 vReasons = Saig_RefManFindReason( p );
946 vRes = Saig_RefManReason2Inputs( p, vReasons );
947
948// if ( fVerbose )
949 {
950 printf( "Frame PIs = %4d (essential = %4d) AIG PIs = %4d (essential = %4d) ",
951 Aig_ManCiNum(p->pFrames), Vec_IntSize(vReasons),
952 Saig_ManPiNum(p->pAig) - p->nInputs, Vec_IntSize(vRes) );
953ABC_PRT( "Time", clock() - clk );
954 }
955
956/*
958 Vec_IntFree( vReasons );
959 vReasons = Saig_RefManRefineWithSat( p, vRes );
961
962 // derive new result
963 Vec_IntFree( vRes );
964 vRes = Saig_RefManReason2Inputs( p, vReasons );
965// if ( fVerbose )
966 {
967 printf( "Frame PIs = %4d (essential = %4d) AIG PIs = %4d (essential = %4d) ",
968 Aig_ManCiNum(p->pFrames), Vec_IntSize(vReasons),
969 Saig_ManPiNum(p->pAig) - p->nInputs, Vec_IntSize(vRes) );
970ABC_PRT( "Time", clock() - clk );
971 }
972*/
973
974 Vec_IntFree( vReasons );
976 return vRes;
977}
void Saig_RefManStop(Saig_RefMan_t *p)
Definition saigRefSat.c:386
typedefABC_NAMESPACE_IMPL_START struct Saig_RefMan_t_ Saig_RefMan_t
DECLARATIONS ///.
Definition saigRefSat.c:33
Vec_Int_t * Saig_RefManFindReason(Saig_RefMan_t *p)
Definition saigRefSat.c:168
Saig_RefMan_t * Saig_RefManStart(Aig_Man_t *pAig, Abc_Cex_t *pCex, int nInputs, int fVerbose)
Definition saigRefSat.c:363
Vec_Int_t * Saig_RefManReason2Inputs(Saig_RefMan_t *p, Vec_Int_t *vReasons)
FUNCTION DEFINITIONS ///.
Definition saigRefSat.c:64
Here is the call graph for this function:
Here is the caller graph for this function: