summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2016-03-11 15:12:52 +0900
committerAlan Mishchenko <alanmi@berkeley.edu>2016-03-11 15:12:52 +0900
commitb2ad140adb64fe5913e086b94aaa53d54d654f98 (patch)
treedf92aa32a15a6dd25092d6d52dd6a221780e149b /src
parent22a5ab19c828b83abb3bd300f1ecd1ee60b4e535 (diff)
downloadabc-b2ad140adb64fe5913e086b94aaa53d54d654f98.tar.gz
abc-b2ad140adb64fe5913e086b94aaa53d54d654f98.tar.bz2
abc-b2ad140adb64fe5913e086b94aaa53d54d654f98.zip
Supporting complemented reduction operators.
Diffstat (limited to 'src')
-rw-r--r--src/base/wlc/wlcReadVer.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/base/wlc/wlcReadVer.c b/src/base/wlc/wlcReadVer.c
index 6c035c3d..4b5bcac9 100644
--- a/src/base/wlc/wlcReadVer.c
+++ b/src/base/wlc/wlcReadVer.c
@@ -662,11 +662,11 @@ static inline int Wlc_PrsFindDefinition( Wlc_Prs_t * p, char * pStr, Vec_Int_t *
return 0;
Type = WLC_OBJ_CONST;
}
- else if ( pStr[0] == '!' || (pStr[0] == '~' && pStr[1] != '^') || pStr[0] == '@' || pStr[0] == '#' )
+ else if ( pStr[0] == '!' || (pStr[0] == '~' && pStr[1] != '&' && pStr[1] != '|' && pStr[1] != '^') || pStr[0] == '@' || pStr[0] == '#' )
{
if ( pStr[0] == '!' )
Type = WLC_OBJ_LOGIC_NOT;
- else if ( pStr[0] == '~' && pStr[1] != '^' )
+ else if ( pStr[0] == '~' )
Type = WLC_OBJ_BIT_NOT;
else if ( pStr[0] == '@' )
Type = WLC_OBJ_ARI_SQRT;
@@ -691,6 +691,7 @@ static inline int Wlc_PrsFindDefinition( Wlc_Prs_t * p, char * pStr, Vec_Int_t *
(pStr[0] == '~' && pStr[1] == '|') ||
(pStr[0] == '~' && pStr[1] == '^') )
{
+ int shift = 1;
if ( pStr[0] == '-' )
Type = WLC_OBJ_ARI_MINUS;
else if ( pStr[0] == '&' )
@@ -700,13 +701,13 @@ static inline int Wlc_PrsFindDefinition( Wlc_Prs_t * p, char * pStr, Vec_Int_t *
else if ( pStr[0] == '^' )
Type = WLC_OBJ_REDUCT_XOR;
else if ( pStr[0] == '~' && pStr[1] == '&' )
- Type = WLC_OBJ_REDUCT_NAND;
+ {Type = WLC_OBJ_REDUCT_NAND; shift = 2;}
else if ( pStr[0] == '~' && pStr[1] == '|' )
- Type = WLC_OBJ_REDUCT_NOR;
+ {Type = WLC_OBJ_REDUCT_NOR; shift = 2;}
else if ( pStr[0] == '~' && pStr[1] == '^' )
- Type = WLC_OBJ_REDUCT_NXOR;
+ {Type = WLC_OBJ_REDUCT_NXOR; shift = 2;}
else assert( 0 );
- if ( !(pStr = Wlc_PrsReadName(p, pStr+1, vFanins)) )
+ if ( !(pStr = Wlc_PrsReadName(p, pStr+shift, vFanins)) )
return Wlc_PrsWriteErrorMessage( p, pStr, "Cannot read name after a unary operator." );
}
else if ( pStr[0] == '{' )