Commit 369b5f47 by Alan Mishchenko

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

parent b852db94
...@@ -399,14 +399,16 @@ Abc_TtStore_t * Abc_TtStoreLoad( char * pFileName, int nVarNum ) ...@@ -399,14 +399,16 @@ Abc_TtStore_t * Abc_TtStoreLoad( char * pFileName, int nVarNum )
Abc_TruthStoreRead( pFileName, p ); Abc_TruthStoreRead( pFileName, p );
} }
else else
{ {
char * pBuffer; char * pBuffer;
int nFileSize = Abc_FileSize( pFileName ); int nFileSize = Abc_FileSize( pFileName );
int nBytes = (1 << nVarNum); int nBytes = (1 << nVarNum);
int nTruths = nFileSize / nBytes; int nTruths = nFileSize / nBytes;
if ( nFileSize == -1 ) if ( nFileSize == -1 )
return NULL; return NULL;
assert( 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",
nFileSize, nBytes, nFileSize % nBytes );
// read file contents // read file contents
pBuffer = Abc_FileRead( pFileName ); pBuffer = Abc_FileRead( pFileName );
// allocate data-structure // allocate data-structure
......
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