changeset 43516d8eabe9 in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=43516d8eabe9
description:
        arch: Properly guess OpClass from optional StaticInst flags

        isa_parser.py guesses the OpClass if none were given based upon the 
StaticInst
        flags.  The existing code does not take into account optionally set 
flags.
        This code hoists the setting of optional flags so OpClass is properly 
assigned.

diffstat:

 src/arch/isa_parser.py |  36 +++++++++++++++++++++++++-----------
 1 files changed, 25 insertions(+), 11 deletions(-)

diffs (57 lines):

diff -r 7aacec2a247d -r 43516d8eabe9 src/arch/isa_parser.py
--- a/src/arch/isa_parser.py    Wed Sep 03 07:42:31 2014 -0400
+++ b/src/arch/isa_parser.py    Wed Sep 03 07:42:32 2014 -0400
@@ -1,3 +1,15 @@
+# Copyright (c) 2014 ARM Limited
+# All rights reserved
+#
+# The license below extends only to copyright in the software and shall
+# not be construed as granting a license to any other intellectual
+# property including but not limited to intellectual property relating
+# to a hardware implementation of the functionality of the software
+# licensed hereunder.  You may use the software subject to the license
+# terms below provided that you ensure that this notice is replicated
+# unmodified and in its entirety in all distributions of the software,
+# modified or unmodified, in source code or in binary form.
+#
 # Copyright (c) 2003-2005 The Regents of The University of Michigan
 # Copyright (c) 2013 Advanced Micro Devices, Inc.
 # All rights reserved.
@@ -1119,17 +1131,7 @@
 
         self.flags = self.operands.concatAttrLists('flags')
 
-        # Make a basic guess on the operand class (function unit type).
-        # These are good enough for most cases, and can be overridden
-        # later otherwise.
-        if 'IsStore' in self.flags:
-            self.op_class = 'MemWriteOp'
-        elif 'IsLoad' in self.flags or 'IsPrefetch' in self.flags:
-            self.op_class = 'MemReadOp'
-        elif 'IsFloating' in self.flags:
-            self.op_class = 'FloatAddOp'
-        else:
-            self.op_class = 'IntAluOp'
+        self.op_class = None
 
         # Optional arguments are assumed to be either StaticInst flags
         # or an OpClass value.  To avoid having to import a complete
@@ -1144,6 +1146,18 @@
                 error('InstObjParams: optional arg "%s" not recognized '
                       'as StaticInst::Flag or OpClass.' % oa)
 
+        # Make a basic guess on the operand class if not set.
+        # These are good enough for most cases.
+        if not self.op_class:
+            if 'IsStore' in self.flags:
+                self.op_class = 'MemWriteOp'
+            elif 'IsLoad' in self.flags or 'IsPrefetch' in self.flags:
+                self.op_class = 'MemReadOp'
+            elif 'IsFloating' in self.flags:
+                self.op_class = 'FloatAddOp'
+            else:
+                self.op_class = 'IntAluOp'
+
         # add flag initialization to contructor here to include
         # any flags added via opt_args
         self.constructor += makeFlagConstructor(self.flags)
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to