Commit 42cebe99 by Alan Mishchenko

Bug fix: unhandled & symbol in Liberty formula representation

parent 9bff0309
......@@ -37,6 +37,7 @@ ABC_NAMESPACE_IMPL_START
#define AMAP_EQN_SYM_NEG '!' // negation before the variable
#define AMAP_EQN_SYM_NEGAFT '\'' // negation after the variable
#define AMAP_EQN_SYM_AND '*' // logic AND
#define AMAP_EQN_SYM_AND2 '&' // logic AND
#define AMAP_EQN_SYM_XOR '^' // logic XOR
#define AMAP_EQN_SYM_OR '+' // logic OR
#define AMAP_EQN_SYM_OR2 '|' // logic OR
......@@ -184,6 +185,7 @@ Hop_Obj_t * Amap_ParseFormula( FILE * pOutput, char * pFormInit, Vec_Ptr_t * vVa
Vec_PtrPush( pStackFn, Hop_Not( (Hop_Obj_t *)Vec_PtrPop(pStackFn) ) );
break;
case AMAP_EQN_SYM_AND:
case AMAP_EQN_SYM_AND2:
case AMAP_EQN_SYM_OR:
case AMAP_EQN_SYM_OR2:
case AMAP_EQN_SYM_XOR:
......@@ -193,7 +195,7 @@ Hop_Obj_t * Amap_ParseFormula( FILE * pOutput, char * pFormInit, Vec_Ptr_t * vVa
Flag = AMAP_EQN_FLAG_ERROR;
break;
}
if ( *pTemp == AMAP_EQN_SYM_AND )
if ( *pTemp == AMAP_EQN_SYM_AND || *pTemp == AMAP_EQN_SYM_AND2 )
Vec_IntPush( pStackOp, AMAP_EQN_OPER_AND );
else if ( *pTemp == AMAP_EQN_SYM_OR || *pTemp == AMAP_EQN_SYM_OR2 )
Vec_IntPush( pStackOp, AMAP_EQN_OPER_OR );
......@@ -252,7 +254,7 @@ Hop_Obj_t * Amap_ParseFormula( FILE * pOutput, char * pFormInit, Vec_Ptr_t * vVa
// scan the next name
for ( i = 0; pTemp[i] &&
pTemp[i] != ' ' && pTemp[i] != '\t' && pTemp[i] != '\r' && pTemp[i] != '\n' &&
pTemp[i] != AMAP_EQN_SYM_AND && pTemp[i] != AMAP_EQN_SYM_OR && pTemp[i] != AMAP_EQN_SYM_OR2 &&
pTemp[i] != AMAP_EQN_SYM_AND && pTemp[i] != AMAP_EQN_SYM_AND2 && pTemp[i] != AMAP_EQN_SYM_OR && pTemp[i] != AMAP_EQN_SYM_OR2 &&
pTemp[i] != AMAP_EQN_SYM_XOR && pTemp[i] != AMAP_EQN_SYM_NEGAFT && pTemp[i] != AMAP_EQN_SYM_CLOSE;
i++ )
{
......
......@@ -28,7 +28,8 @@ ABC_NAMESPACE_IMPL_START
// these symbols (and no other) can appear in the formulas
#define MIO_SYMB_AND '*'
#define MIO_SYMB_OR1 '+'
#define MIO_SYMB_AND2 '&'
#define MIO_SYMB_OR '+'
#define MIO_SYMB_OR2 '|'
#define MIO_SYMB_XOR '^'
#define MIO_SYMB_NOT '!'
......@@ -246,10 +247,12 @@ int Mio_GateCollectNames( char * pFormula, char * pPinNames[] )
// remove the non-name symbols
for ( pTemp = Buffer; *pTemp; pTemp++ )
if ( *pTemp == MIO_SYMB_AND || *pTemp == MIO_SYMB_OR1 || *pTemp == MIO_SYMB_OR2
|| *pTemp == MIO_SYMB_XOR || *pTemp == MIO_SYMB_NOT || *pTemp == MIO_SYMB_OPEN
|| *pTemp == MIO_SYMB_CLOSE || *pTemp == MIO_SYMB_AFTNOT )
*pTemp = ' ';
if ( *pTemp == MIO_SYMB_AND || *pTemp == MIO_SYMB_AND2 ||
*pTemp == MIO_SYMB_OR || *pTemp == MIO_SYMB_OR2 ||
*pTemp == MIO_SYMB_XOR ||
*pTemp == MIO_SYMB_NOT || *pTemp == MIO_SYMB_AFTNOT ||
*pTemp == MIO_SYMB_OPEN || *pTemp == MIO_SYMB_CLOSE )
*pTemp = ' ';
// save the names
nPins = 0;
......
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