bmc.h 10.9 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
/**CFile****************************************************************

  FileName    [bmc.h]

  SystemName  [ABC: Logic synthesis and verification system.]

  PackageName [SAT-based bounded model checking.]

  Synopsis    [External declarations.]

  Author      [Alan Mishchenko]
  
  Affiliation [UC Berkeley]

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

  Revision    [$Id: bmc.h,v 1.00 2005/06/20 00:00:00 alanmi Exp $]

***********************************************************************/
 
#ifndef ABC___sat_bmc_BMC_h
#define ABC___sat_bmc_BMC_h


////////////////////////////////////////////////////////////////////////
///                          INCLUDES                                ///
////////////////////////////////////////////////////////////////////////

#include "aig/saig/saig.h"
30
#include "aig/gia/gia.h"
31 32 33 34 35 36 37

////////////////////////////////////////////////////////////////////////
///                         PARAMETERS                               ///
////////////////////////////////////////////////////////////////////////

ABC_NAMESPACE_HEADER_START

38 39
//#define USE_NODE_ORDER 1

40 41 42
////////////////////////////////////////////////////////////////////////
///                         BASIC TYPES                              ///
////////////////////////////////////////////////////////////////////////
43

44 45 46 47 48 49 50 51 52

// exact synthesis parameters

typedef struct Bmc_EsPar_t_ Bmc_EsPar_t;
struct Bmc_EsPar_t_
{
    int        nVars; 
    int        nNodes;
    int        nLutSize;
53 54
    int        nMajSupp;
    int        fMajority;
55
    int        fUseIncr;
56
    int        fOnlyAnd;
57 58
    int        fGlucose;
    int        fOrderNodes;
59
    int        fEnumSols;
60
    int        fFewerVars;
61
    int        RuntimeLim;
62 63 64 65 66 67
    int        fVerbose; 
    char *     pTtStr;
};

static inline void Bmc_EsParSetDefault( Bmc_EsPar_t * pPars )
{
68 69 70 71 72 73
    memset( pPars, 0, sizeof(Bmc_EsPar_t) );
    pPars->nVars       = 0; 
    pPars->nNodes      = 0; 
    pPars->nLutSize    = 2; 
    pPars->nMajSupp    = 0;
    pPars->fMajority   = 0; 
74
    pPars->fUseIncr    = 0;
75 76 77
    pPars->fOnlyAnd    = 0; 
    pPars->fGlucose    = 0; 
    pPars->fOrderNodes = 0; 
78
    pPars->fEnumSols   = 0; 
79
    pPars->fFewerVars  = 0; 
80
    pPars->RuntimeLim  = 0;
81
    pPars->fVerbose    = 1; 
82 83 84
}


85 86 87
// unrolling manager 
typedef struct Unr_Man_t_ Unr_Man_t;

88 89 90 91 92 93 94 95 96
typedef struct Saig_ParBmc_t_ Saig_ParBmc_t;
struct Saig_ParBmc_t_
{
    int         nStart;         // starting timeframe
    int         nFramesMax;     // maximum number of timeframes 
    int         nConfLimit;     // maximum number of conflicts at a node
    int         nConfLimitJump; // maximum number of conflicts after jumping
    int         nFramesJump;    // the number of tiemframes to jump
    int         nTimeOut;       // approximate timeout in seconds
97
    int         nTimeOutGap;    // approximate timeout in seconds since the last change
98
    int         nTimeOutOne;    // timeout per output in multi-output solving
99 100
    int         nPisAbstract;   // the number of PIs to abstract
    int         fSolveAll;      // does not stop at the first SAT output
101
    int         fStoreCex;      // enable storing CEXes in the MO mode
102
    int         fUseBridge;     // use bridge interface
103 104 105
    int         fDropSatOuts;   // replace sat outputs by constant 0
    int         nFfToAddMax;    // max number of flops to add during CBA
    int         fSkipRand;      // skip random decisions
106
    int         fNoRestarts;    // disables periodic restarts
107
    int         fUseSatoko;     // enables using Satoko
108
    int         fUseGlucose;    // enables using Glucose 3.0
109 110 111
    int         nLearnedStart;  // starting learned clause limit
    int         nLearnedDelta;  // delta of learned clause limit
    int         nLearnedPerce;  // ratio of learned clause limit
112
    int         fVerbose;       // verbose 
113
    int         fNotVerbose;    // skip line-by-line print-out 
114
    char *      pLogFileName;   // log file name
115
    int         fSilent;        // completely silent
116 117
    int         iFrame;         // explored up to this frame
    int         nFailOuts;      // the number of failed outputs
118
    int         nDropOuts;      // the number of dropped outputs
119
    abctime     timeLastSolved; // the time when the last output was solved
120
    int(*pFuncOnFail)(int,Abc_Cex_t*); // called for a failed output in MO mode
Yen-Sheng Ho committed
121 122
    int         RunId;          // BMC id in this run 
    int(*pFuncStop)(int);       // callback to terminate
123 124
};

125
 
126 127
typedef struct Bmc_AndPar_t_ Bmc_AndPar_t;
struct Bmc_AndPar_t_
128 129 130
{
    int         nStart;         // starting timeframe
    int         nFramesMax;     // maximum number of timeframes 
131
    int         nFramesAdd;     // the number of additional frames
132
    int         nConfLimit;     // maximum number of conflicts at a node
Alan Mishchenko committed
133
    int         nTimeOut;       // timeout in seconds
134
    int         nLutSize;       // LUT size for cut computation
135
    int         nProcs;         // the number of parallel solvers
136
    int         fLoadCnf;       // dynamic CNF loading
137
    int         fDumpFrames;    // dump unrolled timeframes
138
    int         fUseSynth;      // use synthesis
Alan Mishchenko committed
139
    int         fUseOldCnf;     // use old CNF construction
140
    int         fUseGlucose;    // use Glucose 3.0 as the default solver
141
    int         fUseEliminate;  // use variable elimination
142
    int         fVerbose;       // verbose 
143
    int         fVeryVerbose;   // very verbose 
144 145 146 147
    int         fNotVerbose;    // skip line-by-line print-out 
    int         iFrame;         // explored up to this frame
    int         nFailOuts;      // the number of failed outputs
    int         nDropOuts;      // the number of dropped outputs
148 149
    
    void (*pFuncOnFrameDone)(int, int, int); // callback on each frame status (frame, po, statuss)
150
};
151 152 153 154 155 156 157 158 159 160 161 162
  
typedef struct Bmc_BCorePar_t_ Bmc_BCorePar_t;
struct Bmc_BCorePar_t_
{
    int         iFrame;         // timeframe
    int         iOutput;        // property output
    int         nTimeOut;       // timeout in seconds
    char *      pFilePivots;    // file name with AIG IDs of pivot objects
    char *      pFileProof;     // file name to write the resulting proof
    int         fVerbose;       // verbose output
};

163 164 165 166 167 168
typedef struct Bmc_MulPar_t_ Bmc_MulPar_t;
struct Bmc_MulPar_t_
{
    int         TimeOutGlo;
    int         TimeOutLoc;
    int         TimeOutInc;
169
    int         TimeOutGap;
170
    int         TimePerOut;
171 172 173 174 175
    int         fUseSyn;
    int         fDumpFinal;
    int         fVerbose;
    int         fVeryVerbose;
};
176

177 178 179 180 181 182 183 184 185
typedef struct Bmc_ParFf_t_ Bmc_ParFf_t;
struct Bmc_ParFf_t_
{
    char *     pFileName;
    char *     pFormStr;
    int        Algo;
    int        fComplVars;
    int        fStartPats;
    int        nTimeOut;
186
    int        nIterCheck;
187 188
    int        nCardConstr;
    int        fNonStrict;
189
    int        fBasic;
190
    int        fFfOnly;
191
    int        fCheckUntest;
192
    int        fDump;
193
    int        fDumpDelay;
194
    int        fDumpUntest;
195
    int        fDumpNewFaults;
196 197 198
    int        fVerbose;
};

199 200 201 202 203 204 205 206
////////////////////////////////////////////////////////////////////////
///                      MACRO DEFINITIONS                           ///
////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////
///                    FUNCTION DECLARATIONS                         ///
////////////////////////////////////////////////////////////////////////

207 208
/*=== bmcBCore.c ==========================================================*/
extern void              Bmc_ManBCorePerform( Gia_Man_t * pGia, Bmc_BCorePar_t * pPars );
209
/*=== bmcBmc.c ==========================================================*/
210
extern int               Saig_ManBmcSimple( Aig_Man_t * pAig, int nFrames, int nSizeMax, int nBTLimit, int fRewrite, int fVerbose, int * piFrame, int nCofFanLit, int fUseSatoko );
211
/*=== bmcBmc2.c ==========================================================*/
212
extern int               Saig_BmcPerform( Aig_Man_t * pAig, int nStart, int nFramesMax, int nNodesMax, int nTimeOut, int nConfMaxOne, int nConfMaxAll, int fVerbose, int fVerbOverwrite, int * piFrames, int fSilent, int fUseSatoko );
213
/*=== bmcBmc3.c ==========================================================*/
214 215
extern void              Saig_ParBmcSetDefaultParams( Saig_ParBmc_t * p );
extern int               Saig_ManBmcScalable( Aig_Man_t * pAig, Saig_ParBmc_t * pPars );
216 217
/*=== bmcBmcAnd.c ==========================================================*/
extern int               Gia_ManBmcPerform( Gia_Man_t * p, Bmc_AndPar_t * pPars );
218
/*=== bmcCexCare.c ==========================================================*/
219
extern Abc_Cex_t *       Bmc_CexCareExtendToObjects( Gia_Man_t * p, Abc_Cex_t * pCex, Abc_Cex_t * pCexCare );
220 221
extern Abc_Cex_t *       Bmc_CexCareMinimize( Aig_Man_t * p, int nRealPis, Abc_Cex_t * pCex, int nTryCexes, int fCheck, int fVerbose );
extern Abc_Cex_t *       Bmc_CexCareMinimizeAig( Gia_Man_t * p, int nRealPis, Abc_Cex_t * pCex, int nTryCexes, int fCheck, int fVerbose );
222
extern void              Bmc_CexCareVerify( Aig_Man_t * p, Abc_Cex_t * pCex, Abc_Cex_t * pCexMin, int fVerbose );
223 224
extern Abc_Cex_t *       Bmc_CexCareSatBasedMinimize( Aig_Man_t * p, int nRealPis, Abc_Cex_t * pCex, int fHighEffort, int fCheck, int fVerbose );
extern Abc_Cex_t *       Bmc_CexCareSatBasedMinimizeAig( Gia_Man_t * p, Abc_Cex_t * pCex, int fHighEffort, int fVerbose );
225
/*=== bmcCexCut.c ==========================================================*/
226 227
extern Gia_Man_t *       Bmc_GiaTargetStates( Gia_Man_t * p, Abc_Cex_t * pCex, int iFrBeg, int iFrEnd, int fCombOnly, int fGenAll, int fAllFrames, int fVerbose );
extern Aig_Man_t *       Bmc_AigTargetStates( Aig_Man_t * p, Abc_Cex_t * pCex, int iFrBeg, int iFrEnd, int fCombOnly, int fGenAll, int fAllFrames, int fVerbose );
228
/*=== bmcCexMin.c ==========================================================*/
229
extern Abc_Cex_t *       Saig_ManCexMinPerform( Aig_Man_t * pAig, Abc_Cex_t * pCex );
230
/*=== bmcCexTool.c ==========================================================*/
231
extern void              Bmc_CexPrint( Abc_Cex_t * pCex, int nRealPis, int fVerbose );
232
extern int               Bmc_CexVerify( Gia_Man_t * p, Abc_Cex_t * pCex, Abc_Cex_t * pCexCare );
233
/*=== bmcICheck.c ==========================================================*/
234
extern void              Bmc_PerformICheck( Gia_Man_t * p, int nFramesMax, int nTimeOut, int fEmpty, int fVerbose );
235
extern Vec_Int_t *       Bmc_PerformISearch( Gia_Man_t * p, int nFramesMax, int nTimeOut, int fReverse, int fBackTopo, int fDump, int fVerbose );
236 237 238 239
/*=== bmcUnroll.c ==========================================================*/
extern Unr_Man_t *       Unr_ManUnrollStart( Gia_Man_t * pGia, int fVerbose );
extern Gia_Man_t *       Unr_ManUnrollFrame( Unr_Man_t * p, int f );
extern void              Unr_ManFree( Unr_Man_t * p );
240 241 242 243 244 245 246 247 248 249 250 251


ABC_NAMESPACE_HEADER_END



#endif

////////////////////////////////////////////////////////////////////////
///                       END OF FILE                                ///
////////////////////////////////////////////////////////////////////////