Making sure read_bench can read nodes up to 15 inputs.

This commit is contained in:
Alan Mishchenko 2021-04-30 16:12:15 -07:00
parent 9b75906740
commit 645752f7d6
2 changed files with 6 additions and 5 deletions

View File

@ -88,7 +88,7 @@ Abc_Ntk_t * Io_ReadBenchNetwork( Extra_FileReader_t * p )
Abc_Ntk_t * pNtk;
Abc_Obj_t * pNode, * pNet;
Vec_Str_t * vString;
unsigned uTruth[8];
unsigned uTruth[2048];
char * pType, ** ppNames, * pString;
int iLine, nNames, nDigits, fLutsPresent = 0;
@ -161,7 +161,7 @@ Abc_Ntk_t * Io_ReadBenchNetwork( Extra_FileReader_t * p )
ppNames = (char **)vTokens->pArray + 3;
nNames = vTokens->nSize - 3;
// check the number of inputs
if ( nNames > 8 )
if ( nNames > 15 )
{
printf( "%s: Currently cannot read truth tables with more than 8 inputs (%d).\n", Extra_FileReaderGetFileName(p), nNames );
Vec_StrFree( vString );

View File

@ -1351,7 +1351,8 @@ static int Io_MvParseLineSubckt( Io_MvMod_t * p, char * pLine )
Abc_Ntk_t * pModel;
Abc_Obj_t * pBox, * pNet, * pTerm;
char * pToken, * pName, * pName2, ** ppNames;
int nEquals, Last, i, k;
int nEquals, i, k;
word Last;
// split the line into tokens
nEquals = Io_MvCountChars( pLine, '=' );
@ -1404,9 +1405,9 @@ static int Io_MvParseLineSubckt( Io_MvMod_t * p, char * pLine )
pName2 = NULL;
pName = Abc_ObjName(Abc_ObjFanout0(pTerm));
for ( k = 0; k < nEquals; k++ )
if ( !strcmp( ppNames[2*((k+Last)%nEquals)], pName ) )
if ( !strcmp( ppNames[2*(int)((k+Last)%nEquals)], pName ) )
{
pName2 = ppNames[2*((k+Last)%nEquals)+1];
pName2 = ppNames[2*(int)((k+Last)%nEquals)+1];
Last = k+Last+1;
break;
}