@@ -9171,11 +9171,11 @@ int Abc_CommandLutCas( Abc_Frame_t * pAbc, int argc, char ** argv )
91719171int Abc_CommandBsEval( Abc_Frame_t * pAbc, int argc, char ** argv )
91729172{
91739173 extern void Abc_BSEvalOneTest( word * pT, int nVars, int nBVars, int fVerbose );
9174- extern void Abc_BSEvalBestTest( word * pIn, int nVars, int nBVars, int fVerbose );
9175- extern void Abc_BSEvalBestGen( int nVars, int nBVars, int nFuncs, int nMints, int fTryAll, int fVerbose );
9176- int c, nVars = 0, nBVars = 0, nFuncs = 0, nMints = 0, fTryAll = 0, fVerbose = 0; char * pTtStr = NULL;
9174+ extern void Abc_BSEvalBestTest( word * pIn, int nVars, int nBVars, int fShared, int fVerbose );
9175+ extern void Abc_BSEvalBestGen( int nVars, int nBVars, int nFuncs, int nMints, int fTryAll, int fShared, int fVerbose );
9176+ int c, nVars = 0, nBVars = 0, nSVars = 0, nFuncs = 0, nMints = 0, fTryAll = 0, fVerbose = 0; char * pTtStr = NULL;
91779177 Extra_UtilGetoptReset();
9178- while ( ( c = Extra_UtilGetopt( argc, argv, "IBRMavh " ) ) != EOF )
9178+ while ( ( c = Extra_UtilGetopt( argc, argv, "IBSRMavh " ) ) != EOF )
91799179 {
91809180 switch ( c )
91819181 {
@@ -9201,6 +9201,17 @@ int Abc_CommandBsEval( Abc_Frame_t * pAbc, int argc, char ** argv )
92019201 if ( nBVars < 1 || nBVars > 16 )
92029202 goto usage;
92039203 break;
9204+ case 'S':
9205+ if ( globalUtilOptind >= argc )
9206+ {
9207+ Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
9208+ goto usage;
9209+ }
9210+ nSVars = atoi(argv[globalUtilOptind]);
9211+ globalUtilOptind++;
9212+ if ( nSVars < 0 || nSVars > 16 )
9213+ goto usage;
9214+ break;
92049215 case 'R':
92059216 if ( globalUtilOptind >= argc )
92069217 {
@@ -9255,23 +9266,24 @@ int Abc_CommandBsEval( Abc_Frame_t * pAbc, int argc, char ** argv )
92559266 return 1;
92569267 }
92579268 if ( nFuncs )
9258- Abc_BSEvalBestGen( nVars, nBVars, nFuncs, nMints, fTryAll, fVerbose );
9269+ Abc_BSEvalBestGen( nVars, nBVars, nFuncs, nMints, fTryAll, nSVars == 1, fVerbose );
92599270 else if ( pTtStr )
92609271 {
92619272 word pTruth[1024] = {0};
92629273 Abc_TtReadHex( pTruth, pTtStr );
92639274 if ( fTryAll )
9264- Abc_BSEvalBestTest( pTruth, nVars, nBVars, fVerbose );
9275+ Abc_BSEvalBestTest( pTruth, nVars, nBVars, nSVars == 1, fVerbose );
92659276 else
92669277 Abc_BSEvalOneTest( pTruth, nVars, nBVars, fVerbose );
92679278 }
92689279 return 0;
92699280
92709281usage:
9271- Abc_Print( -2, "usage: bseval [-IBRM <num>] [-avh] <hex>\n" );
9282+ Abc_Print( -2, "usage: bseval [-IBSRM <num>] [-avh] <hex>\n" );
92729283 Abc_Print( -2, "\t bound set evaluation\n" );
92739284 Abc_Print( -2, "\t-I <num> : the number of input variables [default = %d]\n", nVars );
92749285 Abc_Print( -2, "\t-B <num> : the number of bound set variables [default = %d]\n", nBVars );
9286+ Abc_Print( -2, "\t-S <num> : the number of shared variables [default = %d]\n", nSVars );
92759287 Abc_Print( -2, "\t-R <num> : the number of random functions to try [default = unused]\n" );
92769288 Abc_Print( -2, "\t-M <num> : the number of positive minterms in the random function [default = unused]\n" );
92779289 Abc_Print( -2, "\t-a : toggle trying all bound sets of this size [default = %s]\n", fTryAll ? "yes" : "no" );
0 commit comments