diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2014-10-21 19:37:33 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2014-10-21 19:37:33 -0700 |
commit | a9317eac758b150ef839aa673e9a04bacb875d8b (patch) | |
tree | c197df11daac01cb6943937b5b19d55b318f1d18 /src | |
parent | 7592aa8a3e4bce6a28fddeea87e90cd3f2fb02a6 (diff) | |
download | abc-a9317eac758b150ef839aa673e9a04bacb875d8b.tar.gz abc-a9317eac758b150ef839aa673e9a04bacb875d8b.tar.bz2 abc-a9317eac758b150ef839aa673e9a04bacb875d8b.zip |
Preparing to work with C++ code.
Diffstat (limited to 'src')
-rw-r--r-- | src/base/abci/abc.c | 36 | ||||
-rw-r--r-- | src/base/cmd/cmdUtils.c | 8 | ||||
-rw-r--r-- | src/misc/vec/vecPtr.h | 2 |
3 files changed, 45 insertions, 1 deletions
diff --git a/src/base/abci/abc.c b/src/base/abci/abc.c index 7fa843a5..1c3bf4da 100644 --- a/src/base/abci/abc.c +++ b/src/base/abci/abc.c @@ -66,6 +66,8 @@ ABC_NAMESPACE_IMPL_START /// DECLARATIONS /// //////////////////////////////////////////////////////////////////////// +//#define USE_MINISAT22 + static int Abc_CommandPrintStats ( Abc_Frame_t * pAbc, int argc, char ** argv ); static int Abc_CommandPrintExdc ( Abc_Frame_t * pAbc, int argc, char ** argv ); static int Abc_CommandPrintIo ( Abc_Frame_t * pAbc, int argc, char ** argv ); @@ -190,6 +192,9 @@ static int Abc_CommandSendStatus ( Abc_Frame_t * pAbc, int argc, cha static int Abc_CommandBackup ( Abc_Frame_t * pAbc, int argc, char ** argv ); static int Abc_CommandRestore ( Abc_Frame_t * pAbc, int argc, char ** argv ); +static int Abc_CommandMinisat ( Abc_Frame_t * pAbc, int argc, char ** argv ); +static int Abc_CommandMinisimp ( Abc_Frame_t * pAbc, int argc, char ** argv ); + static int Abc_CommandIStrash ( Abc_Frame_t * pAbc, int argc, char ** argv ); static int Abc_CommandICut ( Abc_Frame_t * pAbc, int argc, char ** argv ); static int Abc_CommandIRewrite ( Abc_Frame_t * pAbc, int argc, char ** argv ); @@ -791,6 +796,9 @@ void Abc_Init( Abc_Frame_t * pAbc ) Cmd_CommandAdd( pAbc, "Various", "backup", Abc_CommandBackup, 0 ); Cmd_CommandAdd( pAbc, "Various", "restore", Abc_CommandRestore, 0 ); + Cmd_CommandAdd( pAbc, "Various", "minisat", Abc_CommandMinisat, 0 ); + Cmd_CommandAdd( pAbc, "Various", "minisimp", Abc_CommandMinisimp, 0 ); + Cmd_CommandAdd( pAbc, "New AIG", "istrash", Abc_CommandIStrash, 1 ); Cmd_CommandAdd( pAbc, "New AIG", "icut", Abc_CommandICut, 0 ); Cmd_CommandAdd( pAbc, "New AIG", "irw", Abc_CommandIRewrite, 1 ); @@ -13248,6 +13256,34 @@ usage: return 1; } +/**Function************************************************************* + + Synopsis [] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ +int Abc_CommandMinisat( Abc_Frame_t * pAbc, int argc, char ** argv ) +{ +#ifdef USE_MINISAT22 + extern int MainSat(int argc, char** argv); + MainSat( argc, argv ); +#endif + return 1; +} +int Abc_CommandMinisimp( Abc_Frame_t * pAbc, int argc, char ** argv ) +{ +#ifdef USE_MINISAT22 + extern int MainSimp(int argc, char** argv); + MainSimp( argc, argv ); +#endif + return 1; +} + /**Function************************************************************* diff --git a/src/base/cmd/cmdUtils.c b/src/base/cmd/cmdUtils.c index 4140680e..3d4d91bb 100644 --- a/src/base/cmd/cmdUtils.c +++ b/src/base/cmd/cmdUtils.c @@ -489,6 +489,14 @@ void CmdFreeArgv( int argc, char **argv ) ABC_FREE( argv[i] ); ABC_FREE( argv ); } +char ** CmdDupArgv( int argc, char **argv ) +{ + char ** argvNew = ABC_ALLOC( char *, argc ); + int i; + for ( i = 0; i < argc; i++ ) + argvNew[i] = Abc_UtilStrsav( argv[i] ); + return argvNew; +} /**Function************************************************************* diff --git a/src/misc/vec/vecPtr.h b/src/misc/vec/vecPtr.h index e7ed1aa9..516429ff 100644 --- a/src/misc/vec/vecPtr.h +++ b/src/misc/vec/vecPtr.h @@ -891,7 +891,7 @@ static void Vec_PtrUniqify2( Vec_Ptr_t * p, int (*Vec_PtrSortCompare)(void**, vo Vec_IntFill( vCounts, 1, 1 ); if ( p->nSize < 2 ) return; - Vec_PtrSort( p, Vec_PtrSortCompare ); + Vec_PtrSort( p, (int (*)())Vec_PtrSortCompare ); for ( i = k = 1; i < p->nSize; i++ ) if ( Vec_PtrSortCompare(p->pArray+i, p->pArray+k-1) != 0 ) { |