ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
cec.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  Cec_ParSat_t_
 
struct  Cec_ParSim_t_
 
struct  Cec_ParSmf_t_
 
struct  Cec_ParFra_t_
 
struct  Cec_ParCec_t_
 
struct  Cec_ParCor_t_
 
struct  Cec_ParChc_t_
 
struct  Cec_ParSeq_t_
 
struct  Cec_ParSimGen_t_
 

Typedefs

typedef typedefABC_NAMESPACE_HEADER_START struct Cec_ParSat_t_ Cec_ParSat_t
 INCLUDES ///.
 
typedef struct Cec_ParSim_t_ Cec_ParSim_t
 
typedef struct Cec_ParSmf_t_ Cec_ParSmf_t
 
typedef struct Cec_ParFra_t_ Cec_ParFra_t
 
typedef struct Cec_ParCec_t_ Cec_ParCec_t
 
typedef struct Cec_ParCor_t_ Cec_ParCor_t
 
typedef struct Cec_ParChc_t_ Cec_ParChc_t
 
typedef struct Cec_ParSeq_t_ Cec_ParSeq_t
 
typedef struct Cec_ParSimGen_t_ Cec_ParSimGen_t
 

Functions

int Cec_ManVerify (Gia_Man_t *p, Cec_ParCec_t *pPars)
 MACRO DEFINITIONS ///.
 
int Cec_ManVerifyTwo (Gia_Man_t *p0, Gia_Man_t *p1, int fVerbose)
 
int Cec_ManVerifyTwoInv (Gia_Man_t *p0, Gia_Man_t *p1, int fVerbose)
 
int Cec_ManVerifySimple (Gia_Man_t *p)
 
Gia_Man_tCec_ManChoiceComputation (Gia_Man_t *pAig, Cec_ParChc_t *pPars)
 
int Cec_ManLSCorrespondenceClasses (Gia_Man_t *pAig, Cec_ParCor_t *pPars)
 
Gia_Man_tCec_ManLSCorrespondence (Gia_Man_t *pAig, Cec_ParCor_t *pPars)
 
void Cec_ManSatSetDefaultParams (Cec_ParSat_t *p)
 DECLARATIONS ///.
 
void Cec_ManSimSetDefaultParams (Cec_ParSim_t *p)
 
void Cec_ManSmfSetDefaultParams (Cec_ParSmf_t *p)
 
void Cec_ManFraSetDefaultParams (Cec_ParFra_t *p)
 
void Cec_ManCecSetDefaultParams (Cec_ParCec_t *p)
 
void Cec_ManCorSetDefaultParams (Cec_ParCor_t *p)
 
void Cec_ManChcSetDefaultParams (Cec_ParChc_t *p)
 
Gia_Man_tCec_ManSatSweeping (Gia_Man_t *pAig, Cec_ParFra_t *pPars, int fSilent)
 
Gia_Man_tCec_ManSatSolving (Gia_Man_t *pAig, Cec_ParSat_t *pPars, int f0Proved)
 
void Cec_ManSimulation (Gia_Man_t *pAig, Cec_ParSim_t *pPars)
 
int Cec_ManSeqResimulateCounter (Gia_Man_t *pAig, Cec_ParSim_t *pPars, Abc_Cex_t *pCex)
 
int Cec_ManSeqSemiformal (Gia_Man_t *pAig, Cec_ParSmf_t *pPars)
 
int Cec_ManCheckNonTrivialCands (Gia_Man_t *pAig)
 
int Cec_SeqReadMinDomSize (Cec_ParSeq_t *p)
 
int Cec_SeqReadVerbose (Cec_ParSeq_t *p)
 
void Cec_SeqSynthesisSetDefaultParams (Cec_ParSeq_t *pPars)
 DECLARATIONS ///.
 
int Cec_SequentialSynthesisPart (Gia_Man_t *p, Cec_ParSeq_t *pPars)
 

Typedef Documentation

◆ Cec_ParCec_t

typedef struct Cec_ParCec_t_ Cec_ParCec_t

Definition at line 129 of file cec.h.

◆ Cec_ParChc_t

typedef struct Cec_ParChc_t_ Cec_ParChc_t

Definition at line 175 of file cec.h.

◆ Cec_ParCor_t

typedef struct Cec_ParCor_t_ Cec_ParCor_t

Definition at line 145 of file cec.h.

◆ Cec_ParFra_t

typedef struct Cec_ParFra_t_ Cec_ParFra_t

Definition at line 96 of file cec.h.

◆ Cec_ParSat_t

typedef typedefABC_NAMESPACE_HEADER_START struct Cec_ParSat_t_ Cec_ParSat_t

INCLUDES ///.

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

FileName [cec.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
cec.h,v 1.00 2005/06/20 00:00:00 alanmi Exp

] PARAMETERS /// BASIC TYPES ///

Definition at line 43 of file cec.h.

◆ Cec_ParSeq_t

typedef struct Cec_ParSeq_t_ Cec_ParSeq_t

Definition at line 188 of file cec.h.

◆ Cec_ParSim_t

typedef struct Cec_ParSim_t_ Cec_ParSim_t

Definition at line 60 of file cec.h.

◆ Cec_ParSimGen_t

Definition at line 205 of file cec.h.

◆ Cec_ParSmf_t

typedef struct Cec_ParSmf_t_ Cec_ParSmf_t

Definition at line 79 of file cec.h.

Function Documentation

◆ Cec_ManCecSetDefaultParams()

void Cec_ManCecSetDefaultParams ( Cec_ParCec_t * p)
extern

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

Synopsis [This procedure sets default parameters.]

Description []

SideEffects []

SeeAlso []

Definition at line 159 of file cecCore.c.

160{
161 memset( p, 0, sizeof(Cec_ParCec_t) );
162 p->nBTLimit = 1000; // conflict limit at a node
163 p->TimeLimit = 0; // the runtime limit in seconds
164// p->fFirstStop = 0; // stop on the first sat output
165 p->fUseSmartCnf = 0; // use smart CNF computation
166 p->fRewriting = 0; // enables AIG rewriting
167 p->fVeryVerbose = 0; // verbose stats
168 p->fVerbose = 0; // verbose stats
169 p->iOutFail = -1; // the number of failed output
170}
struct Cec_ParCec_t_ Cec_ParCec_t
Definition cec.h:129
Cube * p
Definition exorList.c:222
char * memset()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Cec_ManChcSetDefaultParams()

void Cec_ManChcSetDefaultParams ( Cec_ParChc_t * p)
extern

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

Synopsis [This procedure sets default parameters.]

Description []

SideEffects []

SeeAlso []

Definition at line 213 of file cecCore.c.

214{
215 memset( p, 0, sizeof(Cec_ParChc_t) );
216 p->nWords = 15; // the number of simulation words
217 p->nRounds = 15; // the number of simulation rounds
218 p->nBTLimit = 1000; // conflict limit at a node
219 p->fUseRings = 1; // use rings
220 p->fUseCSat = 0; // use circuit-based solver
221 p->fVeryVerbose = 0; // verbose stats
222 p->fVerbose = 0; // verbose stats
223}
struct Cec_ParChc_t_ Cec_ParChc_t
Definition cec.h:175
Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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_ManChoiceComputation()

Gia_Man_t * Cec_ManChoiceComputation ( Gia_Man_t * pAig,
Cec_ParChc_t * pParsChc )
extern

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

Synopsis [Computes choices for one AIGs.]

Description []

SideEffects []

SeeAlso []

Definition at line 348 of file cecChoice.c.

349{
350// extern Aig_Man_t * Dar_ManChoiceNew( Aig_Man_t * pAig, Dch_Pars_t * pPars );
351 Dch_Pars_t Pars, * pPars = &Pars;
352 Aig_Man_t * pMan, * pManNew;
353 Gia_Man_t * pGia;
354 if ( 0 )
355 {
356 pGia = Cec_ManChoiceComputationVec( pAig, 3, pParsChc );
357 }
358 else
359 {
360 pMan = Gia_ManToAig( pAig, 0 );
362 pPars->fUseGia = 1;
363 pPars->nBTLimit = pParsChc->nBTLimit;
364 pPars->fUseCSat = pParsChc->fUseCSat;
365 pPars->fVerbose = pParsChc->fVerbose;
366 pManNew = Dar_ManChoiceNew( pMan, pPars );
367 pGia = Gia_ManFromAig( pManNew );
368 Aig_ManStop( pManNew );
369// Aig_ManStop( pMan );
370 }
371 return pGia;
372}
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
Gia_Man_t * Cec_ManChoiceComputationVec(Gia_Man_t *pGia, int nGias, Cec_ParChc_t *pPars)
Definition cecChoice.c:313
Aig_Man_t * Dar_ManChoiceNew(Aig_Man_t *pAig, Dch_Pars_t *pPars)
Definition darScript.c:849
typedefABC_NAMESPACE_HEADER_START struct Dch_Pars_t_ Dch_Pars_t
INCLUDES ///.
Definition dch.h:43
void Dch_ManSetDefaultParams(Dch_Pars_t *p)
DECLARATIONS ///.
Definition dchCore.c:45
Gia_Man_t * Gia_ManFromAig(Aig_Man_t *p)
INCLUDES ///.
Definition giaAig.c:76
Aig_Man_t * Gia_ManToAig(Gia_Man_t *p, int fChoices)
Definition giaAig.c:318
struct Gia_Man_t_ Gia_Man_t
Definition gia.h:96
int fVerbose
Definition cec.h:184
int nBTLimit
Definition cec.h:180
int fUseCSat
Definition cec.h:182
Here is the call graph for this function:

◆ Cec_ManCorSetDefaultParams()

void Cec_ManCorSetDefaultParams ( Cec_ParCor_t * p)
extern

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

Synopsis [This procedure sets default parameters.]

Description []

SideEffects []

SeeAlso []

Definition at line 183 of file cecCore.c.

184{
185 memset( p, 0, sizeof(Cec_ParCor_t) );
186 p->nWords = 15; // the number of simulation words
187 p->nRounds = 15; // the number of simulation rounds
188 p->nFrames = 1; // the number of time frames
189 p->nBTLimit = 100; // conflict limit at a node
190 p->nLevelMax = -1; // (scorr only) the max number of levels
191 p->nStepsMax = -1; // (scorr only) the max number of induction steps
192 p->fLatchCorr = 0; // consider only latch outputs
193 p->fConstCorr = 0; // consider only constants
194 p->fUseRings = 1; // combine classes into rings
195 p->fUseCSat = 1; // use circuit-based solver
196// p->fFirstStop = 0; // stop on the first sat output
197 p->fUseSmartCnf = 0; // use smart CNF computation
198 p->fVeryVerbose = 0; // verbose stats
199 p->fVerbose = 0; // verbose stats
200}
struct Cec_ParCor_t_ Cec_ParCor_t
Definition cec.h:145
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Cec_ManFraSetDefaultParams()

void Cec_ManFraSetDefaultParams ( Cec_ParFra_t * p)
extern

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

Synopsis [This procedure sets default parameters.]

Description []

SideEffects []

SeeAlso []

Definition at line 126 of file cecCore.c.

127{
128 memset( p, 0, sizeof(Cec_ParFra_t) );
129 p->nWords = 15; // the number of simulation words
130 p->nRounds = 15; // the number of simulation rounds
131 p->TimeLimit = 0; // the runtime limit in seconds
132 p->nItersMax = 10; // the maximum number of iterations of SAT sweeping
133 p->nBTLimit = 100; // conflict limit at a node
134 p->nLevelMax = 0; // restriction on the level of nodes to be swept
135 p->nDepthMax = 1; // the depth in terms of steps of speculative reduction
136 p->fRewriting = 0; // enables AIG rewriting
137 p->fCheckMiter = 0; // the circuit is the miter
138// p->fFirstStop = 0; // stop on the first sat output
139 p->fDualOut = 0; // miter with separate outputs
140 p->fColorDiff = 0; // miter with separate outputs
141 p->fSatSweeping = 0; // enable SAT sweeping
142 p->fUseCones = 0; // use cones
143 p->fVeryVerbose = 0; // verbose stats
144 p->fVerbose = 0; // verbose stats
145 p->iOutFail = -1; // the failed output
146}
struct Cec_ParFra_t_ Cec_ParFra_t
Definition cec.h:96
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Cec_ManLSCorrespondence()

Gia_Man_t * Cec_ManLSCorrespondence ( Gia_Man_t * pAig,
Cec_ParCor_t * pPars )
extern

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

Synopsis [Top-level procedure for register correspondence.]

Description []

SideEffects []

SeeAlso []

Definition at line 1179 of file cecCorr.c.

1180{
1181 Gia_Man_t * pNew, * pTemp;
1182 unsigned * pInitState;
1183 int RetValue;
1184 ABC_FREE( pAig->pReprs );
1185 ABC_FREE( pAig->pNexts );
1186 if ( pPars->nPrefix == 0 )
1187 {
1188 RetValue = Cec_ManLSCorrespondenceClasses( pAig, pPars );
1189 if ( RetValue == 0 )
1190 return Gia_ManDup( pAig );
1191 }
1192 else
1193 {
1194 // compute the cycles AIG
1195 pInitState = Cec_ManComputeInitState( pAig, pPars->nPrefix );
1196 pTemp = Gia_ManDupFlip( pAig, (int *)pInitState );
1197 ABC_FREE( pInitState );
1198 // compute classes of this AIG
1199 RetValue = Cec_ManLSCorrespondenceClasses( pTemp, pPars );
1200 // transfer the class info
1201 pAig->pReprs = pTemp->pReprs; pTemp->pReprs = NULL;
1202 pAig->pNexts = pTemp->pNexts; pTemp->pNexts = NULL;
1203 // perform additional BMC
1204 pPars->fUseCSat = 0;
1205 pPars->nBTLimit = Abc_MaxInt( pPars->nBTLimit, 1000 );
1206 Cec_ManLSCorrespondenceBmc( pAig, pPars, pPars->nPrefix );
1207/*
1208 // transfer the class info back
1209 pTemp->pReprs = pAig->pReprs; pAig->pReprs = NULL;
1210 pTemp->pNexts = pAig->pNexts; pAig->pNexts = NULL;
1211 // continue refining
1212 RetValue = Cec_ManLSCorrespondenceClasses( pTemp, pPars );
1213 // transfer the class info
1214 pAig->pReprs = pTemp->pReprs; pTemp->pReprs = NULL;
1215 pAig->pNexts = pTemp->pNexts; pTemp->pNexts = NULL;
1216*/
1217 Gia_ManStop( pTemp );
1218 }
1219 // derive reduced AIG
1220 if ( pPars->fMakeChoices )
1221 {
1222 pNew = Gia_ManEquivToChoices( pAig, 1 );
1223// Gia_ManHasChoices_very_old( pNew );
1224 }
1225 else
1226 {
1227// Gia_ManEquivImprove( pAig );
1228 pNew = Gia_ManCorrReduce( pAig );
1229 pNew = Gia_ManSeqCleanup( pTemp = pNew );
1230 Gia_ManStop( pTemp );
1231 //Gia_AigerWrite( pNew, "reduced.aig", 0, 0, 0 );
1232 }
1233 // report the results
1234 if ( pPars->fVerbose )
1235 {
1236 Abc_Print( 1, "NBeg = %d. NEnd = %d. (Gain = %6.2f %%). RBeg = %d. REnd = %d. (Gain = %6.2f %%).\n",
1237 Gia_ManAndNum(pAig), Gia_ManAndNum(pNew),
1238 100.0*(Gia_ManAndNum(pAig)-Gia_ManAndNum(pNew))/(Gia_ManAndNum(pAig)?Gia_ManAndNum(pAig):1),
1239 Gia_ManRegNum(pAig), Gia_ManRegNum(pNew),
1240 100.0*(Gia_ManRegNum(pAig)-Gia_ManRegNum(pNew))/(Gia_ManRegNum(pAig)?Gia_ManRegNum(pAig):1) );
1241 }
1242 if ( pPars->nPrefix && (Gia_ManAndNum(pNew) < Gia_ManAndNum(pAig) || Gia_ManRegNum(pNew) < Gia_ManRegNum(pAig)) )
1243 Abc_Print( 1, "The reduced AIG was produced using %d-th invariants and will not verify.\n", pPars->nPrefix );
1244 // print verbose info about equivalences
1245 if ( pPars->fVerboseFlops )
1246 {
1247 if ( pAig->vNamesIn == NULL )
1248 Abc_Print( 1, "Flop output names are not available. Use command \"&get -n\".\n" );
1249 else
1250 Cec_ManPrintFlopEquivs( pAig );
1251 }
1252 // copy names if present
1253 if ( pAig->vNamesIn )
1254 {
1255 char * pName; int i;
1256 pNew->vNamesIn = Vec_PtrDupStr( pAig->vNamesIn );
1257 Vec_PtrForEachEntryStart( char *, pNew->vNamesIn, pName, i, Gia_ManCiNum(pNew) )
1258 ABC_FREE( pName );
1259 Vec_PtrShrink( pNew->vNamesIn, Gia_ManCiNum(pNew) );
1260 }
1261 if ( pAig->vNamesOut )
1262 {
1263 char * pName; int i;
1264 pNew->vNamesOut = Vec_PtrDupStr( pAig->vNamesOut );
1265 Vec_PtrForEachEntryStart( char *, pNew->vNamesOut, pName, i, Gia_ManCoNum(pNew) )
1266 ABC_FREE( pName );
1267 Vec_PtrShrink( pNew->vNamesOut, Gia_ManCoNum(pNew) );
1268 }
1269 return pNew;
1270}
#define ABC_FREE(obj)
Definition abc_global.h:267
Gia_Man_t * Gia_ManCorrReduce(Gia_Man_t *p)
Definition cecCorr.c:690
unsigned * Cec_ManComputeInitState(Gia_Man_t *pAig, int nFrames)
Definition cecCorr.c:1100
int Cec_ManLSCorrespondenceClasses(Gia_Man_t *pAig, Cec_ParCor_t *pPars)
Definition cecCorr.c:924
void Cec_ManPrintFlopEquivs(Gia_Man_t *p)
Definition cecCorr.c:1145
void Cec_ManLSCorrespondenceBmc(Gia_Man_t *pAig, Cec_ParCor_t *pPars, int nPrefs)
Definition cecCorr.c:786
void Gia_ManStop(Gia_Man_t *p)
Definition giaMan.c:82
Gia_Man_t * Gia_ManDup(Gia_Man_t *p)
Definition giaDup.c:720
Gia_Man_t * Gia_ManDupFlip(Gia_Man_t *p, int *pInitState)
Definition giaDup.c:628
Gia_Man_t * Gia_ManEquivToChoices(Gia_Man_t *p, int nSnapshots)
Definition giaEquiv.c:2034
Gia_Man_t * Gia_ManSeqCleanup(Gia_Man_t *p)
Definition giaScl.c:183
int fMakeChoices
Definition cec.h:161
int fVerboseFlops
Definition cec.h:166
int fUseCSat
Definition cec.h:162
int nBTLimit
Definition cec.h:152
int fVerbose
Definition cec.h:168
int nPrefix
Definition cec.h:151
Vec_Ptr_t * vNamesIn
Definition gia.h:181
int * pNexts
Definition gia.h:127
Vec_Ptr_t * vNamesOut
Definition gia.h:182
#define Vec_PtrForEachEntryStart(Type, vVec, pEntry, i, Start)
Definition vecPtr.h:57
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Cec_ManLSCorrespondenceClasses()

int Cec_ManLSCorrespondenceClasses ( Gia_Man_t * pAig,
Cec_ParCor_t * pPars )
extern

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

Synopsis [Internal procedure for register correspondence.]

Description []

SideEffects []

SeeAlso []

Definition at line 924 of file cecCorr.c.

925{
926 int nIterMax = 100000;
927 int nAddFrames = 1; // additional timeframes to simulate
928 int fRunBmcFirst = 1;
929 Vec_Str_t * vStatus;
930 Vec_Int_t * vOutputs;
931 Vec_Int_t * vCexStore;
932 Cec_ParSim_t ParsSim, * pParsSim = &ParsSim;
933 Cec_ParSat_t ParsSat, * pParsSat = &ParsSat;
934 Cec_ManSim_t * pSim;
935 Gia_Man_t * pSrm;
936 int r, RetValue, nPrev[4] = {0};
937 abctime clkTotal = Abc_Clock();
938 abctime clkSat = 0, clkSim = 0, clkSrm = 0;
939 abctime clk2, clk = Abc_Clock();
940 if ( Gia_ManRegNum(pAig) == 0 )
941 {
942 Abc_Print( 1, "Cec_ManLatchCorrespondence(): Not a sequential AIG.\n" );
943 return 0;
944 }
945 Gia_ManRandom( 1 );
946 // prepare simulation manager
947 Cec_ManSimSetDefaultParams( pParsSim );
948 pParsSim->nWords = pPars->nWords;
949 pParsSim->nFrames = pPars->nFrames;
950 pParsSim->fVerbose = pPars->fVerbose;
951 pParsSim->fLatchCorr = pPars->fLatchCorr;
952 pParsSim->fConstCorr = pPars->fConstCorr;
953 pParsSim->fSeqSimulate = 1;
954 // create equivalence classes of registers
955 pSim = Cec_ManSimStart( pAig, pParsSim );
956 if ( pAig->pReprs == NULL )
957 {
958 Cec_ManSimClassesPrepare( pSim, pPars->nLevelMax );
960 }
961 // prepare SAT solving
962 Cec_ManSatSetDefaultParams( pParsSat );
963 pParsSat->nBTLimit = pPars->nBTLimit;
964 pParsSat->fVerbose = pPars->fVerbose;
965 // limit the number of conflicts in the circuit-based solver
966 if ( pPars->fUseCSat )
967 pParsSat->nBTLimit = Abc_MinInt( pParsSat->nBTLimit, 1000 );
968 if ( pPars->fVerbose )
969 {
970 Abc_Print( 1, "Obj = %7d. And = %7d. Conf = %5d. Fr = %d. Lcorr = %d. Ring = %d. CSat = %d.\n",
971 Gia_ManObjNum(pAig), Gia_ManAndNum(pAig),
972 pPars->nBTLimit, pPars->nFrames, pPars->fLatchCorr, pPars->fUseRings, pPars->fUseCSat );
973 Cec_ManRefinedClassPrintStats( pAig, NULL, 0, Abc_Clock() - clk );
974 }
975 // check the base case
976 if ( fRunBmcFirst && (!pPars->fLatchCorr || pPars->nFrames > 1) )
977 Cec_ManLSCorrespondenceBmc( pAig, pPars, 0 );
978 if ( pPars->pFunc )
979 {
980 ((int (*)(void *))pPars->pFunc)( pPars->pData );
981 ((int (*)(void *))pPars->pFunc)( pPars->pData );
982 }
983 if ( pPars->nStepsMax == 0 )
984 {
985 Abc_Print( 1, "Stopped signal correspondence after BMC.\n" );
986 Cec_ManSimStop( pSim );
987 return 1;
988 }
989 // perform refinement of equivalence classes
990 for ( r = 0; r < nIterMax; r++ )
991 {
992 if ( pPars->nStepsMax == r )
993 {
994 Cec_ManSimStop( pSim );
995 Abc_Print( 1, "Stopped signal correspondence after %d refiment iterations.\n", r );
996 return 1;
997 }
998 clk = Abc_Clock();
999 // perform speculative reduction
1000 clk2 = Abc_Clock();
1001 pSrm = Gia_ManCorrSpecReduce( pAig, pPars->nFrames, !pPars->fLatchCorr, &vOutputs, pPars->fUseRings );
1002 assert( Gia_ManRegNum(pSrm) == 0 && Gia_ManPiNum(pSrm) == Gia_ManRegNum(pAig)+(pPars->nFrames+!pPars->fLatchCorr)*Gia_ManPiNum(pAig) );
1003 clkSrm += Abc_Clock() - clk2;
1004 if ( Gia_ManCoNum(pSrm) == 0 )
1005 {
1006 Vec_IntFree( vOutputs );
1007 Gia_ManStop( pSrm );
1008 break;
1009 }
1010//Gia_DumpAiger( pSrm, "corrsrm", r, 2 );
1011 // found counter-examples to speculation
1012 clk2 = Abc_Clock();
1013 if ( pPars->fUseCSat )
1014 vCexStore = Cbs_ManSolveMiterNc( pSrm, pPars->nBTLimit, &vStatus, 0, 0 );
1015 else
1016 vCexStore = Cec_ManSatSolveMiter( pSrm, pParsSat, &vStatus );
1017 Gia_ManStop( pSrm );
1018 clkSat += Abc_Clock() - clk2;
1019 if ( Vec_IntSize(vCexStore) == 0 )
1020 {
1021 Vec_IntFree( vCexStore );
1022 Vec_StrFree( vStatus );
1023 Vec_IntFree( vOutputs );
1024 break;
1025 }
1026// Cec_ManLSCorrAnalyzeDependence( pAig, vOutputs, vStatus );
1027
1028 // refine classes with these counter-examples
1029 clk2 = Abc_Clock();
1030 RetValue = Cec_ManResimulateCounterExamples( pSim, vCexStore, pPars->nFrames + 1 + nAddFrames );
1031 Vec_IntFree( vCexStore );
1032 clkSim += Abc_Clock() - clk2;
1033 Gia_ManCheckRefinements( pAig, vStatus, vOutputs, pSim, pPars->fUseRings );
1034 if ( pPars->fVerbose )
1035 Cec_ManRefinedClassPrintStats( pAig, vStatus, r+1, Abc_Clock() - clk );
1036 Vec_StrFree( vStatus );
1037 Vec_IntFree( vOutputs );
1038//Gia_ManEquivPrintClasses( pAig, 1, 0 );
1039 if ( pPars->pFunc )
1040 ((int (*)(void *))pPars->pFunc)( pPars->pData );
1041 // quit if const is no longer there
1042 if ( pPars->fStopWhenGone && Gia_ManPoNum(pAig) == 1 && !Gia_ObjIsConst( pAig, Gia_ObjFaninId0p(pAig, Gia_ManPo(pAig, 0)) ) )
1043 {
1044 printf( "Iterative refinement is stopped after iteration %d\n", r );
1045 printf( "because the property output is no longer a candidate constant.\n" );
1046 Cec_ManSimStop( pSim );
1047 return 0;
1048 }
1049 if ( pPars->nLimitMax )
1050 {
1051 int nCur = Cec_ManCountLits(pAig);
1052 if ( r > 4 && nPrev[0] - nCur <= 4*pPars->nLimitMax )
1053 {
1054 printf( "Iterative refinement is stopped after iteration %d\n", r );
1055 printf( "because refinement does not proceed quickly.\n" );
1056 Cec_ManSimStop( pSim );
1057 ABC_FREE( pAig->pReprs );
1058 ABC_FREE( pAig->pNexts );
1059 return 0;
1060 }
1061 nPrev[0] = nPrev[1];
1062 nPrev[1] = nPrev[2];
1063 nPrev[2] = nPrev[3];
1064 nPrev[3] = nCur;
1065 }
1066 }
1067 if ( pPars->fVerbose )
1068 Cec_ManRefinedClassPrintStats( pAig, NULL, r+1, Abc_Clock() - clk );
1069 // check the overflow
1070 if ( r == nIterMax )
1071 Abc_Print( 1, "The refinement was not finished. The result may be incorrect.\n" );
1072 Cec_ManSimStop( pSim );
1073 // check the base case
1074 if ( !fRunBmcFirst && (!pPars->fLatchCorr || pPars->nFrames > 1) )
1075 Cec_ManLSCorrespondenceBmc( pAig, pPars, 0 );
1076 clkTotal = Abc_Clock() - clkTotal;
1077 // report the results
1078 if ( pPars->fVerbose )
1079 {
1080 ABC_PRTP( "Srm ", clkSrm, clkTotal );
1081 ABC_PRTP( "Sat ", clkSat, clkTotal );
1082 ABC_PRTP( "Sim ", clkSim, clkTotal );
1083 ABC_PRTP( "Other", clkTotal-clkSat-clkSrm-clkSim, clkTotal );
1084 Abc_PrintTime( 1, "TOTAL", clkTotal );
1085 }
1086 return 1;
1087}
ABC_INT64_T abctime
Definition abc_global.h:332
#define ABC_PRTP(a, t, T)
Definition abc_global.h:258
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition bblif.c:37
struct Vec_Str_t_ Vec_Str_t
Definition bblif.c:46
int Cec_ManSimClassesPrepare(Cec_ManSim_t *p, int LevelMax)
Definition cecClass.c:867
int Cec_ManSimClassesRefine(Cec_ManSim_t *p)
Definition cecClass.c:939
int Cec_ManResimulateCounterExamples(Cec_ManSim_t *pSim, Vec_Int_t *vCexStore, int nFrames)
Definition cecCorr.c:545
void Cec_ManRefinedClassPrintStats(Gia_Man_t *p, Vec_Str_t *vStatus, int iIter, abctime Time)
MACRO DEFINITIONS ///.
Definition cecCorr.c:725
int Cec_ManCountLits(Gia_Man_t *p)
Definition cecCorr.c:759
int Gia_ManCheckRefinements(Gia_Man_t *p, Vec_Str_t *vStatus, Vec_Int_t *vOutputs, Cec_ManSim_t *pSim, int fRings)
Definition cecCorr.c:612
Gia_Man_t * Gia_ManCorrSpecReduce(Gia_Man_t *p, int nFrames, int fScorr, Vec_Int_t **pvOutputs, int fRings)
Definition cecCorr.c:106
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
Vec_Int_t * Cec_ManSatSolveMiter(Gia_Man_t *pAig, Cec_ParSat_t *pPars, Vec_Str_t **pvStatus)
Definition cecSolve.c:1070
void Cec_ManSatSetDefaultParams(Cec_ParSat_t *p)
DECLARATIONS ///.
Definition cecCore.c:45
void Cec_ManSimSetDefaultParams(Cec_ParSim_t *p)
Definition cecCore.c:71
typedefABC_NAMESPACE_HEADER_START struct Cec_ParSat_t_ Cec_ParSat_t
INCLUDES ///.
Definition cec.h:43
struct Cec_ParSim_t_ Cec_ParSim_t
Definition cec.h:60
Vec_Int_t * Cbs_ManSolveMiterNc(Gia_Man_t *pGia, int nConfs, Vec_Str_t **pvStatus, int f0Proved, int fVerbose)
Definition giaCSat.c:1037
unsigned Gia_ManRandom(int fReset)
FUNCTION DEFINITIONS ///.
Definition giaUtil.c:49
int nFrames
Definition cec.h:150
int nLevelMax
Definition cec.h:155
int fLatchCorr
Definition cec.h:158
int nStepsMax
Definition cec.h:156
int fUseRings
Definition cec.h:160
void * pFunc
Definition cec.h:171
int fConstCorr
Definition cec.h:159
int nWords
Definition cec.h:148
void * pData
Definition cec.h:170
int nLimitMax
Definition cec.h:157
int fStopWhenGone
Definition cec.h:165
int fVerbose
Definition cec.h:75
int fLatchCorr
Definition cec.h:72
int fSeqSimulate
Definition cec.h:71
int nFrames
Definition cec.h:64
int nWords
Definition cec.h:63
int fConstCorr
Definition cec.h:73
#define assert(ex)
Definition util_old.h:213
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Cec_ManSatSetDefaultParams()

void Cec_ManSatSetDefaultParams ( Cec_ParSat_t * p)
extern

DECLARATIONS ///.

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

FileName [cecCore.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Combinational equivalence checking.]

Synopsis [Core procedures.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

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

Revision [

Id
cecCore.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 45 of file cecCore.c.

46{
47 memset( p, 0, sizeof(Cec_ParSat_t) );
48 p->SolverType = -1; // SAT solver type
49 p->nBTLimit = 100; // conflict limit at a node
50 p->nSatVarMax = 2000; // the max number of SAT variables
51 p->nCallsRecycle = 200; // calls to perform before recycling SAT solver
52 p->fNonChrono = 1; // use non-chronological backtracling (for circuit SAT only)
53 p->fPolarFlip = 1; // flops polarity of variables
54 p->fCheckMiter = 0; // the circuit is the miter
55// p->fFirstStop = 0; // stop on the first sat output
56 p->fLearnCls = 0; // perform clause learning
57 p->fVerbose = 0; // verbose stats
58}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Cec_ManSatSolving()

Gia_Man_t * Cec_ManSatSolving ( Gia_Man_t * pAig,
Cec_ParSat_t * pPars,
int f0Proved )
extern

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

Synopsis [Core procedure for SAT sweeping.]

Description []

SideEffects []

SeeAlso []

Definition at line 236 of file cecCore.c.

237{
238 Gia_Man_t * pNew;
239 Cec_ManPat_t * pPat;
240 pPat = Cec_ManPatStart();
241 if ( pPars->SolverType == -1 )
242 Cec_ManSatSolve( pPat, pAig, pPars, NULL, NULL, NULL, f0Proved );
243 else
244 CecG_ManSatSolve( pPat, pAig, pPars, f0Proved );
245// pNew = Gia_ManDupDfsSkip( pAig );
246 pNew = Gia_ManCleanup( pAig );
247 Cec_ManPatStop( pPat );
248 pNew->vSeqModelVec = pAig->vSeqModelVec;
249 pAig->vSeqModelVec = NULL;
250 return pNew;
251}
Cec_ManPat_t * Cec_ManPatStart()
Definition cecMan.c:130
void Cec_ManPatStop(Cec_ManPat_t *p)
Definition cecMan.c:178
void CecG_ManSatSolve(Cec_ManPat_t *pPat, Gia_Man_t *pAig, Cec_ParSat_t *pPars, int f0Proved)
Definition cecSolveG.c:562
typedefABC_NAMESPACE_HEADER_START struct Cec_ManPat_t_ Cec_ManPat_t
INCLUDES ///.
Definition cecInt.h:49
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)
Definition cecSolve.c:699
Gia_Man_t * Gia_ManCleanup(Gia_Man_t *p)
Definition giaScl.c:84
Vec_Ptr_t * vSeqModelVec
Definition gia.h:151
Here is the call graph for this function:

◆ Cec_ManSatSweeping()

Gia_Man_t * Cec_ManSatSweeping ( Gia_Man_t * pAig,
Cec_ParFra_t * pPars,
int fSilent )
extern

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

Synopsis [Core procedure for SAT sweeping.]

Description []

SideEffects []

SeeAlso []

Definition at line 344 of file cecCore.c.

345{
346 int fOutputResult = 0;
347 Cec_ParSat_t ParsSat, * pParsSat = &ParsSat;
348 Cec_ParSim_t ParsSim, * pParsSim = &ParsSim;
349 Gia_Man_t * pIni, * pSrm, * pTemp;
350 Cec_ManFra_t * p;
351 Cec_ManSim_t * pSim;
352 Cec_ManPat_t * pPat;
353 int i, fTimeOut = 0, nMatches = 0;
354 abctime clk, clk2, clkTotal = Abc_Clock();
355 if ( pPars->fVerbose )
356 printf( "Simulating %d words for %d rounds. SAT solving with %d conflicts.\n", pPars->nWords, pPars->nRounds, pPars->nBTLimit );
357
358 // duplicate AIG and transfer equivalence classes
359 Gia_ManRandom( 1 );
360 pIni = Gia_ManDup(pAig);
361 pIni->pReprs = pAig->pReprs; pAig->pReprs = NULL;
362 pIni->pNexts = pAig->pNexts; pAig->pNexts = NULL;
363 if ( pPars->fUseOrigIds )
364 {
365 Gia_ManOrigIdsInit( pIni );
366 Vec_IntFreeP( &pAig->vIdsEquiv );
367 pAig->vIdsEquiv = Vec_IntAlloc( 1000 );
368 }
369 if ( pAig->vSimsPi )
370 {
371 pIni->vSimsPi = Vec_WrdDup(pAig->vSimsPi);
372 pIni->nSimWords = pAig->nSimWords;
373 }
374
375 // prepare the managers
376 // SAT sweeping
377 p = Cec_ManFraStart( pIni, pPars );
378 if ( pPars->fDualOut )
379 pPars->fColorDiff = 1;
380 // simulation
381 Cec_ManSimSetDefaultParams( pParsSim );
382 pParsSim->nWords = Abc_MaxInt(2*pAig->nSimWords, pPars->nWords);
383 pParsSim->nFrames = pPars->nRounds;
384 pParsSim->fCheckMiter = pPars->fCheckMiter;
385 pParsSim->fDualOut = pPars->fDualOut;
386 pParsSim->fVerbose = pPars->fVerbose;
387 pSim = Cec_ManSimStart( pIni, pParsSim );
388 // SAT solving
389 Cec_ManSatSetDefaultParams( pParsSat );
390 pParsSat->nBTLimit = pPars->nBTLimit;
391 pParsSat->fVerbose = pPars->fVeryVerbose;
392 // simulation patterns
393 pPat = Cec_ManPatStart();
394 //pPat->fVerbose = pPars->fVeryVerbose;
395
396 // start equivalence classes
397clk = Abc_Clock();
398 if ( p->pAig->pReprs == NULL )
399 {
400 if ( Cec_ManSimClassesPrepare(pSim, -1) || (!p->pAig->nSimWords && Cec_ManSimClassesRefine(pSim)) )
401 {
402 Gia_ManStop( p->pAig );
403 p->pAig = NULL;
404 goto finalize;
405 }
406 }
407p->timeSim += Abc_Clock() - clk;
408 // perform solving
409 for ( i = 1; i <= pPars->nItersMax; i++ )
410 {
411 clk2 = Abc_Clock();
412 nMatches = 0;
413 if ( pPars->fDualOut )
414 {
415 nMatches = Gia_ManEquivSetColors( p->pAig, pPars->fVeryVerbose );
416// p->pAig->pIso = Cec_ManDetectIsomorphism( p->pAig );
417// Gia_ManEquivTransform( p->pAig, 1 );
418 }
419 pSrm = Cec_ManFraSpecReduction( p );
420
421// Gia_AigerWrite( pSrm, "gia_srm.aig", 0, 0, 0 );
422
423 if ( pPars->fVeryVerbose )
424 Gia_ManPrintStats( pSrm, NULL );
425 if ( Gia_ManCoNum(pSrm) == 0 )
426 {
427 Gia_ManStop( pSrm );
428 if ( p->pPars->fVerbose )
429 Abc_Print( 1, "Considered all available candidate equivalences.\n" );
430 if ( pPars->fDualOut && Gia_ManAndNum(p->pAig) > 0 )
431 {
432 if ( pPars->fColorDiff )
433 {
434 if ( p->pPars->fVerbose )
435 Abc_Print( 1, "Switching into reduced mode.\n" );
436 pPars->fColorDiff = 0;
437 }
438 else
439 {
440 if ( p->pPars->fVerbose )
441 Abc_Print( 1, "Switching into normal mode.\n" );
442 pPars->fDualOut = 0;
443 }
444 continue;
445 }
446 break;
447 }
448clk = Abc_Clock();
449 if ( pPars->fRunCSat )
450 Cec_ManSatSolveCSat( pPat, pSrm, pParsSat );
451 else
452 Cec_ManSatSolve( pPat, pSrm, pParsSat, p->pAig->vIdsOrig, p->vXorNodes, pAig->vIdsEquiv, 0 );
453p->timeSat += Abc_Clock() - clk;
454 if ( Cec_ManFraClassesUpdate( p, pSim, pPat, pSrm ) )
455 {
456 Gia_ManStop( pSrm );
457 Gia_ManStop( p->pAig );
458 p->pAig = NULL;
459 goto finalize;
460 }
461 Gia_ManStop( pSrm );
462
463 // update the manager
464 pSim->pAig = p->pAig = Gia_ManEquivReduceAndRemap( pTemp = p->pAig, 0, pParsSim->fDualOut );
465 if ( p->pAig == NULL )
466 {
467 p->pAig = pTemp;
468 break;
469 }
470 Gia_ManStop( pTemp );
471 if ( p->pPars->fVerbose )
472 {
473 Abc_Print( 1, "%3d : P =%7d. D =%7d. F =%6d. M = %7d. And =%8d. ",
474 i, p->nAllProved, p->nAllDisproved, p->nAllFailed, nMatches, Gia_ManAndNum(p->pAig) );
475 Abc_PrintTime( 1, "Time", Abc_Clock() - clk2 );
476 }
477 if ( Gia_ManAndNum(p->pAig) == 0 )
478 {
479 if ( p->pPars->fVerbose )
480 Abc_Print( 1, "Network after reduction is empty.\n" );
481 break;
482 }
483 // check resource limits
484 if ( p->pPars->TimeLimit && (Abc_Clock() - clkTotal)/CLOCKS_PER_SEC >= p->pPars->TimeLimit )
485 {
486 fTimeOut = 1;
487 break;
488 }
489// if ( p->nAllFailed && !p->nAllProved && !p->nAllDisproved )
490 if ( p->nAllFailed > p->nAllProved + p->nAllDisproved )
491 {
492 if ( pParsSat->nBTLimit >= 10001 )
493 break;
494 if ( pPars->fSatSweeping )
495 {
496 if ( p->pPars->fVerbose )
497 Abc_Print( 1, "Exceeded the limit on the number of conflicts (%d).\n", pParsSat->nBTLimit );
498 break;
499 }
500 pParsSat->nBTLimit *= 10;
501 if ( p->pPars->fVerbose )
502 {
503 if ( p->pPars->fVerbose )
504 Abc_Print( 1, "Increasing conflict limit to %d.\n", pParsSat->nBTLimit );
505 if ( fOutputResult )
506 {
507 Gia_AigerWrite( p->pAig, "gia_cec_temp.aig", 0, 0, 0 );
508 Abc_Print( 1,"The result is written into file \"%s\".\n", "gia_cec_temp.aig" );
509 }
510 }
511 }
512 if ( pPars->fDualOut && pPars->fColorDiff && (Gia_ManAndNum(p->pAig) < 100000 || p->nAllProved + p->nAllDisproved < 10) )
513 {
514 if ( p->pPars->fVerbose )
515 Abc_Print( 1, "Switching into reduced mode.\n" );
516 pPars->fColorDiff = 0;
517 }
518// if ( pPars->fDualOut && Gia_ManAndNum(p->pAig) < 20000 )
519 else if ( pPars->fDualOut && (Gia_ManAndNum(p->pAig) < 20000 || p->nAllProved + p->nAllDisproved < 10) )
520 {
521 if ( p->pPars->fVerbose )
522 Abc_Print( 1, "Switching into normal mode.\n" );
523 pPars->fColorDiff = 0;
524 pPars->fDualOut = 0;
525 }
526 }
527finalize:
528 if ( pPars->fVerbose )
529 printf( "Performed %d SAT calls: P = %d D = %d F = %d\n",
530 p->nAllProvedS + p->nAllDisprovedS + p->nAllFailedS, p->nAllProvedS, p->nAllDisprovedS, p->nAllFailedS );
531 if ( p->pPars->fVerbose && p->pAig )
532 {
533 Abc_Print( 1, "NBeg = %d. NEnd = %d. (Gain = %6.2f %%). RBeg = %d. REnd = %d. (Gain = %6.2f %%).\n",
534 Gia_ManAndNum(pAig), Gia_ManAndNum(p->pAig),
535 100.0*(Gia_ManAndNum(pAig)-Gia_ManAndNum(p->pAig))/(Gia_ManAndNum(pAig)?Gia_ManAndNum(pAig):1),
536 Gia_ManRegNum(pAig), Gia_ManRegNum(p->pAig),
537 100.0*(Gia_ManRegNum(pAig)-Gia_ManRegNum(p->pAig))/(Gia_ManRegNum(pAig)?Gia_ManRegNum(pAig):1) );
538 Abc_PrintTimeP( 1, "Sim ", p->timeSim, Abc_Clock() - (int)clkTotal );
539 Abc_PrintTimeP( 1, "Sat ", p->timeSat-pPat->timeTotalSave, Abc_Clock() - (int)clkTotal );
540 Abc_PrintTimeP( 1, "Pat ", p->timePat+pPat->timeTotalSave, Abc_Clock() - (int)clkTotal );
541 Abc_PrintTime( 1, "Time", (int)(Abc_Clock() - clkTotal) );
542 }
543
544 pTemp = p->pAig; p->pAig = NULL;
545 if ( pTemp == NULL && pSim->iOut >= 0 )
546 {
547 if ( !fSilent )
548 Abc_Print( 1, "Disproved at least one output of the miter (zero-based number %d).\n", pSim->iOut );
549 pPars->iOutFail = pSim->iOut;
550 }
551 else if ( pSim->pCexes && !fSilent )
552 Abc_Print( 1, "Disproved %d outputs of the miter.\n", pSim->nOuts );
553 if ( fTimeOut && !fSilent )
554 Abc_Print( 1, "Timed out after %d seconds.\n", (int)((double)Abc_Clock() - clkTotal)/CLOCKS_PER_SEC );
555
556 pAig->pCexComb = pSim->pCexComb; pSim->pCexComb = NULL;
557 Cec_ManSimStop( pSim );
558 Cec_ManPatStop( pPat );
559 Cec_ManFraStop( p );
560 if ( pTemp ) ABC_FREE( pTemp->pReprs );
561 if ( pTemp ) ABC_FREE( pTemp->pNexts );
562 return pTemp;
563}
ABC_NAMESPACE_IMPL_START void Cec_ManSatSetDefaultParams(Cec_ParSat_t *p)
DECLARATIONS ///.
Definition cecCore.c:45
void Cec_ManSimSetDefaultParams(Cec_ParSim_t *p)
Definition cecCore.c:71
void Cec_ManSatSolveCSat(Cec_ManPat_t *pPat, Gia_Man_t *pAig, Cec_ParSat_t *pPars)
Definition cecSolve.c:809
Gia_Man_t * Cec_ManFraSpecReduction(Cec_ManFra_t *p)
DECLARATIONS ///.
Definition cecSweep.c:45
struct Cec_ManFra_t_ Cec_ManFra_t
Definition cecInt.h:147
void Cec_ManFraStop(Cec_ManFra_t *p)
Definition cecMan.c:285
int Cec_ManFraClassesUpdate(Cec_ManFra_t *p, Cec_ManSim_t *pSim, Cec_ManPat_t *pPat, Gia_Man_t *pNew)
Definition cecSweep.c:188
Cec_ManFra_t * Cec_ManFraStart(Gia_Man_t *pAig, Cec_ParFra_t *pPars)
Definition cecMan.c:263
int Gia_ManEquivSetColors(Gia_Man_t *p, int fVerbose)
Definition giaEquiv.c:1097
void Gia_ManOrigIdsInit(Gia_Man_t *p)
DECLARATIONS ///.
Definition giaEquiv.c:46
void Gia_ManPrintStats(Gia_Man_t *p, Gps_Par_t *pPars)
Definition giaMan.c:495
void Gia_AigerWrite(Gia_Man_t *p, char *pFileName, int fWriteSymbols, int fCompact, int fWriteNewLine)
Definition giaAiger.c:1595
Gia_Man_t * Gia_ManEquivReduceAndRemap(Gia_Man_t *p, int fSeq, int fMiterPairs)
Definition giaEquiv.c:1040
Abc_Cex_t * pCexComb
Definition cecInt.h:135
Gia_Man_t * pAig
Definition cecInt.h:117
void ** pCexes
Definition cecInt.h:132
int fDualOut
Definition cec.h:114
int fVeryVerbose
Definition cec.h:120
int fRunCSat
Definition cec.h:117
int fCheckMiter
Definition cec.h:112
int fColorDiff
Definition cec.h:115
int nBTLimit
Definition cec.h:103
int nWords
Definition cec.h:100
int nItersMax
Definition cec.h:102
int nRounds
Definition cec.h:101
int fVerbose
Definition cec.h:121
int iOutFail
Definition cec.h:122
int fSatSweeping
Definition cec.h:116
int fUseOrigIds
Definition cec.h:119
int fCheckMiter
Definition cec.h:69
int fDualOut
Definition cec.h:68
int nSimWords
Definition gia.h:209
Vec_Wrd_t * vSimsPi
Definition gia.h:215
Abc_Cex_t * pCexComb
Definition gia.h:149
Vec_Int_t * vIdsEquiv
Definition gia.h:190
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Cec_ManSeqResimulateCounter()

int Cec_ManSeqResimulateCounter ( Gia_Man_t * pAig,
Cec_ParSim_t * pPars,
Abc_Cex_t * pCex )
extern

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

Synopsis [Resimuates one counter-example to refine equivalence classes.]

Description []

SideEffects []

SeeAlso []

Definition at line 215 of file cecSeq.c.

216{
217 Vec_Ptr_t * vSimInfo;
218 int RetValue;
219 abctime clkTotal = Abc_Clock();
220 if ( pCex == NULL )
221 {
222 Abc_Print( 1, "Cec_ManSeqResimulateCounter(): Counter-example is not available.\n" );
223 return -1;
224 }
225 if ( pAig->pReprs == NULL )
226 {
227 Abc_Print( 1, "Cec_ManSeqResimulateCounter(): Equivalence classes are not available.\n" );
228 return -1;
229 }
230 if ( Gia_ManRegNum(pAig) == 0 )
231 {
232 Abc_Print( 1, "Cec_ManSeqResimulateCounter(): Not a sequential AIG.\n" );
233 return -1;
234 }
235// if ( Gia_ManRegNum(pAig) != pCex->nRegs || Gia_ManPiNum(pAig) != pCex->nPis )
236 if ( Gia_ManPiNum(pAig) != pCex->nPis )
237 {
238 Abc_Print( 1, "Cec_ManSeqResimulateCounter(): The number of PIs in the AIG and the counter-example differ.\n" );
239 return -1;
240 }
241 if ( pPars->fVerbose )
242 Abc_Print( 1, "Resimulating %d timeframes.\n", pPars->nFrames + pCex->iFrame + 1 );
243 Gia_ManRandom( 1 );
244 vSimInfo = Vec_PtrAllocSimInfo( Gia_ManRegNum(pAig) +
245 Gia_ManPiNum(pAig) * (pPars->nFrames + pCex->iFrame + 1), 1 );
246 Cec_ManSeqDeriveInfoFromCex( vSimInfo, pAig, pCex );
247 if ( pPars->fVerbose )
248 Gia_ManEquivPrintClasses( pAig, 0, 0 );
249 RetValue = Cec_ManSeqResimulateInfo( pAig, vSimInfo, NULL, pPars->fCheckMiter );
250 if ( pPars->fVerbose )
251 Gia_ManEquivPrintClasses( pAig, 0, 0 );
252 Vec_PtrFree( vSimInfo );
253 if ( pPars->fVerbose )
254 ABC_PRT( "Time", Abc_Clock() - clkTotal );
255// if ( RetValue && pPars->fCheckMiter )
256// Abc_Print( 1, "Cec_ManSeqResimulateCounter(): An output of the miter is asserted!\n" );
257 return RetValue;
258}
#define ABC_PRT(a, t)
Definition abc_global.h:255
int Cec_ManSeqResimulateInfo(Gia_Man_t *pAig, Vec_Ptr_t *vSimInfo, Abc_Cex_t *pBestState, int fCheckMiter)
Definition cecSeq.c:184
ABC_NAMESPACE_IMPL_START void Cec_ManSeqDeriveInfoFromCex(Vec_Ptr_t *vInfo, Gia_Man_t *pAig, Abc_Cex_t *pCex)
DECLARATIONS ///.
Definition cecSeq.c:45
void Gia_ManEquivPrintClasses(Gia_Man_t *p, int fVerbose, float Mem)
Definition giaEquiv.c:501
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_ManSeqSemiformal()

int Cec_ManSeqSemiformal ( Gia_Man_t * pAig,
Cec_ParSmf_t * pPars )
extern

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

Synopsis [Performs semiformal refinement of equivalence classes.]

Description []

SideEffects []

SeeAlso []

Definition at line 328 of file cecSeq.c.

329{
330 int nAddFrames = 16; // additional timeframes to simulate
331 int nCountNoRef = 0;
332 int nFramesReal;
333 Cec_ParSat_t ParsSat, * pParsSat = &ParsSat;
334 Vec_Ptr_t * vSimInfo;
335 Vec_Str_t * vStatus;
336 Abc_Cex_t * pState;
337 Gia_Man_t * pSrm, * pReduce, * pAux;
338 int r, nPats, RetValue = 0;
339 if ( pAig->pReprs == NULL )
340 {
341 Abc_Print( 1, "Cec_ManSeqSemiformal(): Equivalence classes are not available.\n" );
342 return -1;
343 }
344 if ( Gia_ManRegNum(pAig) == 0 )
345 {
346 Abc_Print( 1, "Cec_ManSeqSemiformal(): Not a sequential AIG.\n" );
347 return -1;
348 }
349 Gia_ManRandom( 1 );
350 // prepare starting pattern
351 pState = Abc_CexAlloc( Gia_ManRegNum(pAig), 0, 0 );
352 pState->iFrame = -1;
353 pState->iPo = -1;
354 // prepare SAT solving
355 Cec_ManSatSetDefaultParams( pParsSat );
356 pParsSat->nBTLimit = pPars->nBTLimit;
357 pParsSat->fVerbose = pPars->fVerbose;
358 if ( pParsSat->fVerbose )
359 {
360 Abc_Print( 1, "Starting: " );
361 Gia_ManEquivPrintClasses( pAig, 0, 0 );
362 }
363 // perform the given number of BMC rounds
364 Gia_ManCleanMark0( pAig );
365 for ( r = 0; r < pPars->nRounds; r++ )
366 {
367 if ( !Cec_ManCheckNonTrivialCands(pAig) )
368 {
369 Abc_Print( 1, "Cec_ManSeqSemiformal: There are only trivial equiv candidates left (PO drivers). Quitting.\n" );
370 break;
371 }
372// Abc_CexPrint( pState );
373 // derive speculatively reduced model
374// pSrm = Gia_ManSpecReduceInit( pAig, pState, pPars->nFrames, pPars->fDualOut );
375 pSrm = Gia_ManSpecReduceInitFrames( pAig, pState, pPars->nFrames, &nFramesReal, pPars->fDualOut, pPars->nMinOutputs );
376 if ( pSrm == NULL )
377 {
378 Abc_Print( 1, "Quitting refinement because miter could not be unrolled.\n" );
379 break;
380 }
381 assert( Gia_ManRegNum(pSrm) == 0 && Gia_ManPiNum(pSrm) == (Gia_ManPiNum(pAig) * nFramesReal) );
382 if ( pPars->fVerbose )
383 Abc_Print( 1, "Unrolled for %d frames.\n", nFramesReal );
384 // allocate room for simulation info
385 vSimInfo = Vec_PtrAllocSimInfo( Gia_ManRegNum(pAig) +
386 Gia_ManPiNum(pAig) * (nFramesReal + nAddFrames), pPars->nWords );
387 Cec_ManSeqDeriveInfoInitRandom( vSimInfo, pAig, pState );
388 // fill in simulation info with counter-examples
389 vStatus = Cec_ManSatSolveSeq( vSimInfo, pSrm, pParsSat, Gia_ManRegNum(pAig), &nPats );
390 Vec_StrFree( vStatus );
391 Gia_ManStop( pSrm );
392 // resimulate and refine the classes
393 RetValue = Cec_ManSeqResimulateInfo( pAig, vSimInfo, pState, pPars->fCheckMiter );
394 Vec_PtrFree( vSimInfo );
395 assert( pState->iPo >= 0 ); // hit counter
396 pState->iPo = -1;
397 if ( pPars->fVerbose )
398 {
399 Abc_Print( 1, "BMC = %3d ", nPats );
400 Gia_ManEquivPrintClasses( pAig, 0, 0 );
401 }
402
403 // write equivalence classes
404 Gia_AigerWrite( pAig, "gore.aig", 0, 0, 0 );
405 // reduce the model
406 pReduce = Gia_ManSpecReduce( pAig, 0, 0, 1, 0, 0 );
407 if ( pReduce )
408 {
409 pReduce = Gia_ManSeqStructSweep( pAux = pReduce, 1, 1, 0 );
410 Gia_ManStop( pAux );
411 Gia_AigerWrite( pReduce, "gsrm.aig", 0, 0, 0 );
412// Abc_Print( 1, "Speculatively reduced model was written into file \"%s\".\n", "gsrm.aig" );
413// Gia_ManPrintStatsShort( pReduce );
414 Gia_ManStop( pReduce );
415 }
416
417 if ( RetValue )
418 {
419 Abc_Print( 1, "Cec_ManSeqSemiformal(): An output of the miter is asserted. Refinement stopped.\n" );
420 break;
421 }
422 // decide when to stop
423 if ( nPats > 0 )
424 nCountNoRef = 0;
425 else if ( ++nCountNoRef == pPars->nNonRefines )
426 break;
427 }
428 ABC_FREE( pState );
429 if ( pPars->fCheckMiter )
430 {
431 int nNonConsts = Cec_ManCountNonConstOutputs( pAig );
432 if ( nNonConsts )
433 Abc_Print( 1, "The number of POs that are not const-0 candidates = %d.\n", nNonConsts );
434 }
435 return RetValue;
436}
Vec_Str_t * Cec_ManSatSolveSeq(Vec_Ptr_t *vPatts, Gia_Man_t *pAig, Cec_ParSat_t *pPars, int nRegs, int *pnPats)
Definition cecSolve.c:911
int Cec_ManCheckNonTrivialCands(Gia_Man_t *pAig)
Definition cecSeq.c:295
void Cec_ManSeqDeriveInfoInitRandom(Vec_Ptr_t *vInfo, Gia_Man_t *pAig, Abc_Cex_t *pCex)
Definition cecSeq.c:104
int Cec_ManCountNonConstOutputs(Gia_Man_t *pAig)
Definition cecSeq.c:272
void Gia_ManCleanMark0(Gia_Man_t *p)
Definition giaUtil.c:256
Gia_Man_t * Gia_ManSeqStructSweep(Gia_Man_t *p, int fConst, int fEquiv, int fVerbose)
Definition giaScl.c:258
Gia_Man_t * Gia_ManSpecReduce(Gia_Man_t *p, int fDualOut, int fSynthesis, int fReduce, int fSkipSome, int fVerbose)
Definition giaEquiv.c:1253
Gia_Man_t * Gia_ManSpecReduceInitFrames(Gia_Man_t *p, Abc_Cex_t *pInit, int nFramesMax, int *pnFrames, int fDualOut, int nMinOutputs)
Definition giaEquiv.c:1480
int nBTLimit
Definition cec.h:87
int fDualOut
Definition cec.h:89
int nNonRefines
Definition cec.h:85
int nWords
Definition cec.h:82
int nRounds
Definition cec.h:83
int fVerbose
Definition cec.h:92
int fCheckMiter
Definition cec.h:90
int nMinOutputs
Definition cec.h:86
int nFrames
Definition cec.h:84
ABC_NAMESPACE_IMPL_START Abc_Cex_t * Abc_CexAlloc(int nRegs, int nRealPis, int nFrames)
DECLARATIONS ///.
Definition utilCex.c:51
typedefABC_NAMESPACE_HEADER_START struct Abc_Cex_t_ Abc_Cex_t
INCLUDES ///.
Definition utilCex.h:39
Here is the call graph for this function:

◆ Cec_ManSimSetDefaultParams()

void Cec_ManSimSetDefaultParams ( Cec_ParSim_t * p)
extern

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

Synopsis [This procedure sets default parameters.]

Description []

SideEffects []

SeeAlso []

Definition at line 71 of file cecCore.c.

72{
73 memset( p, 0, sizeof(Cec_ParSim_t) );
74 p->nWords = 31; // the number of simulation words
75 p->nFrames = 100; // the number of simulation frames
76 p->nRounds = 20; // the max number of simulation rounds
77 p->nNonRefines = 3; // the max number of rounds without refinement
78 p->TimeLimit = 0; // the runtime limit in seconds
79 p->fCheckMiter = 0; // the circuit is the miter
80// p->fFirstStop = 0; // stop on the first sat output
81 p->fDualOut = 0; // miter with separate outputs
82 p->fConstCorr = 0; // consider only constants
83 p->fSeqSimulate = 0; // performs sequential simulation
84 p->fVeryVerbose = 0; // verbose stats
85 p->fVerbose = 0; // verbose stats
86}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Cec_ManSimulation()

void Cec_ManSimulation ( Gia_Man_t * pAig,
Cec_ParSim_t * pPars )
extern

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

Synopsis [Core procedure for simulation.]

Description []

SideEffects []

SeeAlso []

Definition at line 291 of file cecCore.c.

292{
293 int r, nLitsOld, nLitsNew, nCountNoRef = 0, fStop = 0;
294 Gia_ManRandom( 1 );
295 if ( pPars->fSeqSimulate )
296 Abc_Print( 1, "Performing rounds of random simulation of %d frames with %d words.\n",
297 pPars->nRounds, pPars->nFrames, pPars->nWords );
298 nLitsOld = Gia_ManEquivCountLits( pAig );
299 for ( r = 0; r < pPars->nRounds; r++ )
300 {
301 if ( Cec_ManSimulationOne( pAig, pPars ) )
302 {
303 fStop = 1;
304 break;
305 }
306 // decide when to stop
307 nLitsNew = Gia_ManEquivCountLits( pAig );
308 if ( nLitsOld == 0 || nLitsOld > nLitsNew )
309 {
310 nLitsOld = nLitsNew;
311 nCountNoRef = 0;
312 }
313 else if ( ++nCountNoRef == pPars->nNonRefines )
314 {
315 r++;
316 break;
317 }
318 assert( nLitsOld == nLitsNew );
319 }
320// if ( pPars->fVerbose )
321 if ( r == pPars->nRounds || fStop )
322 Abc_Print( 1, "Random simulation is stopped after %d rounds.\n", r );
323 else
324 Abc_Print( 1, "Random simulation saturated after %d rounds.\n", r );
325 if ( pPars->fCheckMiter )
326 {
327 int nNonConsts = Cec_ManCountNonConstOutputs( pAig );
328 if ( nNonConsts )
329 Abc_Print( 1, "The number of POs that are not const-0 candidates = %d.\n", nNonConsts );
330 }
331}
int Cec_ManSimulationOne(Gia_Man_t *pAig, Cec_ParSim_t *pPars)
Definition cecCore.c:264
int Cec_ManCountNonConstOutputs(Gia_Man_t *pAig)
Definition cecSeq.c:272
int Gia_ManEquivCountLits(Gia_Man_t *p)
Definition giaEquiv.c:450
int nNonRefines
Definition cec.h:66
int nRounds
Definition cec.h:65
Here is the call graph for this function:

◆ Cec_ManSmfSetDefaultParams()

void Cec_ManSmfSetDefaultParams ( Cec_ParSmf_t * p)
extern

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

Synopsis [This procedure sets default parameters.]

Description []

SideEffects []

SeeAlso []

Definition at line 99 of file cecCore.c.

100{
101 memset( p, 0, sizeof(Cec_ParSmf_t) );
102 p->nWords = 31; // the number of simulation words
103 p->nRounds = 200; // the number of simulation rounds
104 p->nFrames = 200; // the max number of time frames
105 p->nNonRefines = 3; // the max number of rounds without refinement
106 p->nMinOutputs = 0; // the min outputs to accumulate
107 p->nBTLimit = 100; // conflict limit at a node
108 p->TimeLimit = 0; // the runtime limit in seconds
109 p->fDualOut = 0; // miter with separate outputs
110 p->fCheckMiter = 0; // the circuit is the miter
111// p->fFirstStop = 0; // stop on the first sat output
112 p->fVerbose = 0; // verbose stats
113}
struct Cec_ParSmf_t_ Cec_ParSmf_t
Definition cec.h:79
Here is the call graph for this function:

◆ Cec_ManVerify()

int Cec_ManVerify ( Gia_Man_t * pInit,
Cec_ParCec_t * pPars )
extern

MACRO DEFINITIONS ///.

FUNCTION DECLARATIONS ///

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

Synopsis [New CEC engine.]

Description []

SideEffects []

SeeAlso []

Definition at line 326 of file cecCec.c.

327{
328 int fDumpUndecided = 0;
329 Cec_ParFra_t ParsFra, * pParsFra = &ParsFra;
330 Gia_Man_t * p, * pNew;
331 int RetValue;
332 abctime clk = Abc_Clock();
333 abctime clkTotal = Abc_Clock();
334 // consider special cases:
335 // 1) (SAT) a pair of POs have different value under all-0 pattern
336 // 2) (SAT) a pair of POs has different PI/Const drivers
337 // 3) (UNSAT) 1-2 do not hold and there is no nodes
338 RetValue = Cec_ManHandleSpecialCases( pInit, pPars );
339 if ( RetValue == 0 || RetValue == 1 )
340 return RetValue;
341 // preprocess
342 p = Gia_ManDup( pInit );
344 p = Gia_ManCleanup( pNew = p );
345 Gia_ManStop( pNew );
346 if ( pPars->fNaive )
347 {
348 RetValue = Cec_ManVerifyNaive( p, pPars );
349 Gia_ManStop( p );
350 return RetValue;
351 }
352 if ( pInit->vSimsPi )
353 {
354 p->vSimsPi = Vec_WrdDup(pInit->vSimsPi);
355 p->nSimWords = pInit->nSimWords;
356 }
357 // sweep for equivalences
358 Cec_ManFraSetDefaultParams( pParsFra );
359 pParsFra->nItersMax = 1000;
360 pParsFra->nBTLimit = pPars->nBTLimit;
361 pParsFra->TimeLimit = pPars->TimeLimit;
362 pParsFra->fVerbose = pPars->fVerbose;
363 pParsFra->fVeryVerbose = pPars->fVeryVerbose;
364 pParsFra->fCheckMiter = 1;
365 pParsFra->fDualOut = 1;
366 pNew = Cec_ManSatSweeping( p, pParsFra, pPars->fSilent );
367 pPars->iOutFail = pParsFra->iOutFail;
368 // update
369 pInit->pCexComb = p->pCexComb; p->pCexComb = NULL;
370 Gia_ManStop( p );
371 p = pInit;
372 // continue
373 if ( pNew == NULL )
374 {
375 if ( p->pCexComb != NULL )
376 {
377 if ( p->pCexComb && !Gia_ManVerifyCex( p, p->pCexComb, 1 ) )
378 Abc_Print( 1, "Counter-example simulation has failed.\n" );
379 if ( !pPars->fSilent )
380 {
381 Abc_Print( 1, "Networks are NOT EQUIVALENT. " );
382 Abc_PrintTime( 1, "Time", Abc_Clock() - clk );
383 }
384 return 0;
385 }
386 p = Gia_ManDup( pInit );
388 p = Gia_ManCleanup( pNew = p );
389 Gia_ManStop( pNew );
390 pNew = p;
391 }
392 if ( pPars->fVerbose )
393 {
394 Abc_Print( 1, "Networks are UNDECIDED after the new CEC engine. " );
395 Abc_PrintTime( 1, "Time", Abc_Clock() - clk );
396 }
397 if ( fDumpUndecided )
398 {
399 ABC_FREE( pNew->pReprs );
400 ABC_FREE( pNew->pNexts );
401 Gia_AigerWrite( pNew, "gia_cec_undecided.aig", 0, 0, 0 );
402 Abc_Print( 1, "The result is written into file \"%s\".\n", "gia_cec_undecided.aig" );
403 }
404 if ( pPars->TimeLimit && (Abc_Clock() - clkTotal)/CLOCKS_PER_SEC >= pPars->TimeLimit )
405 {
406 Gia_ManStop( pNew );
407 return -1;
408 }
409 // call other solver
410 if ( pPars->fVerbose )
411 Abc_Print( 1, "Calling the old CEC engine.\n" );
412 fflush( stdout );
413 RetValue = Cec_ManVerifyOld( pNew, pPars->fVerbose, &pPars->iOutFail, clkTotal, pPars->fSilent );
414 p->pCexComb = pNew->pCexComb; pNew->pCexComb = NULL;
415 if ( p->pCexComb && !Gia_ManVerifyCex( p, p->pCexComb, 1 ) )
416 Abc_Print( 1, "Counter-example simulation has failed.\n" );
417 Gia_ManStop( pNew );
418 return RetValue;
419}
int Cec_ManVerifyNaive(Gia_Man_t *p, Cec_ParCec_t *pPars)
Definition cecCec.c:226
int Cec_ManHandleSpecialCases(Gia_Man_t *p, Cec_ParCec_t *pPars)
Definition cecCec.c:142
int Cec_ManVerifyOld(Gia_Man_t *pMiter, int fVerbose, int *piOutFail, abctime clkTotal, int fSilent)
Definition cecCec.c:71
void Cec_ManFraSetDefaultParams(Cec_ParFra_t *p)
Definition cecCore.c:126
Gia_Man_t * Cec_ManSatSweeping(Gia_Man_t *pAig, Cec_ParFra_t *pPars, int fSilent)
Definition cecCore.c:344
void Gia_ManEquivFixOutputPairs(Gia_Man_t *p)
Definition giaEquiv.c:882
int Gia_ManVerifyCex(Gia_Man_t *pAig, Abc_Cex_t *p, int fDualOut)
DECLARATIONS ///.
Definition giaCex.c:48
int nBTLimit
Definition cec.h:132
int iOutFail
Definition cec.h:141
int fVeryVerbose
Definition cec.h:139
int TimeLimit
Definition cec.h:133
int fNaive
Definition cec.h:137
int fSilent
Definition cec.h:138
int fVerbose
Definition cec.h:140
int TimeLimit
Definition cec.h:105
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Cec_ManVerifySimple()

int Cec_ManVerifySimple ( Gia_Man_t * p)
extern

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

Synopsis [Simple SAT run to check equivalence.]

Description []

SideEffects []

SeeAlso []

Definition at line 432 of file cecCec.c.

433{
434 Cec_ParCec_t ParsCec, * pPars = &ParsCec;
436 pPars->fSilent = 1;
437 assert( Gia_ManCoNum(p) == 2 );
438 assert( Gia_ManRegNum(p) == 0 );
439 return Cec_ManVerify( p, pPars );
440}
int Cec_ManVerify(Gia_Man_t *pInit, Cec_ParCec_t *pPars)
MACRO DEFINITIONS ///.
Definition cecCec.c:326
void Cec_ManCecSetDefaultParams(Cec_ParCec_t *p)
Definition cecCore.c:159
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Cec_ManVerifyTwo()

int Cec_ManVerifyTwo ( Gia_Man_t * p0,
Gia_Man_t * p1,
int fVerbose )
extern

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

Synopsis [New CEC engine applied to two circuits.]

Description []

SideEffects []

SeeAlso []

Definition at line 453 of file cecCec.c.

454{
455 Cec_ParCec_t ParsCec, * pPars = &ParsCec;
456 Gia_Man_t * pMiter;
457 int RetValue;
459 pPars->fVerbose = fVerbose;
460 pMiter = Gia_ManMiter( p0, p1, 0, 1, 0, 0, pPars->fVerbose );
461 if ( pMiter == NULL )
462 return -1;
463 RetValue = Cec_ManVerify( pMiter, pPars );
464 p0->pCexComb = pMiter->pCexComb; pMiter->pCexComb = NULL;
465 Gia_ManStop( pMiter );
466 return RetValue;
467}
Gia_Man_t * Gia_ManMiter(Gia_Man_t *pAig0, Gia_Man_t *pAig1, int nInsDup, int fDualOut, int fSeq, int fImplic, int fVerbose)
Definition giaDup.c:2983
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Cec_ManVerifyTwoInv()

int Cec_ManVerifyTwoInv ( Gia_Man_t * p0,
Gia_Man_t * p1,
int fVerbose )
extern

Definition at line 468 of file cecCec.c.

469{
470 Cec_ParCec_t ParsCec, * pPars = &ParsCec;
471 Gia_Man_t * pMiter;
472 int RetValue;
474 pPars->fVerbose = fVerbose;
475 pMiter = Gia_ManMiterInverse( p0, p1, 1, pPars->fVerbose );
476 if ( pMiter == NULL )
477 return -1;
478 RetValue = Cec_ManVerify( pMiter, pPars );
479 p0->pCexComb = pMiter->pCexComb; pMiter->pCexComb = NULL;
480 Gia_ManStop( pMiter );
481 return RetValue;
482}
Gia_Man_t * Gia_ManMiterInverse(Gia_Man_t *pBot, Gia_Man_t *pTop, int fDualOut, int fVerbose)
Definition giaDup.c:3130
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Cec_SeqReadMinDomSize()

int Cec_SeqReadMinDomSize ( Cec_ParSeq_t * p)
extern

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 73 of file cecSynth.c.

74{
75 return p->nMinDomSize;
76}

◆ Cec_SeqReadVerbose()

int Cec_SeqReadVerbose ( Cec_ParSeq_t * p)
extern

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 89 of file cecSynth.c.

90{
91 return p->fVerbose;
92}

◆ Cec_SeqSynthesisSetDefaultParams()

void Cec_SeqSynthesisSetDefaultParams ( Cec_ParSeq_t * p)
extern

DECLARATIONS ///.

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

FileName [cecSynth.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Combinational equivalence checking.]

Synopsis [Partitioned sequential synthesis.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

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

Revision [

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

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

Synopsis [Populate sequential synthesis parameters.]

Description []

SideEffects []

SeeAlso []

Definition at line 46 of file cecSynth.c.

47{
48 memset( p, 0, sizeof(Cec_ParSeq_t) );
49 p->fUseLcorr = 0; // enables latch correspondence
50 p->fUseScorr = 0; // enables signal correspondence
51 p->nBTLimit = 1000; // (scorr/lcorr) conflict limit at a node
52 p->nFrames = 1; // (scorr only) the number of timeframes
53 p->nLevelMax = -1; // (scorr only) the max number of levels
54 p->fConsts = 1; // (scl only) merging constants
55 p->fEquivs = 1; // (scl only) merging equivalences
56 p->fUseMiniSat = 0; // enables MiniSat in lcorr/scorr
57 p->nMinDomSize = 100; // the size of minimum clock domain
58 p->fVeryVerbose = 0; // verbose stats
59 p->fVerbose = 0; // verbose stats
60}
struct Cec_ParSeq_t_ Cec_ParSeq_t
Definition cec.h:188
Here is the call graph for this function:

◆ Cec_SequentialSynthesisPart()

int Cec_SequentialSynthesisPart ( Gia_Man_t * p,
Cec_ParSeq_t * pPars )
extern

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

Synopsis [Partitioned sequential synthesis.]

Description [Returns AIG annotated with equivalence classes.]

SideEffects []

SeeAlso []

Definition at line 291 of file cecSynth.c.

292{
293 int fPrintParts = 0;
294 char Buffer[100];
295 Gia_Man_t * pTemp;
296 Vec_Ptr_t * vParts = (Vec_Ptr_t *)p->vClockDoms;
297 Vec_Int_t * vPart;
298 int * pMapBack, * pReprs;
299 int i, nCountPis, nCountRegs;
300 int nClasses;
301 abctime clk = Abc_Clock();
302
303 // save parameters
304 if ( fPrintParts )
305 {
306 // print partitions
307 Abc_Print( 1, "The following clock domains are used:\n" );
308 Vec_PtrForEachEntry( Vec_Int_t *, vParts, vPart, i )
309 {
310 pTemp = Gia_ManRegCreatePart( p, vPart, &nCountPis, &nCountRegs, NULL );
311 sprintf( Buffer, "part%03d.aig", i );
312 Gia_AigerWrite( pTemp, Buffer, 0, 0, 0 );
313 Abc_Print( 1, "part%03d.aig : Reg = %4d. PI = %4d. (True = %4d. Regs = %4d.) And = %5d.\n",
314 i, Vec_IntSize(vPart), Gia_ManCiNum(pTemp)-Vec_IntSize(vPart), nCountPis, nCountRegs, Gia_ManAndNum(pTemp) );
315 Gia_ManStop( pTemp );
316 }
317 }
318
319 // perform sequential synthesis for clock domains
320 pReprs = ABC_FALLOC( int, Gia_ManObjNum(p) );
321 Vec_PtrForEachEntry( Vec_Int_t *, vParts, vPart, i )
322 {
323 pTemp = Gia_ManRegCreatePart( p, vPart, &nCountPis, &nCountRegs, &pMapBack );
324 if ( nCountPis > 0 )
325 {
326 if ( pPars->fUseScorr )
327 {
328 Cec_ParCor_t CorPars, * pCorPars = &CorPars;
329 Cec_ManCorSetDefaultParams( pCorPars );
330 pCorPars->nBTLimit = pPars->nBTLimit;
331 pCorPars->nLevelMax = pPars->nLevelMax;
332 pCorPars->fVerbose = pPars->fVeryVerbose;
333 pCorPars->fUseCSat = 1;
334 Cec_ManLSCorrespondenceClasses( pTemp, pCorPars );
335 }
336 else if ( pPars->fUseLcorr )
337 {
338 Cec_ParCor_t CorPars, * pCorPars = &CorPars;
339 Cec_ManCorSetDefaultParams( pCorPars );
340 pCorPars->fLatchCorr = 1;
341 pCorPars->nBTLimit = pPars->nBTLimit;
342 pCorPars->fVerbose = pPars->fVeryVerbose;
343 pCorPars->fUseCSat = 1;
344 Cec_ManLSCorrespondenceClasses( pTemp, pCorPars );
345 }
346 else
347 {
348// pNew = Gia_ManSeqStructSweep( pTemp, pPars->fConsts, pPars->fEquivs, pPars->fVerbose );
349// Gia_ManStop( pNew );
350 Gia_ManSeqCleanupClasses( pTemp, pPars->fConsts, pPars->fEquivs, pPars->fVerbose );
351 }
352//Abc_Print( 1, "Part equivalences = %d.\n", Gia_ManEquivCountLitsAll(pTemp) );
353 nClasses = Gia_TransferMappedClasses( pTemp, pMapBack, pReprs );
354 if ( pPars->fVerbose )
355 {
356 Abc_Print( 1, "%3d : Reg = %4d. PI = %4d. (True = %4d. Regs = %4d.) And = %5d. Cl = %5d.\n",
357 i, Vec_IntSize(vPart), Gia_ManCiNum(pTemp)-Vec_IntSize(vPart), nCountPis, nCountRegs, Gia_ManAndNum(pTemp), nClasses );
358 }
359 }
360 Gia_ManStop( pTemp );
361 ABC_FREE( pMapBack );
362 }
363
364 // generate resulting equivalences
366//Abc_Print( 1, "Total equivalences = %d.\n", Gia_ManEquivCountLitsAll(p) );
367 ABC_FREE( pReprs );
368 if ( pPars->fVerbose )
369 {
370 Abc_PrintTime( 1, "Total time", Abc_Clock() - clk );
371 }
372 return 1;
373}
#define ABC_FALLOC(type, num)
Definition abc_global.h:266
void Gia_ManNormalizeEquivalences(Gia_Man_t *p, int *pReprs)
Definition cecSynth.c:262
Gia_Man_t * Gia_ManRegCreatePart(Gia_Man_t *p, Vec_Int_t *vPart, int *pnCountPis, int *pnCountRegs, int **ppMapBack)
Definition cecSynth.c:105
int Gia_TransferMappedClasses(Gia_Man_t *pPart, int *pMapBack, int *pReprs)
Definition cecSynth.c:204
void Cec_ManCorSetDefaultParams(Cec_ParCor_t *p)
Definition cecCore.c:183
int Cec_ManLSCorrespondenceClasses(Gia_Man_t *pAig, Cec_ParCor_t *pPars)
Definition cecCorr.c:924
void Gia_ManSeqCleanupClasses(Gia_Man_t *p, int fConst, int fEquiv, int fVerbose)
Definition giaAig.c:676
int nLevelMax
Definition cec.h:195
int fUseScorr
Definition cec.h:192
int nBTLimit
Definition cec.h:193
int fVeryVerbose
Definition cec.h:200
int fUseLcorr
Definition cec.h:191
int fVerbose
Definition cec.h:201
int fEquivs
Definition cec.h:197
int fConsts
Definition cec.h:196
char * sprintf()
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition vecPtr.h:55
Here is the call graph for this function: