mem-ruby: allow comparison of int and Addr in SLICC (#701)

allow easy isolation of specific addresses in coherence protocols.
useful for debugging.

Change-Id: I93e07956b8e29837219d328dacfbd5c6067c1a62
This commit is contained in:
Arteen Abrishami
2024-01-12 10:02:29 -08:00
committed by GitHub
parent 7487c13181
commit e5bdc760e3

View File

@@ -62,7 +62,15 @@ class InfixOperatorExprAST(ExprAST):
# Figure out what the input and output types should be
if self.op in ("==", "!=", ">=", "<=", ">", "<"):
output = "bool"
if ltype != rtype:
if (
str(ltype) == "Addr"
and str(rtype) == "int"
or str(ltype) == "int"
and str(rtype) == "Addr"
):
pass
elif ltype != rtype:
self.error(
"Type mismatch: left and right operands of "
+ "operator '%s' must be the same type. "