abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
ifCache.c File Reference
#include "if.h"
#include "misc/vec/vecHsh.h"

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START void If_ManCacheRecord (If_Man_t *p, int iDsd0, int iDsd1, int nShared, int iDsd)
 DECLARATIONS ///. More...
 
void If_ManCacheAnalize (If_Man_t *p)
 

Function Documentation

void If_ManCacheAnalize ( If_Man_t p)

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 70 of file ifCache.c.

71 {
72  Vec_Int_t * vRes, * vTest[32];
73  int i, Entry, uUnique;
74  vRes = Hsh_IntManHashArray( p->vCutData, 4 );
75  for ( i = 0; i <= p->pPars->nLutSize; i++ )
76  vTest[i] = Vec_IntAlloc( 1000 );
77  Vec_IntForEachEntry( vRes, Entry, i )
78  Vec_IntPush( vTest[Vec_IntEntry(p->vCutData, 4*i+2)], Entry );
79  for ( i = 0; i <= p->pPars->nLutSize; i++ )
80  {
81  uUnique = Vec_IntCountUnique(vTest[i]);
82  printf( "%2d-var entries = %8d. (%6.2f %%) Unique entries = %8d. (%6.2f %%)\n",
83  i, Vec_IntSize(vTest[i]), 100.0*Vec_IntSize(vTest[i])/Abc_MaxInt(1, Vec_IntSize(vRes)),
84  uUnique, 100.0*uUnique/Abc_MaxInt(1, Vec_IntSize(vTest[i])) );
85  }
86  for ( i = 0; i <= p->pPars->nLutSize; i++ )
87  Vec_IntFree( vTest[i] );
88  uUnique = Vec_IntCountUnique(vRes);
89  printf( "Total entries = %8d. (%6.2f %%) Unique entries = %8d. (%6.2f %%)\n",
90  Vec_IntSize(p->vCutData)/4, 100.0, uUnique, 100.0*uUnique/Abc_MaxInt(1, Vec_IntSize(p->vCutData)/4) );
91  Vec_IntFree( vRes );
92 }
int nLutSize
Definition: if.h:103
static int Vec_IntCountUnique(Vec_Int_t *p)
Definition: vecInt.h:1345
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
static int Abc_MaxInt(int a, int b)
Definition: abc_global.h:238
static Vec_Int_t * Hsh_IntManHashArray(Vec_Int_t *vData, int nSize)
Definition: vecHsh.h:191
for(p=first;p->value< newval;p=p->next)
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: bblif.c:149
static int Vec_IntEntry(Vec_Int_t *p, int i)
Definition: bblif.c:268
Vec_Int_t * vCutData
Definition: if.h:260
static void Vec_IntPush(Vec_Int_t *p, int Entry)
Definition: bblif.c:468
If_Par_t * pPars
Definition: if.h:184
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
static void Vec_IntFree(Vec_Int_t *p)
Definition: bblif.c:235
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
Definition: vecInt.h:54
ABC_NAMESPACE_IMPL_START void If_ManCacheRecord ( If_Man_t p,
int  iDsd0,
int  iDsd1,
int  nShared,
int  iDsd 
)

DECLARATIONS ///.

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

FileName [ifCache.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [FPGA mapping based on priority cuts.]

Synopsis []

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - November 21, 2006.]

Revision [

Id:
ifCache.c,v 1.00 2006/11/21 00:00:00 alanmi Exp

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 45 of file ifCache.c.

46 {
47  assert( nShared >= 0 && nShared <= p->pPars->nLutSize );
48  if ( p->vCutData == NULL )
49  p->vCutData = Vec_IntAlloc( 10000 );
50  if ( iDsd0 > iDsd1 )
51  ABC_SWAP( int, iDsd0, iDsd1 );
52  Vec_IntPush( p->vCutData, iDsd0 );
53  Vec_IntPush( p->vCutData, iDsd1 );
54  Vec_IntPush( p->vCutData, nShared );
55  Vec_IntPush( p->vCutData, iDsd );
56 // printf( "%6d %6d %6d %6d\n", iDsd0, iDsd1, nShared, iDsd );
57 }
#define ABC_SWAP(Type, a, b)
Definition: abc_global.h:218
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: bblif.c:149
Vec_Int_t * vCutData
Definition: if.h:260
static void Vec_IntPush(Vec_Int_t *p, int Entry)
Definition: bblif.c:468
#define assert(ex)
Definition: util_old.h:213