abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
dsd.h
Go to the documentation of this file.
1 /**CFile****************************************************************
2 
3  FileName [dsd.h]
4 
5  PackageName [DSD: Disjoint-support decomposition package.]
6 
7  Synopsis [External declarations of the package.
8  This fast BDD-based recursive algorithm for simple
9  (single-output) DSD is based on the following papers:
10  (1) V. Bertacco and M. Damiani, "Disjunctive decomposition of
11  logic functions," Proc. ICCAD '97, pp. 78-82.
12  (2) Y. Matsunaga, "An exact and efficient algorithm for disjunctive
13  decomposition", Proc. SASIMI '98, pp. 44-50.
14  The scope of detected decompositions is the same as in the paper:
15  T. Sasao and M. Matsuura, "DECOMPOS: An integrated system for
16  functional decomposition," Proc. IWLS '98, pp. 471-477.]
17 
18  Author [Alan Mishchenko]
19 
20  Affiliation [UC Berkeley]
21 
22  Date [Ver. 8.0. Started - September 22, 2003.]
23 
24  Revision [$Id: dsd.h,v 1.0 2002/22/09 00:00:00 alanmi Exp $]
25 
26 ***********************************************************************/
27 
28 #ifndef ABC__bdd__dsd__dsd_h
29 #define ABC__bdd__dsd__dsd_h
30 
31 
32 ////////////////////////////////////////////////////////////////////////
33 /// STRUCTURE DEFINITIONS ///
34 ////////////////////////////////////////////////////////////////////////
35 
36 ////////////////////////////////////////////////////////////////////////
37 /// PARAMETERS ///
38 ////////////////////////////////////////////////////////////////////////
39 
40 
41 
43 
44 
45 // types of DSD nodes
46 enum Dsd_Type_t_ {
53 };
54 
55 ////////////////////////////////////////////////////////////////////////
56 /// TYPEDEF DEFINITIONS ///
57 ////////////////////////////////////////////////////////////////////////
58 
60 typedef struct Dsd_Node_t_ Dsd_Node_t;
61 typedef enum Dsd_Type_t_ Dsd_Type_t;
62 
63 ////////////////////////////////////////////////////////////////////////
64 /// MACRO DEFINITIONS ///
65 ////////////////////////////////////////////////////////////////////////
66 
67 // complementation and testing for pointers for decomposition entries
68 #define Dsd_IsComplement(p) (((int)((ABC_PTRUINT_T) (p) & 01)))
69 #define Dsd_Regular(p) ((Dsd_Node_t *)((ABC_PTRUINT_T)(p) & ~01))
70 #define Dsd_Not(p) ((Dsd_Node_t *)((ABC_PTRUINT_T)(p) ^ 01))
71 #define Dsd_NotCond(p,c) ((Dsd_Node_t *)((ABC_PTRUINT_T)(p) ^ (c)))
72 
73 ////////////////////////////////////////////////////////////////////////
74 /// ITERATORS ///
75 ////////////////////////////////////////////////////////////////////////
76 
77 // iterator through the transitions
78 #define Dsd_NodeForEachChild( Node, Index, Child ) \
79  for ( Index = 0; \
80  Index < Dsd_NodeReadDecsNum(Node) && \
81  ((Child = Dsd_NodeReadDec(Node,Index))>=0); \
82  Index++ )
83 
84 ////////////////////////////////////////////////////////////////////////
85 /// FUNCTION DEFINITIONS ///
86 ////////////////////////////////////////////////////////////////////////
87 
88 /*=== dsdApi.c =======================================================*/
90 extern DdNode * Dsd_NodeReadFunc( Dsd_Node_t * p );
91 extern DdNode * Dsd_NodeReadSupp( Dsd_Node_t * p );
93 extern Dsd_Node_t * Dsd_NodeReadDec ( Dsd_Node_t * p, int i );
94 extern int Dsd_NodeReadDecsNum( Dsd_Node_t * p );
95 extern int Dsd_NodeReadMark( Dsd_Node_t * p );
96 extern void Dsd_NodeSetMark( Dsd_Node_t * p, int Mark );
97 extern DdManager * Dsd_ManagerReadDd( Dsd_Manager_t * pMan );
98 extern Dsd_Node_t * Dsd_ManagerReadRoot( Dsd_Manager_t * pMan, int i );
99 extern Dsd_Node_t * Dsd_ManagerReadInput( Dsd_Manager_t * pMan, int i );
101 /*=== dsdMan.c =======================================================*/
102 extern Dsd_Manager_t * Dsd_ManagerStart( DdManager * dd, int nSuppMax, int fVerbose );
103 extern void Dsd_ManagerStop( Dsd_Manager_t * dMan );
104 /*=== dsdProc.c =======================================================*/
105 extern void Dsd_Decompose( Dsd_Manager_t * dMan, DdNode ** pbFuncs, int nFuncs );
106 extern Dsd_Node_t * Dsd_DecomposeOne( Dsd_Manager_t * pDsdMan, DdNode * bFunc );
107 /*=== dsdTree.c =======================================================*/
108 extern void Dsd_TreeNodeGetInfo( Dsd_Manager_t * dMan, int * DepthMax, int * GateSizeMax );
109 extern void Dsd_TreeNodeGetInfoOne( Dsd_Node_t * pNode, int * DepthMax, int * GateSizeMax );
110 extern int Dsd_TreeGetAigCost( Dsd_Node_t * pNode );
111 extern int Dsd_TreeCountNonTerminalNodes( Dsd_Manager_t * dMan );
112 extern int Dsd_TreeCountNonTerminalNodesOne( Dsd_Node_t * pRoot );
113 extern int Dsd_TreeCountPrimeNodes( Dsd_Manager_t * pDsdMan );
114 extern int Dsd_TreeCountPrimeNodesOne( Dsd_Node_t * pRoot );
115 extern int Dsd_TreeCollectDecomposableVars( Dsd_Manager_t * dMan, int * pVars );
116 extern Dsd_Node_t ** Dsd_TreeCollectNodesDfs( Dsd_Manager_t * dMan, int * pnNodes );
117 extern Dsd_Node_t ** Dsd_TreeCollectNodesDfsOne( Dsd_Manager_t * pDsdMan, Dsd_Node_t * pNode, int * pnNodes );
118 extern void Dsd_TreePrint( FILE * pFile, Dsd_Manager_t * dMan, char * pInputNames[], char * pOutputNames[], int fShortNames, int Output );
119 extern void Dsd_TreePrint2( FILE * pFile, Dsd_Manager_t * dMan, char * pInputNames[], char * pOutputNames[], int Output );
120 extern void Dsd_NodePrint( FILE * pFile, Dsd_Node_t * pNode );
121 /*=== dsdLocal.c =======================================================*/
122 extern DdNode * Dsd_TreeGetPrimeFunction( DdManager * dd, Dsd_Node_t * pNode );
123 
124 
125 
127 
128 
129 
130 #endif
131 
132 ////////////////////////////////////////////////////////////////////////
133 /// END OF FILE ///
134 ////////////////////////////////////////////////////////////////////////
Definition: cudd.h:278
void Dsd_ManagerStop(Dsd_Manager_t *dMan)
Definition: dsdMan.c:100
static Llb_Mgr_t * p
Definition: llb3Image.c:950
void Dsd_TreePrint2(FILE *pFile, Dsd_Manager_t *dMan, char *pInputNames[], char *pOutputNames[], int Output)
Definition: dsdTree.c:917
Dsd_Node_t ** Dsd_TreeCollectNodesDfs(Dsd_Manager_t *dMan, int *pnNodes)
Definition: dsdTree.c:555
DdManager * Dsd_ManagerReadDd(Dsd_Manager_t *pMan)
Definition: dsdApi.c:96
Dsd_Node_t * Dsd_ManagerReadInput(Dsd_Manager_t *pMan, int i)
Definition: dsdApi.c:94
int Dsd_NodeReadDecsNum(Dsd_Node_t *p)
Definition: dsdApi.c:58
int Dsd_TreeCountNonTerminalNodes(Dsd_Manager_t *dMan)
Definition: dsdTree.c:310
Dsd_Type_t_
STRUCTURE DEFINITIONS ///.
Definition: dsd.h:46
int nSuppMax
Definition: llb3Image.c:83
Dsd_Node_t * Dsd_ManagerReadRoot(Dsd_Manager_t *pMan, int i)
Definition: dsdApi.c:93
int Dsd_TreeGetAigCost(Dsd_Node_t *pNode)
Definition: dsdTree.c:291
void Dsd_TreeNodeGetInfo(Dsd_Manager_t *dMan, int *DepthMax, int *GateSizeMax)
Definition: dsdTree.c:156
int Dsd_TreeCountPrimeNodesOne(Dsd_Node_t *pRoot)
Definition: dsdTree.c:410
void Dsd_NodePrint(FILE *pFile, Dsd_Node_t *pNode)
Definition: dsdTree.c:949
Dsd_Node_t * Dsd_ManagerReadConst1(Dsd_Manager_t *pMan)
Definition: dsdApi.c:95
int Dsd_TreeCollectDecomposableVars(Dsd_Manager_t *dMan, int *pVars)
Definition: dsdTree.c:470
STRUCTURE DEFINITIONS ///.
Definition: dsdInt.h:40
#define ABC_NAMESPACE_HEADER_START
NAMESPACES ///.
Definition: abc_global.h:105
Dsd_Node_t ** Dsd_TreeCollectNodesDfsOne(Dsd_Manager_t *pDsdMan, Dsd_Node_t *pNode, int *pnNodes)
Definition: dsdTree.c:585
Dsd_Manager_t * Dsd_ManagerStart(DdManager *dd, int nSuppMax, int fVerbose)
FUNCTION DECLARATIONS ///.
Definition: dsdMan.c:47
#define ABC_NAMESPACE_HEADER_END
Definition: abc_global.h:106
int Mark
Definition: dsdInt.h:60
int Dsd_TreeCountPrimeNodes(Dsd_Manager_t *pDsdMan)
Definition: dsdTree.c:389
DdNode * Dsd_TreeGetPrimeFunction(DdManager *dd, Dsd_Node_t *pNode)
FUNCTION DEFINITIONS ///.
Definition: dsdLocal.c:54
DdNode * Dsd_NodeReadSupp(Dsd_Node_t *p)
Definition: dsdApi.c:55
DdNode * Dsd_NodeReadFunc(Dsd_Node_t *p)
Definition: dsdApi.c:54
int Dsd_NodeReadMark(Dsd_Node_t *p)
Definition: dsdApi.c:59
enum Dsd_Type_t_ Dsd_Type_t
Definition: dsd.h:61
int Dsd_TreeCountNonTerminalNodesOne(Dsd_Node_t *pRoot)
Definition: dsdTree.c:331
void Dsd_Decompose(Dsd_Manager_t *dMan, DdNode **pbFuncs, int nFuncs)
DECOMPOSITION FUNCTIONS ///.
Definition: dsdProc.c:113
Dsd_Type_t Dsd_NodeReadType(Dsd_Node_t *p)
FUNCTION DEFINITIONS ///.
Definition: dsdApi.c:53
Dsd_Node_t * Dsd_DecomposeOne(Dsd_Manager_t *pDsdMan, DdNode *bFunc)
Definition: dsdProc.c:230
Dsd_Node_t * Dsd_NodeReadDec(Dsd_Node_t *p, int i)
Definition: dsdApi.c:57
void Dsd_NodeSetMark(Dsd_Node_t *p, int Mark)
Definition: dsdApi.c:77
void Dsd_TreeNodeGetInfoOne(Dsd_Node_t *pNode, int *DepthMax, int *GateSizeMax)
Definition: dsdTree.c:183
Dsd_Node_t ** Dsd_NodeReadDecs(Dsd_Node_t *p)
Definition: dsdApi.c:56
void Dsd_TreePrint(FILE *pFile, Dsd_Manager_t *dMan, char *pInputNames[], char *pOutputNames[], int fShortNames, int Output)
Definition: dsdTree.c:641