Improving printouts in sharing extraction.

This commit is contained in:
Alan Mishchenko 2013-09-28 22:42:01 -07:00
parent 5f97f5cffa
commit 68011de615
6 changed files with 25 additions and 17 deletions

View File

@ -135,7 +135,7 @@ Gia_Man_t * Shr_ManFree( Shr_Man_t * p )
{ {
p->pNew = Gia_ManCleanup( pTemp = p->pNew ); p->pNew = Gia_ManCleanup( pTemp = p->pNew );
if ( Gia_ManAndNum(p->pNew) != Gia_ManAndNum(pTemp) ) if ( Gia_ManAndNum(p->pNew) != Gia_ManAndNum(pTemp) )
printf( "Gia_ManShrink6() node reduction after sweep %6d -> %6d.\n", Gia_ManAndNum(pTemp), Gia_ManAndNum(p->pNew) ); printf( "Node reduction after sweep %6d -> %6d.\n", Gia_ManAndNum(pTemp), Gia_ManAndNum(p->pNew) );
Gia_ManStop( pTemp ); Gia_ManStop( pTemp );
} }
Gia_ManSetRegNum( p->pNew, Gia_ManRegNum(p->pGia) ); Gia_ManSetRegNum( p->pNew, Gia_ManRegNum(p->pGia) );

View File

@ -2666,7 +2666,7 @@ Abc_Ntk_t * Abc_NtkFromPla( char ** pPlas, int nInputs, int nOutputs )
if ( !Abc_NtkCheck( pNtkSop ) ) if ( !Abc_NtkCheck( pNtkSop ) )
fprintf( stdout, "Abc_NtkFromPla(): Network check has failed.\n" ); fprintf( stdout, "Abc_NtkFromPla(): Network check has failed.\n" );
// perform fast_extract // perform fast_extract
Abc_NtkSetDefaultParams( p ); Abc_NtkSetDefaultFxParams( p );
Abc_NtkFastExtract( pNtkSop, p ); Abc_NtkFastExtract( pNtkSop, p );
Abc_NtkFxuFreeInfo( p ); Abc_NtkFxuFreeInfo( p );
// convert to an AIG // convert to an AIG

View File

@ -3632,14 +3632,14 @@ usage:
***********************************************************************/ ***********************************************************************/
int Abc_CommandFastExtract( Abc_Frame_t * pAbc, int argc, char ** argv ) int Abc_CommandFastExtract( Abc_Frame_t * pAbc, int argc, char ** argv )
{ {
extern int Abc_NtkFxPerform( Abc_Ntk_t * pNtk, int nNewNodesMax, int nLitCountMax, int fVerbose ); extern int Abc_NtkFxPerform( Abc_Ntk_t * pNtk, int nNewNodesMax, int nLitCountMax, int fVerbose, int fVeryVerbose );
Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc); Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
Fxu_Data_t Params, * p = &Params; Fxu_Data_t Params, * p = &Params;
int c, fNewAlgo = 1; int c, fNewAlgo = 1;
// set the defaults // set the defaults
Abc_NtkSetDefaultParams( p ); Abc_NtkSetDefaultFxParams( p );
Extra_UtilGetoptReset(); Extra_UtilGetoptReset();
while ( (c = Extra_UtilGetopt(argc, argv, "SDNWMsdzcnvh")) != EOF ) while ( (c = Extra_UtilGetopt(argc, argv, "SDNWMsdzcnvwh")) != EOF )
{ {
switch (c) switch (c)
{ {
@ -3716,6 +3716,9 @@ int Abc_CommandFastExtract( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'v': case 'v':
p->fVerbose ^= 1; p->fVerbose ^= 1;
break; break;
case 'w':
p->fVeryVerbose ^= 1;
break;
case 'h': case 'h':
goto usage; goto usage;
break; break;
@ -3746,14 +3749,14 @@ int Abc_CommandFastExtract( Abc_Frame_t * pAbc, int argc, char ** argv )
// the nodes to be merged are linked into the special linked list // the nodes to be merged are linked into the special linked list
if ( fNewAlgo ) if ( fNewAlgo )
Abc_NtkFxPerform( pNtk, p->nNodesExt, p->LitCountMax, p->fVerbose ); Abc_NtkFxPerform( pNtk, p->nNodesExt, p->LitCountMax, p->fVerbose, p->fVeryVerbose );
else else
Abc_NtkFastExtract( pNtk, p ); Abc_NtkFastExtract( pNtk, p );
Abc_NtkFxuFreeInfo( p ); Abc_NtkFxuFreeInfo( p );
return 0; return 0;
usage: usage:
Abc_Print( -2, "usage: fx [-SDNWM <num>] [-sdzcnvh]\n"); Abc_Print( -2, "usage: fx [-SDNWM <num>] [-sdzcnvwh]\n");
Abc_Print( -2, "\t performs unate fast extract on the current network\n"); Abc_Print( -2, "\t performs unate fast extract on the current network\n");
Abc_Print( -2, "\t-S <num> : max number of single-cube divisors to consider [default = %d]\n", p->nSingleMax ); Abc_Print( -2, "\t-S <num> : max number of single-cube divisors to consider [default = %d]\n", p->nSingleMax );
Abc_Print( -2, "\t-D <num> : max number of double-cube divisors to consider [default = %d]\n", p->nPairsMax ); Abc_Print( -2, "\t-D <num> : max number of double-cube divisors to consider [default = %d]\n", p->nPairsMax );
@ -3766,6 +3769,7 @@ usage:
Abc_Print( -2, "\t-c : use complement in the binary case [default = %s]\n", p->fUseCompl? "yes": "no" ); Abc_Print( -2, "\t-c : use complement in the binary case [default = %s]\n", p->fUseCompl? "yes": "no" );
Abc_Print( -2, "\t-n : use new implementation of fast extract [default = %s]\n", fNewAlgo? "yes": "no" ); Abc_Print( -2, "\t-n : use new implementation of fast extract [default = %s]\n", fNewAlgo? "yes": "no" );
Abc_Print( -2, "\t-v : print verbose information [default = %s]\n", p->fVerbose? "yes": "no" ); Abc_Print( -2, "\t-v : print verbose information [default = %s]\n", p->fVerbose? "yes": "no" );
Abc_Print( -2, "\t-w : print additional information [default = %s]\n", p->fVeryVerbose? "yes": "no" );
Abc_Print( -2, "\t-h : print the command usage\n"); Abc_Print( -2, "\t-h : print the command usage\n");
return 1; return 1;
} }
@ -27414,7 +27418,7 @@ int Abc_CommandAbc9Balance( Abc_Frame_t * pAbc, int argc, char ** argv )
int fMultiExt = 0; int fMultiExt = 0;
int fSimpleAnd = 0; int fSimpleAnd = 0;
int fKeepLevel = 0; int fKeepLevel = 0;
int c, fVerbose = 1; int c, fVerbose = 0;
int fVeryVerbose = 0; int fVeryVerbose = 0;
Extra_UtilGetoptReset(); Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "Nealvwh" ) ) != EOF ) while ( ( c = Extra_UtilGetopt( argc, argv, "Nealvwh" ) ) != EOF )

View File

@ -299,9 +299,9 @@ int Abc_NtkFxCheck( Abc_Ntk_t * pNtk )
SeeAlso [] SeeAlso []
***********************************************************************/ ***********************************************************************/
int Abc_NtkFxPerform( Abc_Ntk_t * pNtk, int nNewNodesMax, int LitCountMax, int fVerbose ) int Abc_NtkFxPerform( Abc_Ntk_t * pNtk, int nNewNodesMax, int LitCountMax, int fVerbose, int fVeryVerbose )
{ {
extern int Fx_FastExtract( Vec_Wec_t * vCubes, int ObjIdMax, int nNewNodesMax, int LitCountMax, int fVerbose ); extern int Fx_FastExtract( Vec_Wec_t * vCubes, int ObjIdMax, int nNewNodesMax, int LitCountMax, int fVerbose, int fVeryVerbose );
Vec_Wec_t * vCubes; Vec_Wec_t * vCubes;
assert( Abc_NtkIsSopLogic(pNtk) ); assert( Abc_NtkIsSopLogic(pNtk) );
// check unique fanins // check unique fanins
@ -318,7 +318,7 @@ int Abc_NtkFxPerform( Abc_Ntk_t * pNtk, int nNewNodesMax, int LitCountMax, int f
// collect information about the covers // collect information about the covers
vCubes = Abc_NtkFxRetrieve( pNtk ); vCubes = Abc_NtkFxRetrieve( pNtk );
// call the fast extract procedure // call the fast extract procedure
if ( Fx_FastExtract( vCubes, Abc_NtkObjNumMax(pNtk), nNewNodesMax, LitCountMax, fVerbose ) > 0 ) if ( Fx_FastExtract( vCubes, Abc_NtkObjNumMax(pNtk), nNewNodesMax, LitCountMax, fVerbose, fVeryVerbose ) > 0 )
{ {
// update the network // update the network
Abc_NtkFxInsert( pNtk, vCubes ); Abc_NtkFxInsert( pNtk, vCubes );
@ -486,6 +486,7 @@ static void Fx_PrintStats( Fx_Man_t * p, abctime clk )
printf( "Divs =%7d ", Hsh_VecSize(p->pHash) ); printf( "Divs =%7d ", Hsh_VecSize(p->pHash) );
printf( "Divs+ =%7d ", Vec_QueSize(p->vPrio) ); printf( "Divs+ =%7d ", Vec_QueSize(p->vPrio) );
printf( "Compl =%6d ", p->nDivMux[1] ); printf( "Compl =%6d ", p->nDivMux[1] );
printf( "Extr =%6d ", p->nDivs );
// printf( "DivsS =%6d ", p->nDivsS ); // printf( "DivsS =%6d ", p->nDivsS );
// printf( "PairS =%6d ", p->nPairsS ); // printf( "PairS =%6d ", p->nPairsS );
// printf( "PairD =%6d ", p->nPairsD ); // printf( "PairD =%6d ", p->nPairsD );
@ -1110,9 +1111,9 @@ void Fx_ManUpdate( Fx_Man_t * p, int iDiv )
SeeAlso [] SeeAlso []
***********************************************************************/ ***********************************************************************/
int Fx_FastExtract( Vec_Wec_t * vCubes, int ObjIdMax, int nNewNodesMax, int LitCountMax, int fVerbose ) int Fx_FastExtract( Vec_Wec_t * vCubes, int ObjIdMax, int nNewNodesMax, int LitCountMax, int fVerbose, int fVeryVerbose )
{ {
int fVeryVerbose = 0; int fVeryVeryVerbose = 0;
int i, iDiv; int i, iDiv;
Fx_Man_t * p; Fx_Man_t * p;
abctime clk = Abc_Clock(); abctime clk = Abc_Clock();
@ -1130,12 +1131,14 @@ int Fx_FastExtract( Vec_Wec_t * vCubes, int ObjIdMax, int nNewNodesMax, int LitC
for ( i = 0; i < nNewNodesMax && Vec_QueTopCost(p->vPrio) > 0.0; i++ ) for ( i = 0; i < nNewNodesMax && Vec_QueTopCost(p->vPrio) > 0.0; i++ )
{ {
iDiv = Vec_QuePop(p->vPrio); iDiv = Vec_QuePop(p->vPrio);
if ( fVerbose ) if ( fVeryVerbose )
Fx_PrintDiv( p, iDiv ); Fx_PrintDiv( p, iDiv );
Fx_ManUpdate( p, iDiv ); Fx_ManUpdate( p, iDiv );
if ( fVeryVerbose ) if ( fVeryVeryVerbose )
Fx_PrintMatrix( p ); Fx_PrintMatrix( p );
} }
if ( fVerbose )
Fx_PrintStats( p, Abc_Clock() - clk );
Fx_ManStop( p ); Fx_ManStop( p );
// return the result // return the result
Vec_WecRemoveEmpty( vCubes ); Vec_WecRemoveEmpty( vCubes );

View File

@ -49,7 +49,7 @@ extern int Fxu_FastExtract( Fxu_Data_t * pData );
SeeAlso [] SeeAlso []
***********************************************************************/ ***********************************************************************/
void Abc_NtkSetDefaultParams( Fxu_Data_t * p ) void Abc_NtkSetDefaultFxParams( Fxu_Data_t * p )
{ {
memset( p, 0, sizeof(Fxu_Data_t) ); memset( p, 0, sizeof(Fxu_Data_t) );
p->nSingleMax = 20000; p->nSingleMax = 20000;

View File

@ -50,6 +50,7 @@ struct FxuDataStruct
int fUse0; // set to 1 to have 0-weight also extracted int fUse0; // set to 1 to have 0-weight also extracted
int fUseCompl; // set to 1 to have complement taken into account int fUseCompl; // set to 1 to have complement taken into account
int fVerbose; // set to 1 to have verbose output int fVerbose; // set to 1 to have verbose output
int fVeryVerbose; // set to 1 to have more verbose output
int nNodesExt; // the number of divisors to extract int nNodesExt; // the number of divisors to extract
int nSingleMax; // the max number of single-cube divisors to consider int nSingleMax; // the max number of single-cube divisors to consider
int nPairsMax; // the max number of double-cube divisors to consider int nPairsMax; // the max number of double-cube divisors to consider
@ -77,7 +78,7 @@ struct FxuDataStruct
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
/*===== fxu.c ==========================================================*/ /*===== fxu.c ==========================================================*/
extern void Abc_NtkSetDefaultParams( Fxu_Data_t * p ); extern void Abc_NtkSetDefaultFxParams( Fxu_Data_t * p );
extern int Abc_NtkFastExtract( Abc_Ntk_t * pNtk, Fxu_Data_t * p ); extern int Abc_NtkFastExtract( Abc_Ntk_t * pNtk, Fxu_Data_t * p );
extern void Abc_NtkFxuFreeInfo( Fxu_Data_t * p ); extern void Abc_NtkFxuFreeInfo( Fxu_Data_t * p );