diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2014-10-25 17:55:35 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2014-10-25 17:55:35 -0700 |
commit | b8556e7edf263b266e3028901c276f925be5f470 (patch) | |
tree | 9ff69af2c757a283a7341fbb8eb36c530eaef2ae /src/base/abci | |
parent | f93ede121d01fe98bd3616b058ab226ea69b7c4f (diff) | |
download | abc-b8556e7edf263b266e3028901c276f925be5f470.tar.gz abc-b8556e7edf263b266e3028901c276f925be5f470.tar.bz2 abc-b8556e7edf263b266e3028901c276f925be5f470.zip |
New command &satenum to enumerate SAT assignments of a miter in a naive way.
Diffstat (limited to 'src/base/abci')
-rw-r--r-- | src/base/abci/abc.c | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/src/base/abci/abc.c b/src/base/abci/abc.c index aa4c7e16..006d691d 100644 --- a/src/base/abci/abc.c +++ b/src/base/abci/abc.c @@ -378,6 +378,7 @@ static int Abc_CommandAbc9Lcorr ( Abc_Frame_t * pAbc, int argc, cha static int Abc_CommandAbc9Scorr ( Abc_Frame_t * pAbc, int argc, char ** argv ); static int Abc_CommandAbc9Choice ( Abc_Frame_t * pAbc, int argc, char ** argv ); static int Abc_CommandAbc9Sat ( Abc_Frame_t * pAbc, int argc, char ** argv ); +static int Abc_CommandAbc9SatEnum ( Abc_Frame_t * pAbc, int argc, char ** argv ); static int Abc_CommandAbc9Fraig ( Abc_Frame_t * pAbc, int argc, char ** argv ); static int Abc_CommandAbc9CFraig ( Abc_Frame_t * pAbc, int argc, char ** argv ); static int Abc_CommandAbc9Srm ( Abc_Frame_t * pAbc, int argc, char ** argv ); @@ -977,6 +978,7 @@ void Abc_Init( Abc_Frame_t * pAbc ) Cmd_CommandAdd( pAbc, "ABC9", "&scorr", Abc_CommandAbc9Scorr, 0 ); Cmd_CommandAdd( pAbc, "ABC9", "&choice", Abc_CommandAbc9Choice, 0 ); Cmd_CommandAdd( pAbc, "ABC9", "&sat", Abc_CommandAbc9Sat, 0 ); + Cmd_CommandAdd( pAbc, "ABC9", "&satenum", Abc_CommandAbc9SatEnum, 0 ); Cmd_CommandAdd( pAbc, "ABC9", "&fraig", Abc_CommandAbc9Fraig, 0 ); Cmd_CommandAdd( pAbc, "ABC9", "&cfraig", Abc_CommandAbc9CFraig, 0 ); Cmd_CommandAdd( pAbc, "ABC9", "&srm", Abc_CommandAbc9Srm, 0 ); @@ -29719,6 +29721,73 @@ usage: SeeAlso [] ***********************************************************************/ +int Abc_CommandAbc9SatEnum( Abc_Frame_t * pAbc, int argc, char ** argv ) +{ + extern int Gia_ManSatEnum( Gia_Man_t * p, int nConfLimit, int nTimeOut, int fVerbose ); + int c, nConfLimit = 0, nTimeOut = 0, fVerbose = 0; + Extra_UtilGetoptReset(); + while ( ( c = Extra_UtilGetopt( argc, argv, "CTvh" ) ) != EOF ) + { + switch ( c ) + { + case 'C': + if ( globalUtilOptind >= argc ) + { + Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" ); + goto usage; + } + nConfLimit = atoi(argv[globalUtilOptind]); + globalUtilOptind++; + if ( nConfLimit < 0 ) + goto usage; + break; + case 'T': + if ( globalUtilOptind >= argc ) + { + Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" ); + goto usage; + } + nTimeOut = atoi(argv[globalUtilOptind]); + globalUtilOptind++; + if ( nTimeOut < 0 ) + goto usage; + break; + case 'v': + fVerbose ^= 1; + break; + default: + goto usage; + } + } + if ( pAbc->pGia == NULL ) + { + Abc_Print( -1, "Abc_CommandAbc9SatEnum(): There is no AIG.\n" ); + return 1; + } + Gia_ManSatEnum( pAbc->pGia, nConfLimit, nTimeOut, fVerbose ); + return 0; + +usage: + Abc_Print( -2, "usage: &satenum [-CT <num>] [-vh]\n" ); + Abc_Print( -2, "\t enumerates solutions of the combinational miter\n" ); + Abc_Print( -2, "\t-C num : the max number of conflicts at a node [default = %d]\n", nConfLimit ); + Abc_Print( -2, "\t-T num : global timeout [default = %d]\n", nTimeOut ); + 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; +} + +/**Function************************************************************* + + Synopsis [] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ int Abc_CommandAbc9Fraig( Abc_Frame_t * pAbc, int argc, char ** argv ) { Cec_ParFra_t ParsFra, * pPars = &ParsFra; |