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

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START void dsdKernelDecompose (Dsd_Manager_t *pDsdMan, DdNode **pbFuncs, int nFuncs)
 FUNCTION DECLARATIONS ///.
 
void Dsd_Decompose (Dsd_Manager_t *pDsdMan, DdNode **pbFuncs, int nFuncs)
 DECOMPOSITION FUNCTIONS ///.
 
Dsd_Node_tDsd_DecomposeOne (Dsd_Manager_t *pDsdMan, DdNode *bFunc)
 

Function Documentation

◆ Dsd_Decompose()

void Dsd_Decompose ( Dsd_Manager_t * pDsdMan,
DdNode ** pbFuncs,
int nFuncs )

DECOMPOSITION FUNCTIONS ///.

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

Synopsis [Performs DSD for the array of functions represented by BDDs.]

Description [This function takes the DSD manager, which should be previously allocated by the call to Dsd_ManagerStart(). The resulting DSD tree is stored in the DSD manager (pDsdMan->pRoots, pDsdMan->nRoots). Access to the tree is through the APIs of the manager. The resulting tree is a shared DSD DAG for the functions given in the array. For one function the resulting DAG is always a tree. The root node pointers can be complemented, as discussed in the literature referred to in "dsd.h". This procedure can be called repeatedly for different functions. There is no need to remove the decomposition tree after it is returned, because the next call to the DSD manager will "recycle" the tree. The user should not modify or dereference any data associated with the nodes of the DSD trees (the user can only change the contents of a temporary mark associated with each node by the calling to Dsd_NodeSetMark()). All the decomposition trees and intermediate nodes will be removed when the DSD manager is deallocated at the end by calling Dsd_ManagerStop().]

SideEffects []

SeeAlso []

Definition at line 113 of file dsdProc.c.

114{
115 DdManager * dd = pDsdMan->dd;
116 int i;
117 abctime clk;
118 Dsd_Node_t * pTemp;
119 int SumMaxGateSize = 0;
120 int nDecOutputs = 0;
121 int nCBFOutputs = 0;
122/*
123s_Loops1 = 0;
124s_Loops2 = 0;
125s_Loops3 = 0;
126s_Case4Calls = 0;
127s_Case4CallsSpecial = 0;
128s_Case5 = 0;
129s_Loops2Useless = 0;
130*/
131 // resize the number of roots in the manager
132 if ( pDsdMan->nRootsAlloc < nFuncs )
133 {
134 if ( pDsdMan->nRootsAlloc > 0 )
135 ABC_FREE( pDsdMan->pRoots );
136 pDsdMan->nRootsAlloc = nFuncs;
137 pDsdMan->pRoots = (Dsd_Node_t **) ABC_ALLOC( char, pDsdMan->nRootsAlloc * sizeof(Dsd_Node_t *) );
138 }
139
140 if ( pDsdMan->fVerbose )
141 printf( "\nDecomposability statistics for individual outputs:\n" );
142
143 // set the counter of decomposition nodes
144 s_nDecBlocks = 0;
145
146 // perform decomposition for all outputs
147 clk = Abc_Clock();
148 pDsdMan->nRoots = 0;
149 s_nCascades = 0;
150 for ( i = 0; i < nFuncs; i++ )
151 {
152 int nLiteralsPrev;
153 int nDecBlocksPrev;
154 int nExorGatesPrev;
155 int nReusedBlocksPres;
156 int nCascades;
157 int MaxBlock;
158 int nPrimeBlocks;
159 abctime clk;
160
161 clk = Abc_Clock();
162 nLiteralsPrev = s_nLiterals;
163 nDecBlocksPrev = s_nDecBlocks;
164 nExorGatesPrev = s_nExorGates;
165 nReusedBlocksPres = s_nReusedBlocks;
166 nPrimeBlocks = s_nPrimeBlocks;
167
168 pDsdMan->pRoots[ pDsdMan->nRoots++ ] = dsdKernelDecompose_rec( pDsdMan, pbFuncs[i] );
169
170 Dsd_TreeNodeGetInfoOne( pDsdMan->pRoots[i], &nCascades, &MaxBlock );
171 s_nCascades = ddMax( s_nCascades, nCascades );
172 pTemp = Dsd_Regular(pDsdMan->pRoots[i]);
173 if ( pTemp->Type != DSD_NODE_PRIME || pTemp->nDecs != Extra_bddSuppSize(dd,pTemp->S) )
174 nDecOutputs++;
175 if ( MaxBlock < 3 )
176 nCBFOutputs++;
177 SumMaxGateSize += MaxBlock;
178
179 if ( pDsdMan->fVerbose )
180 {
181 printf("#%02d: ", i );
182 printf("Ins=%2d. ", Cudd_SupportSize(dd,pbFuncs[i]) );
183 printf("Gts=%3d. ", Dsd_TreeCountNonTerminalNodesOne( pDsdMan->pRoots[i] ) );
184 printf("Pri=%3d. ", Dsd_TreeCountPrimeNodesOne( pDsdMan->pRoots[i] ) );
185 printf("Max=%3d. ", MaxBlock );
186 printf("Reuse=%2d. ", s_nReusedBlocks-nReusedBlocksPres );
187 printf("Csc=%2d. ", nCascades );
188 printf("T= %.2f s. ", (float)(Abc_Clock()-clk)/(float)(CLOCKS_PER_SEC) ) ;
189 printf("Bdd=%2d. ", Cudd_DagSize(pbFuncs[i]) );
190 printf("\n");
191 fflush( stdout );
192 }
193 }
194 assert( pDsdMan->nRoots == nFuncs );
195
196 if ( pDsdMan->fVerbose )
197 {
198 printf( "\n" );
199 printf( "The cumulative decomposability statistics:\n" );
200 printf( " Total outputs = %5d\n", nFuncs );
201 printf( " Decomposable outputs = %5d\n", nDecOutputs );
202 printf( " Completely decomposable outputs = %5d\n", nCBFOutputs );
203 printf( " The sum of max gate sizes = %5d\n", SumMaxGateSize );
204 printf( " Shared BDD size = %5d\n", Cudd_SharingSize( pbFuncs, nFuncs ) );
205 printf( " Decomposition entries = %5d\n", st__count( pDsdMan->Table ) );
206 printf( " Pure decomposition time = %.2f sec\n", (float)(Abc_Clock() - clk)/(float)(CLOCKS_PER_SEC) );
207 }
208/*
209 printf( "s_Loops1 = %d.\n", s_Loops1 );
210 printf( "s_Loops2 = %d.\n", s_Loops2 );
211 printf( "s_Loops3 = %d.\n", s_Loops3 );
212 printf( "s_Case4Calls = %d.\n", s_Case4Calls );
213 printf( "s_Case4CallsSpecial = %d.\n", s_Case4CallsSpecial );
214 printf( "s_Case5 = %d.\n", s_Case5 );
215 printf( "s_Loops2Useless = %d.\n", s_Loops2Useless );
216*/
217}
ABC_INT64_T abctime
Definition abc_global.h:332
#define ABC_ALLOC(type, num)
Definition abc_global.h:264
#define ABC_FREE(obj)
Definition abc_global.h:267
int Dsd_TreeCountPrimeNodesOne(Dsd_Node_t *pRoot)
Definition dsdTree.c:410
void Dsd_TreeNodeGetInfoOne(Dsd_Node_t *pNode, int *DepthMax, int *GateSizeMax)
Definition dsdTree.c:183
int Dsd_TreeCountNonTerminalNodesOne(Dsd_Node_t *pRoot)
Definition dsdTree.c:331
struct Dsd_Node_t_ Dsd_Node_t
Definition dsd.h:60
#define Dsd_Regular(p)
Definition dsd.h:69
@ DSD_NODE_PRIME
Definition dsd.h:52
int Extra_bddSuppSize(DdManager *dd, DdNode *bSupp)
#define st__count(table)
Definition st.h:71
DdManager * dd
Definition dsdInt.h:42
int nRootsAlloc
Definition dsdInt.h:46
st__table * Table
Definition dsdInt.h:43
Dsd_Node_t ** pRoots
Definition dsdInt.h:48
Dsd_Type_t Type
Definition dsdInt.h:56
DdNode * S
Definition dsdInt.h:58
short nDecs
Definition dsdInt.h:61
#define assert(ex)
Definition util_old.h:213
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Dsd_DecomposeOne()

Dsd_Node_t * Dsd_DecomposeOne ( Dsd_Manager_t * pDsdMan,
DdNode * bFunc )

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

Synopsis [Performs decomposition for one function.]

Description []

SideEffects []

SeeAlso []

Definition at line 230 of file dsdProc.c.

231{
232 return dsdKernelDecompose_rec( pDsdMan, bFunc );
233}

◆ dsdKernelDecompose()

ABC_NAMESPACE_IMPL_START void dsdKernelDecompose ( Dsd_Manager_t * pDsdMan,
DdNode ** pbFuncs,
int nFuncs )

FUNCTION DECLARATIONS ///.

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

FileName [dsdProc.c]

PackageName [DSD: Disjoint-support decomposition package.]

Synopsis [The core procedures of the package.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

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

Revision [

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

]