ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
dsdMan.c
Go to the documentation of this file.
1
18
19#include "dsdInt.h"
20
22
23
27
31
47Dsd_Manager_t * Dsd_ManagerStart( DdManager * dd, int nSuppMax, int fVerbose )
48{
49 Dsd_Manager_t * dMan;
50 Dsd_Node_t * pNode;
51 int i;
52
54
55 dMan = ABC_ALLOC( Dsd_Manager_t, 1 );
56 memset( dMan, 0, sizeof(Dsd_Manager_t) );
57 dMan->dd = dd;
58 dMan->nInputs = nSuppMax;
59 dMan->fVerbose = fVerbose;
60 dMan->nRoots = 0;
61 dMan->nRootsAlloc = 50;
62 dMan->pRoots = (Dsd_Node_t **) ABC_ALLOC( char, dMan->nRootsAlloc * sizeof(Dsd_Node_t *) );
63 dMan->pInputs = (Dsd_Node_t **) ABC_ALLOC( char, dMan->nInputs * sizeof(Dsd_Node_t *) );
64
65 // create the primary inputs and insert them into the table
67 for ( i = 0; i < dMan->nInputs; i++ )
68 {
69 pNode = Dsd_TreeNodeCreate( DSD_NODE_BUF, 1, 0 );
70 pNode->G = dd->vars[i]; Cudd_Ref( pNode->G );
71 pNode->S = dd->vars[i]; Cudd_Ref( pNode->S );
72 st__insert( dMan->Table, (char*)dd->vars[i], (char*)pNode );
73 dMan->pInputs[i] = pNode;
74 }
75 pNode = Dsd_TreeNodeCreate( DSD_NODE_CONST1, 0, 0 );
76 pNode->G = b1; Cudd_Ref( pNode->G );
77 pNode->S = b1; Cudd_Ref( pNode->S );
78 st__insert( dMan->Table, (char*)b1, (char*)pNode );
79 dMan->pConst1 = pNode;
80
82 return dMan;
83}
84
101{
102 st__generator * gen;
103 Dsd_Node_t * pNode;
104 DdNode * bFunc;
105 // delete the nodes
106 st__foreach_item( dMan->Table, gen, (const char**)&bFunc, (char**)&pNode )
107 Dsd_TreeNodeDelete( dMan->dd, Dsd_Regular(pNode) );
108 st__free_table(dMan->Table);
109 ABC_FREE( dMan->pInputs );
110 ABC_FREE( dMan->pRoots );
111 ABC_FREE( dMan );
113}
114
119
#define ABC_ALLOC(type, num)
Definition abc_global.h:264
#define ABC_FREE(obj)
Definition abc_global.h:267
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
#define b1
Definition bbrImage.c:97
void Dsd_CheckCacheDeallocate()
Definition dsdCheck.c:97
void Dsd_CheckCacheAllocate(int nEntries)
FUNCTION DEFINITIONS ///.
Definition dsdCheck.c:63
Dsd_Node_t * Dsd_TreeNodeCreate(int Type, int nDecs, int BlockNum)
FUNCTION DEFINITIONS ///.
Definition dsdTree.c:61
void Dsd_TreeNodeDelete(DdManager *dd, Dsd_Node_t *pNode)
Definition dsdTree.c:87
ABC_NAMESPACE_IMPL_START Dsd_Manager_t * Dsd_ManagerStart(DdManager *dd, int nSuppMax, int fVerbose)
FUNCTION DECLARATIONS ///.
Definition dsdMan.c:47
void Dsd_ManagerStop(Dsd_Manager_t *dMan)
Definition dsdMan.c:100
struct Dsd_Manager_t_ Dsd_Manager_t
TYPEDEF DEFINITIONS ///.
Definition dsd.h:59
struct Dsd_Node_t_ Dsd_Node_t
Definition dsd.h:60
#define Dsd_Regular(p)
Definition dsd.h:69
@ DSD_NODE_CONST1
Definition dsd.h:48
@ DSD_NODE_BUF
Definition dsd.h:49
int nSuppMax
Definition llb3Image.c:83
int st__ptrhash(const char *, int)
Definition st.c:467
int st__ptrcmp(const char *, const char *)
Definition st.c:479
st__table * st__init_table(st__compare_func_type compare, st__hash_func_type hash)
Definition st.c:72
int st__insert(st__table *table, const char *key, char *value)
Definition st.c:171
void st__free_table(st__table *table)
Definition st.c:81
#define st__foreach_item(table, gen, key, value)
Definition st.h:107
DdManager * dd
Definition dsdInt.h:42
Dsd_Node_t ** pInputs
Definition dsdInt.h:47
int nRootsAlloc
Definition dsdInt.h:46
Dsd_Node_t * pConst1
Definition dsdInt.h:49
st__table * Table
Definition dsdInt.h:43
Dsd_Node_t ** pRoots
Definition dsdInt.h:48
DdNode * G
Definition dsdInt.h:57
DdNode * S
Definition dsdInt.h:58
#define assert(ex)
Definition util_old.h:213
char * memset()