Commit d05f83b2 by Alan Mishchenko

Improvement in SOP balancing.

parent 2a399042
...@@ -681,7 +681,7 @@ int Gia_ManNodeIfSopToGia( Gia_Man_t * pNew, If_Man_t * p, If_Cut_t * pCut, Vec_ ...@@ -681,7 +681,7 @@ int Gia_ManNodeIfSopToGia( Gia_Man_t * pNew, If_Man_t * p, If_Cut_t * pCut, Vec_
SeeAlso [] SeeAlso []
***********************************************************************/ ***********************************************************************/
int Gia_ManBuildFromMini( Gia_Man_t * pNew, Vec_Int_t * vLeaves, Vec_Int_t * vAig, int fHash ) int Gia_ManBuildFromMiniInt( Gia_Man_t * pNew, Vec_Int_t * vLeaves, Vec_Int_t * vAig, int fHash )
{ {
assert( Vec_IntSize(vAig) > 0 ); assert( Vec_IntSize(vAig) > 0 );
assert( Vec_IntEntryLast(vAig) < 2 ); assert( Vec_IntEntryLast(vAig) < 2 );
...@@ -719,6 +719,14 @@ int Gia_ManBuildFromMini( Gia_Man_t * pNew, Vec_Int_t * vLeaves, Vec_Int_t * vAi ...@@ -719,6 +719,14 @@ int Gia_ManBuildFromMini( Gia_Man_t * pNew, Vec_Int_t * vLeaves, Vec_Int_t * vAi
return iLit; return iLit;
} }
} }
int Gia_ManBuildFromMini( Gia_Man_t * pNew, If_Man_t * pIfMan, If_Cut_t * pCut, Vec_Int_t * vLeaves, Vec_Int_t * vAig, int fHash, int fUseDsd )
{
if ( fUseDsd )
If_DsdCutBalanceAig( pIfMan, pCut, vAig );
else
If_CutDelaySopArray3( pIfMan, pCut, vAig );
return Gia_ManBuildFromMiniInt( pNew, vLeaves, vAig, fHash );
}
/**Function************************************************************* /**Function*************************************************************
...@@ -762,12 +770,9 @@ Gia_Man_t * Gia_ManFromIfAig( If_Man_t * pIfMan ) ...@@ -762,12 +770,9 @@ Gia_Man_t * Gia_ManFromIfAig( If_Man_t * pIfMan )
Vec_IntPush( vLeaves, pIfLeaf->iCopy ); Vec_IntPush( vLeaves, pIfLeaf->iCopy );
// get the functionality // get the functionality
if ( pIfMan->pPars->fDelayOpt ) if ( pIfMan->pPars->fDelayOpt )
pIfObj->iCopy = Gia_ManNodeIfSopToGia( pNew, pIfMan, pCutBest, vLeaves, fHash ); pIfObj->iCopy = Gia_ManBuildFromMini( pNew, pIfMan, pCutBest, vLeaves, vAig, fHash, 0 );
else if ( pIfMan->pPars->fDsdBalance ) else if ( pIfMan->pPars->fDsdBalance )
{ pIfObj->iCopy = Gia_ManBuildFromMini( pNew, pIfMan, pCutBest, vLeaves, vAig, fHash, 1 );
If_DsdCutBalanceAig( pIfMan, pCutBest, vAig );
pIfObj->iCopy = Gia_ManBuildFromMini( pNew, vLeaves, vAig, fHash );
}
else if ( pIfMan->pPars->fUserRecLib ) else if ( pIfMan->pPars->fUserRecLib )
pIfObj->iCopy = Abc_RecToGia3( pNew, pIfMan, pCutBest, vLeaves, fHash ); pIfObj->iCopy = Abc_RecToGia3( pNew, pIfMan, pCutBest, vLeaves, fHash );
else assert( 0 ); else assert( 0 );
......
...@@ -466,8 +466,7 @@ int If_CutPinDelaysSopArray3IntInt( Vec_Int_t * vCover, int * pTimes, int nSuppA ...@@ -466,8 +466,7 @@ int If_CutPinDelaysSopArray3IntInt( Vec_Int_t * vCover, int * pTimes, int nSuppA
Vec_IntForEachEntry( vCover, Entry, i ) Vec_IntForEachEntry( vCover, Entry, i )
{ {
nCounterAnd = 0; nCounterAnd = 0;
// for ( k = 0; k < nSuppAll; k++ ) for ( k = 0; k < nSuppAll; k++ )
for ( k = nSuppAll-1; k >= 0; k-- )
{ {
Literal = 3 & (Entry >> (k << 1)); Literal = 3 & (Entry >> (k << 1));
if ( Literal == 1 || Literal == 2 ) // neg or pos literal if ( Literal == 1 || Literal == 2 ) // neg or pos literal
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment