Commit 5f97f5cf by Alan Mishchenko

New logic sharing extraction.

parent 61ee156b
......@@ -931,7 +931,7 @@ extern Vec_Str_t * Gia_AigerWriteIntoMemoryStrPart( Gia_Man_t * p, Vec_I
extern void Gia_AigerWriteSimple( Gia_Man_t * pInit, char * pFileName );
/*=== giaBalance.c ===========================================================*/
extern Gia_Man_t * Gia_ManBalance( Gia_Man_t * p, int fSimpleAnd, int fVerbose );
extern Gia_Man_t * Gia_ManMultiExtract( Gia_Man_t * p, int fSimpleAnd, int nNewNodesMax, int fVerbose );
extern Gia_Man_t * Gia_ManMultiExtract( Gia_Man_t * p, int fSimpleAnd, int nNewNodesMax, int fVerbose, int fVeryVerbose );
/*=== giaBidec.c ===========================================================*/
extern unsigned * Gia_ManConvertAigToTruth( Gia_Man_t * p, Gia_Obj_t * pRoot, Vec_Int_t * vLeaves, Vec_Int_t * vTruth, Vec_Int_t * vVisited );
extern Gia_Man_t * Gia_ManPerformBidec( Gia_Man_t * p, int fVerbose );
......
......@@ -527,6 +527,10 @@ int Gia_ManHashMuxReal( Gia_Man_t * p, int iLitC, int iLit1, int iLit0 )
assert( iLit0 > 1 && iLit1 > 1 && iLitC > 1 );
if ( iLit0 == iLit1 )
return iLit0;
if ( iLitC == iLit0 || iLitC == Abc_LitNot(iLit1) )
return Gia_ManHashAnd(p, iLit0, iLit1);
if ( iLitC == iLit1 || iLitC == Abc_LitNot(iLit0) )
return Gia_ManHashOr(p, iLit0, iLit1);
if ( Abc_Lit2Var(iLit0) == Abc_Lit2Var(iLit1) )
return Gia_ManHashXorReal( p, iLitC, iLit0 );
if ( iLit0 > iLit1 )
......
......@@ -27415,8 +27415,9 @@ int Abc_CommandAbc9Balance( Abc_Frame_t * pAbc, int argc, char ** argv )
int fSimpleAnd = 0;
int fKeepLevel = 0;
int c, fVerbose = 1;
int fVeryVerbose = 0;
Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "Nealvh" ) ) != EOF )
while ( ( c = Extra_UtilGetopt( argc, argv, "Nealvwh" ) ) != EOF )
{
switch ( c )
{
......@@ -27443,6 +27444,9 @@ int Abc_CommandAbc9Balance( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'v':
fVerbose ^= 1;
break;
case 'w':
fVeryVerbose ^= 1;
break;
case 'h':
goto usage;
default:
......@@ -27460,20 +27464,21 @@ int Abc_CommandAbc9Balance( Abc_Frame_t * pAbc, int argc, char ** argv )
return 1;
}
if ( fMultiExt )
pTemp = Gia_ManMultiExtract( pAbc->pGia, fSimpleAnd, nNewNodesMax, fVerbose );
pTemp = Gia_ManMultiExtract( pAbc->pGia, fSimpleAnd, nNewNodesMax, fVerbose, fVeryVerbose );
else
pTemp = Gia_ManBalance( pAbc->pGia, fSimpleAnd, fVerbose );
Abc_FrameUpdateGia( pAbc, pTemp );
return 0;
usage:
Abc_Print( -2, "usage: &b [-N num] [-ealvh]\n" );
Abc_Print( -2, "usage: &b [-N num] [-ealvwh]\n" );
Abc_Print( -2, "\t performs AIG balancing to reduce delay\n" );
Abc_Print( -2, "\t-N num : the max fanout count to skip a divisor [default = %d]\n", nNewNodesMax );
Abc_Print( -2, "\t-e : toggle extacting shared logic while balancing [default = %s]\n", fMultiExt? "yes": "no" );
Abc_Print( -2, "\t-a : toggle using AND instead of AND/XOR/MUX [default = %s]\n", fSimpleAnd? "yes": "no" );
Abc_Print( -2, "\t-l : toggle level update during shrinking [default = %s]\n", fKeepLevel? "yes": "no" );
Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
Abc_Print( -2, "\t-w : toggle printing additional information [default = %s]\n", fVeryVerbose? "yes": "no" );
Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
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