diff options
author | Nilay Vaish <nilay@cs.wisc.edu> | 2011-12-31 16:38:30 -0600 |
---|---|---|
committer | Nilay Vaish <nilay@cs.wisc.edu> | 2011-12-31 16:38:30 -0600 |
commit | 734ef9a209279ea3c391bcb0097241b2235661dc (patch) | |
tree | d6be8c137f17431a2c8ec5556899df02c495c087 /src/mem/slicc | |
parent | 19e65a650266a526ca47389188f21bbde79d5054 (diff) | |
download | gem5-734ef9a209279ea3c391bcb0097241b2235661dc.tar.xz |
SLICC: Use pointers for directory entries
SLICC uses pointers for cache and TBE entries but not for directory entries.
This patch changes the protocols, SLICC and Ruby memory system so that even
directory entries are referenced using pointers.
--HG--
extra : rebase_source : abeb4ac78033d003153751f216fd1948251fcfad
Diffstat (limited to 'src/mem/slicc')
-rw-r--r-- | src/mem/slicc/ast/FormalParamAST.py | 5 | ||||
-rw-r--r-- | src/mem/slicc/ast/LocalVariableAST.py | 4 | ||||
-rw-r--r-- | src/mem/slicc/ast/MemberExprAST.py | 5 | ||||
-rw-r--r-- | src/mem/slicc/ast/MethodCallExprAST.py | 6 |
4 files changed, 14 insertions, 6 deletions
diff --git a/src/mem/slicc/ast/FormalParamAST.py b/src/mem/slicc/ast/FormalParamAST.py index e94f24ccb..6ed5bca0a 100644 --- a/src/mem/slicc/ast/FormalParamAST.py +++ b/src/mem/slicc/ast/FormalParamAST.py @@ -52,8 +52,9 @@ class FormalParamAST(AST): self.pairs) self.symtab.newSymbol(v) if self.pointer or str(type) == "TBE" or ( - "interface" in type and type["interface"] == "AbstractCacheEntry"): - + "interface" in type and ( + type["interface"] == "AbstractCacheEntry" or + type["interface"] == "AbstractEntry")): return type, "%s* %s" % (type.c_ident, param) else: return type, "const %s& %s" % (type.c_ident, param) diff --git a/src/mem/slicc/ast/LocalVariableAST.py b/src/mem/slicc/ast/LocalVariableAST.py index b779415f3..0b77323b7 100644 --- a/src/mem/slicc/ast/LocalVariableAST.py +++ b/src/mem/slicc/ast/LocalVariableAST.py @@ -52,7 +52,9 @@ class LocalVariableAST(StatementAST): self.pairs) self.symtab.newSymbol(v) if self.pointer or str(type) == "TBE" or ( - "interface" in type and type["interface"] == "AbstractCacheEntry"): + "interface" in type and ( + type["interface"] == "AbstractCacheEntry" or + type["interface"] == "AbstractEntry")): code += "%s* %s" % (type.c_ident, ident) else: code += "%s %s" % (type.c_ident, ident) diff --git a/src/mem/slicc/ast/MemberExprAST.py b/src/mem/slicc/ast/MemberExprAST.py index 412c178d8..6a6fc49bb 100644 --- a/src/mem/slicc/ast/MemberExprAST.py +++ b/src/mem/slicc/ast/MemberExprAST.py @@ -41,7 +41,10 @@ class MemberExprAST(ExprAST): return_type, gcode = self.expr_ast.inline(True) fix = code.nofix() - if str(return_type) == "TBE" or ("interface" in return_type and return_type["interface"] == "AbstractCacheEntry"): + if str(return_type) == "TBE" \ + or ("interface" in return_type and + (return_type["interface"] == "AbstractCacheEntry" or + return_type["interface"] == "AbstractEntry")): code("(*$gcode).m_${{self.field}}") else: code("($gcode).m_${{self.field}}") diff --git a/src/mem/slicc/ast/MethodCallExprAST.py b/src/mem/slicc/ast/MethodCallExprAST.py index cfee9b19d..cf30cfa96 100644 --- a/src/mem/slicc/ast/MethodCallExprAST.py +++ b/src/mem/slicc/ast/MethodCallExprAST.py @@ -162,8 +162,10 @@ class MemberMethodCallExprAST(MethodCallExprAST): prefix = "static_cast<%s &>" % return_type.c_ident if str(obj_type) == "AbstractCacheEntry" or \ - ("interface" in obj_type and - obj_type["interface"] == "AbstractCacheEntry"): + str(obj_type) == "AbstractEntry" or \ + ("interface" in obj_type and ( + obj_type["interface"] == "AbstractCacheEntry" or + obj_type["interface"] == "AbstractEntry")): prefix = "%s((*(%s))." % (prefix, code) else: prefix = "%s((%s)." % (prefix, code) |