Add `&mfs -r` for re-import testing

This commit is contained in:
Martin Povišer 2024-03-22 21:42:12 +01:00
parent 0cd90d0d2c
commit b83985c25b
4 changed files with 10 additions and 1 deletions

View File

@ -517,6 +517,8 @@ Gia_Man_t * Gia_ManPerformMfs( Gia_Man_t * p, Sfm_Par_t * pPars )
}
// collect information
pNtk = Gia_ManExtractMfs( p );
if (pPars->fTestReimport)
goto reimport;
// perform optimization
nNodes = Sfm_NtkPerform( pNtk, pPars );
if ( nNodes == 0 )
@ -529,6 +531,7 @@ Gia_Man_t * Gia_ManPerformMfs( Gia_Man_t * p, Sfm_Par_t * pPars )
}
else
{
reimport:
pNew = Gia_ManInsertMfs( p, pNtk, pPars->fAllBoxes );
if( pPars->fVerbose )
Abc_Print( 1, "The network has %d nodes changed by \"&mfs\".\n", nNodes );

View File

@ -49096,7 +49096,7 @@ int Abc_CommandAbc9Mfs( Abc_Frame_t * pAbc, int argc, char ** argv )
pPars->nDepthMax = 100;
pPars->nWinSizeMax = 2000;
Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "WFDMLCNdaeblvwh" ) ) != EOF )
while ( ( c = Extra_UtilGetopt( argc, argv, "WFDMLCNdaeblvwhr" ) ) != EOF )
{
switch ( c )
{
@ -49192,6 +49192,9 @@ int Abc_CommandAbc9Mfs( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'l':
pPars->fUseDcs ^= 1;
break;
case 'r':
pPars->fTestReimport ^= 1;
break;
case 'v':
pPars->fVerbose ^= 1;
break;
@ -49261,6 +49264,7 @@ usage:
Abc_Print( -2, "\t-l : toggle deriving don't-cares [default = %s]\n", pPars->fUseDcs? "yes": "no" );
Abc_Print( -2, "\t-v : toggle printing optimization summary [default = %s]\n", pPars->fVerbose? "yes": "no" );
Abc_Print( -2, "\t-w : toggle printing detailed stats for each node [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
Abc_Print( -2, "\t-r : toggle testing re-importing the network unchanged [default = %s]\n", pPars->fTestReimport? "yes": "no" );
Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}

View File

@ -73,6 +73,7 @@ struct Sfm_Par_t_
int fDelayVerbose; // enable delay stats
int fVerbose; // enable basic stats
int fVeryVerbose; // enable detailed stats
int fTestReimport; // enable testing of re-import
};
////////////////////////////////////////////////////////////////////////

View File

@ -58,6 +58,7 @@ void Sfm_ParSetDefault( Sfm_Par_t * pPars )
pPars->fAllBoxes = 0; // enable preserving all boxes
pPars->fVerbose = 0; // enable basic stats
pPars->fVeryVerbose = 0; // enable detailed stats
pPars->fTestReimport = 0; // enable testing of re-import
}
/**Function*************************************************************