cec.h 11.3 KB
Newer Older
Alan Mishchenko committed
1 2 3 4 5 6
/**CFile****************************************************************

  FileName    [cec.h]

  SystemName  [ABC: Logic synthesis and verification system.]

Alan Mishchenko committed
7
  PackageName [Combinational equivalence checking.]
Alan Mishchenko committed
8 9 10 11 12 13 14 15 16 17 18 19 20

  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 $]

***********************************************************************/
 
21 22
#ifndef ABC__aig__cec__cec_h
#define ABC__aig__cec__cec_h
Alan Mishchenko committed
23

24

Alan Mishchenko committed
25 26 27 28 29 30 31 32
////////////////////////////////////////////////////////////////////////
///                          INCLUDES                                ///
////////////////////////////////////////////////////////////////////////

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

33 34 35 36


ABC_NAMESPACE_HEADER_START

Alan Mishchenko committed
37

Alan Mishchenko committed
38 39 40 41 42 43 44 45 46 47 48
////////////////////////////////////////////////////////////////////////
///                         BASIC TYPES                              ///
////////////////////////////////////////////////////////////////////////

// dynamic SAT parameters
typedef struct Cec_ParSat_t_ Cec_ParSat_t;
struct Cec_ParSat_t_
{
    int              nBTLimit;      // conflict limit at a node
    int              nSatVarMax;    // the max number of SAT variables
    int              nCallsRecycle; // calls to perform before recycling SAT solver
Alan Mishchenko committed
49
    int              fNonChrono;    // use non-chronological backtracling (for circuit SAT only)
Alan Mishchenko committed
50
    int              fPolarFlip;    // flops polarity of variables
Alan Mishchenko committed
51
    int              fCheckMiter;   // the circuit is the miter
Alan Mishchenko committed
52
//    int              fFirstStop;    // stop on the first sat output
Alan Mishchenko committed
53
    int              fLearnCls;     // perform clause learning
Alan Mishchenko committed
54 55 56
    int              fVerbose;      // verbose stats
};

Alan Mishchenko committed
57 58
// simulation parameters
typedef struct Cec_ParSim_t_ Cec_ParSim_t;
Alan Mishchenko committed
59
struct Cec_ParSim_t_ 
Alan Mishchenko committed
60 61
{
    int              nWords;        // the number of simulation words
Alan Mishchenko committed
62
    int              nFrames;       // the number of simulation frames
Alan Mishchenko committed
63
    int              nRounds;       // the number of simulation rounds
Alan Mishchenko committed
64
    int              nNonRefines;   // the max number of rounds without refinement
Alan Mishchenko committed
65
    int              TimeLimit;     // the runtime limit in seconds
Alan Mishchenko committed
66
    int              fDualOut;      // miter with separate outputs
Alan Mishchenko committed
67
    int              fCheckMiter;   // the circuit is the miter
Alan Mishchenko committed
68
//    int              fFirstStop;    // stop on the first sat output
Alan Mishchenko committed
69
    int              fSeqSimulate;  // performs sequential simulation
Alan Mishchenko committed
70
    int              fLatchCorr;    // consider only latch outputs
71
    int              fConstCorr;    // consider only constants
Alan Mishchenko committed
72 73 74 75
    int              fVeryVerbose;  // verbose stats
    int              fVerbose;      // verbose stats
};

Alan Mishchenko committed
76 77 78 79 80 81
// semiformal parameters
typedef struct Cec_ParSmf_t_ Cec_ParSmf_t;
struct Cec_ParSmf_t_
{
    int              nWords;        // the number of simulation words
    int              nRounds;       // the number of simulation rounds
Alan Mishchenko committed
82 83 84
    int              nFrames;       // the max number of time frames
    int              nNonRefines;   // the max number of rounds without refinement
    int              nMinOutputs;   // the min outputs to accumulate
Alan Mishchenko committed
85 86 87 88
    int              nBTLimit;      // conflict limit at a node
    int              TimeLimit;     // the runtime limit in seconds
    int              fDualOut;      // miter with separate outputs
    int              fCheckMiter;   // the circuit is the miter
Alan Mishchenko committed
89
//    int              fFirstStop;    // stop on the first sat output
Alan Mishchenko committed
90 91 92
    int              fVerbose;      // verbose stats
};

Alan Mishchenko committed
93
// combinational SAT sweeping parameters
Alan Mishchenko committed
94 95
typedef struct Cec_ParFra_t_ Cec_ParFra_t;
struct Cec_ParFra_t_
Alan Mishchenko committed
96 97 98
{
    int              nWords;        // the number of simulation words
    int              nRounds;       // the number of simulation rounds
Alan Mishchenko committed
99 100
    int              nItersMax;     // the maximum number of iterations of SAT sweeping
    int              nBTLimit;      // conflict limit at a node
Alan Mishchenko committed
101
    int              TimeLimit;     // the runtime limit in seconds
Alan Mishchenko committed
102 103
    int              nLevelMax;     // restriction on the level nodes to be swept
    int              nDepthMax;     // the depth in terms of steps of speculative reduction
Alan Mishchenko committed
104
    int              fRewriting;    // enables AIG rewriting
Alan Mishchenko committed
105
    int              fCheckMiter;   // the circuit is the miter
Alan Mishchenko committed
106
//    int              fFirstStop;    // stop on the first sat output
Alan Mishchenko committed
107
    int              fDualOut;      // miter with separate outputs
Alan Mishchenko committed
108
    int              fColorDiff;    // miter with separate outputs
109
    int              fSatSweeping;  // enable SAT sweeping
110
    int              fRunCSat;      // enable another solver
Alan Mishchenko committed
111
    int              fVeryVerbose;  // verbose stats
Alan Mishchenko committed
112
    int              fVerbose;      // verbose stats
113
    int              iOutFail;      // the failed output
Alan Mishchenko committed
114 115 116 117 118 119
};

// combinational equivalence checking parameters
typedef struct Cec_ParCec_t_ Cec_ParCec_t;
struct Cec_ParCec_t_
{
Alan Mishchenko committed
120 121
    int              nBTLimit;      // conflict limit at a node
    int              TimeLimit;     // the runtime limit in seconds
Alan Mishchenko committed
122
//    int              fFirstStop;    // stop on the first sat output
Alan Mishchenko committed
123 124
    int              fUseSmartCnf;  // use smart CNF computation
    int              fRewriting;    // enables AIG rewriting
125
    int              fNaive;        // performs naive SAT-based checking
126
    int              fSilent;       // print no messages
Alan Mishchenko committed
127
    int              fVeryVerbose;  // verbose stats
Alan Mishchenko committed
128
    int              fVerbose;      // verbose stats
129
    int              iOutFail;      // the number of failed output
Alan Mishchenko committed
130 131
};

Alan Mishchenko committed
132 133 134 135 136 137 138
// sequential register correspodence parameters
typedef struct Cec_ParCor_t_ Cec_ParCor_t;
struct Cec_ParCor_t_
{
    int              nWords;        // the number of simulation words
    int              nRounds;       // the number of simulation rounds
    int              nFrames;       // the number of time frames
Alan Mishchenko committed
139
    int              nPrefix;       // the number of time frames in the prefix
Alan Mishchenko committed
140
    int              nBTLimit;      // conflict limit at a node
141 142
    int              nLevelMax;     // (scorr only) the max number of levels
    int              nStepsMax;     // (scorr only) the max number of induction steps
Alan Mishchenko committed
143
    int              fLatchCorr;    // consider only latch outputs
144
    int              fConstCorr;    // consider only constants
Alan Mishchenko committed
145
    int              fUseRings;     // use rings
Alan Mishchenko committed
146
    int              fMakeChoices;  // use equilvaences as choices
Alan Mishchenko committed
147
    int              fUseCSat;      // use circuit-based solver
Alan Mishchenko committed
148
//    int              fFirstStop;    // stop on the first sat output
Alan Mishchenko committed
149
    int              fUseSmartCnf;  // use smart CNF computation
150
    int              fStopWhenGone; // quit when PO is not a candidate constant
Alan Mishchenko committed
151
    int              fVerboseFlops; // verbose stats
Alan Mishchenko committed
152 153
    int              fVeryVerbose;  // verbose stats
    int              fVerbose;      // verbose stats
154 155 156
    // callback
    void *           pData;
    void *           pFunc;
Alan Mishchenko committed
157 158 159 160 161 162 163 164 165
};

// sequential register correspodence parameters
typedef struct Cec_ParChc_t_ Cec_ParChc_t;
struct Cec_ParChc_t_
{
    int              nWords;        // the number of simulation words
    int              nRounds;       // the number of simulation rounds
    int              nBTLimit;      // conflict limit at a node
Alan Mishchenko committed
166 167
    int              fUseRings;     // use rings
    int              fUseCSat;      // use circuit-based solver
Alan Mishchenko committed
168 169 170 171
    int              fVeryVerbose;  // verbose stats
    int              fVerbose;      // verbose stats
};

172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188
// sequential synthesis parameters
typedef struct Cec_ParSeq_t_ Cec_ParSeq_t;
struct Cec_ParSeq_t_
{
    int              fUseLcorr;     // enables latch correspondence
    int              fUseScorr;     // enables signal correspondence
    int              nBTLimit;      // (scorr/lcorr) conflict limit at a node
    int              nFrames;       // (scorr/lcorr) the number of timeframes
    int              nLevelMax;     // (scorr only) the max number of levels
    int              fConsts;       // (scl only) merging constants
    int              fEquivs;       // (scl only) merging equivalences
    int              fUseMiniSat;   // enables MiniSat in lcorr/scorr
    int              nMinDomSize;   // the size of minimum clock domain
    int              fVeryVerbose;  // verbose stats
    int              fVerbose;      // verbose stats
};

Alan Mishchenko committed
189 190 191 192 193 194 195 196
////////////////////////////////////////////////////////////////////////
///                      MACRO DEFINITIONS                           ///
////////////////////////////////////////////////////////////////////////

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

Alan Mishchenko committed
197 198 199
/*=== cecCec.c ==========================================================*/
extern int           Cec_ManVerify( Gia_Man_t * p, Cec_ParCec_t * pPars );
extern int           Cec_ManVerifyTwo( Gia_Man_t * p0, Gia_Man_t * p1, int fVerbose );
200
extern int           Cec_ManVerifySimple( Gia_Man_t * p );
Alan Mishchenko committed
201 202 203
/*=== cecChoice.c ==========================================================*/
extern Gia_Man_t *   Cec_ManChoiceComputation( Gia_Man_t * pAig, Cec_ParChc_t * pPars );
/*=== cecCorr.c ==========================================================*/
204
extern int           Cec_ManLSCorrespondenceClasses( Gia_Man_t * pAig, Cec_ParCor_t * pPars );
Alan Mishchenko committed
205
extern Gia_Man_t *   Cec_ManLSCorrespondence( Gia_Man_t * pAig, Cec_ParCor_t * pPars );
Alan Mishchenko committed
206 207
/*=== cecCore.c ==========================================================*/
extern void          Cec_ManSatSetDefaultParams( Cec_ParSat_t * p );
Alan Mishchenko committed
208
extern void          Cec_ManSimSetDefaultParams( Cec_ParSim_t * p );
Alan Mishchenko committed
209
extern void          Cec_ManSmfSetDefaultParams( Cec_ParSmf_t * p );
Alan Mishchenko committed
210
extern void          Cec_ManFraSetDefaultParams( Cec_ParFra_t * p );
Alan Mishchenko committed
211
extern void          Cec_ManCecSetDefaultParams( Cec_ParCec_t * p );
Alan Mishchenko committed
212 213
extern void          Cec_ManCorSetDefaultParams( Cec_ParCor_t * p );
extern void          Cec_ManChcSetDefaultParams( Cec_ParChc_t * p );
214
extern Gia_Man_t *   Cec_ManSatSweeping( Gia_Man_t * pAig, Cec_ParFra_t * pPars, int fSilent );
Alan Mishchenko committed
215
extern Gia_Man_t *   Cec_ManSatSolving( Gia_Man_t * pAig, Cec_ParSat_t * pPars );
Alan Mishchenko committed
216
extern void          Cec_ManSimulation( Gia_Man_t * pAig, Cec_ParSim_t * pPars );
Alan Mishchenko committed
217
/*=== cecSeq.c ==========================================================*/
218
extern int           Cec_ManSeqResimulateCounter( Gia_Man_t * pAig, Cec_ParSim_t * pPars, Abc_Cex_t * pCex );
Alan Mishchenko committed
219
extern int           Cec_ManSeqSemiformal( Gia_Man_t * pAig, Cec_ParSmf_t * pPars );
220 221 222 223 224 225 226 227 228 229 230
extern int           Cec_ManCheckNonTrivialCands( Gia_Man_t * pAig );
/*=== cecSynth.c ==========================================================*/
extern int           Cec_SeqReadMinDomSize( Cec_ParSeq_t * p );
extern int           Cec_SeqReadVerbose( Cec_ParSeq_t * p );
extern void          Cec_SeqSynthesisSetDefaultParams( Cec_ParSeq_t * pPars );
extern int           Cec_SequentialSynthesisPart( Gia_Man_t * p, Cec_ParSeq_t * pPars );



ABC_NAMESPACE_HEADER_END

Alan Mishchenko committed
231 232 233 234 235 236 237 238


#endif

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