cudd  3.0.0
The University of Colorado Decision Diagram Package
Functions
cuddCache.c File Reference

Functions for cache insertion and lookup. More...

#include "util.h"
#include "cuddInt.h"
Include dependency graph for cuddCache.c:

Functions

int cuddInitCache (DdManager *unique, unsigned int cacheSize, unsigned int maxCacheSize)
 Initializes the computed table. More...
 
void cuddCacheInsert (DdManager *table, ptruint op, DdNode *f, DdNode *g, DdNode *h, DdNode *data)
 Inserts a result in the cache for a function with three operands. More...
 
void cuddCacheInsert2 (DdManager *table, DD_CTFP op, DdNode *f, DdNode *g, DdNode *data)
 Inserts a result in the cache for a function with two operands. More...
 
void cuddCacheInsert1 (DdManager *table, DD_CTFP1 op, DdNode *f, DdNode *data)
 Inserts a result in the cache for a function with two operands. More...
 
DdNodecuddCacheLookup (DdManager *table, ptruint op, DdNode *f, DdNode *g, DdNode *h)
 Looks up in the cache for the result of op applied to f, g, and h. More...
 
DdNodecuddCacheLookupZdd (DdManager *table, ptruint op, DdNode *f, DdNode *g, DdNode *h)
 Looks up in the cache for the result of op applied to f, g, and h. More...
 
DdNodecuddCacheLookup2 (DdManager *table, DD_CTFP op, DdNode *f, DdNode *g)
 Looks up in the cache for the result of op applied to f and g. More...
 
DdNodecuddCacheLookup1 (DdManager *table, DD_CTFP1 op, DdNode *f)
 Looks up in the cache for the result of op applied to f. More...
 
DdNodecuddCacheLookup2Zdd (DdManager *table, DD_CTFP op, DdNode *f, DdNode *g)
 Looks up in the cache for the result of op applied to f and g. More...
 
DdNodecuddCacheLookup1Zdd (DdManager *table, DD_CTFP1 op, DdNode *f)
 Looks up in the cache for the result of op applied to f. More...
 
DdNodecuddConstantLookup (DdManager *table, ptruint op, DdNode *f, DdNode *g, DdNode *h)
 Looks up in the cache for the result of op applied to f, g, and h. More...
 
int cuddCacheProfile (DdManager *table, FILE *fp)
 Computes and prints a profile of the cache usage. More...
 
void cuddCacheResize (DdManager *table)
 Resizes the cache. More...
 
void cuddCacheFlush (DdManager *table)
 Flushes the cache. More...
 
int cuddComputeFloorLog2 (unsigned int value)
 Returns the floor of the logarithm to the base 2. More...
 

Detailed Description

Functions for cache insertion and lookup.

Author
Fabio Somenzi

Function Documentation

◆ cuddCacheFlush()

void cuddCacheFlush ( DdManager table)

Flushes the cache.

Side effects None

◆ cuddCacheInsert()

void cuddCacheInsert ( DdManager table,
ptruint  op,
DdNode f,
DdNode g,
DdNode h,
DdNode data 
)

Inserts a result in the cache for a function with three operands.

The operator tag (see cuddInt.h for details) is split and stored into unused bits of the first two pointers.

Side effects None
See also
cuddCacheInsert2 cuddCacheInsert1

◆ cuddCacheInsert1()

void cuddCacheInsert1 ( DdManager table,
DD_CTFP1  op,
DdNode f,
DdNode data 
)

Inserts a result in the cache for a function with two operands.

Side effects None
See also
cuddCacheInsert cuddCacheInsert2

◆ cuddCacheInsert2()

void cuddCacheInsert2 ( DdManager table,
DD_CTFP  op,
DdNode f,
DdNode g,
DdNode data 
)

Inserts a result in the cache for a function with two operands.

Side effects None
See also
cuddCacheInsert cuddCacheInsert1

◆ cuddCacheLookup()

DdNode* cuddCacheLookup ( DdManager table,
ptruint  op,
DdNode f,
DdNode g,
DdNode h 
)

Looks up in the cache for the result of op applied to f, g, and h.

Returns
the result if found; it returns NULL if no result is found.
Side effects None
See also
cuddCacheLookup2 cuddCacheLookup1

◆ cuddCacheLookup1()

DdNode* cuddCacheLookup1 ( DdManager table,
DD_CTFP1  op,
DdNode f 
)

Looks up in the cache for the result of op applied to f.

Returns
the result if found; it returns NULL if no result is found.
Side effects None
See also
cuddCacheLookup cuddCacheLookup2

◆ cuddCacheLookup1Zdd()

DdNode* cuddCacheLookup1Zdd ( DdManager table,
DD_CTFP1  op,
DdNode f 
)

Looks up in the cache for the result of op applied to f.

Returns
the result if found; it returns NULL if no result is found.
Side effects None
See also
cuddCacheLookupZdd cuddCacheLookup2Zdd

◆ cuddCacheLookup2()

DdNode* cuddCacheLookup2 ( DdManager table,
DD_CTFP  op,
DdNode f,
DdNode g 
)

Looks up in the cache for the result of op applied to f and g.

Returns
the result if found; it returns NULL if no result is found.
Side effects None
See also
cuddCacheLookup cuddCacheLookup1

◆ cuddCacheLookup2Zdd()

DdNode* cuddCacheLookup2Zdd ( DdManager table,
DD_CTFP  op,
DdNode f,
DdNode g 
)

Looks up in the cache for the result of op applied to f and g.

Returns
the result if found; it returns NULL if no result is found.
Side effects None
See also
cuddCacheLookupZdd cuddCacheLookup1Zdd

◆ cuddCacheLookupZdd()

DdNode* cuddCacheLookupZdd ( DdManager table,
ptruint  op,
DdNode f,
DdNode g,
DdNode h 
)

Looks up in the cache for the result of op applied to f, g, and h.

Returns
the result if found; it returns NULL if no result is found.
Side effects None
See also
cuddCacheLookup2Zdd cuddCacheLookup1Zdd

◆ cuddCacheProfile()

int cuddCacheProfile ( DdManager table,
FILE *  fp 
)

Computes and prints a profile of the cache usage.

Returns
1 if successful; 0 otherwise.
Side effects None

◆ cuddCacheResize()

void cuddCacheResize ( DdManager table)

Resizes the cache.

Side effects None

◆ cuddComputeFloorLog2()

int cuddComputeFloorLog2 ( unsigned int  value)

Returns the floor of the logarithm to the base 2.

The input value is assumed to be greater than 0.

Side effects None

◆ cuddConstantLookup()

DdNode* cuddConstantLookup ( DdManager table,
ptruint  op,
DdNode f,
DdNode g,
DdNode h 
)

Looks up in the cache for the result of op applied to f, g, and h.

Assumes that the calling procedure (e.g., Cudd_bddIteConstant) is only interested in whether the result is constant or not.

Returns
the result if found (possibly DD_NON_CONSTANT); otherwise it returns NULL.
Side effects None
See also
cuddCacheLookup

◆ cuddInitCache()

int cuddInitCache ( DdManager unique,
unsigned int  cacheSize,
unsigned int  maxCacheSize 
)

Initializes the computed table.

It is called by Cudd_Init.

Returns
1 in case of success; 0 otherwise.
Side effects None
See also
Cudd_Init
Parameters
uniqueunique table
cacheSizeinitial size of the cache
maxCacheSizecache size beyond which no resizing occurs