ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
dsdMan.c File Reference
#include "dsdInt.h"
Include dependency graph for dsdMan.c:

Go to the source code of this file.

Functions

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

Function Documentation

◆ Dsd_ManagerStart()

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
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}
#define ABC_ALLOC(type, num)
Definition abc_global.h:264
#define b1
Definition bbrImage.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
struct Dsd_Manager_t_ Dsd_Manager_t
TYPEDEF DEFINITIONS ///.
Definition dsd.h:59
struct Dsd_Node_t_ Dsd_Node_t
Definition dsd.h:60
@ 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
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()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Dsd_ManagerStop()

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}
#define ABC_FREE(obj)
Definition abc_global.h:267
void Dsd_CheckCacheDeallocate()
Definition dsdCheck.c:97
void Dsd_TreeNodeDelete(DdManager *dd, Dsd_Node_t *pNode)
Definition dsdTree.c:87
#define Dsd_Regular(p)
Definition dsd.h:69
void st__free_table(st__table *table)
Definition st.c:81
#define st__foreach_item(table, gen, key, value)
Definition st.h:107
Here is the call graph for this function:
Here is the caller graph for this function: