From 9e164ec52d58655354df6176a51e455270df427f Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Sun, 24 Apr 2022 20:15:15 -0700 Subject: Adding a switch to complement outputs after collapsing. --- src/base/wln/wlnCom.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/base') diff --git a/src/base/wln/wlnCom.c b/src/base/wln/wlnCom.c index 6b754457..31e0bea3 100644 --- a/src/base/wln/wlnCom.c +++ b/src/base/wln/wlnCom.c @@ -335,9 +335,9 @@ int Abc_CommandCollapse( Abc_Frame_t * pAbc, int argc, char ** argv ) Gia_Man_t * pNew = NULL; Rtl_Lib_t * pLib = Wln_AbcGetRtl(pAbc); char * pTopModule = NULL; - int c, fVerbose = 0; + int c, fInv = 0, fVerbose = 0; Extra_UtilGetoptReset(); - while ( ( c = Extra_UtilGetopt( argc, argv, "Tvh" ) ) != EOF ) + while ( ( c = Extra_UtilGetopt( argc, argv, "Tivh" ) ) != EOF ) { switch ( c ) { @@ -350,6 +350,9 @@ int Abc_CommandCollapse( Abc_Frame_t * pAbc, int argc, char ** argv ) pTopModule = argv[globalUtilOptind]; globalUtilOptind++; break; + case 'i': + fInv ^= 1; + break; case 'v': fVerbose ^= 1; break; @@ -365,12 +368,15 @@ int Abc_CommandCollapse( Abc_Frame_t * pAbc, int argc, char ** argv ) return 1; } pNew = Rtl_LibCollapse( pLib, pTopModule, fVerbose ); + if ( fInv ) + Gia_ManInvertPos( pNew ); Abc_FrameUpdateGia( pAbc, pNew ); return 0; usage: - Abc_Print( -2, "usage: %%collapse [-T ] [-vh] \n" ); + Abc_Print( -2, "usage: %%collapse [-T ] [-ivh] \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-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-h : print the command usage\n"); return 1; -- cgit v1.2.3