diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2013-05-15 00:17:06 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2013-05-15 00:17:06 -0700 |
commit | 7be3e3e6b48ca34f0cfa841c59e2a569afe89bd8 (patch) | |
tree | b9bf5f8b0ce51a1804844b10d3aef3497fe1f7b4 /src | |
parent | 533ff6984e4a757dedb14210b0cdbd4ce254ab6e (diff) | |
download | abc-7be3e3e6b48ca34f0cfa841c59e2a569afe89bd8.tar.gz abc-7be3e3e6b48ca34f0cfa841c59e2a569afe89bd8.tar.bz2 abc-7be3e3e6b48ca34f0cfa841c59e2a569afe89bd8.zip |
Adding 'zeropo -o' to replace a given PO by const 1.
Diffstat (limited to 'src')
-rw-r--r-- | src/base/abc/abcNtk.c | 4 | ||||
-rw-r--r-- | src/base/abci/abc.c | 13 |
2 files changed, 11 insertions, 6 deletions
diff --git a/src/base/abc/abcNtk.c b/src/base/abc/abcNtk.c index 7074b975..af57ae45 100644 --- a/src/base/abc/abcNtk.c +++ b/src/base/abc/abcNtk.c @@ -1717,7 +1717,7 @@ void Abc_NtkDropSatOutputs( Abc_Ntk_t * pNtk, Vec_Ptr_t * vCexes, int fVerbose ) SeeAlso [] ***********************************************************************/ -void Abc_NtkDropOneOutput( Abc_Ntk_t * pNtk, int iOutput, int fSkipSweep ) +void Abc_NtkDropOneOutput( Abc_Ntk_t * pNtk, int iOutput, int fSkipSweep, int fUseConst1 ) { Abc_Obj_t * pObj, * pConst0, * pFaninNew; pObj = Abc_NtkPo( pNtk, iOutput ); @@ -1727,7 +1727,7 @@ void Abc_NtkDropOneOutput( Abc_Ntk_t * pNtk, int iOutput, int fSkipSweep ) Abc_ObjXorFaninC( pObj, 0 ); return; } - pConst0 = Abc_ObjNot( Abc_AigConst1(pNtk) ); + pConst0 = Abc_ObjNotCond( Abc_AigConst1(pNtk), !fUseConst1 ); pFaninNew = Abc_ObjNotCond( pConst0, Abc_ObjFaninC0(pObj) ); Abc_ObjPatchFanin( pObj, Abc_ObjFanin0(pObj), pFaninNew ); assert( Abc_ObjChild0(pObj) == pConst0 ); diff --git a/src/base/abci/abc.c b/src/base/abci/abc.c index 70646874..6da8b17c 100644 --- a/src/base/abci/abc.c +++ b/src/base/abci/abc.c @@ -6536,11 +6536,12 @@ int Abc_CommandZeroPo( Abc_Frame_t * pAbc, int argc, char ** argv ) Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);//, * pNtkRes = NULL; int c, iOutput = -1; int fSkipSweep = 0; - extern void Abc_NtkDropOneOutput( Abc_Ntk_t * pNtk, int iOutput, int fSkipSweep ); + int fUseConst1 = 0; + extern void Abc_NtkDropOneOutput( Abc_Ntk_t * pNtk, int iOutput, int fSkipSweep, int fUseConst1 ); // set defaults Extra_UtilGetoptReset(); - while ( ( c = Extra_UtilGetopt( argc, argv, "Nsh" ) ) != EOF ) + while ( ( c = Extra_UtilGetopt( argc, argv, "Nsoh" ) ) != EOF ) { switch ( c ) { @@ -6558,6 +6559,9 @@ int Abc_CommandZeroPo( Abc_Frame_t * pAbc, int argc, char ** argv ) case 's': fSkipSweep ^= 1; break; + case 'o': + fUseConst1 ^= 1; + break; default: goto usage; } @@ -6589,14 +6593,15 @@ int Abc_CommandZeroPo( Abc_Frame_t * pAbc, int argc, char ** argv ) // pNtkRes = Abc_NtkDup( pNtk ); // Abc_NtkDropOneOutput( pNtkRes, iOutput ); // Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes ); - Abc_NtkDropOneOutput( pNtk, iOutput, fSkipSweep ); + Abc_NtkDropOneOutput( pNtk, iOutput, fSkipSweep, fUseConst1 ); return 0; usage: - Abc_Print( -2, "usage: zeropo [-N <num>] [-sh]\n" ); + Abc_Print( -2, "usage: zeropo [-N <num>] [-soh]\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-s : performs comb sweep after removimg a PO [default = %s]\n", !fSkipSweep? "yes": "no" ); + Abc_Print( -2, "\t-o : toggles using const 1 instead of const 0 [default = %s]\n", fUseConst1? "yes": "no" ); Abc_Print( -2, "\t-h : print the command usage\n"); return 1; } |