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

Go to the source code of this file.

Functions

Hop_Obj_tHop_TableLookup (Hop_Man_t *p, Hop_Obj_t *pGhost)
 FUNCTION DEFINITIONS ///.
 
void Hop_TableInsert (Hop_Man_t *p, Hop_Obj_t *pObj)
 
void Hop_TableDelete (Hop_Man_t *p, Hop_Obj_t *pObj)
 
int Hop_TableCountEntries (Hop_Man_t *p)
 
void Hop_TableProfile (Hop_Man_t *p)
 

Function Documentation

◆ Hop_TableCountEntries()

int Hop_TableCountEntries ( Hop_Man_t * p)

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

Synopsis [Count the number of nodes in the table.]

Description []

SideEffects []

SeeAlso []

Definition at line 145 of file hopTable.c.

146{
147 Hop_Obj_t * pEntry;
148 int i, Counter = 0;
149 for ( i = 0; i < p->nTableSize; i++ )
150 for ( pEntry = p->pTable[i]; pEntry; pEntry = pEntry->pNext )
151 Counter++;
152 return Counter;
153}
Cube * p
Definition exorList.c:222
struct Hop_Obj_t_ Hop_Obj_t
Definition hop.h:50
Hop_Obj_t * pNext
Definition hop.h:71
Here is the caller graph for this function:

◆ Hop_TableDelete()

void Hop_TableDelete ( Hop_Man_t * p,
Hop_Obj_t * pObj )

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

Synopsis [Deletes the node from the hash table.]

Description []

SideEffects []

SeeAlso []

Definition at line 123 of file hopTable.c.

124{
125 Hop_Obj_t ** ppPlace;
126 assert( !Hop_IsComplement(pObj) );
127 ppPlace = Hop_TableFind( p, pObj );
128 assert( *ppPlace == pObj ); // node should be in the table
129 // remove the node
130 *ppPlace = pObj->pNext;
131 pObj->pNext = NULL;
132}
#define assert(ex)
Definition util_old.h:213
Here is the caller graph for this function:

◆ Hop_TableInsert()

void Hop_TableInsert ( Hop_Man_t * p,
Hop_Obj_t * pObj )

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

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

Description []

SideEffects []

SeeAlso []

Definition at line 100 of file hopTable.c.

101{
102 Hop_Obj_t ** ppPlace;
103 assert( !Hop_IsComplement(pObj) );
104 assert( Hop_TableLookup(p, pObj) == NULL );
105 if ( (pObj->Id & 0xFF) == 0 && 2 * p->nTableSize < Hop_ManNodeNum(p) )
106 Hop_TableResize( p );
107 ppPlace = Hop_TableFind( p, pObj );
108 assert( *ppPlace == NULL );
109 *ppPlace = pObj;
110}
Hop_Obj_t * Hop_TableLookup(Hop_Man_t *p, Hop_Obj_t *pGhost)
FUNCTION DEFINITIONS ///.
Definition hopTable.c:71
int Id
Definition hop.h:80
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Hop_TableLookup()

Hop_Obj_t * Hop_TableLookup ( Hop_Man_t * p,
Hop_Obj_t * pGhost )

FUNCTION DEFINITIONS ///.

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

Synopsis [Checks if a node with the given attributes is in the hash table.]

Description []

SideEffects []

SeeAlso []

Definition at line 71 of file hopTable.c.

72{
73 Hop_Obj_t * pEntry;
74 assert( !Hop_IsComplement(pGhost) );
75 assert( Hop_ObjChild0(pGhost) && Hop_ObjChild1(pGhost) );
76 assert( Hop_ObjFanin0(pGhost)->Id < Hop_ObjFanin1(pGhost)->Id );
77 if ( p->fRefCount && (!Hop_ObjRefs(Hop_ObjFanin0(pGhost)) || !Hop_ObjRefs(Hop_ObjFanin1(pGhost))) )
78 return NULL;
79 for ( pEntry = p->pTable[Hop_Hash(pGhost, p->nTableSize)]; pEntry; pEntry = pEntry->pNext )
80 {
81 if ( Hop_ObjChild0(pEntry) == Hop_ObjChild0(pGhost) &&
82 Hop_ObjChild1(pEntry) == Hop_ObjChild1(pGhost) &&
83 Hop_ObjType(pEntry) == Hop_ObjType(pGhost) )
84 return pEntry;
85 }
86 return NULL;
87}
Here is the caller graph for this function:

◆ Hop_TableProfile()

void Hop_TableProfile ( Hop_Man_t * p)

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

Synopsis [Profiles the hash table.]

Description []

SideEffects []

SeeAlso []

Definition at line 212 of file hopTable.c.

213{
214 Hop_Obj_t * pEntry;
215 int i, Counter;
216 for ( i = 0; i < p->nTableSize; i++ )
217 {
218 Counter = 0;
219 for ( pEntry = p->pTable[i]; pEntry; pEntry = pEntry->pNext )
220 Counter++;
221 if ( Counter )
222 printf( "%d ", Counter );
223 }
224}