#include "dsdInt.h"
Go to the source code of this file.
Functions | |
Dsd_Manager_t * | Dsd_ManagerStart (DdManager *dd, int nSuppMax, int fVerbose) |
void | Dsd_ManagerStop (Dsd_Manager_t *dMan) |
Dsd_Manager_t* Dsd_ManagerStart | ( | DdManager * | dd, | |
int | nSuppMax, | |||
int | fVerbose | |||
) |
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 [
] FUNCTION DECLARATIONS /// 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 44 of file dsdMan.c.
00045 { 00046 Dsd_Manager_t * dMan; 00047 Dsd_Node_t * pNode; 00048 int i; 00049 00050 assert( nSuppMax <= dd->size ); 00051 00052 dMan = ALLOC( Dsd_Manager_t, 1 ); 00053 memset( dMan, 0, sizeof(Dsd_Manager_t) ); 00054 dMan->dd = dd; 00055 dMan->nInputs = nSuppMax; 00056 dMan->fVerbose = fVerbose; 00057 dMan->nRoots = 0; 00058 dMan->nRootsAlloc = 50; 00059 dMan->pRoots = (Dsd_Node_t **) malloc( dMan->nRootsAlloc * sizeof(Dsd_Node_t *) ); 00060 dMan->pInputs = (Dsd_Node_t **) malloc( dMan->nInputs * sizeof(Dsd_Node_t *) ); 00061 00062 // create the primary inputs and insert them into the table 00063 dMan->Table = st_init_table(st_ptrcmp, st_ptrhash); 00064 for ( i = 0; i < dMan->nInputs; i++ ) 00065 { 00066 pNode = Dsd_TreeNodeCreate( DSD_NODE_BUF, 1, 0 ); 00067 pNode->G = dd->vars[i]; Cudd_Ref( pNode->G ); 00068 pNode->S = dd->vars[i]; Cudd_Ref( pNode->S ); 00069 st_insert( dMan->Table, (char*)dd->vars[i], (char*)pNode ); 00070 dMan->pInputs[i] = pNode; 00071 } 00072 pNode = Dsd_TreeNodeCreate( DSD_NODE_CONST1, 0, 0 ); 00073 pNode->G = b1; Cudd_Ref( pNode->G ); 00074 pNode->S = b1; Cudd_Ref( pNode->S ); 00075 st_insert( dMan->Table, (char*)b1, (char*)pNode ); 00076 dMan->pConst1 = pNode; 00077 00078 Dsd_CheckCacheAllocate( 5000 ); 00079 return dMan; 00080 }
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 97 of file dsdMan.c.
00098 { 00099 st_generator * gen; 00100 Dsd_Node_t * pNode; 00101 DdNode * bFunc; 00102 // delete the nodes 00103 st_foreach_item( dMan->Table, gen, (char**)&bFunc, (char**)&pNode ) 00104 Dsd_TreeNodeDelete( dMan->dd, Dsd_Regular(pNode) ); 00105 st_free_table(dMan->Table); 00106 free( dMan->pInputs ); 00107 free( dMan->pRoots ); 00108 free( dMan ); 00109 Dsd_CheckCacheDeallocate(); 00110 }