diff options
author | Tony Gutierrez <anthony.gutierrez@amd.com> | 2015-07-20 09:15:18 -0500 |
---|---|---|
committer | Tony Gutierrez <anthony.gutierrez@amd.com> | 2015-07-20 09:15:18 -0500 |
commit | a3177645773b8eb4b835050c395554d3e2b4664a (patch) | |
tree | 793299969de1562785063448ac12f9e06ac164e3 /src/mem/slicc/parser.py | |
parent | 3f68884c0e432cdc241ed0442e19ade0d74aa6f4 (diff) | |
download | gem5-a3177645773b8eb4b835050c395554d3e2b4664a.tar.xz |
ruby: slicc: have a static MachineType
This patch is imported from reviewboard patch 2551 by Nilay.
This patch moves from a dynamically defined MachineType to a statically
defined one. The need for this patch was felt since a dynamically defined
type prevents us from having types for which no machine definition may
exist.
The following changes have been made:
i. each machine definition now uses a type from the MachineType enumeration
instead of any random identifier. This required changing the grammar and the
*.sm files.
ii. MachineType enumeration defined statically in RubySlicc_Exports.sm.
* * *
normal protocol fixes for nilay's parser machine type fix
Diffstat (limited to 'src/mem/slicc/parser.py')
-rw-r--r-- | src/mem/slicc/parser.py | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/mem/slicc/parser.py b/src/mem/slicc/parser.py index 364bb92f7..4afe0d367 100644 --- a/src/mem/slicc/parser.py +++ b/src/mem/slicc/parser.py @@ -62,7 +62,6 @@ class SLICC(Grammar): return code def process(self): - self.decl_list.findMachines() self.decl_list.generate() def writeCodeFiles(self, code_path, includes): @@ -72,10 +71,7 @@ class SLICC(Grammar): self.symtab.writeHTMLFiles(html_path) def files(self): - f = set([ - 'MachineType.cc', - 'MachineType.hh', - 'Types.hh' ]) + f = set(['Types.hh']) f |= self.decl_list.files() @@ -259,11 +255,11 @@ class SLICC(Grammar): p[0] = self.parse_file(filename) def p_decl__machine0(self, p): - "decl : MACHINE '(' ident ')' ':' obj_decls '{' decls '}'" + "decl : MACHINE '(' enumeration ')' ':' obj_decls '{' decls '}'" p[0] = ast.MachineAST(self, p[3], [], p[7], p[9]) def p_decl__machine1(self, p): - "decl : MACHINE '(' ident pairs ')' ':' obj_decls '{' decls '}'" + "decl : MACHINE '(' enumeration pairs ')' ':' obj_decls '{' decls '}'" p[0] = ast.MachineAST(self, p[3], p[4], p[7], p[9]) def p_decl__action(self, p): |