summaryrefslogtreecommitdiff
path: root/src/mem/slicc/ast
diff options
context:
space:
mode:
authorBrad Beckmann ext:(%2C%20Nilay%20Vaish%20%3Cnilay%40cs.wisc.edu%3E) <Brad.Beckmann@amd.com>2011-06-30 19:49:26 -0500
committerBrad Beckmann ext:(%2C%20Nilay%20Vaish%20%3Cnilay%40cs.wisc.edu%3E) <Brad.Beckmann@amd.com>2011-06-30 19:49:26 -0500
commitc86f849d5a1da1fc77f2fca43b82cb6760f68bc9 (patch)
treef192cbc73d86ee4e15e752f6ed174e4ce3425c9e /src/mem/slicc/ast
parentf4cfd65d2982f0f97304ef05083b40f3346a496f (diff)
downloadgem5-c86f849d5a1da1fc77f2fca43b82cb6760f68bc9.tar.xz
Ruby: Add support for functional accesses
This patch rpovides functional access support in Ruby. Currently only the M5Port of RubyPort supports functional accesses. The support for functional through the PioPort will be added as a separate patch.
Diffstat (limited to 'src/mem/slicc/ast')
-rw-r--r--src/mem/slicc/ast/MemberExprAST.py19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/mem/slicc/ast/MemberExprAST.py b/src/mem/slicc/ast/MemberExprAST.py
index a13205252..412c178d8 100644
--- a/src/mem/slicc/ast/MemberExprAST.py
+++ b/src/mem/slicc/ast/MemberExprAST.py
@@ -49,10 +49,15 @@ class MemberExprAST(ExprAST):
code.fix(fix)
# Verify that this is a valid field name for this type
- if self.field not in return_type.data_members:
- self.error("Invalid object field: " +
- "Type '%s' does not have data member %s" % \
- (return_type, self.field))
-
- # Return the type of the field
- return return_type.data_members[self.field].type
+ if self.field in return_type.data_members:
+ # Return the type of the field
+ return return_type.data_members[self.field].type
+ else:
+ if "interface" in return_type:
+ interface_type = self.symtab.find(return_type["interface"]);
+ if self.field in interface_type.data_members:
+ # Return the type of the field
+ return interface_type.data_members[self.field].type
+ self.error("Invalid object field: " +
+ "Type '%s' does not have data member %s" % \
+ (return_type, self.field))