summaryrefslogtreecommitdiffstats
path: root/src/aig/gia/giaBalance.c
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2013-11-15 00:59:16 -0800
committerAlan Mishchenko <alanmi@berkeley.edu>2013-11-15 00:59:16 -0800
commit260fe0830a3400f2345868fb8c9a52ad480e63b1 (patch)
tree59832183bfd27af9620f086c5607629147e0ec0d /src/aig/gia/giaBalance.c
parenta4325272c2db3119f0fa693002473b4493d4de64 (diff)
downloadabc-260fe0830a3400f2345868fb8c9a52ad480e63b1.tar.gz
abc-260fe0830a3400f2345868fb8c9a52ad480e63b1.tar.bz2
abc-260fe0830a3400f2345868fb8c9a52ad480e63b1.zip
Propagating initial PI level during balancing.
Diffstat (limited to 'src/aig/gia/giaBalance.c')
-rw-r--r--src/aig/gia/giaBalance.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/aig/gia/giaBalance.c b/src/aig/gia/giaBalance.c
index 293449bf..0f3a9406 100644
--- a/src/aig/gia/giaBalance.c
+++ b/src/aig/gia/giaBalance.c
@@ -984,6 +984,39 @@ Gia_Man_t * Gia_ManAreaBalance( Gia_Man_t * p, int fSimpleAnd, int nNewNodesMax,
SeeAlso []
***********************************************************************/
+void Gia_ManAigPrintPiLevels( Gia_Man_t * p )
+{
+ Gia_Obj_t * pObj;
+ int i;
+ Gia_ManForEachPi( p, pObj, i )
+ printf( "%d ", Gia_ObjLevel(p, pObj) );
+ printf( "\n" );
+}
+void Gia_ManAigTransferPiLevels( Gia_Man_t * pNew, Gia_Man_t * p )
+{
+/*
+ Gia_Obj_t * pObj;
+ int i;
+ if ( p->vLevels == NULL )
+ return;
+ Gia_ManCleanLevels( pNew, Gia_ManObjNum(pNew) );
+ Gia_ManForEachCi( pNew, pObj, i )
+ Gia_ObjSetLevel( pNew, pObj, Gia_ObjLevel(p, Gia_ManCi(p, i)) );
+*/
+ if ( p->pManTime ) pNew->pManTime = p->pManTime, p->pManTime = NULL;
+}
+
+/**Function*************************************************************
+
+ Synopsis [Synthesis script.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
Gia_Man_t * Gia_ManAigSyn2( Gia_Man_t * p, int fVerbose, int fVeryVerbose )
{
Gia_Man_t * pNew, * pTemp;
@@ -995,6 +1028,7 @@ Gia_Man_t * Gia_ManAigSyn2( Gia_Man_t * p, int fVerbose, int fVeryVerbose )
// perform balancing
pNew = Gia_ManAreaBalance( p, 0, ABC_INFINITY, fVeryVerbose, 0 );
if ( fVerbose ) Gia_ManPrintStats( pNew, NULL );
+ Gia_ManAigTransferPiLevels( pNew, p );
// perform mapping
pNew = Jf_ManPerformMapping( pTemp = pNew, pPars );
if ( fVerbose ) Gia_ManPrintStats( pNew, NULL );
@@ -1002,6 +1036,7 @@ Gia_Man_t * Gia_ManAigSyn2( Gia_Man_t * p, int fVerbose, int fVeryVerbose )
// perform balancing
pNew = Gia_ManAreaBalance( pTemp = pNew, 0, ABC_INFINITY, fVeryVerbose, 0 );
if ( fVerbose ) Gia_ManPrintStats( pNew, NULL );
+ Gia_ManAigTransferPiLevels( pNew, pTemp );
Gia_ManStop( pTemp );
return pNew;
}
@@ -1016,6 +1051,7 @@ Gia_Man_t * Gia_ManAigSyn3( Gia_Man_t * p, int fVerbose, int fVeryVerbose )
// perform balancing
pNew = Gia_ManAreaBalance( p, 0, ABC_INFINITY, fVeryVerbose, 0 );
if ( fVerbose ) Gia_ManPrintStats( pNew, NULL );
+ Gia_ManAigTransferPiLevels( pNew, p );
// perform mapping
pPars->nLutSize = 6;
pNew = Jf_ManPerformMapping( pTemp = pNew, pPars );
@@ -1024,6 +1060,7 @@ Gia_Man_t * Gia_ManAigSyn3( Gia_Man_t * p, int fVerbose, int fVeryVerbose )
// perform balancing
pNew = Gia_ManAreaBalance( pTemp = pNew, 0, ABC_INFINITY, fVeryVerbose, 0 );
if ( fVerbose ) Gia_ManPrintStats( pNew, NULL );
+ Gia_ManAigTransferPiLevels( pNew, pTemp );
Gia_ManStop( pTemp );
// perform mapping
pPars->nLutSize = 4;
@@ -1033,6 +1070,7 @@ Gia_Man_t * Gia_ManAigSyn3( Gia_Man_t * p, int fVerbose, int fVeryVerbose )
// perform balancing
pNew = Gia_ManAreaBalance( pTemp = pNew, 0, ABC_INFINITY, fVeryVerbose, 0 );
if ( fVerbose ) Gia_ManPrintStats( pNew, NULL );
+ Gia_ManAigTransferPiLevels( pNew, pTemp );
Gia_ManStop( pTemp );
return pNew;
}
@@ -1044,9 +1082,11 @@ Gia_Man_t * Gia_ManAigSyn4( Gia_Man_t * p, int fVerbose, int fVeryVerbose )
if ( fVerbose ) Gia_ManPrintStats( p, NULL );
if ( Gia_ManAndNum(p) == 0 )
return Gia_ManDup(p);
+//Gia_ManAigPrintPiLevels( p );
// perform balancing
pNew = Gia_ManAreaBalance( p, 0, ABC_INFINITY, fVeryVerbose, 0 );
if ( fVerbose ) Gia_ManPrintStats( pNew, NULL );
+ Gia_ManAigTransferPiLevels( pNew, p );
// perform mapping
pPars->nLutSize = 7;
pNew = Jf_ManPerformMapping( pTemp = pNew, pPars );
@@ -1055,10 +1095,12 @@ Gia_Man_t * Gia_ManAigSyn4( Gia_Man_t * p, int fVerbose, int fVeryVerbose )
// perform extraction
pNew = Gia_ManPerformFx( pTemp = pNew, ABC_INFINITY, 0, 0, fVeryVerbose, 0 );
if ( fVerbose ) Gia_ManPrintStats( pNew, NULL );
+ Gia_ManAigTransferPiLevels( pNew, pTemp );
Gia_ManStop( pTemp );
// perform balancing
pNew = Gia_ManAreaBalance( pTemp = pNew, 0, ABC_INFINITY, fVeryVerbose, 0 );
if ( fVerbose ) Gia_ManPrintStats( pNew, NULL );
+ Gia_ManAigTransferPiLevels( pNew, pTemp );
Gia_ManStop( pTemp );
// perform mapping
pPars->nLutSize = 5;
@@ -1068,11 +1110,14 @@ Gia_Man_t * Gia_ManAigSyn4( Gia_Man_t * p, int fVerbose, int fVeryVerbose )
// perform extraction
pNew = Gia_ManPerformFx( pTemp = pNew, ABC_INFINITY, 0, 0, fVeryVerbose, 0 );
if ( fVerbose ) Gia_ManPrintStats( pNew, NULL );
+ Gia_ManAigTransferPiLevels( pNew, pTemp );
Gia_ManStop( pTemp );
// perform balancing
pNew = Gia_ManAreaBalance( pTemp = pNew, 0, ABC_INFINITY, fVeryVerbose, 0 );
if ( fVerbose ) Gia_ManPrintStats( pNew, NULL );
+ Gia_ManAigTransferPiLevels( pNew, pTemp );
Gia_ManStop( pTemp );
+//Gia_ManAigPrintPiLevels( pNew );
return pNew;
}