configs: Fix baremetal platform
[gem5.git] / configs / common / cpu2000.py
index a8cc0ce5f0b4b35aa98012f1d4d5ae8bc904ae9b..730a478783d6df722953b6002742f655ce952db5 100644 (file)
@@ -26,6 +26,9 @@
 #
 # Authors: Nathan Binkert
 
+from __future__ import print_function
+from __future__ import absolute_import
+
 import os
 import sys
 from os.path import basename, exists, join as joinpath, normpath
@@ -91,13 +94,13 @@ class Benchmark(object):
         try:
             func = getattr(self.__class__, input_set)
         except AttributeError:
-            raise AttributeError, \
-                  'The benchmark %s does not have the %s input set' % \
-                  (self.name, input_set)
+            raise AttributeError(
+                'The benchmark %s does not have the %s input set' % \
+                (self.name, input_set))
 
         executable = joinpath(spec_dist, 'binaries', isa, os, self.binary)
         if not isfile(executable):
-            raise AttributeError, '%s not found' % executable
+            raise AttributeError('%s not found' % executable)
         self.executable = executable
 
         # root of tree for input & output data files
@@ -111,7 +114,7 @@ class Benchmark(object):
         self.input_set = input_set
 
         if not isdir(inputs_dir):
-            raise AttributeError, '%s not found' % inputs_dir
+            raise AttributeError('%s not found' % inputs_dir)
 
         self.inputs_dir = [ inputs_dir ]
         if isdir(all_dir):
@@ -131,8 +134,8 @@ class Benchmark(object):
 
         func(self, isa, os)
 
-    def makeLiveProcessArgs(self, **kwargs):
-        # set up default args for LiveProcess object
+    def makeProcessArgs(self, **kwargs):
+        # set up default args for Process object
         process_args = {}
         process_args['cmd'] = [ self.name ] + self.args
         process_args['executable'] = self.executable
@@ -147,11 +150,11 @@ class Benchmark(object):
 
         return process_args
 
-    def makeLiveProcess(self, **kwargs):
-        process_args = self.makeLiveProcessArgs(**kwargs)
+    def makeProcess(self, **kwargs):
+        process_args = self.makeProcessArgs(**kwargs)
 
         # figure out working directory: use m5's outdir unless
-        # overridden by LiveProcess's cwd param
+        # overridden by Process's cwd param
         cwd = process_args.get('cwd')
 
         if not cwd:
@@ -163,9 +166,9 @@ class Benchmark(object):
         # copy input files to working directory
         for d in self.inputs_dir:
             copyfiles(d, cwd)
-        # generate LiveProcess object
-        from m5.objects import LiveProcess
-        return LiveProcess(**process_args)
+        # generate Process object
+        from m5.objects import Process
+        return Process(**process_args)
 
     def __str__(self):
         return self.name
@@ -663,12 +666,12 @@ class vortex(Benchmark):
     stdin = None
 
     def __init__(self, isa, os, input_set):
-        if (isa == 'alpha' or isa == 'arm'):
+        if (isa in ('alpha', 'arm', 'thumb', 'aarch64')):
             self.endian = 'lendian'
         elif (isa == 'sparc' or isa == 'sparc32'):
             self.endian = 'bendian'
         else:
-            raise AttributeError, "unknown ISA %s" % isa
+            raise AttributeError("unknown ISA %s" % isa)
 
         super(vortex, self).__init__(isa, os, input_set)
 
@@ -731,7 +734,7 @@ class vpr_route(vpr):
              '-first_iter_pres_fac', '4', '-initial_pres_fac', '8' ]
     output = 'route_log.out'
 
-all = [ ammp, applu, apsi, art110, art470, equake, facerec, fma3d, galgel,
+all = [ ammp, applu, apsi, art, art110, art470, equake, facerec, fma3d, galgel,
         lucas, mesa, mgrid, sixtrack, swim, wupwise, bzip2_source,
         bzip2_graphic, bzip2_program, crafty, eon_kajiya, eon_cook,
         eon_rushmeier, gap, gcc_166, gcc_200, gcc_expr, gcc_integrate,
@@ -747,8 +750,8 @@ if __name__ == '__main__':
     from pprint import pprint
     for bench in all:
         for input_set in 'ref', 'test', 'train':
-            print 'class: %s' % bench.__name__
+            print('class: %s' % bench.__name__)
             x = bench('alpha', 'tru64', input_set)
-            print '%s: %s' % (x, input_set)
-            pprint(x.makeLiveProcessArgs())
-            print
+            print('%s: %s' % (x, input_set))
+            pprint(x.makeProcessArgs())
+            print()