summaryrefslogtreecommitdiffstats
path: root/src/aig/gia
diff options
context:
space:
mode:
Diffstat (limited to 'src/aig/gia')
-rw-r--r--src/aig/gia/gia.h1
-rw-r--r--src/aig/gia/giaDup.c3
-rw-r--r--src/aig/gia/giaMan.c21
3 files changed, 24 insertions, 1 deletions
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
@@ -129,6 +129,27 @@ void Gia_ManStop( Gia_Man_t * 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.]
Description []