summaryrefslogtreecommitdiff
path: root/arch/isa_parser.py
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2006-04-06 14:52:44 -0400
committerGabe Black <gblack@eecs.umich.edu>2006-04-06 14:52:44 -0400
commit6d8d6d15cdf5547740afbd41efe7c0f1d62079f3 (patch)
treead61b78dd531bd4696f00aeda36ff97b145622a2 /arch/isa_parser.py
parenta4b31e8f6b3c8ea33a5dad3e194c9865b92b0962 (diff)
downloadgem5-6d8d6d15cdf5547740afbd41efe7c0f1d62079f3.tar.xz
Fixed up the isa description. Also added some capability to the isa_parser in the InstObjParams constructor.
arch/isa_parser.py: Expanded the capability of the InstObjParams constructor to allow adding in extra keys for use in templates. These are added as key, value tuples as optional arguements. arch/sparc/isa/base.isa: arch/sparc/isa/formats/mem.isa: arch/sparc/isa/formats/priv.isa: The genCompositeIop function is no longer needed, as this functionality is now in the InstObjParams constructor. arch/sparc/isa/decoder.isa: Fixed up alot of instructions, and fixed indentation. arch/sparc/isa/formats/integerop.isa: The genCompositeIop function is no longer needed, as this functionality is now in the InstObjParams constructor. Also changed the immediate values to be signed. base/traceflags.py: Added SPARC traceflag configs/test/hello_sparc: Recompiled without -mflat cpu/cpu_exec_context.cc: Used the regfile clear function rather than memsetting to 0. --HG-- extra : convert_revision : b9da6f264f3ebc4ce1815008dfff7f476b247ee9
Diffstat (limited to 'arch/isa_parser.py')
-rwxr-xr-xarch/isa_parser.py22
1 files changed, 18 insertions, 4 deletions
diff --git a/arch/isa_parser.py b/arch/isa_parser.py
index 6fce783b1..8279a6a5d 100755
--- a/arch/isa_parser.py
+++ b/arch/isa_parser.py
@@ -1618,13 +1618,27 @@ opClassRE = re.compile(r'.*Op|No_OpClass')
class InstObjParams:
def __init__(self, mnem, class_name, base_class = '',
- code_block = None, opt_args = []):
+ code = None, opt_args = [], *extras):
self.mnemonic = mnem
self.class_name = class_name
self.base_class = base_class
- if code_block:
- for code_attr in code_block.__dict__.keys():
- setattr(self, code_attr, getattr(code_block, code_attr))
+ if code:
+ #If the user already made a CodeBlock, pick the parts from it
+ if isinstance(code, CodeBlock):
+ origCode = code.orig_code
+ codeBlock = code
+ else:
+ origCode = code
+ codeBlock = CodeBlock(code)
+ compositeCode = '\n'.join([origCode] +
+ [pair[1] for pair in extras])
+ compositeBlock = CodeBlock(compositeCode)
+ for code_attr in compositeBlock.__dict__.keys():
+ setattr(self, code_attr, getattr(compositeBlock, code_attr))
+ for (key, snippet) in extras:
+ setattr(self, key, CodeBlock(snippet).code)
+ self.code = codeBlock.code
+ self.orig_code = origCode
else:
self.constructor = ''
self.flags = []