mirror of https://github.com/YosysHQ/abc.git
Bug fix in liberty parser and change suggested by Clifford.
This commit is contained in:
parent
0224039132
commit
59aea7639f
|
|
@ -335,13 +335,27 @@ int Mio_LibraryReadInternal( Mio_Library_t * pLib, char * pBuffer, int fExtended
|
|||
char * Mio_LibraryCleanStr( char * p )
|
||||
{
|
||||
int i, k;
|
||||
int whitespace_state = 0;
|
||||
char * pRes = Abc_UtilStrsav( p );
|
||||
for ( i = k = 0; pRes[i]; i++ )
|
||||
if ( pRes[i] != ' ' && pRes[i] != '\t' && pRes[i] != '\r' && pRes[i] != '\n' )
|
||||
if ( pRes[i] != ' ' && pRes[i] != '\t' && pRes[i] != '\r' && pRes[i] != '\n' )
|
||||
{
|
||||
if ( pRes[i] != '(' && pRes[i] != ')' && pRes[i] != '+' && pRes[i] != '*' && pRes[i] != '|' && pRes[i] != '&' && pRes[i] != '^' && pRes[i] != '\'' && pRes[i] != '!' )
|
||||
{
|
||||
if (whitespace_state == 2)
|
||||
pRes[k++] = ' ';
|
||||
whitespace_state = 1;
|
||||
}
|
||||
else
|
||||
whitespace_state = 0;
|
||||
pRes[k++] = pRes[i];
|
||||
}
|
||||
else
|
||||
whitespace_state = whitespace_state ? 2 : 0;
|
||||
pRes[k] = 0;
|
||||
return pRes;
|
||||
}
|
||||
|
||||
Mio_Gate_t * Mio_LibraryReadGate( char ** ppToken, int fExtendedFormat )
|
||||
{
|
||||
Mio_Gate_t * pGate;
|
||||
|
|
|
|||
|
|
@ -1517,6 +1517,8 @@ Vec_Str_t * Scl_LibertyReadSclStr( Scl_Tree_t * p, int fVerbose, int fVeryVerbos
|
|||
Vec_StrPutS_( vOut, pFormula );
|
||||
// write truth table
|
||||
vTruth = Mio_ParseFormulaTruth( pFormula, (char **)Vec_PtrArray(vNameIns), Vec_PtrSize(vNameIns) );
|
||||
if ( vTruth == NULL )
|
||||
return NULL;
|
||||
for ( i = 0; i < Abc_Truth6WordNum(Vec_PtrSize(vNameIns)); i++ )
|
||||
Vec_StrPutW_( vOut, Vec_WrdEntry(vTruth, i) );
|
||||
Vec_WrdFree( vTruth );
|
||||
|
|
|
|||
Loading…
Reference in New Issue