abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
bdcTable.c File Reference
#include "bdcInt.h"

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START int Bdc_TableCheckContainment (Bdc_Man_t *p, Bdc_Isf_t *pIsf, unsigned *puTruth)
 DECLARATIONS ///. More...
 
Bdc_Fun_tBdc_TableLookup (Bdc_Man_t *p, Bdc_Isf_t *pIsf)
 
void Bdc_TableAdd (Bdc_Man_t *p, Bdc_Fun_t *pFunc)
 
void Bdc_TableClear (Bdc_Man_t *p)
 

Function Documentation

void Bdc_TableAdd ( Bdc_Man_t p,
Bdc_Fun_t pFunc 
)

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

Synopsis [Adds the new entry to the hash table.]

Description []

SideEffects []

SeeAlso []

Definition at line 101 of file bdcTable.c.

102 {
103  if ( p->pTable[pFunc->uSupp] == NULL )
104  Vec_IntPush( p->vSpots, pFunc->uSupp );
105  pFunc->pNext = p->pTable[pFunc->uSupp];
106  p->pTable[pFunc->uSupp] = pFunc;
107 }
Vec_Int_t * vSpots
Definition: bdcInt.h:98
static void Vec_IntPush(Vec_Int_t *p, int Entry)
Definition: bblif.c:468
Bdc_Fun_t ** pTable
Definition: bdcInt.h:96
ABC_NAMESPACE_IMPL_START int Bdc_TableCheckContainment ( Bdc_Man_t p,
Bdc_Isf_t pIsf,
unsigned *  puTruth 
)

DECLARATIONS ///.

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

FileName [bdcTable.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Truth-table-based bi-decomposition engine.]

Synopsis [Hash table for intermediate nodes.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - January 30, 2007.]

Revision [

Id:
bdcTable.c,v 1.00 2007/01/30 00:00:00 alanmi Exp

]FUNCTION DEFINITIONS /// Function*************************************************************

Synopsis [Checks containment of the function in the ISF.]

Description []

SideEffects []

SeeAlso []

Definition at line 45 of file bdcTable.c.

46 {
47  return Kit_TruthIsImply( pIsf->puOn, puTruth, p->nVars ) &&
48  Kit_TruthIsDisjoint( puTruth, pIsf->puOff, p->nVars );
49 }
int nVars
Definition: bdcInt.h:85
static int Kit_TruthIsImply(unsigned *pIn1, unsigned *pIn2, int nVars)
Definition: kit.h:331
unsigned * puOff
Definition: bdcInt.h:78
static int Kit_TruthIsDisjoint(unsigned *pIn1, unsigned *pIn2, int nVars)
Definition: kit.h:339
unsigned * puOn
Definition: bdcInt.h:77
void Bdc_TableClear ( Bdc_Man_t p)

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

Synopsis [Adds the new entry to the hash table.]

Description []

SideEffects []

SeeAlso []

Definition at line 120 of file bdcTable.c.

121 {
122  int Spot, i;
123  Vec_IntForEachEntry( p->vSpots, Spot, i )
124  p->pTable[Spot] = NULL;
125  Vec_IntClear( p->vSpots );
126 }
Vec_Int_t * vSpots
Definition: bdcInt.h:98
static void Vec_IntClear(Vec_Int_t *p)
Definition: bblif.c:452
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
Definition: vecInt.h:54
Bdc_Fun_t* Bdc_TableLookup ( Bdc_Man_t p,
Bdc_Isf_t pIsf 
)

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

Synopsis [Adds the new entry to the hash table.]

Description []

SideEffects []

SeeAlso []

Definition at line 62 of file bdcTable.c.

63 {
64  int fDisableCache = 0;
65  Bdc_Fun_t * pFunc;
66  if ( fDisableCache && Kit_WordCountOnes(pIsf->uSupp) > 1 )
67  return NULL;
68  if ( pIsf->uSupp == 0 )
69  {
70  assert( p->pTable[pIsf->uSupp] == p->pNodes );
71  if ( Kit_TruthIsConst1( pIsf->puOn, p->nVars ) )
72  return p->pNodes;
73  assert( Kit_TruthIsConst1( pIsf->puOff, p->nVars ) );
74  return Bdc_Not(p->pNodes);
75  }
76  for ( pFunc = p->pTable[pIsf->uSupp]; pFunc; pFunc = pFunc->pNext )
77  if ( Bdc_TableCheckContainment( p, pIsf, pFunc->puFunc ) )
78  return pFunc;
79  Bdc_IsfNot( pIsf );
80  for ( pFunc = p->pTable[pIsf->uSupp]; pFunc; pFunc = pFunc->pNext )
81  if ( Bdc_TableCheckContainment( p, pIsf, pFunc->puFunc ) )
82  {
83  Bdc_IsfNot( pIsf );
84  return Bdc_Not(pFunc);
85  }
86  Bdc_IsfNot( pIsf );
87  return NULL;
88 }
unsigned uSupp
Definition: bdcInt.h:75
int nVars
Definition: bdcInt.h:85
unsigned * puOff
Definition: bdcInt.h:78
static int Kit_TruthIsConst1(unsigned *pIn, int nVars)
Definition: kit.h:323
typedefABC_NAMESPACE_HEADER_START struct Bdc_Fun_t_ Bdc_Fun_t
INCLUDES ///.
Definition: bdc.h:42
ABC_NAMESPACE_IMPL_START int Bdc_TableCheckContainment(Bdc_Man_t *p, Bdc_Isf_t *pIsf, unsigned *puTruth)
DECLARATIONS ///.
Definition: bdcTable.c:45
Bdc_Fun_t ** pTable
Definition: bdcInt.h:96
unsigned * puOn
Definition: bdcInt.h:77
Bdc_Fun_t * pNodes
Definition: bdcInt.h:90
static Bdc_Fun_t * Bdc_Not(Bdc_Fun_t *p)
Definition: bdc.h:56
#define assert(ex)
Definition: util_old.h:213
static int Kit_WordCountOnes(unsigned uWord)
Definition: kit.h:243
static void Bdc_IsfNot(Bdc_Isf_t *p)
Definition: bdcInt.h:134