changeset f0a07f1e8ee2 in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=f0a07f1e8ee2
description:
        arch: Include generated decoder header after normal headers

        The generated decoder header defines macros that represent bit fields
        within instructions. These fields typically have short names that
        conflict with names in other header files. Include the generated
        header after all normal header to avoid this issue.

        Change-Id: I53d149b75432c20abdbf651e32c3c785d897973b
        Signed-off-by: Andreas Sandberg <[email protected]>
        Reviewed-by: Curtis Dunham <[email protected]>
        Reviewed-by: Jason Lowe-Power <[email protected]>

diffstat:

 src/arch/generic/memhelpers.hh |   2 ++
 src/arch/isa_parser.py         |  16 ++++++++++++----
 2 files changed, 14 insertions(+), 4 deletions(-)

diffs (72 lines):

diff -r 8c369af31b6c -r f0a07f1e8ee2 src/arch/generic/memhelpers.hh
--- a/src/arch/generic/memhelpers.hh    Mon Feb 27 11:25:01 2017 +0000
+++ b/src/arch/generic/memhelpers.hh    Mon Feb 27 12:06:00 2017 +0000
@@ -43,7 +43,9 @@
 #ifndef __ARCH_GENERIC_MEMHELPERS_HH__
 #define __ARCH_GENERIC_MEMHELPERS_HH__
 
+#include "arch/isa_traits.hh"
 #include "base/types.hh"
+#include "mem/packet.hh"
 #include "mem/request.hh"
 #include "sim/byteswap.hh"
 #include "sim/insttracer.hh"
diff -r 8c369af31b6c -r f0a07f1e8ee2 src/arch/isa_parser.py
--- a/src/arch/isa_parser.py    Mon Feb 27 11:25:01 2017 +0000
+++ b/src/arch/isa_parser.py    Mon Feb 27 12:06:00 2017 +0000
@@ -1318,8 +1318,6 @@
             print >>f, '#if !defined(__SPLIT) || (__SPLIT == 1)'
             self.splits[f] = 1
         # ensure requisite #include's
-        elif filename in ['decoder-g.cc.inc', 'exec-g.cc.inc']:
-            print >>f, '#include "decoder.hh"'
         elif filename == 'decoder-g.hh.inc':
             print >>f, '#include "base/bitfield.hh"'
 
@@ -1360,12 +1358,15 @@
             f.write('#include "%s"\n' % fn)
             inc.append(fn)
 
+            fn = 'decoder.hh'
+            f.write('#include "%s"\n' % fn)
+            inc.append(fn)
+
             fn = 'decode-method.cc.inc'
             # is guaranteed to have been written for parse to complete
             f.write('#include "%s"\n' % fn)
             inc.append(fn)
 
-            inc.append("decoder.hh")
             print >>dep, file+':', ' '.join(inc)
 
         extn = re.compile('(\.[^\.]+)$')
@@ -1386,6 +1387,10 @@
                 f.write('#include "%s"\n' % fn)
                 inc.append(fn)
 
+                fn = 'decoder.hh'
+                f.write('#include "%s"\n' % fn)
+                inc.append(fn)
+
                 fn = 'decoder-ns.cc.inc'
                 assert(fn in self.files)
                 print >>f, 'namespace %s {' % self.namespace
@@ -1395,7 +1400,6 @@
                 print >>f, '}'
                 inc.append(fn)
 
-                inc.append("decoder.hh")
                 print >>dep, file+':', ' '.join(inc)
 
         # instruction execution per-CPU model
@@ -1416,6 +1420,10 @@
 
                     f.write(cpu.includes+"\n")
 
+                    fn = 'decoder.hh'
+                    f.write('#include "%s"\n' % fn)
+                    inc.append(fn)
+
                     fn = 'exec-ns.cc.inc'
                     assert(fn in self.files)
                     print >>f, 'namespace %s {' % self.namespace
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to