abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
bdc.h
Go to the documentation of this file.
1 /**CFile****************************************************************
2 
3  FileName [bdc.h]
4 
5  SystemName [ABC: Logic synthesis and verification system.]
6 
7  PackageName [Truth-table-based bi-decomposition engine.]
8 
9  Synopsis [External declarations.]
10 
11  Author [Alan Mishchenko]
12 
13  Affiliation [UC Berkeley]
14 
15  Date [Ver. 1.0. Started - January 30, 2007.]
16 
17  Revision [$Id: bdc.h,v 1.00 2007/01/30 00:00:00 alanmi Exp $]
18 
19 ***********************************************************************/
20 
21 #ifndef ABC__aig__bdc__bdc_h
22 #define ABC__aig__bdc__bdc_h
23 
24 
25 ////////////////////////////////////////////////////////////////////////
26 /// INCLUDES ///
27 ////////////////////////////////////////////////////////////////////////
28 
29 ////////////////////////////////////////////////////////////////////////
30 /// PARAMETERS ///
31 ////////////////////////////////////////////////////////////////////////
32 
33 
34 
36 
37 
38 ////////////////////////////////////////////////////////////////////////
39 /// BASIC TYPES ///
40 ////////////////////////////////////////////////////////////////////////
41 
42 typedef struct Bdc_Fun_t_ Bdc_Fun_t;
43 typedef struct Bdc_Man_t_ Bdc_Man_t;
44 typedef struct Bdc_Par_t_ Bdc_Par_t;
45 struct Bdc_Par_t_
46 {
47  // general parameters
48  int nVarsMax; // the maximum support
49  int fVerbose; // enable basic stats
50  int fVeryVerbose; // enable detailed stats
51 };
52 
53 // working with complemented attributes of objects
54 static inline int Bdc_IsComplement( Bdc_Fun_t * p ) { return (int)((ABC_PTRUINT_T)p & (ABC_PTRUINT_T)01); }
55 static inline Bdc_Fun_t * Bdc_Regular( Bdc_Fun_t * p ) { return (Bdc_Fun_t *)((ABC_PTRUINT_T)p & ~(ABC_PTRUINT_T)01); }
56 static inline Bdc_Fun_t * Bdc_Not( Bdc_Fun_t * p ) { return (Bdc_Fun_t *)((ABC_PTRUINT_T)p ^ (ABC_PTRUINT_T)01); }
57 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)); }
58 
59 ////////////////////////////////////////////////////////////////////////
60 /// MACRO DEFINITIONS ///
61 ////////////////////////////////////////////////////////////////////////
62 
63 ////////////////////////////////////////////////////////////////////////
64 /// FUNCTION DECLARATIONS ///
65 ////////////////////////////////////////////////////////////////////////
66 
67 /*=== bdcCore.c ==========================================================*/
68 extern Bdc_Man_t * Bdc_ManAlloc( Bdc_Par_t * pPars );
69 extern void Bdc_ManFree( Bdc_Man_t * p );
70 extern void Bdc_ManDecPrint( Bdc_Man_t * p );
71 extern int Bdc_ManDecompose( Bdc_Man_t * p, unsigned * puFunc, unsigned * puCare, int nVars, Vec_Ptr_t * vDivs, int nNodesMax );
72 extern Bdc_Fun_t * Bdc_ManFunc( Bdc_Man_t * p, int i );
73 extern Bdc_Fun_t * Bdc_ManRoot( Bdc_Man_t * p );
74 extern int Bdc_ManNodeNum( Bdc_Man_t * p );
75 extern int Bdc_ManAndNum( Bdc_Man_t * p );
76 extern Bdc_Fun_t * Bdc_FuncFanin0( Bdc_Fun_t * p );
77 extern Bdc_Fun_t * Bdc_FuncFanin1( Bdc_Fun_t * p );
78 extern void * Bdc_FuncCopy( Bdc_Fun_t * p );
79 extern int Bdc_FuncCopyInt( Bdc_Fun_t * p );
80 extern void Bdc_FuncSetCopy( Bdc_Fun_t * p, void * pCopy );
81 extern void Bdc_FuncSetCopyInt( Bdc_Fun_t * p, int iCopy );
82 
83 /*=== working with saved copies ==========================================*/
84 static inline int Bdc_FunObjCopy( Bdc_Fun_t * pObj ) { return Abc_LitNotCond( Bdc_FuncCopyInt(Bdc_Regular(pObj)), Bdc_IsComplement(pObj) ); }
85 static inline int Bdc_FunFanin0Copy( Bdc_Fun_t * pObj ) { return Bdc_FunObjCopy( Bdc_FuncFanin0(pObj) ); }
86 static inline int Bdc_FunFanin1Copy( Bdc_Fun_t * pObj ) { return Bdc_FunObjCopy( Bdc_FuncFanin1(pObj) ); }
87 
88 
90 
91 
92 
93 #endif
94 
95 ////////////////////////////////////////////////////////////////////////
96 /// END OF FILE ///
97 ////////////////////////////////////////////////////////////////////////
98 
Bdc_Fun_t * Bdc_ManRoot(Bdc_Man_t *p)
Definition: bdcCore.c:47
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
void Bdc_ManDecPrint(Bdc_Man_t *p)
Definition: bdcCore.c:260
static int Bdc_FunFanin1Copy(Bdc_Fun_t *pObj)
Definition: bdc.h:86
int fVerbose
Definition: bdc.h:49
static Llb_Mgr_t * p
Definition: llb3Image.c:950
int nVarsMax
Definition: bdc.h:48
int fVeryVerbose
Definition: bdc.h:50
Bdc_Man_t * Bdc_ManAlloc(Bdc_Par_t *pPars)
MACRO DEFINITIONS ///.
Definition: bdcCore.c:68
int Bdc_ManDecompose(Bdc_Man_t *p, unsigned *puFunc, unsigned *puCare, int nVars, Vec_Ptr_t *vDivs, int nNodesMax)
Definition: bdcCore.c:291
static int Abc_LitNotCond(int Lit, int c)
Definition: abc_global.h:267
Bdc_Fun_t * Bdc_ManFunc(Bdc_Man_t *p, int i)
DECLARATIONS ///.
Definition: bdcCore.c:46
void Bdc_FuncSetCopy(Bdc_Fun_t *p, void *pCopy)
Definition: bdcCore.c:54
typedefABC_NAMESPACE_HEADER_START struct Bdc_Fun_t_ Bdc_Fun_t
INCLUDES ///.
Definition: bdc.h:42
void Bdc_FuncSetCopyInt(Bdc_Fun_t *p, int iCopy)
Definition: bdcCore.c:55
int Bdc_FuncCopyInt(Bdc_Fun_t *p)
Definition: bdcCore.c:53
#define ABC_NAMESPACE_HEADER_START
NAMESPACES ///.
Definition: abc_global.h:105
static Bdc_Fun_t * Bdc_NotCond(Bdc_Fun_t *p, int c)
Definition: bdc.h:57
#define ABC_NAMESPACE_HEADER_END
Definition: abc_global.h:106
int Bdc_ManAndNum(Bdc_Man_t *p)
Definition: bdcCore.c:49
Bdc_Fun_t * Bdc_FuncFanin0(Bdc_Fun_t *p)
Definition: bdcCore.c:50
static int Bdc_IsComplement(Bdc_Fun_t *p)
Definition: bdc.h:54
Definition: bdc.h:45
static Bdc_Fun_t * Bdc_Not(Bdc_Fun_t *p)
Definition: bdc.h:56
static int Bdc_FunFanin0Copy(Bdc_Fun_t *pObj)
Definition: bdc.h:85
int Bdc_ManNodeNum(Bdc_Man_t *p)
Definition: bdcCore.c:48
void Bdc_ManFree(Bdc_Man_t *p)
Definition: bdcCore.c:113
static int Bdc_FunObjCopy(Bdc_Fun_t *pObj)
Definition: bdc.h:84
Bdc_Fun_t * Bdc_FuncFanin1(Bdc_Fun_t *p)
Definition: bdcCore.c:51
void * Bdc_FuncCopy(Bdc_Fun_t *p)
Definition: bdcCore.c:52
static Bdc_Fun_t * Bdc_Regular(Bdc_Fun_t *p)
Definition: bdc.h:55