abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
dsdApi.c
Go to the documentation of this file.
1 /**CFile****************************************************************
2 
3  FileName [dsdApi.c]
4 
5  PackageName [DSD: Disjoint-support decomposition package.]
6 
7  Synopsis [Implementation of API functions.]
8 
9  Author [Alan Mishchenko]
10 
11  Affiliation [UC Berkeley]
12 
13  Date [Ver. 8.0. Started - September 22, 2003.]
14 
15  Revision [$Id: dsdApi.c,v 1.0 2002/22/09 00:00:00 alanmi Exp $]
16 
17 ***********************************************************************/
18 
19 #include "dsdInt.h"
20 
22 
23 
24 ////////////////////////////////////////////////////////////////////////
25 /// DECLARATIONS ///
26 ////////////////////////////////////////////////////////////////////////
27 
28 ////////////////////////////////////////////////////////////////////////
29 /// FUNCTION DEFINITIONS ///
30 ////////////////////////////////////////////////////////////////////////
31 
32 /**Function*************************************************************
33 
34  Synopsis [APIs of the DSD node.]
35 
36  Description [The node's type can be retrieved by calling
37  Dsd_NodeReadType(). The type is one of the following: constant 1 node,
38  the buffer (or the elementary variable), OR gate, EXOR gate, or
39  PRIME function (a non-DSD-decomposable function with more than two
40  inputs). The return value of Dsd_NodeReadFunc() is the global function
41  of the DSD node. The return value of Dsd_NodeReadSupp() is the support
42  of the global function of the DSD node. The array of DSD nodes
43  returned by Dsd_NodeReadDecs() is the array of decomposition nodes for
44  the formal inputs of the given node. The number of decomposition entries
45  returned by Dsd_NodeReadDecsNum() is the number of formal inputs.
46  The mark is explained below.]
47 
48  SideEffects []
49 
50  SeeAlso []
51 
52 ***********************************************************************/
54 DdNode * Dsd_NodeReadFunc( Dsd_Node_t * p ) { return p->G; }
55 DdNode * Dsd_NodeReadSupp( Dsd_Node_t * p ) { return p->S; }
56 Dsd_Node_t ** Dsd_NodeReadDecs( Dsd_Node_t * p ) { return p->pDecs; }
57 Dsd_Node_t * Dsd_NodeReadDec ( Dsd_Node_t * p, int i ) { return p->pDecs[i]; }
58 int Dsd_NodeReadDecsNum( Dsd_Node_t * p ) { return p->nDecs; }
59 int Dsd_NodeReadMark( Dsd_Node_t * p ) { return p->Mark; }
60 
61 /**Function*************************************************************
62 
63  Synopsis [APIs of the DSD node.]
64 
65  Description [This API allows the user to set the integer mark in the
66  given DSD node. The mark is guaranteed to persist as long as the
67  calls to the decomposition are not performed. In any case, the mark
68  is useful to associate the node with some temporary information, such
69  as its number in the DFS ordered list of the DSD nodes or its number in
70  the BLIF file that it being written.]
71 
72  SideEffects []
73 
74  SeeAlso []
75 
76 ***********************************************************************/
77 void Dsd_NodeSetMark( Dsd_Node_t * p, int Mark ){ p->Mark = Mark; }
78 
79 /**Function*************************************************************
80 
81  Synopsis [APIs of the DSD manager.]
82 
83  Description [Allows the use to get hold of an individual leave of
84  the DSD tree (Dsd_ManagerReadInput) or an individual root of the
85  decomposition tree (Dsd_ManagerReadRoot). The root may have the
86  complemented attribute.]
87 
88  SideEffects []
89 
90  SeeAlso []
91 
92 ***********************************************************************/
93 Dsd_Node_t * Dsd_ManagerReadRoot( Dsd_Manager_t * pMan, int i ) { return pMan->pRoots[i]; }
94 Dsd_Node_t * Dsd_ManagerReadInput( Dsd_Manager_t * pMan, int i ) { return pMan->pInputs[i]; }
95 Dsd_Node_t * Dsd_ManagerReadConst1( Dsd_Manager_t * pMan ) { return pMan->pConst1; }
96 DdManager * Dsd_ManagerReadDd( Dsd_Manager_t * pMan ) { return pMan->dd; }
97 
98 ////////////////////////////////////////////////////////////////////////
99 /// END OF FILE ///
100 ////////////////////////////////////////////////////////////////////////
102 
DdNode * S
Definition: dsdInt.h:58
DdManager * dd
Definition: dsdInt.h:42
ABC_NAMESPACE_IMPL_START Dsd_Type_t Dsd_NodeReadType(Dsd_Node_t *p)
DECLARATIONS ///.
Definition: dsdApi.c:53
Definition: cudd.h:278
static Llb_Mgr_t * p
Definition: llb3Image.c:950
DdNode * G
Definition: dsdInt.h:57
Dsd_Node_t * pConst1
Definition: dsdInt.h:49
Dsd_Node_t * Dsd_ManagerReadRoot(Dsd_Manager_t *pMan, int i)
Definition: dsdApi.c:93
DdNode * Dsd_NodeReadSupp(Dsd_Node_t *p)
Definition: dsdApi.c:55
Dsd_Node_t ** pDecs
Definition: dsdInt.h:59
void Dsd_NodeSetMark(Dsd_Node_t *p, int Mark)
Definition: dsdApi.c:77
int Dsd_NodeReadDecsNum(Dsd_Node_t *p)
Definition: dsdApi.c:58
#define ABC_NAMESPACE_IMPL_END
Definition: abc_global.h:108
STRUCTURE DEFINITIONS ///.
Definition: dsdInt.h:40
Dsd_Node_t * Dsd_ManagerReadInput(Dsd_Manager_t *pMan, int i)
Definition: dsdApi.c:94
Dsd_Node_t * Dsd_NodeReadDec(Dsd_Node_t *p, int i)
Definition: dsdApi.c:57
Dsd_Type_t Type
Definition: dsdInt.h:56
int Mark
Definition: dsdInt.h:60
#define ABC_NAMESPACE_IMPL_START
Definition: abc_global.h:107
Dsd_Node_t ** pInputs
Definition: dsdInt.h:47
int Dsd_NodeReadMark(Dsd_Node_t *p)
Definition: dsdApi.c:59
enum Dsd_Type_t_ Dsd_Type_t
Definition: dsd.h:61
DdManager * Dsd_ManagerReadDd(Dsd_Manager_t *pMan)
Definition: dsdApi.c:96
DdNode * Dsd_NodeReadFunc(Dsd_Node_t *p)
Definition: dsdApi.c:54
Dsd_Node_t ** Dsd_NodeReadDecs(Dsd_Node_t *p)
Definition: dsdApi.c:56
Dsd_Node_t * Dsd_ManagerReadConst1(Dsd_Manager_t *pMan)
Definition: dsdApi.c:95
Dsd_Node_t ** pRoots
Definition: dsdInt.h:48
short nDecs
Definition: dsdInt.h:61