Propagating initial PI level during balancing.

This commit is contained in:
Alan Mishchenko 2013-11-15 00:59:16 -08:00
parent a4325272c2
commit 260fe0830a
1 changed files with 45 additions and 0 deletions

View File

@ -973,6 +973,39 @@ Gia_Man_t * Gia_ManAreaBalance( Gia_Man_t * p, int fSimpleAnd, int nNewNodesMax,
return pNew2;
}
/**Function*************************************************************
Synopsis [Synthesis script.]
Description []
SideEffects []
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.]
@ -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;
}