diff options
author | Gabe Black <gblack@eecs.umich.edu> | 2010-06-02 12:57:59 -0500 |
---|---|---|
committer | Gabe Black <gblack@eecs.umich.edu> | 2010-06-02 12:57:59 -0500 |
commit | 1c0d9806e5475e07fd62e56938bde77f52496cfb (patch) | |
tree | f90739d6649f9354f4c0a5bd8a85a3e5034abd16 /src/arch/isa_parser.py | |
parent | 4b87bc887adc020984702aeafeb038da861dc04a (diff) | |
download | gem5-1c0d9806e5475e07fd62e56938bde77f52496cfb.tar.xz |
ARM: Fix custom writer/reader code for non indexed operands.
Diffstat (limited to 'src/arch/isa_parser.py')
-rwxr-xr-x | src/arch/isa_parser.py | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/src/arch/isa_parser.py b/src/arch/isa_parser.py index 282010429..4e06c2ded 100755 --- a/src/arch/isa_parser.py +++ b/src/arch/isa_parser.py @@ -388,12 +388,14 @@ class Operand(object): type (e.g., "32-bit integer register").''' def buildReadCode(self, func = None): - code = self.read_code % {"name": self.base_name, - "func": func, - "op_idx": self.src_reg_idx, - "reg_idx": self.reg_spec, - "size": self.size, - "ctype": self.ctype} + subst_dict = {"name": self.base_name, + "func": func, + "reg_idx": self.reg_spec, + "size": self.size, + "ctype": self.ctype} + if hasattr(self, 'src_reg_idx'): + subst_dict['op_idx'] = self.src_reg_idx + code = self.read_code % subst_dict if self.size != self.dflt_size: return '%s = bits(%s, %d, 0);\n' % \ (self.base_name, code, self.size-1) @@ -406,13 +408,15 @@ class Operand(object): final_val = 'sext<%d>(%s)' % (self.size, self.base_name) else: final_val = self.base_name - code = self.write_code % {"name": self.base_name, - "func": func, - "op_idx": self.dest_reg_idx, - "reg_idx": self.reg_spec, - "size": self.size, - "ctype": self.ctype, - "final_val": final_val} + subst_dict = {"name": self.base_name, + "func": func, + "reg_idx": self.reg_spec, + "size": self.size, + "ctype": self.ctype, + "final_val": final_val} + if hasattr(self, 'dest_reg_idx'): + subst_dict['op_idx'] = self.dest_reg_idx + code = self.write_code % subst_dict return ''' { %s final_val = %s; |