Commit 9e164ec5 by Alan Mishchenko

Adding a switch to complement outputs after collapsing.

parent 7693ce6a
...@@ -335,9 +335,9 @@ int Abc_CommandCollapse( Abc_Frame_t * pAbc, int argc, char ** argv ) ...@@ -335,9 +335,9 @@ int Abc_CommandCollapse( Abc_Frame_t * pAbc, int argc, char ** argv )
Gia_Man_t * pNew = NULL; Gia_Man_t * pNew = NULL;
Rtl_Lib_t * pLib = Wln_AbcGetRtl(pAbc); Rtl_Lib_t * pLib = Wln_AbcGetRtl(pAbc);
char * pTopModule = NULL; char * pTopModule = NULL;
int c, fVerbose = 0; int c, fInv = 0, fVerbose = 0;
Extra_UtilGetoptReset(); Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "Tvh" ) ) != EOF ) while ( ( c = Extra_UtilGetopt( argc, argv, "Tivh" ) ) != EOF )
{ {
switch ( c ) switch ( c )
{ {
...@@ -350,6 +350,9 @@ int Abc_CommandCollapse( Abc_Frame_t * pAbc, int argc, char ** argv ) ...@@ -350,6 +350,9 @@ int Abc_CommandCollapse( Abc_Frame_t * pAbc, int argc, char ** argv )
pTopModule = argv[globalUtilOptind]; pTopModule = argv[globalUtilOptind];
globalUtilOptind++; globalUtilOptind++;
break; break;
case 'i':
fInv ^= 1;
break;
case 'v': case 'v':
fVerbose ^= 1; fVerbose ^= 1;
break; break;
...@@ -365,12 +368,15 @@ int Abc_CommandCollapse( Abc_Frame_t * pAbc, int argc, char ** argv ) ...@@ -365,12 +368,15 @@ int Abc_CommandCollapse( Abc_Frame_t * pAbc, int argc, char ** argv )
return 1; return 1;
} }
pNew = Rtl_LibCollapse( pLib, pTopModule, fVerbose ); pNew = Rtl_LibCollapse( pLib, pTopModule, fVerbose );
if ( fInv )
Gia_ManInvertPos( pNew );
Abc_FrameUpdateGia( pAbc, pNew ); Abc_FrameUpdateGia( pAbc, pNew );
return 0; return 0;
usage: usage:
Abc_Print( -2, "usage: %%collapse [-T <module>] [-vh] <file_name>\n" ); Abc_Print( -2, "usage: %%collapse [-T <module>] [-ivh] <file_name>\n" );
Abc_Print( -2, "\t collapse hierarchical design into an AIG\n" ); Abc_Print( -2, "\t collapse hierarchical design into an AIG\n" );
Abc_Print( -2, "\t-T : specify the top module of the design [default = none]\n" ); Abc_Print( -2, "\t-T : specify the top module of the design [default = none]\n" );
Abc_Print( -2, "\t-i : toggle complementing miter outputs after collapsing [default = %s]\n", fInv? "yes": "no" );
Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" ); Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "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