From 6df122bda6a48ab61a27989b73027d617e0db626 Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Fri, 20 Jul 2012 18:56:26 -0700 Subject: Updated code for lazy man's synthesis (memory optimization). --- src/aig/gia/giaHash.c | 2 +- src/aig/gia/giaMan.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/aig/gia') diff --git a/src/aig/gia/giaHash.c b/src/aig/gia/giaHash.c index 61f73705..7167de39 100644 --- a/src/aig/gia/giaHash.c +++ b/src/aig/gia/giaHash.c @@ -109,7 +109,7 @@ int Gia_ManHashLookup( Gia_Man_t * p, Gia_Obj_t * p0, Gia_Obj_t * p1 ) void Gia_ManHashAlloc( Gia_Man_t * p ) { assert( p->pHTable == NULL ); - p->nHTable = Abc_PrimeCudd( p->nObjsAlloc ); + p->nHTable = Abc_PrimeCudd( Gia_ManAndNum(p) ? Gia_ManAndNum(p) + 1000 : p->nObjsAlloc ); p->pHTable = ABC_CALLOC( int, p->nHTable ); } diff --git a/src/aig/gia/giaMan.c b/src/aig/gia/giaMan.c index 31f03d80..b8a8afb8 100644 --- a/src/aig/gia/giaMan.c +++ b/src/aig/gia/giaMan.c @@ -52,8 +52,8 @@ Gia_Man_t * Gia_ManStart( int nObjsMax ) p->pObjs = ABC_CALLOC( Gia_Obj_t, nObjsMax ); p->pObjs->iDiff0 = p->pObjs->iDiff1 = GIA_NONE; p->nObjs = 1; - p->vCis = Vec_IntAlloc( nObjsMax / 10 ); - p->vCos = Vec_IntAlloc( nObjsMax / 10 ); + p->vCis = Vec_IntAlloc( nObjsMax / 20 ); + p->vCos = Vec_IntAlloc( nObjsMax / 20 ); return p; } @@ -414,10 +414,10 @@ void Gia_ManPrintStats( Gia_Man_t * p, int fTents, int fSwitch ) if ( Gia_ManRegNum(p) ) printf( " ff =%7d", Gia_ManRegNum(p) ); printf( " and =%8d", Gia_ManAndNum(p) ); - printf( " lev =%5d", Gia_ManLevelNum(p) ); + printf( " lev =%5d", Gia_ManLevelNum(p) ); Vec_IntFreeP( &p->vLevels ); printf( " cut =%5d", Gia_ManCrossCut(p) ); - printf( " mem =%5.2f MB", 1.0*(sizeof(Gia_Obj_t)*p->nObjs + sizeof(int)*(Vec_IntSize(p->vCis) + Vec_IntSize(p->vCos)))/(1<<20) ); -// printf( " mem =%5.2f MB", 1.0*(sizeof(Gia_Obj_t)*p->nObjsAlloc + sizeof(int)*(Vec_IntCap(p->vCis) + Vec_IntCap(p->vCos)))/(1<<20) ); +// printf( " mem =%5.2f MB", 1.0*(sizeof(Gia_Obj_t)*p->nObjs + sizeof(int)*(Vec_IntSize(p->vCis) + Vec_IntSize(p->vCos)))/(1<<20) ); + printf( " mem =%5.2f MB", 1.0*(sizeof(Gia_Obj_t)*p->nObjsAlloc + sizeof(int)*(Vec_IntCap(p->vCis) + Vec_IntCap(p->vCos)))/(1<<20) ); if ( Gia_ManHasDangling(p) ) printf( " ch =%5d", Gia_ManEquivCountClasses(p) ); if ( fSwitch ) -- cgit v1.2.3