abc-master
|
Go to the source code of this file.
Macros | |
#define | DD_MAX_HASHTABLE_DENSITY 2 /* tells when to resize a table */ |
#define | ddLCHash2(f, g, shift) ((((unsigned)(f) * DD_P1 + (unsigned)(g)) * DD_P2) >> (shift)) |
#define | ddLCHash3(f, g, h, shift) ddCHash2(f,g,h,shift) |
Variables | |
static char rcsid[] | DD_UNUSED = "$Id: cuddLCache.c,v 1.24 2009/03/08 02:49:02 fabio Exp $" |
#define DD_MAX_HASHTABLE_DENSITY 2 /* tells when to resize a table */ |
CFile***********************************************************************
FileName [cuddLCache.c]
PackageName [cudd]
Synopsis [Functions for local caches.]
Description [Internal procedures included in this module:
Static procedures included in this module:
]
SeeAlso []
Author [Fabio Somenzi]
Copyright [Copyright (c) 1995-2004, Regents of the University of Colorado
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
Neither the name of the University of Colorado nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.]
Definition at line 86 of file cuddLCache.c.
Macro***********************************************************************
Synopsis [Computes hash function for keys of two operands.]
Description []
SideEffects [None]
SeeAlso [ddLCHash3 ddLCHash]
Definition at line 126 of file cuddLCache.c.
#define ddLCHash3 | ( | f, | |
g, | |||
h, | |||
shift | |||
) | ddCHash2(f,g,h,shift) |
Macro***********************************************************************
Synopsis [Computes hash function for keys of three operands.]
Description []
SideEffects [None]
SeeAlso [ddLCHash2 ddLCHash]
Definition at line 142 of file cuddLCache.c.
|
static |
Function********************************************************************
Synopsis [Fast storage allocation for items in a hash table.]
Description [Fast storage allocation for items in a hash table. The first 4 bytes of a chunk contain a pointer to the next block; the rest contains DD_MEM_CHUNK spaces for hash items. Returns a pointer to a new item if successful; NULL is memory is full.]
SideEffects [None]
SeeAlso [cuddAllocNode cuddDynamicAllocNode]
Definition at line 1393 of file cuddLCache.c.
DdHashTable* cuddHashTableInit | ( | DdManager * | manager, |
unsigned int | keySize, | ||
unsigned int | initSize | ||
) |
Function********************************************************************
Synopsis [Initializes a hash table.]
Description [Initializes a hash table. Returns a pointer to the new table if successful; NULL otherwise.]
SideEffects [None]
SeeAlso [cuddHashTableQuit]
Definition at line 538 of file cuddLCache.c.
int cuddHashTableInsert | ( | DdHashTable * | hash, |
DdNodePtr * | key, | ||
DdNode * | value, | ||
ptrint | count | ||
) |
Function********************************************************************
Synopsis [Inserts an item in a hash table.]
Description [Inserts an item in a hash table when the key has more than three pointers. Returns 1 if successful; 0 otherwise.]
SideEffects [None]
SeeAlso [[cuddHashTableInsert1 cuddHashTableInsert2 cuddHashTableInsert3 cuddHashTableLookup]
Definition at line 648 of file cuddLCache.c.
int cuddHashTableInsert1 | ( | DdHashTable * | hash, |
DdNode * | f, | ||
DdNode * | value, | ||
ptrint | count | ||
) |
Function********************************************************************
Synopsis [Inserts an item in a hash table.]
Description [Inserts an item in a hash table when the key is one pointer. Returns 1 if successful; 0 otherwise.]
SideEffects [None]
SeeAlso [cuddHashTableInsert cuddHashTableInsert2 cuddHashTableInsert3 cuddHashTableLookup1]
Definition at line 767 of file cuddLCache.c.
int cuddHashTableInsert2 | ( | DdHashTable * | hash, |
DdNode * | f, | ||
DdNode * | g, | ||
DdNode * | value, | ||
ptrint | count | ||
) |
Function********************************************************************
Synopsis [Inserts an item in a hash table.]
Description [Inserts an item in a hash table when the key is composed of two pointers. Returns 1 if successful; 0 otherwise.]
SideEffects [None]
SeeAlso [cuddHashTableInsert cuddHashTableInsert1 cuddHashTableInsert3 cuddHashTableLookup2]
Definition at line 874 of file cuddLCache.c.
int cuddHashTableInsert3 | ( | DdHashTable * | hash, |
DdNode * | f, | ||
DdNode * | g, | ||
DdNode * | h, | ||
DdNode * | value, | ||
ptrint | count | ||
) |
Function********************************************************************
Synopsis [Inserts an item in a hash table.]
Description [Inserts an item in a hash table when the key is composed of three pointers. Returns 1 if successful; 0 otherwise.]
SideEffects [None]
SeeAlso [cuddHashTableInsert cuddHashTableInsert1 cuddHashTableInsert2 cuddHashTableLookup3]
Definition at line 984 of file cuddLCache.c.
DdNode* cuddHashTableLookup | ( | DdHashTable * | hash, |
DdNodePtr * | key | ||
) |
Function********************************************************************
Synopsis [Looks up a key in a hash table.]
Description [Looks up a key consisting of more than three pointers in a hash table. Returns the value associated to the key if there is an entry for the given key in the table; NULL otherwise. If the entry is present, its reference counter is decremented if not saturated. If the counter reaches 0, the value of the entry is dereferenced, and the entry is returned to the free list.]
SideEffects [None]
SeeAlso [cuddHashTableLookup1 cuddHashTableLookup2 cuddHashTableLookup3 cuddHashTableInsert]
Definition at line 703 of file cuddLCache.c.
DdNode* cuddHashTableLookup1 | ( | DdHashTable * | hash, |
DdNode * | f | ||
) |
Function********************************************************************
Synopsis [Looks up a key consisting of one pointer in a hash table.]
Description [Looks up a key consisting of one pointer in a hash table. Returns the value associated to the key if there is an entry for the given key in the table; NULL otherwise. If the entry is present, its reference counter is decremented if not saturated. If the counter reaches 0, the value of the entry is dereferenced, and the entry is returned to the free list.]
SideEffects [None]
SeeAlso [cuddHashTableLookup cuddHashTableLookup2 cuddHashTableLookup3 cuddHashTableInsert1]
Definition at line 819 of file cuddLCache.c.
DdNode* cuddHashTableLookup2 | ( | DdHashTable * | hash, |
DdNode * | f, | ||
DdNode * | g | ||
) |
Function********************************************************************
Synopsis [Looks up a key consisting of two pointers in a hash table.]
Description [Looks up a key consisting of two pointer in a hash table. Returns the value associated to the key if there is an entry for the given key in the table; NULL otherwise. If the entry is present, its reference counter is decremented if not saturated. If the counter reaches 0, the value of the entry is dereferenced, and the entry is returned to the free list.]
SideEffects [None]
SeeAlso [cuddHashTableLookup cuddHashTableLookup1 cuddHashTableLookup3 cuddHashTableInsert2]
Definition at line 928 of file cuddLCache.c.
DdNode* cuddHashTableLookup3 | ( | DdHashTable * | hash, |
DdNode * | f, | ||
DdNode * | g, | ||
DdNode * | h | ||
) |
Function********************************************************************
Synopsis [Looks up a key consisting of three pointers in a hash table.]
Description [Looks up a key consisting of three pointers in a hash table. Returns the value associated to the key if there is an entry for the given key in the table; NULL otherwise. If the entry is present, its reference counter is decremented if not saturated. If the counter reaches 0, the value of the entry is dereferenced, and the entry is returned to the free list.]
SideEffects [None]
SeeAlso [cuddHashTableLookup cuddHashTableLookup1 cuddHashTableLookup2 cuddHashTableInsert3]
Definition at line 1040 of file cuddLCache.c.
void cuddHashTableQuit | ( | DdHashTable * | hash | ) |
Function********************************************************************
Synopsis [Shuts down a hash table.]
Description [Shuts down a hash table, dereferencing all the values.]
SideEffects [None]
SeeAlso [cuddHashTableInit]
Definition at line 595 of file cuddLCache.c.
|
static |
Function********************************************************************
Synopsis [Resizes a hash table.]
Description [Resizes a hash table. Returns 1 if successful; 0 otherwise.]
SideEffects [None]
SeeAlso [cuddHashTableInsert]
Definition at line 1277 of file cuddLCache.c.
|
static |
Function********************************************************************
Synopsis [Inserts a local cache in the manager list.]
Description []
SideEffects [None]
SeeAlso []
Definition at line 1211 of file cuddLCache.c.
void cuddLocalCacheClearAll | ( | DdManager * | manager | ) |
Function********************************************************************
Synopsis [Clears the local caches of a manager.]
Description [Clears the local caches of a manager. Used before reordering.]
SideEffects [None]
SeeAlso []
Definition at line 404 of file cuddLCache.c.
void cuddLocalCacheClearDead | ( | DdManager * | manager | ) |
Function********************************************************************
Synopsis [Clears the dead entries of the local caches of a manager.]
Description [Clears the dead entries of the local caches of a manager. Used during garbage collection.]
SideEffects [None]
SeeAlso []
Definition at line 352 of file cuddLCache.c.
DdLocalCache* cuddLocalCacheInit | ( | DdManager * | manager, |
unsigned int | keySize, | ||
unsigned int | cacheSize, | ||
unsigned int | maxCacheSize | ||
) |
AutomaticEnd Function********************************************************************
Synopsis [Initializes a local computed table.]
Description [Initializes a computed table. Returns a pointer the the new local cache in case of success; NULL otherwise.]
SideEffects [None]
SeeAlso [cuddInitCache]
Definition at line 183 of file cuddLCache.c.
void cuddLocalCacheInsert | ( | DdLocalCache * | cache, |
DdNodePtr * | key, | ||
DdNode * | value | ||
) |
Function********************************************************************
Synopsis [Inserts a result in a local cache.]
Description []
SideEffects [None]
SeeAlso []
Definition at line 272 of file cuddLCache.c.
DdNode* cuddLocalCacheLookup | ( | DdLocalCache * | cache, |
DdNodePtr * | key | ||
) |
Function********************************************************************
Synopsis [Looks up in a local cache.]
Description [Looks up in a local cache. Returns the result if found; it returns NULL if no result is found.]
SideEffects [None]
SeeAlso []
Definition at line 305 of file cuddLCache.c.
void cuddLocalCacheQuit | ( | DdLocalCache * | cache | ) |
Function********************************************************************
Synopsis [Shuts down a local computed table.]
Description [Initializes the computed table. It is called by Cudd_Init. Returns a pointer the the new local cache in case of success; NULL otherwise.]
SideEffects [None]
SeeAlso [cuddLocalCacheInit]
Definition at line 246 of file cuddLCache.c.
|
static |
Function********************************************************************
Synopsis [Removes a local cache from the manager list.]
Description []
SideEffects [None]
SeeAlso []
Definition at line 1235 of file cuddLCache.c.
|
static |
AutomaticStart
Function********************************************************************
Synopsis [Resizes a local cache.]
Description []
SideEffects [None]
SeeAlso []
Definition at line 1100 of file cuddLCache.c.
Function********************************************************************
Synopsis [Computes the hash value for a local cache.]
Description [Computes the hash value for a local cache. Returns the bucket index.]
SideEffects [None]
SeeAlso []
Definition at line 1182 of file cuddLCache.c.
|
static |
Definition at line 103 of file cuddLCache.c.