bdc.h 3.6 KB
Newer Older
Alan Mishchenko committed
1 2
/**CFile****************************************************************

Alan Mishchenko committed
3
  FileName    [bdc.h]
Alan Mishchenko committed
4 5 6

  SystemName  [ABC: Logic synthesis and verification system.]

Alan Mishchenko committed
7
  PackageName [Truth-table-based bi-decomposition engine.]
Alan Mishchenko committed
8 9 10 11 12 13 14

  Synopsis    [External declarations.]

  Author      [Alan Mishchenko]
  
  Affiliation [UC Berkeley]

Alan Mishchenko committed
15
  Date        [Ver. 1.0. Started - January 30, 2007.]
Alan Mishchenko committed
16

Alan Mishchenko committed
17
  Revision    [$Id: bdc.h,v 1.00 2007/01/30 00:00:00 alanmi Exp $]
Alan Mishchenko committed
18 19

***********************************************************************/
Alan Mishchenko committed
20 21 22
 
#ifndef __BDC_H__
#define __BDC_H__
Alan Mishchenko committed
23

24

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

////////////////////////////////////////////////////////////////////////
///                         PARAMETERS                               ///
////////////////////////////////////////////////////////////////////////
Alan Mishchenko committed
32
 
33 34 35 36


ABC_NAMESPACE_HEADER_START

Alan Mishchenko committed
37 38 39 40 41

////////////////////////////////////////////////////////////////////////
///                         BASIC TYPES                              ///
////////////////////////////////////////////////////////////////////////

Alan Mishchenko committed
42
typedef struct Bdc_Fun_t_ Bdc_Fun_t;
Alan Mishchenko committed
43 44 45 46 47 48 49 50 51
typedef struct Bdc_Man_t_ Bdc_Man_t;
typedef struct Bdc_Par_t_ Bdc_Par_t;
struct Bdc_Par_t_
{
    // general parameters
    int           nVarsMax;      // the maximum support
    int           fVerbose;      // enable basic stats
    int           fVeryVerbose;  // enable detailed stats
};
Alan Mishchenko committed
52

Alan Mishchenko committed
53
// working with complemented attributes of objects
Alan Mishchenko committed
54 55 56 57
static inline int         Bdc_IsComplement( Bdc_Fun_t * p )      { return (int)((ABC_PTRUINT_T)p & (ABC_PTRUINT_T)01);              }
static inline Bdc_Fun_t * Bdc_Regular( Bdc_Fun_t * p )           { return (Bdc_Fun_t *)((ABC_PTRUINT_T)p & ~(ABC_PTRUINT_T)01);     }
static inline Bdc_Fun_t * Bdc_Not( Bdc_Fun_t * p )               { return (Bdc_Fun_t *)((ABC_PTRUINT_T)p ^  (ABC_PTRUINT_T)01);     }
static inline Bdc_Fun_t * Bdc_NotCond( Bdc_Fun_t * p, int c )    { return (Bdc_Fun_t *)((ABC_PTRUINT_T)p ^  (ABC_PTRUINT_T)(c!=0)); }
Alan Mishchenko committed
58

Alan Mishchenko committed
59
////////////////////////////////////////////////////////////////////////
Alan Mishchenko committed
60
///                      MACRO DEFINITIONS                           ///
Alan Mishchenko committed
61 62 63 64 65 66
////////////////////////////////////////////////////////////////////////

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

Alan Mishchenko committed
67 68 69
/*=== bdcCore.c ==========================================================*/
extern Bdc_Man_t * Bdc_ManAlloc( Bdc_Par_t * pPars );
extern void        Bdc_ManFree( Bdc_Man_t * p );
Alan Mishchenko committed
70
extern int         Bdc_ManDecompose( Bdc_Man_t * p, unsigned * puFunc, unsigned * puCare, int nVars, Vec_Ptr_t * vDivs, int nNodesMax );
Alan Mishchenko committed
71 72 73 74 75 76
extern Bdc_Fun_t * Bdc_ManFunc( Bdc_Man_t * p, int i );
extern Bdc_Fun_t * Bdc_ManRoot( Bdc_Man_t * p );
extern int         Bdc_ManNodeNum( Bdc_Man_t * p );
extern Bdc_Fun_t * Bdc_FuncFanin0( Bdc_Fun_t * p );
extern Bdc_Fun_t * Bdc_FuncFanin1( Bdc_Fun_t * p );
extern void *      Bdc_FuncCopy( Bdc_Fun_t * p );
77
extern int         Bdc_FuncCopyInt( Bdc_Fun_t * p );
Alan Mishchenko committed
78
extern void        Bdc_FuncSetCopy( Bdc_Fun_t * p, void * pCopy );
79 80 81 82 83
extern void        Bdc_FuncSetCopyInt( Bdc_Fun_t * p, int iCopy );



ABC_NAMESPACE_HEADER_END
Alan Mishchenko committed
84

Alan Mishchenko committed
85 86 87 88 89 90 91 92


#endif

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