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

Go to the source code of this file.

Classes

struct  _HashEntry_cof
 
struct  _HashEntry_mint
 
struct  traventry
 

Macros

#define _TABLESIZE_COF   51113
 
#define _TABLESIZE_MINT   15113
 

Functions

unsigned Extra_CountCofactorMinterms (DdManager *dd, DdNode *bFunc, DdNode *bVarsCof, DdNode *bVarsAll)
 
DdNode * Extra_bddEncodingBinary (DdManager *dd, DdNode **pbFuncs, int nFuncs, DdNode **pbVars, int nVars)
 
DdNode * Extra_bddEncodingNonStrict (DdManager *dd, DdNode **pbColumns, int nColumns, DdNode *bVarsCol, DdNode **pCVars, int nMulti, int *pSimple)
 
st__tableExtra_bddNodePathsUnderCut (DdManager *dd, DdNode *bFunc, int CutLevel)
 
int Extra_bddNodePathsUnderCutArray (DdManager *dd, DdNode **paNodes, DdNode **pbCubes, int nNodes, DdNode **paNodesRes, DdNode **pbCubesRes, int CutLevel)
 
void extraCollectNodes (DdNode *Func, st__table *tNodes)
 
st__tableExtra_CollectNodes (DdNode *Func)
 
void extraProfileUpdateTopLevel (st__table *tNodeTopRef, int TopLevelNew, DdNode *node)
 
int Extra_ProfileWidth (DdManager *dd, DdNode *Func, int *pProfile, int CutLevel)
 

Variables

_HashEntry_cof HHTable1 [_TABLESIZE_COF]
 
_HashEntry_mint HHTable2 [_TABLESIZE_MINT]
 

Macro Definition Documentation

◆ _TABLESIZE_COF

#define _TABLESIZE_COF   51113

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

FileName [extraBddCas.c]

PackageName [extra]

Synopsis [Procedures related to LUT cascade synthesis.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 2.0. Started - September 1, 2003.]

Revision [

Id
extraBddCas.c,v 1.0 2003/05/21 18:03:50 alanmi Exp

]

Definition at line 37 of file extraBddCas.c.

◆ _TABLESIZE_MINT

#define _TABLESIZE_MINT   15113

Definition at line 46 of file extraBddCas.c.

Function Documentation

◆ Extra_bddEncodingBinary()

DdNode * Extra_bddEncodingBinary ( DdManager * dd,
DdNode ** pbFuncs,
int nFuncs,
DdNode ** pbVars,
int nVars )

AutomaticEnd Function********************************************************************

Synopsis [Performs the binary encoding of the set of function using the given vars.]

Description [Performs a straight binary encoding of the set of functions using the variable cubes formed from the given set of variables. ]

SideEffects []

SeeAlso []

Definition at line 138 of file extraBddCas.c.

144{
145 int i;
146 DdNode * bResult;
147 DdNode * bCube, * bTemp, * bProd;
148
149 assert( nVars >= Abc_Base2Log(nFuncs) );
150
151 bResult = b0; Cudd_Ref( bResult );
152 for ( i = 0; i < nFuncs; i++ )
153 {
154 bCube = Extra_bddBitsToCube( dd, i, nVars, pbVars, 1 ); Cudd_Ref( bCube );
155 bProd = Cudd_bddAnd( dd, bCube, pbFuncs[i] ); Cudd_Ref( bProd );
156 Cudd_RecursiveDeref( dd, bCube );
157
158 bResult = Cudd_bddOr( dd, bProd, bTemp = bResult ); Cudd_Ref( bResult );
159 Cudd_RecursiveDeref( dd, bTemp );
160 Cudd_RecursiveDeref( dd, bProd );
161 }
162
163 Cudd_Deref( bResult );
164 return bResult;
165} /* end of Extra_bddEncodingBinary */
#define b0
Definition bbrImage.c:96
DdNode * Extra_bddBitsToCube(DdManager *dd, int Code, int CodeWidth, DdNode **pbVars, int fMsbFirst)
#define assert(ex)
Definition util_old.h:213
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Extra_bddEncodingNonStrict()

DdNode * Extra_bddEncodingNonStrict ( DdManager * dd,
DdNode ** pbColumns,
int nColumns,
DdNode * bVarsCol,
DdNode ** pCVars,
int nMulti,
int * pSimple )

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

Synopsis [Solves the column encoding problem using a sophisticated method.]

Description [The encoding is based on the idea of deriving functions which depend on only one variable, which corresponds to the case of non-disjoint decompostion. It is assumed that the variables pCVars are ordered below the variables representing the solumns, and the first variable pCVars[0] is the topmost one.]

SideEffects []

SeeAlso [Extra_bddEncodingBinary]

Definition at line 184 of file extraBddCas.c.

192{
193 DdNode * bEncoded, * bResult;
194 int nVarsCol = Cudd_SupportSize(dd,bVarsCol);
195 abctime clk;
196
197 // cannot work with more that 32-bit codes
198 assert( nMulti < 32 );
199
200 // perform the preliminary encoding using the straight binary code
201 bEncoded = Extra_bddEncodingBinary( dd, pbColumns, nColumns, pCVars, nMulti ); Cudd_Ref( bEncoded );
202 //printf( "Node count = %d", Cudd_DagSize(bEncoded) );
203
204 // set the backgroup value for counting minterms
205 s_Terminal = b0;
206 // set the level of the encoding variables
207 s_EncodingVarsLevel = dd->invperm[pCVars[0]->index];
208
209 // the current number of backtracks
210 s_BackTracks = 0;
211 // the variables that are cofactored on the topmost level where everything starts (no vars)
212 s_Field[0][0] = b1;
213 // the size of the best set of "simple" encoding variables found so far
214 s_nVarsBest = 0;
215
216 // set the relation to be accessible to traversal procedures
217 s_Encoded = bEncoded;
218 // the set of all vars to be accessible to traversal procedures
219 s_VarAll = bVarsCol;
220 // the column multiplicity
221 s_MultiStart = nMulti;
222
223
224 clk = Abc_Clock();
225 // find the simplest encoding
226 if ( nColumns > 2 )
227 EvaluateEncodings_rec( dd, bVarsCol, nVarsCol, nMulti, 1 );
228// printf( "The number of backtracks = %d\n", s_BackTracks );
229// s_EncSearchTime += Abc_Clock() - clk;
230
231 // allocate the temporary storage for the columns
232 s_pbTemp = (DdNode **)ABC_ALLOC( char, nColumns * sizeof(DdNode *) );
233
234// clk = Abc_Clock();
235 bResult = CreateTheCodes_rec( dd, bEncoded, 0, pCVars ); Cudd_Ref( bResult );
236// s_EncComputeTime += Abc_Clock() - clk;
237
238 // delocate the preliminarily encoded set
239 Cudd_RecursiveDeref( dd, bEncoded );
240// Cudd_RecursiveDeref( dd, aEncoded );
241
242 ABC_FREE( s_pbTemp );
243
244 *pSimple = s_nVarsBest;
245 Cudd_Deref( bResult );
246 return bResult;
247}
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
#define b1
Definition bbrImage.c:97
DdNode * Extra_bddEncodingBinary(DdManager *dd, DdNode **pbFuncs, int nFuncs, DdNode **pbVars, int nVars)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Extra_bddNodePathsUnderCut()

st__table * Extra_bddNodePathsUnderCut ( DdManager * dd,
DdNode * bFunc,
int CutLevel )

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

Synopsis [Collects the nodes under the cut and, for each node, computes the sum of paths leading to it from the root.]

Description [The table returned contains the set of BDD nodes pointed to under the cut and, for each node, the BDD of the sum of paths leading to this node from the root The sums of paths in the table are referenced. CutLevel is the first DD level considered to be under the cut.]

SideEffects []

SeeAlso [Extra_bddNodePaths]

Definition at line 263 of file extraBddCas.c.

264{
265 st__table * Visited; // temporary table to remember the visited nodes
266 st__table * CutNodes; // the result goes here
267 st__table * Result; // the result goes here
268 DdNode * aFunc;
269
270 s_CutLevel = CutLevel;
271
273 // the terminal cases
274 if ( Cudd_IsConstant( bFunc ) )
275 {
276 if ( bFunc == b1 )
277 {
278 st__insert( Result, (char*)b1, (char*)b1 );
279 Cudd_Ref( b1 );
280 Cudd_Ref( b1 );
281 }
282 else
283 {
284 st__insert( Result, (char*)b0, (char*)b0 );
285 Cudd_Ref( b0 );
286 Cudd_Ref( b0 );
287 }
288 return Result;
289 }
290
291 // create the ADD to simplify processing (no complemented edges)
292 aFunc = Cudd_BddToAdd( dd, bFunc ); Cudd_Ref( aFunc );
293
294 // Step 1: Start the tables and collect information about the nodes above the cut
295 // this information tells how many edges point to each node
298
299 CountNodeVisits_rec( dd, aFunc, Visited );
300
301 // Step 2: Traverse the BDD using the visited table and compute the sum of paths
302 CollectNodesAndComputePaths_rec( dd, aFunc, b1, Visited, CutNodes );
303
304 // at this point the table of cut nodes is ready and the table of visited is useless
305 {
306 st__generator * gen;
307 DdNode * aNode;
308 traventry * p;
309 st__foreach_item( Visited, gen, (const char**)&aNode, (char**)&p )
310 {
311 Cudd_RecursiveDeref( dd, p->bSum );
312 ABC_FREE( p );
313 }
314 st__free_table( Visited );
315 }
316
317 // go through the table CutNodes and create the BDD and the path to be returned
318 {
319 st__generator * gen;
320 DdNode * aNode, * bNode, * bSum;
321 st__foreach_item( CutNodes, gen, (const char**)&aNode, (char**)&bSum)
322 {
323 // aNode is not referenced, because aFunc is holding it
324 bNode = Cudd_addBddPattern( dd, aNode ); Cudd_Ref( bNode );
325 st__insert( Result, (char*)bNode, (char*)bSum );
326 // the new table takes both refs
327 }
328 st__free_table( CutNodes );
329 }
330
331 // dereference the ADD
332 Cudd_RecursiveDeref( dd, aFunc );
333
334 // return the table
335 return Result;
336
337} /* end of Extra_bddNodePathsUnderCut */
Cube * p
Definition exorList.c:222
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
Definition st.h:52
Here is the call graph for this function:

◆ Extra_bddNodePathsUnderCutArray()

int Extra_bddNodePathsUnderCutArray ( DdManager * dd,
DdNode ** paNodes,
DdNode ** pbCubes,
int nNodes,
DdNode ** paNodesRes,
DdNode ** pbCubesRes,
int CutLevel )

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

Synopsis [Collects the nodes under the cut in the ADD starting from the given set of ADD nodes.]

Description [Takes the array, paNodes, of ADD nodes to start the traversal, the array, pbCubes, of BDD cubes to start the traversal with in each node, and the number, nNodes, of ADD nodes and BDD cubes in paNodes and pbCubes. Returns the number of columns found. Fills in paNodesRes (pbCubesRes) with the set of ADD columns (BDD paths). These arrays should be allocated by the user.]

SideEffects []

SeeAlso [Extra_bddNodePaths]

Definition at line 355 of file extraBddCas.c.

356{
357 st__table * Visited; // temporary table to remember the visited nodes
358 st__table * CutNodes; // the nodes under the cut go here
359 int i, Counter;
360
361 s_CutLevel = CutLevel;
362
363 // there should be some nodes
364 assert( nNodes > 0 );
365 if ( nNodes == 1 && Cudd_IsConstant( paNodes[0] ) )
366 {
367 if ( paNodes[0] == a1 )
368 {
369 paNodesRes[0] = a1; Cudd_Ref( a1 );
370 pbCubesRes[0] = pbCubes[0]; Cudd_Ref( pbCubes[0] );
371 }
372 else
373 {
374 paNodesRes[0] = a0; Cudd_Ref( a0 );
375 pbCubesRes[0] = pbCubes[0]; Cudd_Ref( pbCubes[0] );
376 }
377 return 1;
378 }
379
380 // Step 1: Start the table and collect information about the nodes above the cut
381 // this information tells how many edges point to each node
384
385 for ( i = 0; i < nNodes; i++ )
386 CountNodeVisits_rec( dd, paNodes[i], Visited );
387
388 // Step 2: Traverse the BDD using the visited table and compute the sum of paths
389 for ( i = 0; i < nNodes; i++ )
390 CollectNodesAndComputePaths_rec( dd, paNodes[i], pbCubes[i], Visited, CutNodes );
391
392 // at this point, the table of cut nodes is ready and the table of visited is useless
393 {
394 st__generator * gen;
395 DdNode * aNode;
396 traventry * p;
397 st__foreach_item( Visited, gen, (const char**)&aNode, (char**)&p )
398 {
399 Cudd_RecursiveDeref( dd, p->bSum );
400 ABC_FREE( p );
401 }
402 st__free_table( Visited );
403 }
404
405 // go through the table CutNodes and create the BDD and the path to be returned
406 {
407 st__generator * gen;
408 DdNode * aNode, * bSum;
409 Counter = 0;
410 st__foreach_item( CutNodes, gen, (const char**)&aNode, (char**)&bSum)
411 {
412 paNodesRes[Counter] = aNode; Cudd_Ref( aNode );
413 pbCubesRes[Counter] = bSum;
414 Counter++;
415 }
416 st__free_table( CutNodes );
417 }
418
419 // return the number of cofactors found
420 return Counter;
421
422} /* end of Extra_bddNodePathsUnderCutArray */
#define a0
Definition extraBdd.h:79
#define a1
Definition extraBdd.h:80
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Extra_CollectNodes()

st__table * Extra_CollectNodes ( DdNode * Func)

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

Synopsis [Collects all the nodes of one DD into the table.]

Description []

SideEffects []

SeeAlso []

Definition at line 458 of file extraBddCas.c.

459{
460 st__table * tNodes;
462 extraCollectNodes( Func, tNodes );
463 return tNodes;
464}
void extraCollectNodes(DdNode *Func, st__table *tNodes)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Extra_CountCofactorMinterms()

unsigned Extra_CountCofactorMinterms ( DdManager * dd,
DdNode * bFunc,
DdNode * bVarsCof,
DdNode * bVarsAll )

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

Synopsis [Counts the number of encoding minterms pointed to by the cofactor of the function.]

Description []

SideEffects [None]

Definition at line 910 of file extraBddCas.c.

915{
916 unsigned HKey;
917 DdNode * bFuncR;
918
919 // if the function is zero, there are no minterms
920// if ( bFunc == b0 )
921// return 0;
922
923// if ( st__lookup(Visited, (char*)bFunc, NULL) )
924// return 0;
925
926// HKey = hashKey2c( s_Signature, bFuncR );
927// if ( HHTable1[HKey].Sign == s_Signature && HHTable1[HKey].Arg1 == bFuncR ) // this node is visited
928// return 0;
929
930
931 // check the hash-table
932 bFuncR = Cudd_Regular(bFunc);
933// HKey = hashKey2( s_Signature, bFuncR, _TABLESIZE_COF );
934 HKey = hashKey2( s_Signature, bFunc, _TABLESIZE_COF );
935 for ( ; HHTable1[HKey].Sign == s_Signature; HKey = (HKey+1) % _TABLESIZE_COF )
936// if ( HHTable1[HKey].Arg1 == bFuncR ) // this node is visited
937 if ( HHTable1[HKey].Arg1 == bFunc ) // this node is visited
938 return 0;
939
940
941 // if the function is already the code
942 if ( dd->perm[bFuncR->index] >= s_EncodingVarsLevel )
943 {
944// st__insert(Visited, (char*)bFunc, NULL);
945
946// HHTable1[HKey].Sign = s_Signature;
947// HHTable1[HKey].Arg1 = bFuncR;
948
949 assert( HHTable1[HKey].Sign != s_Signature );
950 HHTable1[HKey].Sign = s_Signature;
951// HHTable1[HKey].Arg1 = bFuncR;
952 HHTable1[HKey].Arg1 = bFunc;
953
954 return Extra_CountMintermsSimple( bFunc, (1<<s_MultiStart) );
955 }
956 else
957 {
958 DdNode * bFunc0, * bFunc1;
959 DdNode * bVarsCof0, * bVarsCof1;
960 DdNode * bVarsCofR = Cudd_Regular(bVarsCof);
961 unsigned Res;
962
963 // get the levels
964 int LevelF = dd->perm[bFuncR->index];
965 int LevelC = cuddI(dd,bVarsCofR->index);
966 int LevelA = dd->perm[bVarsAll->index];
967
968 int LevelTop = LevelF;
969
970 if ( LevelTop > LevelC )
971 LevelTop = LevelC;
972
973 if ( LevelTop > LevelA )
974 LevelTop = LevelA;
975
976 // the top var in the function or in cofactoring vars always belongs to the set of all vars
977 assert( !( LevelTop == LevelF || LevelTop == LevelC ) || LevelTop == LevelA );
978
979 // cofactor the function
980 if ( LevelTop == LevelF )
981 {
982 if ( bFuncR != bFunc ) // bFunc is complemented
983 {
984 bFunc0 = Cudd_Not( cuddE(bFuncR) );
985 bFunc1 = Cudd_Not( cuddT(bFuncR) );
986 }
987 else
988 {
989 bFunc0 = cuddE(bFuncR);
990 bFunc1 = cuddT(bFuncR);
991 }
992 }
993 else // bVars is higher in the variable order
994 bFunc0 = bFunc1 = bFunc;
995
996 // cofactor the cube
997 if ( LevelTop == LevelC )
998 {
999 if ( bVarsCofR != bVarsCof ) // bFunc is complemented
1000 {
1001 bVarsCof0 = Cudd_Not( cuddE(bVarsCofR) );
1002 bVarsCof1 = Cudd_Not( cuddT(bVarsCofR) );
1003 }
1004 else
1005 {
1006 bVarsCof0 = cuddE(bVarsCofR);
1007 bVarsCof1 = cuddT(bVarsCofR);
1008 }
1009 }
1010 else // bVars is higher in the variable order
1011 bVarsCof0 = bVarsCof1 = bVarsCof;
1012
1013 // there are two cases:
1014 // (1) the top variable belongs to the cofactoring variables
1015 // (2) the top variable does not belong to the cofactoring variables
1016
1017 // (1) the top variable belongs to the cofactoring variables
1018 Res = 0;
1019 if ( LevelTop == LevelC )
1020 {
1021 if ( bVarsCof1 == b0 ) // this is a negative cofactor
1022 {
1023 if ( bFunc0 != b0 )
1024 Res = Extra_CountCofactorMinterms( dd, bFunc0, bVarsCof0, cuddT(bVarsAll) );
1025 }
1026 else // this is a positive cofactor
1027 {
1028 if ( bFunc1 != b0 )
1029 Res = Extra_CountCofactorMinterms( dd, bFunc1, bVarsCof1, cuddT(bVarsAll) );
1030 }
1031 }
1032 else
1033 {
1034 if ( bFunc0 != b0 )
1035 Res += Extra_CountCofactorMinterms( dd, bFunc0, bVarsCof0, cuddT(bVarsAll) );
1036
1037 if ( bFunc1 != b0 )
1038 Res += Extra_CountCofactorMinterms( dd, bFunc1, bVarsCof1, cuddT(bVarsAll) );
1039 }
1040
1041// st__insert(Visited, (char*)bFunc, NULL);
1042
1043// HHTable1[HKey].Sign = s_Signature;
1044// HHTable1[HKey].Arg1 = bFuncR;
1045
1046 // skip through the entries with the same signatures
1047 // (these might have been created at the time of recursive calls)
1048 for ( ; HHTable1[HKey].Sign == s_Signature; HKey = (HKey+1) % _TABLESIZE_COF );
1049 assert( HHTable1[HKey].Sign != s_Signature );
1050 HHTable1[HKey].Sign = s_Signature;
1051// HHTable1[HKey].Arg1 = bFuncR;
1052 HHTable1[HKey].Arg1 = bFunc;
1053
1054 return Res;
1055 }
1056}
#define _TABLESIZE_COF
Definition extraBddCas.c:37
_HashEntry_cof HHTable1[_TABLESIZE_COF]
Definition extraBddCas.c:43
unsigned Extra_CountCofactorMinterms(DdManager *dd, DdNode *bFunc, DdNode *bVarsCof, DdNode *bVarsAll)
#define hashKey2(a, b, TSIZE)
Definition extraBdd.h:86
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Extra_ProfileWidth()

int Extra_ProfileWidth ( DdManager * dd,
DdNode * Func,
int * pProfile,
int CutLevel )

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

Synopsis [Fast computation of the BDD profile.]

Description [The array to store the profile is given by the user and should contain at least as many entries as there is the maximum of the BDD/ZDD size of the manager PLUS ONE. When we say that the widths of the DD on level L is W, we mean the following. Let us create the cut between the level L-1 and the level L and count the number of different DD nodes pointed to across the cut. This number is the width W. From this it follows the on level 0, the width is equal to the number of external pointers to the considered DDs. If there is only one DD, then the profile on level 0 is always 1. If this DD is rooted in the topmost variable, then the width on level 1 is always 2, etc. The width at the level equal to dd->size is the number of terminal nodes in the DD. (Because we consider the first level #0 and the last level #dd->size, the profile array should contain dd->size+1 entries.) ]

SideEffects [This procedure will not work for BDDs w/ complement edges, only for ADDs and ZDDs]

SeeAlso []

Definition at line 519 of file extraBddCas.c.

520{
521 st__generator * gen;
522 st__table * tNodeTopRef; // this table stores the top level from which this node is pointed to
523 st__table * tNodes;
524 DdNode * node;
525 DdNode * nodeR;
526 int LevelStart, Limit;
527 int i, size;
528 int WidthMax;
529
530 // start the mapping table
531 tNodeTopRef = st__init_table( st__ptrcmp, st__ptrhash);;
532 // add the topmost node to the profile
533 extraProfileUpdateTopLevel( tNodeTopRef, 0, Func );
534
535 // collect all nodes
536 tNodes = Extra_CollectNodes( Func );
537 // go though all the nodes and set the top level the cofactors are pointed from
538// Cudd_ForeachNode( dd, Func, genDD, node )
539 st__foreach_item( tNodes, gen, (const char**)&node, NULL )
540 {
541// assert( Cudd_Regular(node) ); // this procedure works only with ADD/ZDD (not BDD w/ compl.edges)
542 nodeR = Cudd_Regular(node);
543 if ( cuddIsConstant(nodeR) )
544 continue;
545 // this node is not a constant - consider its cofactors
546 extraProfileUpdateTopLevel( tNodeTopRef, dd->perm[node->index]+1, cuddE(nodeR) );
547 extraProfileUpdateTopLevel( tNodeTopRef, dd->perm[node->index]+1, cuddT(nodeR) );
548 }
549 st__free_table( tNodes );
550
551 // clean the profile
552 size = ddMax(dd->size, dd->sizeZ) + 1;
553 for ( i = 0; i < size; i++ )
554 pProfile[i] = 0;
555
556 // create the profile
557 st__foreach_item( tNodeTopRef, gen, (const char**)&node, (char**)&LevelStart )
558 {
559 nodeR = Cudd_Regular(node);
560 Limit = (cuddIsConstant(nodeR))? dd->size: dd->perm[nodeR->index];
561 for ( i = LevelStart; i <= Limit; i++ )
562 pProfile[i]++;
563 }
564
565 if ( CutLevel != -1 && CutLevel != 0 )
566 size = CutLevel;
567
568 // get the max width
569 WidthMax = 0;
570 for ( i = 0; i < size; i++ )
571 if ( WidthMax < pProfile[i] )
572 WidthMax = pProfile[i];
573
574 // deref the table
575 st__free_table( tNodeTopRef );
576
577 return WidthMax;
578} /* end of Extra_ProfileWidth */
st__table * Extra_CollectNodes(DdNode *Func)
void extraProfileUpdateTopLevel(st__table *tNodeTopRef, int TopLevelNew, DdNode *node)
unsigned long long size
Definition giaNewBdd.h:39
Here is the call graph for this function:
Here is the caller graph for this function:

◆ extraCollectNodes()

void extraCollectNodes ( DdNode * Func,
st__table * tNodes )

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

Synopsis [Collects all the BDD nodes into the table.]

Description []

SideEffects []

SeeAlso []

Definition at line 435 of file extraBddCas.c.

436{
437 DdNode * FuncR;
438 FuncR = Cudd_Regular(Func);
439 if ( st__find_or_add( tNodes, (char*)FuncR, NULL ) )
440 return;
441 if ( cuddIsConstant(FuncR) )
442 return;
443 extraCollectNodes( cuddE(FuncR), tNodes );
444 extraCollectNodes( cuddT(FuncR), tNodes );
445}
int st__find_or_add(st__table *table, char *key, char ***slot)
Definition st.c:230
Here is the call graph for this function:
Here is the caller graph for this function:

◆ extraProfileUpdateTopLevel()

void extraProfileUpdateTopLevel ( st__table * tNodeTopRef,
int TopLevelNew,
DdNode * node )

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

Synopsis [Updates the topmost level from which the given node is referenced.]

Description [Takes the table which maps each BDD nodes (including the constants) into the topmost level on which this node counts as a cofactor. Takes the topmost level, on which this node counts as a cofactor (see Extra_ProfileWidthFast(). Takes the node, for which the table entry should be updated.]

SideEffects []

SeeAlso []

Definition at line 480 of file extraBddCas.c.

481{
482 int * pTopLevel;
483
484 if ( st__find_or_add( tNodeTopRef, (char*)node, (char***)&pTopLevel ) )
485 { // the node is already referenced
486 // the current top level should be updated if it is larger than the new level
487 if ( *pTopLevel > TopLevelNew )
488 *pTopLevel = TopLevelNew;
489 }
490 else
491 { // the node is not referenced
492 // its level should be set to the current new level
493 *pTopLevel = TopLevelNew;
494 }
495}
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ HHTable1

Definition at line 43 of file extraBddCas.c.

◆ HHTable2

Definition at line 53 of file extraBddCas.c.