From e9d0466494cbf7a707a450a7e058a0ae4c652f8b Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Thu, 5 Sep 2013 15:39:18 -0700 Subject: Updates for the new BMC engine. --- src/aig/gia/gia.h | 1 + src/aig/gia/giaDup.c | 3 ++- src/aig/gia/giaMan.c | 21 +++++++++++++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) (limited to 'src/aig/gia') diff --git a/src/aig/gia/gia.h b/src/aig/gia/gia.h index 7653dc62..2d3cf518 100644 --- a/src/aig/gia/gia.h +++ b/src/aig/gia/gia.h @@ -1018,6 +1018,7 @@ extern void Gia_ManSolveProblem( Gia_Man_t * pGia, Emb_Par_t * pP extern Gia_Man_t * Gia_ManStart( int nObjsMax ); extern void Gia_ManStop( Gia_Man_t * p ); extern void Gia_ManStopP( Gia_Man_t ** p ); +extern float Gia_ManMemory( Gia_Man_t * p ); extern void Gia_ManPrintStats( Gia_Man_t * p, int fTents, int fSwitch, int fCut ); extern void Gia_ManPrintStatsShort( Gia_Man_t * p ); extern void Gia_ManPrintMiterStatus( Gia_Man_t * p ); diff --git a/src/aig/gia/giaDup.c b/src/aig/gia/giaDup.c index 2e911ba8..e8e186cf 100644 --- a/src/aig/gia/giaDup.c +++ b/src/aig/gia/giaDup.c @@ -907,7 +907,7 @@ Gia_Man_t * Gia_ManDupMarked( Gia_Man_t * p ) Gia_Obj_t * pObj; int i, nRos = 0, nRis = 0; int CountMarked = 0; - Gia_ManForEachObj1( p, pObj, i ) + Gia_ManForEachObj( p, pObj, i ) CountMarked += pObj->fMark0; Gia_ManFillValue( p ); pNew = Gia_ManStart( Gia_ManObjNum(p) - CountMarked ); @@ -945,6 +945,7 @@ Gia_Man_t * Gia_ManDupMarked( Gia_Man_t * p ) nRis += Gia_ObjIsRi(p, pObj); } } + assert( pNew->nObjsAlloc == pNew->nObjs ); assert( nRos == nRis ); Gia_ManSetRegNum( pNew, nRos ); if ( p->pReprs && p->pNexts ) diff --git a/src/aig/gia/giaMan.c b/src/aig/gia/giaMan.c index a573e9e7..58057136 100644 --- a/src/aig/gia/giaMan.c +++ b/src/aig/gia/giaMan.c @@ -127,6 +127,27 @@ void Gia_ManStop( Gia_Man_t * p ) ABC_FREE( p ); } +/**Function************************************************************* + + Synopsis [Returns memory used in megabytes.] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ +float Gia_ManMemory( Gia_Man_t * p ) +{ + word Memory = sizeof(Gia_Man_t); + Memory += sizeof(Gia_Obj_t) * Gia_ManObjNum(p); + Memory += sizeof(int) * Gia_ManCiNum(p); + Memory += sizeof(int) * Gia_ManCoNum(p); + Memory += sizeof(int) * p->nHTable * (p->pHTable != NULL); + return (float)(int)(Memory / (1 << 20)) + (float)(1e-6 * (int)(Memory % (1 << 20))); +} + /**Function************************************************************* Synopsis [Stops the AIG manager.] -- cgit v1.2.3