ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
cecInt.h
Go to the documentation of this file.
1
20
21#ifndef ABC__aig__cec__cecInt_h
22#define ABC__aig__cec__cecInt_h
23
24
28
29#include "sat/bsat/satSolver.h"
31#include "misc/bar/bar.h"
32#include "aig/gia/gia.h"
33#include "cec.h"
34
38
39
40
42
43
47
48// simulation pattern manager
51{
52 Vec_Int_t * vPattern1; // pattern in terms of primary inputs
53 Vec_Int_t * vPattern2; // pattern in terms of primary inputs
54 Vec_Str_t * vStorage; // storage for compressed patterns
55 int iStart; // position in the array where recent patterns begin
56 int nPats; // total number of recent patterns
57 int nPatsAll; // total number of all patterns
58 int nPatLits; // total number of literals in recent patterns
59 int nPatLitsAll; // total number of literals in all patterns
60 int nPatLitsMin; // total number of literals in minimized recent patterns
61 int nPatLitsMinAll; // total number of literals in minimized all patterns
62 int nSeries; // simulation series
63 int fVerbose; // verbose stats
64 // runtime statistics
65 abctime timeFind; // detecting the pattern
66 abctime timeShrink; // minimizing the pattern
67 abctime timeVerify; // verifying the result of minimisation
68 abctime timeSort; // sorting literals
69 abctime timePack; // packing into sim info structures
70 abctime timeTotal; // total runtime
71 abctime timeTotalSave; // total runtime for saving
72};
73
74// SAT solving manager
77{
78 // parameters
80 // AIGs used in the package
81 Gia_Man_t * pAig; // the AIG whose outputs are considered
82 Vec_Int_t * vStatus; // status for each output
83 // SAT solving
84 sat_solver * pSat; // recyclable SAT solver (MiniSAT)
85 bmcg2_sat_solver*pSat2; // recyclable SAT solver (Glucose)
86 int nSatVars; // the counter of SAT variables
87 int * pSatVars; // mapping of each node into its SAT var
88 Vec_Ptr_t * vUsedNodes; // nodes whose SAT vars are assigned
89 int nRecycles; // the number of times SAT solver was recycled
90 int nCallsSince; // the number of calls since the last recycle
91 Vec_Ptr_t * vFanins; // fanins of the CNF node
92 // counter-examples
93 Vec_Int_t * vCex; // the latest counter-example
94 Vec_Int_t * vVisits; // temporary array for visited nodes
95 // SAT calls statistics
96 int nSatUnsat; // the number of proofs
97 int nSatSat; // the number of failure
98 int nSatUndec; // the number of timeouts
99 int nSatTotal; // the number of calls
101 // conflicts
102 int nConfUnsat; // conflicts in unsat problems
103 int nConfSat; // conflicts in sat problems
104 int nConfUndec; // conflicts in undec problems
105 // runtime stats
106 int timeSatUnsat; // unsat
107 int timeSatSat; // sat
108 int timeSatUndec; // undecided
109 int timeTotal; // total runtime
110};
111
112// combinational simulation manager
115{
116 // parameters
117 Gia_Man_t * pAig; // the AIG to be used for simulation
118 Cec_ParSim_t * pPars; // simulation parameters
119 int nWords; // the number of simulation words
120 // recycable memory
121 int * pSimInfo; // simulation information offsets
122 unsigned * pMems; // allocated simulaton memory
123 int nWordsAlloc; // the number of allocated entries
124 int nMems; // the number of used entries
125 int nMemsMax; // the max number of used entries
126 int MemFree; // next free entry
127 int nWordsOld; // the number of simulation words after previous relink
128 // internal simulation info
129 Vec_Ptr_t * vCiSimInfo; // CI simulation info
130 Vec_Ptr_t * vCoSimInfo; // CO simulation info
131 // counter examples
132 void ** pCexes; // counter-examples for each output
133 int iOut; // first failed output
134 int nOuts; // the number of failed outputs
135 Abc_Cex_t * pCexComb; // counter-example for the first failed output
136 Abc_Cex_t * pBestState; // the state that led to most of the refinements
137 // scoring simulation patterns
138 int * pScores; // counters of refinement for each pattern
139 // temporaries
140 Vec_Int_t * vClassOld; // old class numbers
141 Vec_Int_t * vClassNew; // new class numbers
142 Vec_Int_t * vClassTemp; // temporary storage
143 Vec_Int_t * vRefinedC; // refined const reprs
144};
145
146// combinational simulation manager
149{
150 // parameters
151 Gia_Man_t * pAig; // the AIG to be used for simulation
152 Cec_ParFra_t * pPars; // SAT sweeping parameters
153 // simulation patterns
154 Vec_Int_t * vXorNodes; // nodes used in speculative reduction
155 int nAllProved; // total number of proved nodes
156 int nAllDisproved; // total number of disproved nodes
157 int nAllFailed; // total number of failed nodes
158 int nAllProvedS; // total number of proved nodes
159 int nAllDisprovedS; // total number of disproved nodes
160 int nAllFailedS; // total number of failed nodes
161 // runtime stats
162 abctime timeSim; // unsat
163 abctime timePat; // unsat
165 abctime timeTotal; // total runtime
166};
167
171
175
176/*=== cecCorr.c ============================================================*/
177extern void Cec_ManRefinedClassPrintStats( Gia_Man_t * p, Vec_Str_t * vStatus, int iIter, abctime Time );
178/*=== cecClass.c ============================================================*/
179extern int Cec_ManSimClassRemoveOne( Cec_ManSim_t * p, int i );
180extern int Cec_ManSimClassesPrepare( Cec_ManSim_t * p, int LevelMax );
182extern int Cec_ManSimSimulateRound( Cec_ManSim_t * p, Vec_Ptr_t * vInfoCis, Vec_Ptr_t * vInfoCos );
183/*=== cecIso.c ============================================================*/
184extern int * Cec_ManDetectIsomorphism( Gia_Man_t * p );
185/*=== cecMan.c ============================================================*/
186extern Cec_ManSat_t * Cec_ManSatCreate( Gia_Man_t * pAig, Cec_ParSat_t * pPars );
187extern void Cec_ManSatPrintStats( Cec_ManSat_t * p );
188extern void Cec_ManSatStop( Cec_ManSat_t * p );
190extern void Cec_ManPatPrintStats( Cec_ManPat_t * p );
191extern void Cec_ManPatStop( Cec_ManPat_t * p );
192extern Cec_ManSim_t * Cec_ManSimStart( Gia_Man_t * pAig, Cec_ParSim_t * pPars );
193extern void Cec_ManSimStop( Cec_ManSim_t * p );
194extern Cec_ManFra_t * Cec_ManFraStart( Gia_Man_t * pAig, Cec_ParFra_t * pPars );
195extern void Cec_ManFraStop( Cec_ManFra_t * p );
196/*=== cecPat.c ============================================================*/
197extern void Cec_ManPatSavePattern( Cec_ManPat_t * pPat, Cec_ManSat_t * p, Gia_Obj_t * pObj );
198extern void Cec_ManPatSavePatternCSat( Cec_ManPat_t * pMan, Vec_Int_t * vPat );
199extern Vec_Ptr_t * Cec_ManPatCollectPatterns( Cec_ManPat_t * pMan, int nInputs, int nWords );
200extern Vec_Ptr_t * Cec_ManPatPackPatterns( Vec_Int_t * vCexStore, int nInputs, int nRegs, int nWordsInit );
201/*=== cecSeq.c ============================================================*/
202extern int Cec_ManSeqResimulate( Cec_ManSim_t * p, Vec_Ptr_t * vInfo );
203extern int Cec_ManSeqResimulateInfo( Gia_Man_t * pAig, Vec_Ptr_t * vSimInfo, Abc_Cex_t * pBestState, int fCheckMiter );
204extern void Cec_ManSeqDeriveInfoInitRandom( Vec_Ptr_t * vInfo, Gia_Man_t * pAig, Abc_Cex_t * pCex );
205extern int Cec_ManCountNonConstOutputs( Gia_Man_t * pAig );
206extern int Cec_ManCheckNonTrivialCands( Gia_Man_t * pAig );
207/*=== cecSolve.c ============================================================*/
208extern int Cec_ObjSatVarValue( Cec_ManSat_t * p, Gia_Obj_t * pObj );
209extern 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 );
210extern void Cec_ManSatSolveCSat( Cec_ManPat_t * pPat, Gia_Man_t * pAig, Cec_ParSat_t * pPars );
211extern Vec_Str_t * Cec_ManSatSolveSeq( Vec_Ptr_t * vPatts, Gia_Man_t * pAig, Cec_ParSat_t * pPars, int nRegs, int * pnPats );
212extern Vec_Int_t * Cec_ManSatSolveMiter( Gia_Man_t * pAig, Cec_ParSat_t * pPars, Vec_Str_t ** pvStatus );
213extern int Cec_ManSatCheckNode( Cec_ManSat_t * p, Gia_Obj_t * pObj );
214extern int Cec_ManSatCheckNodeTwo( Cec_ManSat_t * p, Gia_Obj_t * pObj1, Gia_Obj_t * pObj2 );
215extern void Cec_ManSavePattern( Cec_ManSat_t * p, Gia_Obj_t * pObj1, Gia_Obj_t * pObj2 );
217/*=== cecSolveG.c ============================================================*/
218extern void CecG_ManSatSolve( Cec_ManPat_t * pPat, Gia_Man_t * pAig, Cec_ParSat_t * pPars, int f0Proved );
219/*=== ceFraeep.c ============================================================*/
221extern int Cec_ManFraClassesUpdate( Cec_ManFra_t * p, Cec_ManSim_t * pSim, Cec_ManPat_t * pPat, Gia_Man_t * pNew );
222
223
224
226
227
228
229#endif
230
234
void bmcg2_sat_solver
Definition AbcGlucose2.h:63
int nWords
Definition abcNpn.c:127
ABC_INT64_T abctime
Definition abc_global.h:332
#define ABC_NAMESPACE_HEADER_END
#define ABC_NAMESPACE_HEADER_START
NAMESPACES ///.
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
void Cec_ManPatPrintStats(Cec_ManPat_t *p)
Definition cecMan.c:151
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
void Cec_ManPatSavePattern(Cec_ManPat_t *pPat, Cec_ManSat_t *p, Gia_Obj_t *pObj)
Definition cecPat.c:359
int Cec_ManSatCheckNode(Cec_ManSat_t *p, Gia_Obj_t *pObj)
Definition cecSolve.c:470
int Cec_ManSimClassesPrepare(Cec_ManSim_t *p, int LevelMax)
Definition cecClass.c:867
void Cec_ManSatSolveCSat(Cec_ManPat_t *pPat, Gia_Man_t *pAig, Cec_ParSat_t *pPars)
Definition cecSolve.c:809
void Cec_ManPatSavePatternCSat(Cec_ManPat_t *pMan, Vec_Int_t *vPat)
Definition cecPat.c:402
void Cec_ManSatPrintStats(Cec_ManSat_t *p)
Definition cecMan.c:74
int Cec_ManSimClassesRefine(Cec_ManSim_t *p)
Definition cecClass.c:939
void Cec_ManSavePattern(Cec_ManSat_t *p, Gia_Obj_t *pObj1, Gia_Obj_t *pObj2)
Definition cecSolve.c:1049
Gia_Man_t * Cec_ManFraSpecReduction(Cec_ManFra_t *p)
DECLARATIONS ///.
Definition cecSweep.c:45
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
int Cec_ManSimSimulateRound(Cec_ManSim_t *p, Vec_Ptr_t *vInfoCis, Vec_Ptr_t *vInfoCos)
Definition cecClass.c:668
void Cec_ManRefinedClassPrintStats(Gia_Man_t *p, Vec_Str_t *vStatus, int iIter, abctime Time)
MACRO DEFINITIONS ///.
Definition cecCorr.c:725
int Cec_ManSimClassRemoveOne(Cec_ManSim_t *p, int i)
Definition cecClass.c:324
int Cec_ManCountNonConstOutputs(Gia_Man_t *pAig)
Definition cecSeq.c:272
int Cec_ManSeqResimulateInfo(Gia_Man_t *pAig, Vec_Ptr_t *vSimInfo, Abc_Cex_t *pBestState, int fCheckMiter)
Definition cecSeq.c:184
Cec_ManPat_t * Cec_ManPatStart()
Definition cecMan.c:130
struct Cec_ManFra_t_ Cec_ManFra_t
Definition cecInt.h:147
struct Cec_ManSim_t_ Cec_ManSim_t
Definition cecInt.h:113
void Cec_ManFraStop(Cec_ManFra_t *p)
Definition cecMan.c:285
int Cec_ManSatCheckNodeTwo(Cec_ManSat_t *p, Gia_Obj_t *pObj1, Gia_Obj_t *pObj2)
Definition cecSolve.c:569
void Cec_ManPatStop(Cec_ManPat_t *p)
Definition cecMan.c:178
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
void CecG_ManSatSolve(Cec_ManPat_t *pPat, Gia_Man_t *pAig, Cec_ParSat_t *pPars, int f0Proved)
Definition cecSolveG.c:562
int * Cec_ManDetectIsomorphism(Gia_Man_t *p)
Definition cecIso.c:297
typedefABC_NAMESPACE_HEADER_START struct Cec_ManPat_t_ Cec_ManPat_t
INCLUDES ///.
Definition cecInt.h:49
void Cec_ManSatStop(Cec_ManSat_t *p)
Definition cecMan.c:105
Vec_Ptr_t * Cec_ManPatCollectPatterns(Cec_ManPat_t *pMan, int nInputs, int nWords)
Definition cecPat.c:455
Vec_Int_t * Cec_ManSatReadCex(Cec_ManSat_t *p)
Definition cecSolve.c:864
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
int Cec_ObjSatVarValue(Cec_ManSat_t *p, Gia_Obj_t *pObj)
FUNCTION DEFINITIONS ///.
Definition cecSolve.c:48
int Cec_ManFraClassesUpdate(Cec_ManFra_t *p, Cec_ManSim_t *pSim, Cec_ManPat_t *pPat, Gia_Man_t *pNew)
Definition cecSweep.c:188
int Cec_ManSeqResimulate(Cec_ManSim_t *p, Vec_Ptr_t *vInfo)
Definition cecSeq.c:137
Vec_Int_t * Cec_ManSatSolveMiter(Gia_Man_t *pAig, Cec_ParSat_t *pPars, Vec_Str_t **pvStatus)
Definition cecSolve.c:1070
Vec_Ptr_t * Cec_ManPatPackPatterns(Vec_Int_t *vCexStore, int nInputs, int nRegs, int nWordsInit)
Definition cecPat.c:513
struct Cec_ManSat_t_ Cec_ManSat_t
Definition cecInt.h:75
Cec_ManSat_t * Cec_ManSatCreate(Gia_Man_t *pAig, Cec_ParSat_t *pPars)
DECLARATIONS ///.
Definition cecMan.c:45
Cec_ManFra_t * Cec_ManFraStart(Gia_Man_t *pAig, Cec_ParFra_t *pPars)
Definition cecMan.c:263
#define sat_solver
Definition cecSatG2.c:34
struct Cec_ParFra_t_ Cec_ParFra_t
Definition cec.h:96
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
Cube * p
Definition exorList.c:222
struct Gia_Obj_t_ Gia_Obj_t
Definition gia.h:76
struct Gia_Man_t_ Gia_Man_t
Definition gia.h:96
int nAllProvedS
Definition cecInt.h:158
int nAllProved
Definition cecInt.h:155
int nAllFailedS
Definition cecInt.h:160
abctime timeSim
Definition cecInt.h:162
int nAllFailed
Definition cecInt.h:157
Vec_Int_t * vXorNodes
Definition cecInt.h:154
int nAllDisprovedS
Definition cecInt.h:159
abctime timeSat
Definition cecInt.h:164
abctime timePat
Definition cecInt.h:163
Gia_Man_t * pAig
Definition cecInt.h:151
Cec_ParFra_t * pPars
Definition cecInt.h:152
int nAllDisproved
Definition cecInt.h:156
abctime timeTotal
Definition cecInt.h:165
Vec_Int_t * vPattern2
Definition cecInt.h:53
abctime timeFind
Definition cecInt.h:65
abctime timeVerify
Definition cecInt.h:67
abctime timePack
Definition cecInt.h:69
int nPatLitsMin
Definition cecInt.h:60
abctime timeTotal
Definition cecInt.h:70
int fVerbose
Definition cecInt.h:63
abctime timeSort
Definition cecInt.h:68
int nPatLits
Definition cecInt.h:58
Vec_Str_t * vStorage
Definition cecInt.h:54
Vec_Int_t * vPattern1
Definition cecInt.h:52
abctime timeTotalSave
Definition cecInt.h:71
int nPatLitsMinAll
Definition cecInt.h:61
int nSeries
Definition cecInt.h:62
int nPatsAll
Definition cecInt.h:57
int nPatLitsAll
Definition cecInt.h:59
abctime timeShrink
Definition cecInt.h:66
int nRecycles
Definition cecInt.h:89
int nCallsSince
Definition cecInt.h:90
int * pSatVars
Definition cecInt.h:87
Vec_Int_t * vVisits
Definition cecInt.h:94
Cec_ParSat_t * pPars
Definition cecInt.h:79
bmcg2_sat_solver * pSat2
Definition cecInt.h:85
int nSatTotal
Definition cecInt.h:99
int nSatVars
Definition cecInt.h:86
Vec_Int_t * vCex
Definition cecInt.h:93
int nConfUndec
Definition cecInt.h:104
int nConfUnsat
Definition cecInt.h:102
Vec_Ptr_t * vUsedNodes
Definition cecInt.h:88
int timeSatUnsat
Definition cecInt.h:106
Vec_Int_t * vStatus
Definition cecInt.h:82
sat_solver * pSat
Definition cecInt.h:84
int timeTotal
Definition cecInt.h:109
int nSatSat
Definition cecInt.h:97
int timeSatSat
Definition cecInt.h:107
int nSatUnsat
Definition cecInt.h:96
int nSatUndec
Definition cecInt.h:98
Gia_Man_t * pAig
Definition cecInt.h:81
int timeSatUndec
Definition cecInt.h:108
Vec_Ptr_t * vFanins
Definition cecInt.h:91
int nWordsOld
Definition cecInt.h:127
Abc_Cex_t * pCexComb
Definition cecInt.h:135
int * pSimInfo
Definition cecInt.h:121
Vec_Int_t * vClassTemp
Definition cecInt.h:142
Cec_ParSim_t * pPars
Definition cecInt.h:118
Vec_Int_t * vClassOld
Definition cecInt.h:140
Vec_Int_t * vClassNew
Definition cecInt.h:141
Vec_Ptr_t * vCoSimInfo
Definition cecInt.h:130
Vec_Int_t * vRefinedC
Definition cecInt.h:143
int nWordsAlloc
Definition cecInt.h:123
Vec_Ptr_t * vCiSimInfo
Definition cecInt.h:129
int * pScores
Definition cecInt.h:138
Gia_Man_t * pAig
Definition cecInt.h:117
void ** pCexes
Definition cecInt.h:132
unsigned * pMems
Definition cecInt.h:122
Abc_Cex_t * pBestState
Definition cecInt.h:136
typedefABC_NAMESPACE_HEADER_START struct Abc_Cex_t_ Abc_Cex_t
INCLUDES ///.
Definition utilCex.h:39
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition vecPtr.h:42