Commit 4bd7efa6 by Alan Mishchenko

Added counting hits and misses during structural hashing.

parent edbff75f
...@@ -149,6 +149,8 @@ struct Gia_Man_t_ ...@@ -149,6 +149,8 @@ struct Gia_Man_t_
Vec_Flt_t * vTiming; // arrival/required/slack Vec_Flt_t * vTiming; // arrival/required/slack
void * pManTime; // the timing manager void * pManTime; // the timing manager
void * pLutLib; // LUT library void * pLutLib; // LUT library
word nHashHit; // hash table hit
word nHashMiss; // hash table miss
}; };
......
...@@ -491,7 +491,11 @@ int Gia_ManHashAnd( Gia_Man_t * p, int iLit0, int iLit1 ) ...@@ -491,7 +491,11 @@ int Gia_ManHashAnd( Gia_Man_t * p, int iLit0, int iLit1 )
{ {
int * pPlace = Gia_ManHashFind( p, iLit0, iLit1 ); int * pPlace = Gia_ManHashFind( p, iLit0, iLit1 );
if ( *pPlace ) if ( *pPlace )
{
p->nHashHit++;
return *pPlace; return *pPlace;
}
p->nHashMiss++;
if ( p->nObjs < p->nObjsAlloc ) if ( p->nObjs < p->nObjsAlloc )
return *pPlace = Gia_ManAppendAnd( p, iLit0, iLit1 ); return *pPlace = Gia_ManAppendAnd( p, iLit0, iLit1 );
else else
......
...@@ -70,6 +70,7 @@ Gia_Man_t * Gia_ManStart( int nObjsMax ) ...@@ -70,6 +70,7 @@ Gia_Man_t * Gia_ManStart( int nObjsMax )
***********************************************************************/ ***********************************************************************/
void Gia_ManStop( Gia_Man_t * p ) void Gia_ManStop( Gia_Man_t * p )
{ {
printf( "Hash table hits = %12u. Hash table misses = %12u.\n", (int)p->nHashHit, (int)p->nHashMiss );
Tim_ManStopP( (Tim_Man_t **)&p->pManTime ); Tim_ManStopP( (Tim_Man_t **)&p->pManTime );
assert( p->pManTime == NULL ); assert( p->pManTime == NULL );
Vec_PtrFreeFree( p->vNamesIn ); Vec_PtrFreeFree( p->vNamesIn );
......
...@@ -369,7 +369,8 @@ int Au_NtkAllocObj( Au_Ntk_t * p, int nFanins, int Type ) ...@@ -369,7 +369,8 @@ int Au_NtkAllocObj( Au_Ntk_t * p, int nFanins, int Type )
{ {
int nObjInt2 = 63 + 64 * (((nObjInt-63) >> 6) + (((nObjInt-63) & 63) > 0)); int nObjInt2 = 63 + 64 * (((nObjInt-63) >> 6) + (((nObjInt-63) & 63) > 0));
assert( nObjInt2 >= nObjInt ); assert( nObjInt2 >= nObjInt );
p->nUseful += nObjInt - nObjInt2; // if ( nObjInt2 + 64 < (1 << 12) )
// p->nUseful += nObjInt - nObjInt2;
nObjInt = nObjInt2; nObjInt = nObjInt2;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment