mem-ruby: Allow trivial integer operations with Addr type
At the moment an address value can only be used in the slicc code to do TBE lookups but there is no way to add/subtract/divide/multiply two addresses nor an address and an integer value. This hinders the development of protocol specific code and forces developers to place such code in shared C++ structures Change-Id: Ia184e793b6cd38f951f475a7cdf284f529972ccb Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
This commit is contained in:
@@ -1,3 +1,15 @@
|
||||
# Copyright (c) 2023 Arm Limited
|
||||
# All rights reserved.
|
||||
#
|
||||
# The license below extends only to copyright in the software and shall
|
||||
# not be construed as granting a license to any other intellectual
|
||||
# property including but not limited to intellectual property relating
|
||||
# to a hardware implementation of the functionality of the software
|
||||
# licensed hereunder. You may use the software subject to the license
|
||||
# terms below provided that you ensure that this notice is replicated
|
||||
# unmodified and in its entirety in all distributions of the software,
|
||||
# modified or unmodified, in source code or in binary form.
|
||||
#
|
||||
# Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
|
||||
# Copyright (c) 2009 The Hewlett-Packard Development Company
|
||||
# All rights reserved.
|
||||
@@ -76,11 +88,14 @@ class InfixOperatorExprAST(ExprAST):
|
||||
("int", "int", "int"),
|
||||
("Cycles", "Cycles", "Cycles"),
|
||||
("Tick", "Tick", "Tick"),
|
||||
("Addr", "Addr", "Addr"),
|
||||
("Cycles", "int", "Cycles"),
|
||||
("Scalar", "int", "Scalar"),
|
||||
("int", "bool", "int"),
|
||||
("bool", "int", "int"),
|
||||
("int", "Cycles", "Cycles"),
|
||||
("Addr", "int", "Addr"),
|
||||
("int", "Addr", "Addr"),
|
||||
]
|
||||
else:
|
||||
self.error(f"No operator matched with {self.op}!")
|
||||
|
||||
Reference in New Issue
Block a user