summaryrefslogtreecommitdiffstats
path: root/src/aig/gia/giaMan.c
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2009-02-15 08:01:00 -0800
committerAlan Mishchenko <alanmi@berkeley.edu>2009-02-15 08:01:00 -0800
commit0871bffae307e0553e0c5186336189e8b55cf6a6 (patch)
tree4571d1563fe33a53a57fea1c35fb668b9d33265f /src/aig/gia/giaMan.c
parentf936cc0680c98ffe51b3a1716c996072d5dbf76c (diff)
downloadabc-0871bffae307e0553e0c5186336189e8b55cf6a6.tar.gz
abc-0871bffae307e0553e0c5186336189e8b55cf6a6.tar.bz2
abc-0871bffae307e0553e0c5186336189e8b55cf6a6.zip
Version abc90215
Diffstat (limited to 'src/aig/gia/giaMan.c')
-rw-r--r--src/aig/gia/giaMan.c203
1 files changed, 203 insertions, 0 deletions
diff --git a/src/aig/gia/giaMan.c b/src/aig/gia/giaMan.c
new file mode 100644
index 00000000..e6e45cb5
--- /dev/null
+++ b/src/aig/gia/giaMan.c
@@ -0,0 +1,203 @@
+/**CFile****************************************************************
+
+ FileName [giaMan.c]
+
+ SystemName [ABC: Logic synthesis and verification system.]
+
+ PackageName [Scalable AIG package.]
+
+ Synopsis [Package manager.]
+
+ Author [Alan Mishchenko]
+
+ Affiliation [UC Berkeley]
+
+ Date [Ver. 1.0. Started - June 20, 2005.]
+
+ Revision [$Id: giaMan.c,v 1.00 2005/06/20 00:00:00 alanmi Exp $]
+
+***********************************************************************/
+
+#include "gia.h"
+
+////////////////////////////////////////////////////////////////////////
+/// DECLARATIONS ///
+////////////////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////////////////
+/// FUNCTION DEFINITIONS ///
+////////////////////////////////////////////////////////////////////////
+
+/**Function*************************************************************
+
+ Synopsis [Creates AIG.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+Gia_Man_t * Gia_ManStart( int nObjsMax )
+{
+ Gia_Man_t * p;
+ assert( nObjsMax > 0 );
+ p = ABC_CALLOC( Gia_Man_t, 1 );
+ p->nObjsAlloc = 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 );
+ return p;
+}
+
+/**Function*************************************************************
+
+ Synopsis [Deletes AIG.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void Gia_ManStop( Gia_Man_t * p )
+{
+ Vec_IntFree( p->vCis );
+ Vec_IntFree( p->vCos );
+ ABC_FREE( p->pFanData );
+ ABC_FREE( p->pReprs );
+ ABC_FREE( p->pName );
+ ABC_FREE( p->pRefs );
+ ABC_FREE( p->pLevels );
+ ABC_FREE( p->pHTable );
+ ABC_FREE( p->pObjs );
+ ABC_FREE( p );
+}
+
+/**Function*************************************************************
+
+ Synopsis [Prints stats for the AIG.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void Gia_ManPrintStats( Gia_Man_t * p )
+{
+ if ( p->pName )
+ printf( "%8s : ", p->pName );
+ printf( "i/o =%7d/%7d ", Gia_ManPiNum(p), Gia_ManPoNum(p) );
+ if ( Gia_ManRegNum(p) )
+ printf( "ff =%7d ", Gia_ManRegNum(p) );
+ printf( "and =%8d ", Gia_ManAndNum(p) );
+ printf( "lev =%5d ", Gia_ManLevelNum(p) );
+// printf( "cut =%5d ", Gia_ManCrossCut(p) );
+ printf( "mem =%5.2f Mb", 12.0*Gia_ManObjNum(p)/(1<<20) );
+// printf( "obj =%5d ", Gia_ManObjNum(p) );
+ printf( "\n" );
+
+// Gia_ManSatExperiment( p );
+}
+
+/**Function*************************************************************
+
+ Synopsis [Prints stats for the AIG.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void Gia_ManPrintStatsShort( Gia_Man_t * p )
+{
+ printf( "i/o =%7d/%7d ", Gia_ManPiNum(p), Gia_ManPoNum(p) );
+// printf( "ff =%7d ", Gia_ManRegNum(p) );
+ printf( "and =%8d ", Gia_ManAndNum(p) );
+ printf( "lev =%5d ", Gia_ManLevelNum(p) );
+ printf( "mem =%5.2f Mb", 12.0*Gia_ManObjNum(p)/(1<<20) );
+ printf( "\n" );
+}
+
+/**Function*************************************************************
+
+ Synopsis [Prints stats for the AIG.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void Gia_ManPrintMiterStatus( Gia_Man_t * p )
+{
+ Gia_Obj_t * pObj, * pChild;
+ int i, nSat = 0, nUnsat = 0, nUndec = 0, iOut = -1;
+ Gia_ManForEachPo( p, pObj, i )
+ {
+ pChild = Gia_ObjChild0(pObj);
+ // check if the output is constant 0
+ if ( pChild == Gia_ManConst0(p) )
+ nUnsat++;
+ // check if the output is constant 1
+ else if ( pChild == Gia_ManConst1(p) )
+ {
+ nSat++;
+ if ( iOut == -1 )
+ iOut = i;
+ }
+ // check if the output is a primary input
+ else if ( Gia_ObjIsPi(p, Gia_Regular(pChild)) )
+ {
+ nSat++;
+ if ( iOut == -1 )
+ iOut = i;
+ }
+/*
+ // check if the output is 1 for the 0000 pattern
+ else if ( Gia_Regular(pChild)->fPhase != (unsigned)Gia_IsComplement(pChild) )
+ {
+ nSat++;
+ if ( iOut == -1 )
+ iOut = i;
+ }
+*/
+ else
+ nUndec++;
+ }
+ printf( "Outputs = %7d. Unsat = %7d. Sat = %7d. Undec = %7d.\n",
+ Gia_ManPoNum(p), nUnsat, nSat, nUndec );
+}
+
+/**Function*************************************************************
+
+ Synopsis [Prints stats for the AIG.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void Gia_ManSetRegNum( Gia_Man_t * p, int nRegs )
+{
+ assert( p->nRegs == 0 );
+ p->nRegs = nRegs;
+}
+
+
+////////////////////////////////////////////////////////////////////////
+/// END OF FILE ///
+////////////////////////////////////////////////////////////////////////
+
+