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 
21 ABC_NAMESPACE_IMPL_START
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 ***********************************************************************/
Dsd_NodeReadType(Dsd_Node_t * p)53 Dsd_Type_t    Dsd_NodeReadType( Dsd_Node_t * p )         { return p->Type;     }
Dsd_NodeReadFunc(Dsd_Node_t * p)54 DdNode *      Dsd_NodeReadFunc( Dsd_Node_t * p )         { return p->G;        }
Dsd_NodeReadSupp(Dsd_Node_t * p)55 DdNode *      Dsd_NodeReadSupp( Dsd_Node_t * p )         { return p->S;        }
Dsd_NodeReadDecs(Dsd_Node_t * p)56 Dsd_Node_t ** Dsd_NodeReadDecs( Dsd_Node_t * p )         { return p->pDecs;    }
Dsd_NodeReadDec(Dsd_Node_t * p,int i)57 Dsd_Node_t *  Dsd_NodeReadDec ( Dsd_Node_t * p, int i )  { return p->pDecs[i]; }
Dsd_NodeReadDecsNum(Dsd_Node_t * p)58 int           Dsd_NodeReadDecsNum( Dsd_Node_t * p )      { return p->nDecs;    }
Dsd_NodeReadMark(Dsd_Node_t * p)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 ***********************************************************************/
Dsd_NodeSetMark(Dsd_Node_t * p,int Mark)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 ***********************************************************************/
Dsd_ManagerReadRoot(Dsd_Manager_t * pMan,int i)93 Dsd_Node_t *  Dsd_ManagerReadRoot( Dsd_Manager_t * pMan, int i )  { return pMan->pRoots[i];  }
Dsd_ManagerReadInput(Dsd_Manager_t * pMan,int i)94 Dsd_Node_t *  Dsd_ManagerReadInput( Dsd_Manager_t * pMan, int i ) { return pMan->pInputs[i]; }
Dsd_ManagerReadConst1(Dsd_Manager_t * pMan)95 Dsd_Node_t *  Dsd_ManagerReadConst1( Dsd_Manager_t * pMan )       { return pMan->pConst1;    }
Dsd_ManagerReadDd(Dsd_Manager_t * pMan)96 DdManager *   Dsd_ManagerReadDd( Dsd_Manager_t * pMan )           { return pMan->dd;         }
97 
98 ////////////////////////////////////////////////////////////////////////
99 ///                           END OF FILE                            ///
100 ////////////////////////////////////////////////////////////////////////
101 ABC_NAMESPACE_IMPL_END
102 
103