diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2010-11-29 01:35:09 -0800 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2010-11-29 01:35:09 -0800 |
commit | 42cebe99d09df1b6ac2f58bdfa1f6e47cb4bc4d2 (patch) | |
tree | 5bfedb22699453f3f6d81e9b4d811b9cfd6387f9 /src/map | |
parent | 9bff0309ae9bee48b4f61c1d82da4cd4ca25fda8 (diff) | |
download | abc-42cebe99d09df1b6ac2f58bdfa1f6e47cb4bc4d2.tar.gz abc-42cebe99d09df1b6ac2f58bdfa1f6e47cb4bc4d2.tar.bz2 abc-42cebe99d09df1b6ac2f58bdfa1f6e47cb4bc4d2.zip |
Bug fix: unhandled & symbol in Liberty formula representation
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/amap/amapParse.c | 6 | ||||
-rw-r--r-- | src/map/mio/mioFunc.c | 13 |
2 files changed, 12 insertions, 7 deletions
diff --git a/src/map/amap/amapParse.c b/src/map/amap/amapParse.c index dd6137c9..3ebbec11 100644 --- a/src/map/amap/amapParse.c +++ b/src/map/amap/amapParse.c @@ -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++ ) { diff --git a/src/map/mio/mioFunc.c b/src/map/mio/mioFunc.c index f6f327e3..e58d3958 100644 --- a/src/map/mio/mioFunc.c +++ b/src/map/mio/mioFunc.c @@ -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; |