summaryrefslogtreecommitdiffstats
path: root/src/base/abci/abcNpn.c
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2012-10-05 20:38:46 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2012-10-05 20:38:46 -0700
commitb852db94fbe7f6652ffcef6964195a4ea4d02108 (patch)
treed954257c377e63e629c82f92d1c7713c1b55b6fc /src/base/abci/abcNpn.c
parent6eb2e7156aaa62cef58f5e7b1f6d944c09688a41 (diff)
downloadabc-b852db94fbe7f6652ffcef6964195a4ea4d02108.tar.gz
abc-b852db94fbe7f6652ffcef6964195a4ea4d02108.tar.bz2
abc-b852db94fbe7f6652ffcef6964195a4ea4d02108.zip
Allow for binary input file in 'testdec' and 'testnpn'.
Diffstat (limited to 'src/base/abci/abcNpn.c')
-rw-r--r--src/base/abci/abcNpn.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/src/base/abci/abcNpn.c b/src/base/abci/abcNpn.c
index 0ca6c70b..9494cba2 100644
--- a/src/base/abci/abcNpn.c
+++ b/src/base/abci/abcNpn.c
@@ -47,8 +47,8 @@ struct Abc_TtStore_t_
word ** pFuncs;
};
-extern Abc_TtStore_t * Abc_TtStoreLoad( char * pFileName );
-extern void Abc_TtStoreFree( Abc_TtStore_t * p );
+extern Abc_TtStore_t * Abc_TtStoreLoad( char * pFileName, int nVarNum );
+extern void Abc_TtStoreFree( Abc_TtStore_t * p, int nVarNum );
extern void Abc_TtStoreWrite( char * pFileName, Abc_TtStore_t * p );
////////////////////////////////////////////////////////////////////////
@@ -276,13 +276,13 @@ void Abc_TruthNpnPerform( Abc_TtStore_t * p, int NpnType, int fVerbose )
SeeAlso []
***********************************************************************/
-void Abc_TruthNpnTest( char * pFileName, int NpnType, int fVerbose )
+void Abc_TruthNpnTest( char * pFileName, int NpnType, int nVarNum, int fDumpRes, int fVerbose )
{
Abc_TtStore_t * p;
char * pFileNameOut;
// read info from file
- p = Abc_TtStoreLoad( pFileName );
+ p = Abc_TtStoreLoad( pFileName, nVarNum );
if ( p == NULL )
return;
@@ -290,13 +290,16 @@ void Abc_TruthNpnTest( char * pFileName, int NpnType, int fVerbose )
Abc_TruthNpnPerform( p, NpnType, fVerbose );
// write the result
- pFileNameOut = Extra_FileNameGenericAppend( pFileName, "_out.txt" );
- Abc_TtStoreWrite( pFileNameOut, p );
- if ( fVerbose )
- printf( "The resulting functions are written into file \"%s\".\n", pFileNameOut );
+ if ( fDumpRes )
+ {
+ pFileNameOut = Extra_FileNameGenericAppend( pFileName, "_out.txt" );
+ Abc_TtStoreWrite( pFileNameOut, p );
+ if ( fVerbose )
+ printf( "The resulting functions are written into file \"%s\".\n", pFileNameOut );
+ }
// delete data-structure
- Abc_TtStoreFree( p );
+ Abc_TtStoreFree( p, nVarNum );
// printf( "Finished computing canonical forms for functions from file \"%s\".\n", pFileName );
}
@@ -312,12 +315,12 @@ void Abc_TruthNpnTest( char * pFileName, int NpnType, int fVerbose )
SeeAlso []
***********************************************************************/
-int Abc_NpnTest( char * pFileName, int NpnType, int fVerbose )
+int Abc_NpnTest( char * pFileName, int NpnType, int nVarNum, int fDumpRes, int fVerbose )
{
if ( fVerbose )
printf( "Using truth tables from file \"%s\"...\n", pFileName );
if ( NpnType >= 0 && NpnType <= 4 )
- Abc_TruthNpnTest( pFileName, NpnType, fVerbose );
+ Abc_TruthNpnTest( pFileName, NpnType, nVarNum, fDumpRes, fVerbose );
else
printf( "Unknown canonical form value (%d).\n", NpnType );
fflush( stdout );