diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2015-02-01 15:15:34 -0800 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2015-02-01 15:15:34 -0800 |
commit | a704e9c9ff9470cd1af184c0f37d42198b86f419 (patch) | |
tree | 9cfb789ea53437220a44a6258d141a889648af59 /src/base/cba/cbaCom.c | |
parent | e32026cf1ec894d02f792516b6246a5cac35da05 (diff) | |
download | abc-a704e9c9ff9470cd1af184c0f37d42198b86f419.tar.gz abc-a704e9c9ff9470cd1af184c0f37d42198b86f419.tar.bz2 abc-a704e9c9ff9470cd1af184c0f37d42198b86f419.zip |
Improvements and tuning of CBA.
Diffstat (limited to 'src/base/cba/cbaCom.c')
-rw-r--r-- | src/base/cba/cbaCom.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/base/cba/cbaCom.c b/src/base/cba/cbaCom.c index 5221a3c7..c74d4b45 100644 --- a/src/base/cba/cbaCom.c +++ b/src/base/cba/cbaCom.c @@ -295,12 +295,23 @@ usage: int Cba_CommandPs( Abc_Frame_t * pAbc, int argc, char ** argv ) { Cba_Man_t * p = Cba_AbcGetMan(pAbc); - int c, fVerbose = 0; + int c, nModules = 0, fVerbose = 0; Extra_UtilGetoptReset(); - while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF ) + while ( ( c = Extra_UtilGetopt( argc, argv, "Mvh" ) ) != EOF ) { switch ( c ) { + case 'M': + if ( globalUtilOptind >= argc ) + { + Abc_Print( -1, "Command line switch \"-M\" should be followed by an integer.\n" ); + goto usage; + } + nModules = atoi(argv[globalUtilOptind]); + globalUtilOptind++; + if ( nModules < 0 ) + goto usage; + break; case 'v': fVerbose ^= 1; break; @@ -315,11 +326,12 @@ int Cba_CommandPs( Abc_Frame_t * pAbc, int argc, char ** argv ) Abc_Print( 1, "Cba_CommandPs(): There is no current design.\n" ); return 0; } - Cba_ManPrintStats( p, fVerbose ); + Cba_ManPrintStats( p, nModules, fVerbose ); return 0; usage: - Abc_Print( -2, "usage: @ps [-vh]\n" ); + Abc_Print( -2, "usage: @ps [-M num] [-vh]\n" ); Abc_Print( -2, "\t prints statistics\n" ); + Abc_Print( -2, "\t-M num : the number of first modules to report [default = %d]\n", nModules ); 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; |