abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
dsdMan.c File Reference
#include "dsdInt.h"

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START
Dsd_Manager_t
Dsd_ManagerStart (DdManager *dd, int nSuppMax, int fVerbose)
 FUNCTION DECLARATIONS ///. More...
 
void Dsd_ManagerStop (Dsd_Manager_t *dMan)
 

Function Documentation

ABC_NAMESPACE_IMPL_START Dsd_Manager_t* Dsd_ManagerStart ( DdManager dd,
int  nSuppMax,
int  fVerbose 
)

FUNCTION DECLARATIONS ///.

CFile****************************************************************

FileName [dsdMan.c]

PackageName [DSD: Disjoint-support decomposition package.]

Synopsis [APIs of the DSD manager.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 8.0. Started - September 22, 2003.]

Revision [

Id:
dsdMan.c,v 1.0 2002/22/09 00:00:00 alanmi Exp

]API OF DSD MANAGER /// Function*************************************************************

Synopsis [Starts the DSD manager.]

Description [Takes the started BDD manager and the maximum support size of the function to be DSD-decomposed. The manager should have at least as many variables as there are variables in the support. The functions should be expressed using the first nSuppSizeMax variables in the manager (these may be ordered not necessarily on top of the manager).]

SideEffects []

SeeAlso []

Definition at line 47 of file dsdMan.c.

48 {
49  Dsd_Manager_t * dMan;
50  Dsd_Node_t * pNode;
51  int i;
52 
53  assert( nSuppMax <= dd->size );
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 
81  Dsd_CheckCacheAllocate( 5000 );
82  return dMan;
83 }
char * memset()
DdNode * S
Definition: dsdInt.h:58
DdManager * dd
Definition: dsdInt.h:42
DdNode * G
Definition: dsdInt.h:57
int fVerbose
Definition: dsdInt.h:50
st__table * Table
Definition: dsdInt.h:43
int st__insert(st__table *table, const char *key, char *value)
Definition: st.c:171
Dsd_Node_t * pConst1
Definition: dsdInt.h:49
#define b1
Definition: extraBdd.h:76
void Dsd_CheckCacheAllocate(int nEntries)
FUNCTION DEFINITIONS ///.
Definition: dsdCheck.c:63
int st__ptrcmp(const char *, const char *)
Definition: st.c:480
#define ABC_ALLOC(type, num)
Definition: abc_global.h:229
int nSuppMax
Definition: llb3Image.c:83
st__table * st__init_table(st__compare_func_type compare, st__hash_func_type hash)
Definition: st.c:72
static int size
Definition: cuddSign.c:86
STRUCTURE DEFINITIONS ///.
Definition: dsdInt.h:40
int nRootsAlloc
Definition: dsdInt.h:46
int nInputs
Definition: dsdInt.h:44
Dsd_Node_t * Dsd_TreeNodeCreate(int Type, int nDecs, int BlockNum)
FUNCTION DEFINITIONS ///.
Definition: dsdTree.c:61
Dsd_Node_t ** pInputs
Definition: dsdInt.h:47
DdNode ** vars
Definition: cuddInt.h:390
#define assert(ex)
Definition: util_old.h:213
void Cudd_Ref(DdNode *n)
Definition: cuddRef.c:129
int nRoots
Definition: dsdInt.h:45
int st__ptrhash(const char *, int)
Definition: st.c:468
Dsd_Node_t ** pRoots
Definition: dsdInt.h:48
void Dsd_ManagerStop ( Dsd_Manager_t dMan)

Function*************************************************************

Synopsis [Stops the DSD manager.]

Description [Stopping the DSD manager automatically derefereces and deallocates all the DSD nodes that were created during the life time of the DSD manager. As a result, the user does not need to deref or deallocate any DSD nodes or trees that are derived and placed in the manager while it exists.]

SideEffects []

SeeAlso []

Definition at line 100 of file dsdMan.c.

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 }
void st__free_table(st__table *table)
Definition: st.c:81
Definition: cudd.h:278
st__table * Table
Definition: dsdInt.h:43
void Dsd_TreeNodeDelete(DdManager *dd, Dsd_Node_t *pNode)
Definition: dsdTree.c:87
#define Dsd_Regular(p)
Definition: dsd.h:69
void Dsd_CheckCacheDeallocate()
Definition: dsdCheck.c:97
#define ABC_FREE(obj)
Definition: abc_global.h:232
#define st__foreach_item(table, gen, key, value)
Definition: st.h:107