diff options
| author | Alan Mishchenko <alanmi@berkeley.edu> | 2015-02-14 15:08:07 -0800 | 
|---|---|---|
| committer | Alan Mishchenko <alanmi@berkeley.edu> | 2015-02-14 15:08:07 -0800 | 
| commit | 5158c711299fd498d91da428932d418142b303fa (patch) | |
| tree | e147ab3e5e5ae4d8997d9eeedf9df7a5d8254677 /src | |
| parent | edf3622ceb8569b87ffc007c75716f1042ba00d7 (diff) | |
| download | abc-5158c711299fd498d91da428932d418142b303fa.tar.gz abc-5158c711299fd498d91da428932d418142b303fa.tar.bz2 abc-5158c711299fd498d91da428932d418142b303fa.zip | |
Added switch -n to 'sop'.
Diffstat (limited to 'src')
| -rw-r--r-- | src/base/abc/abcFunc.c | 6 | ||||
| -rw-r--r-- | src/base/abci/abc.c | 12 | 
2 files changed, 11 insertions, 7 deletions
| diff --git a/src/base/abc/abcFunc.c b/src/base/abc/abcFunc.c index 154e7f58..628a803f 100644 --- a/src/base/abc/abcFunc.c +++ b/src/base/abc/abcFunc.c @@ -382,9 +382,11 @@ int Abc_NtkBddToSop( Abc_Ntk_t * pNtk, int fDirect, int nCubeLimit )          //printf( "The total number of cubes = %d.\n", nCubes );      } -    if ( fDirect ) +    if ( fDirect == 2 ) // negative polarity only +        fMode = 0; +    else if ( fDirect == 1 ) // positive polarity only          fMode = 1; -    else +    else // both polarities          fMode = -1;      assert( Abc_NtkHasBdd(pNtk) ); diff --git a/src/base/abci/abc.c b/src/base/abci/abc.c index 1b92b334..8b42ccfa 100644 --- a/src/base/abci/abc.c +++ b/src/base/abci/abc.c @@ -7889,13 +7889,12 @@ usage:  int Abc_CommandSop( Abc_Frame_t * pAbc, int argc, char ** argv )  {      Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc); -    int fDirect, nCubeLimit = 1000000; +    int fDirect = 0, nCubeLimit = 1000000;      int c;      // set defaults -    fDirect = 0;      Extra_UtilGetoptReset(); -    while ( ( c = Extra_UtilGetopt( argc, argv, "Cdh" ) ) != EOF ) +    while ( ( c = Extra_UtilGetopt( argc, argv, "Cdnh" ) ) != EOF )      {          switch ( c )          { @@ -7911,7 +7910,10 @@ int Abc_CommandSop( Abc_Frame_t * pAbc, int argc, char ** argv )                  goto usage;              break;          case 'd': -            fDirect ^= 1; +            fDirect = 1; +            break; +        case 'n': +            fDirect = 2;              break;          case 'h':              goto usage; @@ -7940,7 +7942,7 @@ usage:      Abc_Print( -2, "usage: sop [-C num] [-dh]\n" );      Abc_Print( -2, "\t         converts node functions to SOP\n" );      Abc_Print( -2, "\t-C num : the limit on the total cube count of all nodes [default = %d]\n", nCubeLimit ); -    Abc_Print( -2, "\t-d     : toggles using both phases or only positive [default = %s]\n", fDirect? "direct": "both" ); +    Abc_Print( -2, "\t-d     : toggles using both phases or only positive [default = %s]\n", fDirect? (fDirect == 1? "direct":"negated"): "both" );      Abc_Print( -2, "\t-h     : print the command usage\n");      return 1;  } | 
