ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
dchInt.h
Go to the documentation of this file.
1
20
21#ifndef ABC__aig__dch__dchInt_h
22#define ABC__aig__dch__dchInt_h
23
24
28
29#include "aig/aig/aig.h"
30#include "sat/bsat/satSolver.h"
31#include "dch.h"
32
36
37
38
40
41
45
46// equivalence classes
47typedef struct Dch_Cla_t_ Dch_Cla_t;
48
49// choicing manager
50typedef struct Dch_Man_t_ Dch_Man_t;
52{
53 // parameters
54 Dch_Pars_t * pPars; // choicing parameters
55 // AIGs used in the package
56// Vec_Ptr_t * vAigs; // user-given AIGs
57 Aig_Man_t * pAigTotal; // intermediate AIG
58 Aig_Man_t * pAigFraig; // final AIG
59 // equivalence classes
60 Dch_Cla_t * ppClasses; // equivalence classes of nodes
61 Aig_Obj_t ** pReprsProved; // equivalences proved
62 // SAT solving
63 sat_solver * pSat; // recyclable SAT solver
64 int nSatVars; // the counter of SAT variables
65 int * pSatVars; // mapping of each node into its SAT var
66 Vec_Ptr_t * vUsedNodes; // nodes whose SAT vars are assigned
67 int nRecycles; // the number of times SAT solver was recycled
68 int nCallsSince; // the number of calls since the last recycle
69 Vec_Ptr_t * vFanins; // fanins of the CNF node
70 Vec_Ptr_t * vSimRoots; // the roots of cand const 1 nodes to simulate
71 Vec_Ptr_t * vSimClasses; // the roots of cand equiv classes to simulate
72 // solver cone size
75 // SAT calls statistics
76 int nSatCalls; // the number of SAT calls
77 int nSatProof; // the number of proofs
78 int nSatFailsReal; // the number of timeouts
79 int nSatCallsUnsat; // the number of unsat SAT calls
80 int nSatCallsSat; // the number of sat SAT calls
81 // choice node statistics
82 int nLits; // the number of lits in the cand equiv classes
83 int nReprs; // the number of proved equivalent pairs
84 int nEquivs; // the number of final equivalences
85 int nChoices; // the number of final choice nodes
86 // runtime stats
87 abctime timeSimInit; // simulation and class computation
88 abctime timeSimSat; // simulation of the counter-examples
89 abctime timeSat; // solving SAT
92 abctime timeSatUndec; // undecided
93 abctime timeChoice; // choice computation
94 abctime timeOther; // other runtime
95 abctime timeTotal; // total runtime
96};
97
101
102static inline int Dch_ObjSatNum( Dch_Man_t * p, Aig_Obj_t * pObj ) { return p->pSatVars[pObj->Id]; }
103static inline void Dch_ObjSetSatNum( Dch_Man_t * p, Aig_Obj_t * pObj, int Num ) { p->pSatVars[pObj->Id] = Num; }
104
105static inline Aig_Obj_t * Dch_ObjFraig( Aig_Obj_t * pObj ) { return (Aig_Obj_t *)pObj->pData; }
106static inline void Dch_ObjSetFraig( Aig_Obj_t * pObj, Aig_Obj_t * pNode ) { pObj->pData = pNode; }
107
108static inline int Dch_ObjIsConst1Cand( Aig_Man_t * pAig, Aig_Obj_t * pObj )
109{
110 return Aig_ObjRepr(pAig, pObj) == Aig_ManConst1(pAig);
111}
112static inline void Dch_ObjSetConst1Cand( Aig_Man_t * pAig, Aig_Obj_t * pObj )
113{
114 assert( !Dch_ObjIsConst1Cand( pAig, pObj ) );
115 Aig_ObjSetRepr( pAig, pObj, Aig_ManConst1(pAig) );
116}
117
121
122/*=== dchAig.c ===================================================*/
123/*=== dchChoice.c ===================================================*/
124extern int Dch_DeriveChoiceCountReprs( Aig_Man_t * pAig );
125extern int Dch_DeriveChoiceCountEquivs( Aig_Man_t * pAig );
126extern Aig_Man_t * Dch_DeriveChoiceAig( Aig_Man_t * pAig, int fSkipRedSupps );
127/*=== dchClass.c =================================================*/
128extern Dch_Cla_t * Dch_ClassesStart( Aig_Man_t * pAig );
129extern void Dch_ClassesSetData( Dch_Cla_t * p, void * pManData,
130 unsigned (*pFuncNodeHash)(void *,Aig_Obj_t *),
131 int (*pFuncNodeIsConst)(void *,Aig_Obj_t *),
132 int (*pFuncNodesAreEqual)(void *,Aig_Obj_t *, Aig_Obj_t *) );
133extern void Dch_ClassesStop( Dch_Cla_t * p );
134extern int Dch_ClassesLitNum( Dch_Cla_t * p );
135extern Aig_Obj_t ** Dch_ClassesReadClass( Dch_Cla_t * p, Aig_Obj_t * pRepr, int * pnSize );
136extern void Dch_ClassesPrint( Dch_Cla_t * p, int fVeryVerbose );
137extern void Dch_ClassesPrepare( Dch_Cla_t * p, int fLatchCorr, int nMaxLevs );
138extern int Dch_ClassesRefine( Dch_Cla_t * p );
139extern int Dch_ClassesRefineOneClass( Dch_Cla_t * p, Aig_Obj_t * pRepr, int fRecursive );
140extern void Dch_ClassesCollectOneClass( Dch_Cla_t * p, Aig_Obj_t * pRepr, Vec_Ptr_t * vRoots );
141extern void Dch_ClassesCollectConst1Group( Dch_Cla_t * p, Aig_Obj_t * pObj, int nNodes, Vec_Ptr_t * vRoots );
142extern int Dch_ClassesRefineConst1Group( Dch_Cla_t * p, Vec_Ptr_t * vRoots, int fRecursive );
143/*=== dchCnf.c ===================================================*/
144extern void Dch_CnfNodeAddToSolver( Dch_Man_t * p, Aig_Obj_t * pObj );
145/*=== dchMan.c ===================================================*/
146extern Dch_Man_t * Dch_ManCreate( Aig_Man_t * pAig, Dch_Pars_t * pPars );
147extern void Dch_ManStop( Dch_Man_t * p );
148extern void Dch_ManSatSolverRecycle( Dch_Man_t * p );
149/*=== dchSat.c ===================================================*/
150extern int Dch_NodesAreEquiv( Dch_Man_t * p, Aig_Obj_t * pObj1, Aig_Obj_t * pObj2 );
151/*=== dchSim.c ===================================================*/
152extern Dch_Cla_t * Dch_CreateCandEquivClasses( Aig_Man_t * pAig, int nWords, int fVerbose );
153/*=== dchSimSat.c ===================================================*/
154extern void Dch_ManResimulateCex( Dch_Man_t * p, Aig_Obj_t * pObj, Aig_Obj_t * pRepr );
155extern void Dch_ManResimulateCex2( Dch_Man_t * p, Aig_Obj_t * pObj, Aig_Obj_t * pRepr );
156/*=== dchSweep.c ===================================================*/
157extern void Dch_ManSweep( Dch_Man_t * p );
158
159
160
162
163
164
165#endif
166
170
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 ///.
struct Aig_Obj_t_ Aig_Obj_t
Definition aig.h:51
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Definition aig.h:50
#define sat_solver
Definition cecSatG2.c:34
Aig_Obj_t ** Dch_ClassesReadClass(Dch_Cla_t *p, Aig_Obj_t *pRepr, int *pnSize)
Definition dchClass.c:222
Aig_Man_t * Dch_DeriveChoiceAig(Aig_Man_t *pAig, int fSkipRedSupps)
Definition dchChoice.c:524
Dch_Man_t * Dch_ManCreate(Aig_Man_t *pAig, Dch_Pars_t *pPars)
DECLARATIONS ///.
Definition dchMan.c:45
void Dch_ClassesPrepare(Dch_Cla_t *p, int fLatchCorr, int nMaxLevs)
Definition dchClass.c:336
struct Dch_Man_t_ Dch_Man_t
Definition dchInt.h:50
void Dch_ClassesCollectConst1Group(Dch_Cla_t *p, Aig_Obj_t *pObj, int nNodes, Vec_Ptr_t *vRoots)
Definition dchClass.c:546
void Dch_ManResimulateCex(Dch_Man_t *p, Aig_Obj_t *pObj, Aig_Obj_t *pRepr)
Definition dchSimSat.c:177
void Dch_ManResimulateCex2(Dch_Man_t *p, Aig_Obj_t *pObj, Aig_Obj_t *pRepr)
Definition dchSimSat.c:225
void Dch_ManStop(Dch_Man_t *p)
Definition dchMan.c:122
void Dch_ManSweep(Dch_Man_t *p)
Definition dchSweep.c:106
Dch_Cla_t * Dch_CreateCandEquivClasses(Aig_Man_t *pAig, int nWords, int fVerbose)
Definition dchSim.c:264
void Dch_ClassesStop(Dch_Cla_t *p)
Definition dchClass.c:185
typedefABC_NAMESPACE_HEADER_START struct Dch_Cla_t_ Dch_Cla_t
INCLUDES ///.
Definition dchInt.h:47
int Dch_DeriveChoiceCountEquivs(Aig_Man_t *pAig)
Definition dchChoice.c:89
int Dch_ClassesRefineConst1Group(Dch_Cla_t *p, Vec_Ptr_t *vRoots, int fRecursive)
Definition dchClass.c:570
int Dch_ClassesRefineOneClass(Dch_Cla_t *p, Aig_Obj_t *pRepr, int fRecursive)
Definition dchClass.c:443
int Dch_NodesAreEquiv(Dch_Man_t *p, Aig_Obj_t *pObj1, Aig_Obj_t *pObj2)
DECLARATIONS ///.
Definition dchSat.c:45
int Dch_DeriveChoiceCountReprs(Aig_Man_t *pAig)
FUNCTION DECLARATIONS ///.
Definition dchChoice.c:75
int Dch_ClassesRefine(Dch_Cla_t *p)
Definition dchClass.c:504
void Dch_ClassesPrint(Dch_Cla_t *p, int fVeryVerbose)
Definition dchClass.c:303
void Dch_ManSatSolverRecycle(Dch_Man_t *p)
Definition dchMan.c:153
void Dch_CnfNodeAddToSolver(Dch_Man_t *p, Aig_Obj_t *pObj)
Definition dchCnf.c:287
void Dch_ClassesCollectOneClass(Dch_Cla_t *p, Aig_Obj_t *pRepr, Vec_Ptr_t *vRoots)
Definition dchClass.c:525
int Dch_ClassesLitNum(Dch_Cla_t *p)
Definition dchClass.c:206
void Dch_ClassesSetData(Dch_Cla_t *p, void *pManData, unsigned(*pFuncNodeHash)(void *, Aig_Obj_t *), int(*pFuncNodeIsConst)(void *, Aig_Obj_t *), int(*pFuncNodesAreEqual)(void *, Aig_Obj_t *, Aig_Obj_t *))
Definition dchClass.c:163
Dch_Cla_t * Dch_ClassesStart(Aig_Man_t *pAig)
Definition dchClass.c:137
typedefABC_NAMESPACE_HEADER_START struct Dch_Pars_t_ Dch_Pars_t
INCLUDES ///.
Definition dch.h:43
Cube * p
Definition exorList.c:222
int Id
Definition aig.h:85
void * pData
Definition aig.h:87
abctime timeOther
Definition dchInt.h:94
Vec_Ptr_t * vFanins
Definition dchInt.h:69
Dch_Pars_t * pPars
Definition dchInt.h:54
int nSatFailsReal
Definition dchInt.h:78
int nReprs
Definition dchInt.h:83
int nLits
Definition dchInt.h:82
Vec_Ptr_t * vSimClasses
Definition dchInt.h:71
int nConeThis
Definition dchInt.h:73
int nRecycles
Definition dchInt.h:67
Vec_Ptr_t * vUsedNodes
Definition dchInt.h:66
sat_solver * pSat
Definition dchInt.h:63
int nSatProof
Definition dchInt.h:77
Dch_Cla_t * ppClasses
Definition dchInt.h:60
abctime timeSat
Definition dchInt.h:89
abctime timeSimSat
Definition dchInt.h:88
int * pSatVars
Definition dchInt.h:65
int nSatCallsUnsat
Definition dchInt.h:79
Vec_Ptr_t * vSimRoots
Definition dchInt.h:70
Aig_Man_t * pAigTotal
Definition dchInt.h:57
int nConeMax
Definition dchInt.h:74
Aig_Obj_t ** pReprsProved
Definition dchInt.h:61
abctime timeSimInit
Definition dchInt.h:87
int nSatCallsSat
Definition dchInt.h:80
int nChoices
Definition dchInt.h:85
abctime timeTotal
Definition dchInt.h:95
int nCallsSince
Definition dchInt.h:68
abctime timeSatUndec
Definition dchInt.h:92
int nEquivs
Definition dchInt.h:84
abctime timeSatSat
Definition dchInt.h:90
Aig_Man_t * pAigFraig
Definition dchInt.h:58
int nSatCalls
Definition dchInt.h:76
int nSatVars
Definition dchInt.h:64
abctime timeChoice
Definition dchInt.h:93
abctime timeSatUnsat
Definition dchInt.h:91
#define assert(ex)
Definition util_old.h:213
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition vecPtr.h:42