summaryrefslogtreecommitdiff
path: root/src/mem/slicc/ast
diff options
context:
space:
mode:
authorTony Gutierrez <anthony.gutierrez@amd.com>2015-07-20 09:15:18 -0500
committerTony Gutierrez <anthony.gutierrez@amd.com>2015-07-20 09:15:18 -0500
commit3f68884c0e432cdc241ed0442e19ade0d74aa6f4 (patch)
treef8122e3390bb70e48b5490673e79450b09c7f996 /src/mem/slicc/ast
parent3840a72f372600ca177ac8765d80853cc92988d0 (diff)
downloadgem5-3f68884c0e432cdc241ed0442e19ade0d74aa6f4.tar.xz
ruby: slicc: remove support for single machine, multiple types
This patch is imported from reviewboard patch 2550 by Nilay. It was possible to specify multiple machine types with a single state machine. This seems unnecessary and is being removed.
Diffstat (limited to 'src/mem/slicc/ast')
-rw-r--r--src/mem/slicc/ast/MachineAST.py23
1 files changed, 8 insertions, 15 deletions
diff --git a/src/mem/slicc/ast/MachineAST.py b/src/mem/slicc/ast/MachineAST.py
index 5d14f7688..4487b094e 100644
--- a/src/mem/slicc/ast/MachineAST.py
+++ b/src/mem/slicc/ast/MachineAST.py
@@ -29,11 +29,10 @@ from slicc.ast.DeclAST import DeclAST
from slicc.symbols import StateMachine, Type
class MachineAST(DeclAST):
- def __init__(self, slicc, idents, pairs_ast, config_parameters, decls):
+ def __init__(self, slicc, ident, pairs_ast, config_parameters, decls):
super(MachineAST, self).__init__(slicc, pairs_ast)
- self.ident = idents[0]
- self.machine_types = idents
+ self.ident = ident
self.pairs_ast = pairs_ast
self.config_parameters = config_parameters
self.decls = decls
@@ -71,19 +70,13 @@ class MachineAST(DeclAST):
self.symtab.popFrame()
def findMachines(self):
- # Add to MachineType enumeration
- for mtype in self.machine_types:
- machine_type = self.symtab.find("MachineType", Type)
- pairs = self.pairs_ast.pairs
+ mtype = self.ident
+ machine_type = self.symtab.find("MachineType", Type)
+ pairs = self.pairs_ast.pairs
- if mtype == self.ident:
- pairs["Primary"] = True
- else:
- pairs["Primary"] = False
-
- if not machine_type.addEnum(mtype, pairs):
- self.error("Duplicate machine name: %s:%s" % (
- machine_type, mtype))
+ pairs["Primary"] = True
+ if not machine_type.addEnum(mtype, pairs):
+ self.error("Duplicate machine name: %s:%s" % (machine_type, mtype))
# Generate code for all the internal decls
self.decls.findMachines()