diff options
| author | Alan Mishchenko <alanmi@berkeley.edu> | 2019-05-15 21:44:02 +0900 | 
|---|---|---|
| committer | Alan Mishchenko <alanmi@berkeley.edu> | 2019-05-15 21:44:02 +0900 | 
| commit | caa120c85554ad863b578cfaa58005a215a69359 (patch) | |
| tree | c6189986c43a4ed69e1770a58ac7c82e62dde743 /src | |
| parent | a103358ae2ef3b742e814bdb657f5a73c717aebf (diff) | |
| download | abc-caa120c85554ad863b578cfaa58005a215a69359.tar.gz abc-caa120c85554ad863b578cfaa58005a215a69359.tar.bz2 abc-caa120c85554ad863b578cfaa58005a215a69359.zip | |
Changes to the interface of &cfs.
Diffstat (limited to 'src')
| -rw-r--r-- | src/base/abci/abc.c | 21 | ||||
| -rw-r--r-- | src/misc/extra/extraUtilCfs.c | 2 | 
2 files changed, 18 insertions, 5 deletions
| diff --git a/src/base/abci/abc.c b/src/base/abci/abc.c index d060da2e..6c053e9d 100644 --- a/src/base/abci/abc.c +++ b/src/base/abci/abc.c @@ -45756,7 +45756,7 @@ usage:  ***********************************************************************/  int Abc_CommandAbc9Cfs( Abc_Frame_t * pAbc, int argc, char ** argv )  { -    extern void Extra_CommandCfs( Gia_Man_t * pGia, int Limit, int Reps, int UnseenUse, int RareUse, int fReplaceRare, int fConstSim, int fDagNodes, int fVerbose ); +    extern void Extra_CommandCfs( Gia_Man_t * pGia, int Limit, int Reps, int UnseenUse, int RareUse, int fReplaceRare, int fConstSim, int fDagNodes, int FlipProb, int fVerbose );      int Limit       =   0;      int Reps        =   1;      int UnseenUse   =   2; @@ -45764,9 +45764,10 @@ int Abc_CommandAbc9Cfs( Abc_Frame_t * pAbc, int argc, char ** argv )      int fReplaceRare=   0;      int fConstSim   =   0;      int fDagNodes   =   0; +    int FlipProb    =   0;      int c, fVerbose =   0;      Extra_UtilGetoptReset(); -    while ( ( c = Extra_UtilGetopt( argc, argv, "LNURrcdvh" ) ) != EOF ) +    while ( ( c = Extra_UtilGetopt( argc, argv, "LNURPrcdvh" ) ) != EOF )      {          switch ( c )          { @@ -45814,6 +45815,17 @@ int Abc_CommandAbc9Cfs( Abc_Frame_t * pAbc, int argc, char ** argv )              if ( RareUse < 0 )                  goto usage;              break; +        case 'P': +            if ( globalUtilOptind >= argc ) +            { +                Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" ); +                goto usage; +            } +            FlipProb = atoi(argv[globalUtilOptind]); +            globalUtilOptind++; +            if ( FlipProb < 0 ) +                goto usage; +            break;          case 'r':              fReplaceRare ^= 1;              break; @@ -45837,16 +45849,17 @@ int Abc_CommandAbc9Cfs( Abc_Frame_t * pAbc, int argc, char ** argv )          Abc_Print( -1, "Abc_CommandAbc9Cfs(): There is no AIG.\n" );          return 1;      } -    Extra_CommandCfs( pAbc->pGia, Limit, Reps, UnseenUse, RareUse, fReplaceRare, fConstSim, fDagNodes, fVerbose ); +    Extra_CommandCfs( pAbc->pGia, Limit, Reps, UnseenUse, RareUse, fReplaceRare, fConstSim, fDagNodes, FlipProb, fVerbose );      return 0;  usage: -    Abc_Print( -2, "usage: &cfs [-LNURrcdvh]\n" ); +    Abc_Print( -2, "usage: &cfs [-LNURPrcdvh]\n" );      Abc_Print( -2, "\t          performs simulation\n" );      Abc_Print( -2, "\t-L num  : the limit on the number of occurrences [default = %d]\n",  Limit );      Abc_Print( -2, "\t-N num  : the number of repetions of each pattern [default = %d]\n", Reps );      Abc_Print( -2, "\t-U num  : what to do with unseen patterns [default = %d]\n",         UnseenUse );      Abc_Print( -2, "\t-R num  : what to do with rare patterns [default = %d]\n",           RareUse ); +    Abc_Print( -2, "\t-P num  : ramdom flip probability [default = %d]\n",                 FlipProb );      Abc_Print( -2, "\t-r      : toggle replacing rare patterns [default = %s]\n",          fReplaceRare? "yes": "no" );      Abc_Print( -2, "\t-c      : toggle inserting constants [default = %s]\n",              fConstSim? "yes": "no" );      Abc_Print( -2, "\t-d      : toggle using only DAG nodes [default = %s]\n",             fDagNodes? "yes": "no" ); diff --git a/src/misc/extra/extraUtilCfs.c b/src/misc/extra/extraUtilCfs.c index 44cfeab4..5a2b84f6 100644 --- a/src/misc/extra/extraUtilCfs.c +++ b/src/misc/extra/extraUtilCfs.c @@ -48,7 +48,7 @@ ABC_NAMESPACE_IMPL_START    SeeAlso     []  ***********************************************************************/ -void Extra_CommandCfs( Gia_Man_t * pGia, int Limit, int Reps, int UnseenUse, int RareUse, int fReplaceRare, int fConstSim, int fDagNodes, int fVerbose ) +void Extra_CommandCfs( Gia_Man_t * pGia, int Limit, int Reps, int UnseenUse, int RareUse, int fReplaceRare, int fConstSim, int fDagNodes, int FlipProb, int fVerbose )  {  } | 
