sbdInt.h 5.61 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 30 31 32 33 34 35 36
/**CFile****************************************************************

  FileName    [rsbInt.h]

  SystemName  [ABC: Logic synthesis and verification system.]

  PackageName [SAT-based optimization using internal don't-cares.]

  Synopsis    [Internal declarations.]

  Author      [Alan Mishchenko]
  
  Affiliation [UC Berkeley]

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

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

***********************************************************************/
 
#ifndef ABC__opt_sbdInt__h
#define ABC__opt_sbdInt__h


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

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>

#include "misc/vec/vec.h"
#include "sat/bsat/satSolver.h"
#include "misc/util/utilNam.h"
37
#include "misc/util/utilTruth.h"
38 39 40 41 42 43 44 45 46 47 48 49 50 51
#include "map/scl/sclLib.h"
#include "map/scl/sclCon.h"
#include "bool/kit/kit.h"
#include "misc/st/st.h"
#include "map/mio/mio.h"
#include "base/abc/abc.h"
#include "sbd.h"

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

ABC_NAMESPACE_HEADER_START

52 53
#define SBD_SAT_UNDEC 0x1234567812345678
#define SBD_SAT_SAT   0x8765432187654321
54

55 56 57 58
#define SBD_LUTS_MAX    2
#define SBD_SIZE_MAX    4
#define SBD_DIV_MAX    10
#define SBD_FVAR_MAX  100
59

60 61 62 63
////////////////////////////////////////////////////////////////////////
///                         BASIC TYPES                              ///
////////////////////////////////////////////////////////////////////////

64
typedef struct Sbd_Sto_t_ Sbd_Sto_t;
65
typedef struct Sbd_Srv_t_ Sbd_Srv_t; 
66

67 68 69 70 71 72
typedef struct Sbd_Str_t_ Sbd_Str_t;
struct Sbd_Str_t_
{
    int               fLut;                 // LUT or SEL
    int               nVarIns;              // input count
    int               VarIns[SBD_DIV_MAX];  // input vars
73
    word              Res;                  // result of solving
74
};
75 76 77 78 79 80 81 82 83 84

////////////////////////////////////////////////////////////////////////
///                      MACRO DEFINITIONS                           ///
////////////////////////////////////////////////////////////////////////


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

85
/*=== sbdCut.c ==========================================================*/
86 87 88 89 90 91 92 93 94
extern Sbd_Sto_t *  Sbd_StoAlloc( Gia_Man_t * pGia, Vec_Int_t * vMirrors, int nLutSize, int nCutSize, int nCutNum, int fCutMin, int fVerbose );
extern void         Sbd_StoFree( Sbd_Sto_t * p );
extern int          Sbd_StoObjRefs( Sbd_Sto_t * p, int iObj );
extern void         Sbd_StoRefObj( Sbd_Sto_t * p, int iObj, int iMirror );
extern void         Sbd_StoDerefObj( Sbd_Sto_t * p, int iObj );
extern void         Sbd_StoComputeCutsConst0( Sbd_Sto_t * p, int iObj );
extern void         Sbd_StoComputeCutsObj( Sbd_Sto_t * p, int iObj, int Delay, int Level );
extern void         Sbd_StoComputeCutsCi( Sbd_Sto_t * p, int iObj, int Delay, int Level );
extern int          Sbd_StoComputeCutsNode( Sbd_Sto_t * p, int iObj );
95
extern void         Sbd_StoSaveBestDelayCut( Sbd_Sto_t * p, int iObj, int * pCut );
96
extern int          Sbd_StoObjBestCut( Sbd_Sto_t * p, int iObj, int nSize, int * pLeaves );
97 98 99 100 101 102
/*=== sbdCut2.c ==========================================================*/
extern Sbd_Srv_t *  Sbd_ManCutServerStart( Gia_Man_t * pGia, Vec_Int_t * vMirrors, 
                                   Vec_Int_t * vLutLevs, Vec_Int_t * vLevs, Vec_Int_t * vRefs, 
                                   int nLutSize, int nCutSize, int nCutNum, int fVerbose );
extern void         Sbd_ManCutServerStop( Sbd_Srv_t * p );
extern int          Sbd_ManCutServerFirst( Sbd_Srv_t * p, int iObj, int * pLeaves );
103 104 105 106 107
/*=== sbdWin.c ==========================================================*/
extern word         Sbd_ManSolve( sat_solver * pSat, int PivotVar, int FreeVar, Vec_Int_t * vDivSet, Vec_Int_t * vDivVars, Vec_Int_t * vDivValues, Vec_Int_t * vTemp );
extern sat_solver * Sbd_ManSatSolver( sat_solver * pSat, Gia_Man_t * p, Vec_Int_t * vMirrors, int Pivot, Vec_Int_t * vWinObjs, Vec_Int_t * vObj2Var, Vec_Int_t * vTfo, Vec_Int_t * vRoots, int fQbf );
extern int          Sbd_ManCollectConstants( sat_solver * pSat, int nCareMints[2], int PivotVar, word * pVarSims[], Vec_Int_t * vInds );
extern int          Sbd_ManCollectConstantsNew( sat_solver * pSat, Vec_Int_t * vDivVars, int nConsts, int PivotVar, word * pOnset, word * pOffset );
108 109
/*=== sbdPath.c ==========================================================*/
extern Vec_Bit_t *  Sbc_ManCriticalPath( Gia_Man_t * p );
110 111 112 113 114 115 116
/*=== sbdQbf.c ==========================================================*/
extern int          Sbd_ProblemSolve( 
                                       Gia_Man_t * p, Vec_Int_t * vMirrors, 
                                       int Pivot, Vec_Int_t * vWinObjs, Vec_Int_t * vObj2Var, 
                                       Vec_Int_t * vTfo, Vec_Int_t * vRoots, 
                                       Vec_Int_t * vDivSet, int nStrs, Sbd_Str_t * pStr0 
                                    );
117 118 119 120 121 122 123 124 125

ABC_NAMESPACE_HEADER_END

#endif

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