From 21922e3e9f45023612c64753311bc2f53e59e332 Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Wed, 18 May 2022 10:43:07 -0700 Subject: Adding switch to dsd_match to skip small functions. --- src/base/cmd/cmdUtils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/base/cmd/cmdUtils.c') diff --git a/src/base/cmd/cmdUtils.c b/src/base/cmd/cmdUtils.c index 3409543f..835e939b 100644 --- a/src/base/cmd/cmdUtils.c +++ b/src/base/cmd/cmdUtils.c @@ -459,7 +459,7 @@ FILE * CmdFileOpen( Abc_Frame_t * pAbc, char *sFileName, char *sMode, char **pFi else { // print the path/name of the resource file 'abc.rc' that is being loaded - if ( !silent && strlen(sRealName) >= 6 && strcmp( sRealName + strlen(sRealName) - 6, "abc.rc" ) == 0 ) + if ( !silent && strlen(sRealName) >= 6 && strcmp( sRealName + strlen(sRealName) - 6, "abc.rc" ) == 0 ) Abc_Print( 1, "Loading resource file \"%s\".\n", sRealName ); } } -- cgit v1.2.3 From aebf1e7b9c531c7907263cb573d8ff2d1a55cebd Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Thu, 2 Jun 2022 09:35:06 -0700 Subject: Integrated Kissat, by Armin Biere, as an external binary. --- src/base/cmd/cmdUtils.c | 78 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) (limited to 'src/base/cmd/cmdUtils.c') diff --git a/src/base/cmd/cmdUtils.c b/src/base/cmd/cmdUtils.c index 835e939b..cf26c0c7 100644 --- a/src/base/cmd/cmdUtils.c +++ b/src/base/cmd/cmdUtils.c @@ -20,6 +20,7 @@ #include "base/abc/abc.h" #include "base/main/mainInt.h" +#include "misc/util/utilSignal.h" #include "cmdInt.h" #include @@ -749,6 +750,83 @@ void CmdPrintTable( st__table * tTable, int fAliases ) ABC_FREE( ppNames ); } +/**Function************************************************************* + + Synopsis [] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ +void Gia_ManKissatCall( Abc_Frame_t * pAbc, char * pFileName, char * pArgs, int nConfs, int nTimeLimit, int fSat, int fUnsat, int fPrintCex, int fVerbose ) +{ + char Command[1000], Buffer[100]; + char * pNameWin = "kissat.exe"; + char * pNameUnix = "kissat"; + char * pKissatName = NULL; + FILE * pFile = NULL; + + // get the names from the resource file + if ( Cmd_FlagReadByName(pAbc, "kissatwin") ) + pNameWin = Cmd_FlagReadByName(pAbc, "kissatwin"); + if ( Cmd_FlagReadByName(pAbc, "kissatunix") ) + pNameUnix = Cmd_FlagReadByName(pAbc, "kissatunix"); + + // check if the binary is available + if ( (pFile = fopen( pNameWin, "r" )) ) + pKissatName = pNameWin; + else if ( (pFile = fopen( pNameUnix, "r" )) ) + pKissatName = pNameUnix; + else if ( pFile == NULL ) + { + fprintf( stdout, "Cannot find Kissat binary \"%s\" or \"%s\" in the current directory.\n", pNameWin, pNameUnix ); + return; + } + fclose( pFile ); + + sprintf( Command, "%s", pKissatName ); + if ( pArgs ) + { + strcat( Command, " " ); + strcat( Command, pArgs ); + } + if ( !pArgs || (strcmp(pArgs, "-h") && strcmp(pArgs, "--help")) ) + { + if ( !fVerbose ) + strcat( Command, " -q" ); + if ( !fPrintCex ) + strcat( Command, " -n" ); + if ( fSat ) + strcat( Command, " --sat" ); + if ( fUnsat ) + strcat( Command, " --unsat" ); + if ( nConfs ) + { + sprintf( Buffer, " --conflicts=%d", nConfs ); + strcat( Command, Buffer ); + } + if ( nTimeLimit ) + { + sprintf( Buffer, " --time=%d", nTimeLimit ); + strcat( Command, Buffer ); + } + strcat( Command, " " ); + strcat( Command, pFileName ); + } + if ( fVerbose ) + printf( "Running command: %s\n", Command ); + if ( Util_SignalSystem( Command ) == -1 ) + { + fprintf( stdout, "The following command has returned a strange exit status:\n" ); + fprintf( stdout, "\"%s\"\n", Command ); + } +} + + + //////////////////////////////////////////////////////////////////////// /// END OF FILE /// //////////////////////////////////////////////////////////////////////// -- cgit v1.2.3 From 25455d358febbb26040916f9f90b5e2af87e1dc0 Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Thu, 23 Jun 2022 08:04:34 -0700 Subject: Making command &kissat not look for the binary in the current dir. --- src/base/cmd/cmdUtils.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/base/cmd/cmdUtils.c') diff --git a/src/base/cmd/cmdUtils.c b/src/base/cmd/cmdUtils.c index cf26c0c7..2158f8e9 100644 --- a/src/base/cmd/cmdUtils.c +++ b/src/base/cmd/cmdUtils.c @@ -767,14 +767,14 @@ void Gia_ManKissatCall( Abc_Frame_t * pAbc, char * pFileName, char * pArgs, int char * pNameWin = "kissat.exe"; char * pNameUnix = "kissat"; char * pKissatName = NULL; - FILE * pFile = NULL; + //FILE * pFile = NULL; // get the names from the resource file if ( Cmd_FlagReadByName(pAbc, "kissatwin") ) pNameWin = Cmd_FlagReadByName(pAbc, "kissatwin"); if ( Cmd_FlagReadByName(pAbc, "kissatunix") ) pNameUnix = Cmd_FlagReadByName(pAbc, "kissatunix"); - +/* // check if the binary is available if ( (pFile = fopen( pNameWin, "r" )) ) pKissatName = pNameWin; @@ -786,6 +786,13 @@ void Gia_ManKissatCall( Abc_Frame_t * pAbc, char * pFileName, char * pArgs, int return; } fclose( pFile ); +*/ + +#ifdef _WIN32 + pKissatName = pNameWin; +#else + pKissatName = pNameUnix; +#endif sprintf( Command, "%s", pKissatName ); if ( pArgs ) -- cgit v1.2.3