diff options
author | Brad Beckmann <Brad.Beckmann@amd.com> | 2011-02-23 16:41:59 -0800 |
---|---|---|
committer | Brad Beckmann <Brad.Beckmann@amd.com> | 2011-02-23 16:41:59 -0800 |
commit | 12a05c23b7d351afee4b0c531021d8fb8ea5f57d (patch) | |
tree | 99a18647ecf642166068187915f2816a1007567d /src/mem/slicc/ast/TypeFieldEnumAST.py | |
parent | 7842e955193c3fba850201acc45001306fe2ff9b (diff) | |
download | gem5-12a05c23b7d351afee4b0c531021d8fb8ea5f57d.tar.xz |
ruby: automate permission setting
This patch integrates permissions with cache and memory states, and then
automates the setting of permissions within the generated code. No longer
does one need to manually set the permissions within the setState funciton.
This patch will faciliate easier functional access support by always correctly
setting permissions for both cache and memory states.
--HG--
rename : src/mem/slicc/ast/EnumDeclAST.py => src/mem/slicc/ast/StateDeclAST.py
rename : src/mem/slicc/ast/TypeFieldEnumAST.py => src/mem/slicc/ast/TypeFieldStateAST.py
Diffstat (limited to 'src/mem/slicc/ast/TypeFieldEnumAST.py')
-rw-r--r-- | src/mem/slicc/ast/TypeFieldEnumAST.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/mem/slicc/ast/TypeFieldEnumAST.py b/src/mem/slicc/ast/TypeFieldEnumAST.py index 138fff793..398604550 100644 --- a/src/mem/slicc/ast/TypeFieldEnumAST.py +++ b/src/mem/slicc/ast/TypeFieldEnumAST.py @@ -39,6 +39,9 @@ class TypeFieldEnumAST(TypeFieldAST): return "[TypeFieldEnum: %r]" % self.field_id def generate(self, type): + if str(type) == "State": + self.error("States must in a State Declaration, not a normal enum.") + # Add enumeration if not type.enumAdd(self.field_id, self.pairs_ast.pairs): self.error("Duplicate enumeration: %s:%s" % (type, self.field_id)) @@ -46,12 +49,6 @@ class TypeFieldEnumAST(TypeFieldAST): # Fill machine info machine = self.symtab.state_machine - if str(type) == "State": - if not machine: - self.error("State declaration not part of a machine.") - s = State(self.symtab, self.field_id, self.location, self.pairs) - machine.addState(s) - if str(type) == "Event": if not machine: self.error("Event declaration not part of a machine.") |