abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
mfsInt.h
Go to the documentation of this file.
1 /**CFile****************************************************************
2 
3  FileName [mfsInt.h]
4 
5  SystemName [ABC: Logic synthesis and verification system.]
6 
7  PackageName [The good old minimization with complete don't-cares.]
8 
9  Synopsis [Internal declarations.]
10 
11  Author [Alan Mishchenko]
12 
13  Affiliation [UC Berkeley]
14 
15  Date [Ver. 1.0. Started - June 20, 2005.]
16 
17  Revision [$Id: mfsInt.h,v 1.00 2005/06/20 00:00:00 alanmi Exp $]
18 
19 ***********************************************************************/
20 
21 #ifndef ABC__opt__mfs__mfsInt_h
22 #define ABC__opt__mfs__mfsInt_h
23 
24 
25 ////////////////////////////////////////////////////////////////////////
26 /// INCLUDES ///
27 ////////////////////////////////////////////////////////////////////////
28 
29 #include "base/abc/abc.h"
30 #include "mfs.h"
31 #include "aig/aig/aig.h"
32 #include "sat/cnf/cnf.h"
33 #include "sat/bsat/satSolver.h"
34 #include "sat/bsat/satStore.h"
35 #include "bool/bdc/bdc.h"
36 #include "aig/gia/gia.h"
37 
38 ////////////////////////////////////////////////////////////////////////
39 /// PARAMETERS ///
40 ////////////////////////////////////////////////////////////////////////
41 
42 
43 
45 
46 
47 #define MFS_FANIN_MAX 12
48 
49 typedef struct Mfs_Man_t_ Mfs_Man_t;
50 struct Mfs_Man_t_
51 {
52  // input data
57  int nFaninMax;
58  // intermeditate data for the node
59  Vec_Ptr_t * vRoots; // the roots of the window
60  Vec_Ptr_t * vSupp; // the support of the window
61  Vec_Ptr_t * vNodes; // the internal nodes of the window
62  Vec_Ptr_t * vDivs; // the divisors of the node
63  Vec_Int_t * vDivLits; // the SAT literals of divisor nodes
64  Vec_Int_t * vProjVarsCnf; // the projection variables
65  Vec_Int_t * vProjVarsSat; // the projection variables
66  // intermediate simulation data
67  Vec_Ptr_t * vDivCexes; // the counter-example for dividors
68  int nDivWords; // the number of words
69  int nCexes; // the numbe rof current counter-examples
70  int nSatCalls;
71  int nSatCexes;
72 /*
73  // intermediate AIG data
74  Gia_Man_t * pGia; // replica of the AIG in the new package
75 // Gia_Obj_t ** pSat2Gia; // mapping of PO SAT var into internal GIA nodes
76  Tas_Man_t * pTas; // the SAT solver
77  Vec_Int_t * vCex; // the counter-example
78  Vec_Ptr_t * vGiaLits; // literals given as assumptions
79 */
80  // used for bidecomposition
83  int nNodesDec;
86  // solving data
87  Aig_Man_t * pAigWin; // window AIG with constraints
88  Cnf_Dat_t * pCnf; // the CNF for the window
89  sat_solver * pSat; // the SAT solver used
90  Int_Man_t * pMan; // interpolation manager;
91  Vec_Int_t * vMem; // memory for intermediate SOPs
92  Vec_Vec_t * vLevels; // levelized structure for updating
93  Vec_Ptr_t * vMfsFanins; // the new set of fanins
94  int nTotConfLim; // total conflict limit
95  int nTotConfLevel; // total conflicts on this level
96  // switching activity
98  // the result of solving
99  int nFanins; // the number of fanins
100  int nWords; // the number of words
101  int nCares; // the number of care minterms
102  unsigned uCare[(MFS_FANIN_MAX<=5)?1:1<<(MFS_FANIN_MAX-5)]; // the computed care-set
103  // performance statistics
104  int nTryRemoves; // number of fanin removals
105  int nTryResubs; // number of resubstitutions
106  int nRemoves; // number of fanin removals
107  int nResubs; // number of resubstitutions
116  int nDcMints;
117  int nMaxDivs;
118  double dTotalRatios;
119  // node/edge stats
126  // statistics
135 };
136 
137 static inline float Abc_MfsObjProb( Mfs_Man_t * p, Abc_Obj_t * pObj ) { return (p->vProbs && pObj->Id < Vec_IntSize(p->vProbs))? Abc_Int2Float(Vec_IntEntry(p->vProbs,pObj->Id)) : 0.0; }
138 
139 ////////////////////////////////////////////////////////////////////////
140 /// BASIC TYPES ///
141 ////////////////////////////////////////////////////////////////////////
142 
143 ////////////////////////////////////////////////////////////////////////
144 /// MACRO DEFINITIONS ///
145 ////////////////////////////////////////////////////////////////////////
146 
147 ////////////////////////////////////////////////////////////////////////
148 /// FUNCTION DECLARATIONS ///
149 ////////////////////////////////////////////////////////////////////////
150 
151 /*=== mfsDiv.c ==========================================================*/
152 extern Vec_Ptr_t * Abc_MfsComputeDivisors( Mfs_Man_t * p, Abc_Obj_t * pNode, int nLevDivMax );
153 /*=== mfsInter.c ==========================================================*/
154 extern sat_solver * Abc_MfsCreateSolverResub( Mfs_Man_t * p, int * pCands, int nCands, int fInvert );
155 extern Hop_Obj_t * Abc_NtkMfsInterplate( Mfs_Man_t * p, int * pCands, int nCands );
156 extern int Abc_NtkMfsInterplateEval( Mfs_Man_t * p, int * pCands, int nCands );
157 /*=== mfsMan.c ==========================================================*/
158 extern Mfs_Man_t * Mfs_ManAlloc( Mfs_Par_t * pPars );
159 extern void Mfs_ManStop( Mfs_Man_t * p );
160 extern void Mfs_ManClean( Mfs_Man_t * p );
161 /*=== mfsResub.c ==========================================================*/
162 extern void Abc_NtkMfsPrintResubStats( Mfs_Man_t * p );
163 extern int Abc_NtkMfsEdgeSwapEval( Mfs_Man_t * p, Abc_Obj_t * pNode );
164 extern int Abc_NtkMfsEdgePower( Mfs_Man_t * p, Abc_Obj_t * pNode );
165 extern int Abc_NtkMfsResubNode( Mfs_Man_t * p, Abc_Obj_t * pNode );
166 extern int Abc_NtkMfsResubNode2( Mfs_Man_t * p, Abc_Obj_t * pNode );
167 /*=== mfsSat.c ==========================================================*/
168 extern int Abc_NtkMfsSolveSat( Mfs_Man_t * p, Abc_Obj_t * pNode );
169 extern int Abc_NtkAddOneHotness( Mfs_Man_t * p );
170 /*=== mfsStrash.c ==========================================================*/
171 extern Aig_Man_t * Abc_NtkConstructAig( Mfs_Man_t * p, Abc_Obj_t * pNode );
172 extern double Abc_NtkConstraintRatio( Mfs_Man_t * p, Abc_Obj_t * pNode );
173 /*=== mfsWin.c ==========================================================*/
174 extern Vec_Ptr_t * Abc_MfsComputeRoots( Abc_Obj_t * pNode, int nWinTfoMax, int nFanoutLimit );
175 
176 /*=== mfsGia.c ==========================================================*/
177 extern void Abc_NtkMfsConstructGia( Mfs_Man_t * p );
178 extern void Abc_NtkMfsDeconstructGia( Mfs_Man_t * p );
179 extern int Abc_NtkMfsTryResubOnceGia( Mfs_Man_t * p, int * pCands, int nCands );
180 
181 
182 
184 
185 
186 
187 #endif
188 
189 ////////////////////////////////////////////////////////////////////////
190 /// END OF FILE ///
191 ////////////////////////////////////////////////////////////////////////
192 
Vec_Int_t * vProbs
Definition: mfsInt.h:97
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
int nResubs
Definition: mfsInt.h:107
int nTotalEdgesBeg
Definition: mfsInt.h:122
int nDcMints
Definition: mfsInt.h:116
typedefABC_NAMESPACE_HEADER_START struct Vec_Vec_t_ Vec_Vec_t
INCLUDES ///.
Definition: vecVec.h:42
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Definition: aig.h:50
Vec_Int_t * vProjVarsSat
Definition: mfsInt.h:65
static Llb_Mgr_t * p
Definition: llb3Image.c:950
abctime timeGia
Definition: mfsInt.h:130
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
double Abc_NtkConstraintRatio(Mfs_Man_t *p, Abc_Obj_t *pNode)
Definition: mfsStrash.c:386
Vec_Ptr_t * vSupp
Definition: mfsInt.h:60
int nTotalNodesEnd
Definition: mfsInt.h:121
Vec_Ptr_t * vRoots
Definition: mfsInt.h:59
int nRemoves
Definition: mfsInt.h:106
Mfs_Par_t * pPars
Definition: mfsInt.h:53
int nNodesGainedLevel
Definition: mfsInt.h:85
Int_Man_t * pMan
Definition: mfsInt.h:90
int Abc_NtkMfsResubNode(Mfs_Man_t *p, Abc_Obj_t *pNode)
Definition: mfsResub.c:539
Vec_Ptr_t * Abc_MfsComputeDivisors(Mfs_Man_t *p, Abc_Obj_t *pNode, int nLevDivMax)
BASIC TYPES ///.
Definition: mfsDiv.c:193
abctime timeCnf
Definition: mfsInt.h:131
Bdc_Man_t * pManDec
Definition: mfsInt.h:82
int nMintsCare
Definition: mfsInt.h:110
int nTotConfLim
Definition: mfsInt.h:94
int nNodesGained
Definition: mfsInt.h:84
Vec_Int_t * vMem
Definition: mfsInt.h:91
Definition: cnf.h:56
Definition: hop.h:65
int Abc_NtkMfsInterplateEval(Mfs_Man_t *p, int *pCands, int nCands)
Definition: mfsInter.c:285
abctime timeAig
Definition: mfsInt.h:129
Vec_Ptr_t * vNodes
Definition: mfsInt.h:61
int Abc_NtkMfsTryResubOnceGia(Mfs_Man_t *p, int *pCands, int nCands)
Definition: mfsGia.c:204
Vec_Ptr_t * vDivs
Definition: mfsInt.h:62
Aig_Man_t * pAigWin
Definition: mfsInt.h:87
static float Abc_MfsObjProb(Mfs_Man_t *p, Abc_Obj_t *pObj)
Definition: mfsInt.h:137
int Abc_NtkMfsEdgeSwapEval(Mfs_Man_t *p, Abc_Obj_t *pNode)
Definition: mfsResub.c:488
void Mfs_ManStop(Mfs_Man_t *p)
Definition: mfsMan.c:170
int nNodesBad
Definition: mfsInt.h:112
int Abc_NtkMfsSolveSat(Mfs_Man_t *p, Abc_Obj_t *pNode)
Definition: mfsSat.c:95
Vec_Ptr_t * vSuppsInv
Definition: mfsInt.h:56
void Abc_NtkMfsConstructGia(Mfs_Man_t *p)
Definition: mfsGia.c:120
int Abc_NtkAddOneHotness(Mfs_Man_t *p)
Definition: mfsSat.c:155
int nNodesDec
Definition: mfsInt.h:83
Aig_Man_t * Abc_NtkConstructAig(Mfs_Man_t *p, Abc_Obj_t *pNode)
Definition: mfsStrash.c:233
int nTimeOutsLevel
Definition: mfsInt.h:115
unsigned uCare[(MFS_FANIN_MAX<=5)?1:1<<(MFS_FANIN_MAX-5)]
Definition: mfsInt.h:102
typedefABC_NAMESPACE_HEADER_START struct Mfs_Par_t_ Mfs_Par_t
INCLUDES ///.
Definition: mfs.h:42
static int Vec_IntEntry(Vec_Int_t *p, int i)
Definition: bblif.c:268
abctime timeDiv
Definition: mfsInt.h:128
Hop_Obj_t * Abc_NtkMfsInterplate(Mfs_Man_t *p, int *pCands, int nCands)
Definition: mfsInter.c:329
int nFaninMax
Definition: mfsInt.h:57
double dTotalRatios
Definition: mfsInt.h:118
Vec_Ptr_t * Abc_MfsComputeRoots(Abc_Obj_t *pNode, int nWinTfoMax, int nFanoutLimit)
Definition: mfsWin.c:99
int nFanins
Definition: mfsInt.h:99
#define ABC_NAMESPACE_HEADER_START
NAMESPACES ///.
Definition: abc_global.h:105
int nSatCalls
Definition: mfsInt.h:70
void Abc_NtkMfsPrintResubStats(Mfs_Man_t *p)
Definition: mfsResub.c:72
#define ABC_NAMESPACE_HEADER_END
Definition: abc_global.h:106
int nDivWords
Definition: mfsInt.h:68
abctime timeTotal
Definition: mfsInt.h:134
Vec_Ptr_t * vDivCexes
Definition: mfsInt.h:67
int nNodesTried
Definition: mfsInt.h:108
float TotalSwitchingBeg
Definition: mfsInt.h:124
int nTotConfLevel
Definition: mfsInt.h:95
int nCexes
Definition: mfsInt.h:69
void Abc_NtkMfsDeconstructGia(Mfs_Man_t *p)
Definition: mfsGia.c:150
int nWords
Definition: mfsInt.h:100
abctime timeWin
Definition: mfsInt.h:127
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
int nTryRemoves
Definition: mfsInt.h:104
Mfs_Man_t * Mfs_ManAlloc(Mfs_Par_t *pPars)
DECLARATIONS ///.
Definition: mfsMan.c:45
int Abc_NtkMfsResubNode2(Mfs_Man_t *p, Abc_Obj_t *pNode)
Definition: mfsResub.c:585
int Id
Definition: abc.h:132
int nTotalDivs
Definition: mfsInt.h:113
Abc_Ntk_t * pNtk
Definition: mfsInt.h:54
sat_solver * Abc_MfsCreateSolverResub(Mfs_Man_t *p, int *pCands, int nCands, int fInvert)
Definition: mfsInter.c:88
abctime timeSat
Definition: mfsInt.h:132
int Abc_NtkMfsEdgePower(Mfs_Man_t *p, Abc_Obj_t *pNode)
Definition: mfsResub.c:508
static float Abc_Int2Float(int Num)
Definition: abc_global.h:250
Vec_Ptr_t * vMfsFanins
Definition: mfsInt.h:93
int nSatCexes
Definition: mfsInt.h:71
int nNodesResub
Definition: mfsInt.h:109
abctime timeInt
Definition: mfsInt.h:133
Vec_Int_t * vProjVarsCnf
Definition: mfsInt.h:64
sat_solver * pSat
Definition: mfsInt.h:89
void Mfs_ManClean(Mfs_Man_t *p)
Definition: mfsMan.c:75
int nCares
Definition: mfsInt.h:101
Cnf_Dat_t * pCnf
Definition: mfsInt.h:88
float TotalSwitchingEnd
Definition: mfsInt.h:125
Aig_Man_t * pCare
Definition: mfsInt.h:55
Vec_Vec_t * vLevels
Definition: mfsInt.h:92
ABC_INT64_T abctime
Definition: abc_global.h:278
Vec_Int_t * vTruth
Definition: mfsInt.h:81
Vec_Int_t * vDivLits
Definition: mfsInt.h:63
int nTotalEdgesEnd
Definition: mfsInt.h:123
int nTotalNodesBeg
Definition: mfsInt.h:120
int nMaxDivs
Definition: mfsInt.h:117
int nTryResubs
Definition: mfsInt.h:105
int nMintsTotal
Definition: mfsInt.h:111
#define MFS_FANIN_MAX
INCLUDES ///.
Definition: mfsInt.h:47
int nTimeOuts
Definition: mfsInt.h:114