changeset 83759f72c7de in /z/repo/m5
details: http://repo.m5sim.org/m5?cmd=changeset;node=83759f72c7de
description:
isa_parser: move more stuff into the ISAParser class
diffstat:
1 file changed, 9 insertions(+), 13 deletions(-)
src/arch/isa_parser.py | 22 +++++++++-------------
diffs (53 lines):
diff -r 73afd9458692 -r 83759f72c7de src/arch/isa_parser.py
--- a/src/arch/isa_parser.py Fri Feb 26 18:14:48 2010 -0800
+++ b/src/arch/isa_parser.py Fri Feb 26 18:14:48 2010 -0800
@@ -893,9 +893,6 @@
global operandsWithExtRE
operandsWithExtRE = re.compile(operandsWithExtREString, re.MULTILINE)
-maxInstSrcRegs = 0
-maxInstDestRegs = 0
-
class OperandList(object):
'''Find all the operands in the given code block. Returns an operand
descriptor list (instance of class OperandList).'''
@@ -957,12 +954,10 @@
if self.memOperand:
error("Code block has more than one memory operand.")
self.memOperand = op_desc
- global maxInstSrcRegs
- global maxInstDestRegs
- if maxInstSrcRegs < self.numSrcRegs:
- maxInstSrcRegs = self.numSrcRegs
- if maxInstDestRegs < self.numDestRegs:
- maxInstDestRegs = self.numDestRegs
+ if parser.maxInstSrcRegs < self.numSrcRegs:
+ parser.maxInstSrcRegs = self.numSrcRegs
+ if parser.maxInstDestRegs < self.numDestRegs:
+ parser.maxInstDestRegs = self.numDestRegs
# now make a final pass to finalize op_desc fields that may depend
# on the register enumeration
for op_desc in self.items:
@@ -1237,6 +1232,9 @@
self.exportContext = {}
+ self.maxInstSrcRegs = 0
+ self.maxInstDestRegs = 0
+
#####################################################################
#
# Lexer
@@ -2049,10 +2047,8 @@
# The variable names here are hacky, but this will creat local
# variables which will be referenced in vars() which have the
# value of the globals.
- global maxInstSrcRegs
- MaxInstSrcRegs = maxInstSrcRegs
- global maxInstDestRegs
- MaxInstDestRegs = maxInstDestRegs
+ MaxInstSrcRegs = self.maxInstSrcRegs
+ MaxInstDestRegs = self.maxInstDestRegs
# max_inst_regs.hh
self.update_if_needed('max_inst_regs.hh',
max_inst_regs_template % vars())
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev