Commit 6de48109 by Alan Mishchenko

Allow for binary input file in 'testdec' and 'testnpn'.

parent 369b5f47
...@@ -818,6 +818,7 @@ void Abc_Init( Abc_Frame_t * pAbc ) ...@@ -818,6 +818,7 @@ void Abc_Init( Abc_Frame_t * pAbc )
Cmd_CommandAdd( pAbc, "Liveness", "l3s", Abc_CommandAbcLivenessToSafetyWithLTL, 0 ); Cmd_CommandAdd( pAbc, "Liveness", "l3s", Abc_CommandAbcLivenessToSafetyWithLTL, 0 );
Cmd_CommandAdd( pAbc, "ABC9", "&test", Abc_CommandAbc9Test, 0 ); Cmd_CommandAdd( pAbc, "ABC9", "&test", Abc_CommandAbc9Test, 0 );
{ {
extern void Dar_LibStart(); extern void Dar_LibStart();
Dar_LibStart(); Dar_LibStart();
...@@ -4802,7 +4803,12 @@ int Abc_CommandTestDec( Abc_Frame_t * pAbc, int argc, char ** argv ) ...@@ -4802,7 +4803,12 @@ int Abc_CommandTestDec( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( argc != globalUtilOptind + 1 ) if ( argc != globalUtilOptind + 1 )
{ {
printf( "Input file is not given.\n" ); printf( "Input file is not given.\n" );
goto usage; return 0;
}
if ( nVarNum >= 0 && nVarNum < 6 )
{
printf( "The number of variables cannot be less than 6.\n" );
return 0;
} }
// get the output file name // get the output file name
pFileName = argv[globalUtilOptind]; pFileName = argv[globalUtilOptind];
...@@ -4889,7 +4895,12 @@ int Abc_CommandTestNpn( Abc_Frame_t * pAbc, int argc, char ** argv ) ...@@ -4889,7 +4895,12 @@ int Abc_CommandTestNpn( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( argc != globalUtilOptind + 1 ) if ( argc != globalUtilOptind + 1 )
{ {
printf( "Input file is not given.\n" ); printf( "Input file is not given.\n" );
goto usage; return 0;
}
if ( nVarNum >= 0 && nVarNum < 6 )
{
printf( "The number of variables cannot be less than 6.\n" );
return 0;
} }
// get the output file name // get the output file name
pFileName = argv[globalUtilOptind]; pFileName = argv[globalUtilOptind];
......
...@@ -402,10 +402,11 @@ Abc_TtStore_t * Abc_TtStoreLoad( char * pFileName, int nVarNum ) ...@@ -402,10 +402,11 @@ Abc_TtStore_t * Abc_TtStoreLoad( char * pFileName, int nVarNum )
{ {
char * pBuffer; char * pBuffer;
int nFileSize = Abc_FileSize( pFileName ); int nFileSize = Abc_FileSize( pFileName );
int nBytes = (1 << nVarNum); int nBytes = (1 << (nVarNum-3));
int nTruths = nFileSize / nBytes; int nTruths = nFileSize / nBytes;
if ( nFileSize == -1 ) if ( nFileSize == -1 )
return NULL; return NULL;
assert( nVarNum >= 6 );
if ( nFileSize % nBytes != 0 ) if ( nFileSize % nBytes != 0 )
Abc_Print( 0, "The file size (%d) is divided by the truth table size (%d) with remainder (%d).\n", Abc_Print( 0, "The file size (%d) is divided by the truth table size (%d) with remainder (%d).\n",
nFileSize, nBytes, nFileSize % nBytes ); nFileSize, nBytes, nFileSize % nBytes );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment