Commit 30ec58fc by Alan Mishchenko

Added switch 'zeropo -s' to skip comb sweep after removing a PO.

parent e6be7ddf
...@@ -1711,7 +1711,7 @@ void Abc_NtkDropSatOutputs( Abc_Ntk_t * pNtk, Vec_Ptr_t * vCexes, int fVerbose ) ...@@ -1711,7 +1711,7 @@ void Abc_NtkDropSatOutputs( Abc_Ntk_t * pNtk, Vec_Ptr_t * vCexes, int fVerbose )
SeeAlso [] SeeAlso []
***********************************************************************/ ***********************************************************************/
void Abc_NtkDropOneOutput( Abc_Ntk_t * pNtk, int iOutput ) void Abc_NtkDropOneOutput( Abc_Ntk_t * pNtk, int iOutput, int fSkipSweep )
{ {
Abc_Obj_t * pObj, * pConst0, * pFaninNew; Abc_Obj_t * pObj, * pConst0, * pFaninNew;
pObj = Abc_NtkPo( pNtk, iOutput ); pObj = Abc_NtkPo( pNtk, iOutput );
...@@ -1725,6 +1725,8 @@ void Abc_NtkDropOneOutput( Abc_Ntk_t * pNtk, int iOutput ) ...@@ -1725,6 +1725,8 @@ void Abc_NtkDropOneOutput( Abc_Ntk_t * pNtk, int iOutput )
pFaninNew = Abc_ObjNotCond( pConst0, Abc_ObjFaninC0(pObj) ); pFaninNew = Abc_ObjNotCond( pConst0, Abc_ObjFaninC0(pObj) );
Abc_ObjPatchFanin( pObj, Abc_ObjFanin0(pObj), pFaninNew ); Abc_ObjPatchFanin( pObj, Abc_ObjFanin0(pObj), pFaninNew );
assert( Abc_ObjChild0(pObj) == pConst0 ); assert( Abc_ObjChild0(pObj) == pConst0 );
if ( fSkipSweep )
return;
Abc_AigCleanup( (Abc_Aig_t *)pNtk->pManFunc ); Abc_AigCleanup( (Abc_Aig_t *)pNtk->pManFunc );
} }
......
...@@ -6295,11 +6295,12 @@ int Abc_CommandZeroPo( Abc_Frame_t * pAbc, int argc, char ** argv ) ...@@ -6295,11 +6295,12 @@ int Abc_CommandZeroPo( Abc_Frame_t * pAbc, int argc, char ** argv )
{ {
Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);//, * pNtkRes = NULL; Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);//, * pNtkRes = NULL;
int c, iOutput = -1; int c, iOutput = -1;
extern void Abc_NtkDropOneOutput( Abc_Ntk_t * pNtk, int iOutput ); int fSkipSweep = 0;
extern void Abc_NtkDropOneOutput( Abc_Ntk_t * pNtk, int iOutput, int fSkipSweep );
// set defaults // set defaults
Extra_UtilGetoptReset(); Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "Nh" ) ) != EOF ) while ( ( c = Extra_UtilGetopt( argc, argv, "Nsh" ) ) != EOF )
{ {
switch ( c ) switch ( c )
{ {
...@@ -6314,6 +6315,9 @@ int Abc_CommandZeroPo( Abc_Frame_t * pAbc, int argc, char ** argv ) ...@@ -6314,6 +6315,9 @@ int Abc_CommandZeroPo( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( iOutput < 0 ) if ( iOutput < 0 )
goto usage; goto usage;
break; break;
case 's':
fSkipSweep ^= 1;
break;
default: default:
goto usage; goto usage;
} }
...@@ -6345,13 +6349,14 @@ int Abc_CommandZeroPo( Abc_Frame_t * pAbc, int argc, char ** argv ) ...@@ -6345,13 +6349,14 @@ int Abc_CommandZeroPo( Abc_Frame_t * pAbc, int argc, char ** argv )
// pNtkRes = Abc_NtkDup( pNtk ); // pNtkRes = Abc_NtkDup( pNtk );
// Abc_NtkDropOneOutput( pNtkRes, iOutput ); // Abc_NtkDropOneOutput( pNtkRes, iOutput );
// Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes ); // Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
Abc_NtkDropOneOutput( pNtk, iOutput ); Abc_NtkDropOneOutput( pNtk, iOutput, fSkipSweep );
return 0; return 0;
usage: usage:
Abc_Print( -2, "usage: zeropo [-N <num>] [-h]\n" ); Abc_Print( -2, "usage: zeropo [-N <num>] [-sh]\n" );
Abc_Print( -2, "\t replaces the PO driver by constant 0\n" ); Abc_Print( -2, "\t replaces the PO driver by constant 0\n" );
Abc_Print( -2, "\t-N <num> : the zero-based index of the PO to replace [default = %d]\n", iOutput ); Abc_Print( -2, "\t-N <num> : the zero-based index of the PO to replace [default = %d]\n", iOutput );
Abc_Print( -2, "\t-s : performs comb sweep after removimg a PO [default = %s]\n", !fSkipSweep? "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;
} }
......
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