-# Copyright (c) 2006-2007 The Regents of The University of Michigan
+# Copyright (c) 2006-2008 The Regents of The University of Michigan
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
#
# 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
from os.path import isdir, isfile, islink
-spec_dist = '/dist/m5/cpu2000'
+spec_dist = os.environ.get('M5_CPU2000', '/dist/m5/cpu2000')
def copyfiles(srcdir, dstdir):
from filecmp import cmp as filecmp
if not hasattr(self.__class__, 'output'):
self.output = '%s.out' % self.name
+ if not hasattr(self.__class__, 'simpoint'):
+ self.simpoint = None
+
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
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):
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 + ' ' + ' '.join(self.args)
+ process_args['cmd'] = [ self.name ] + self.args
process_args['executable'] = self.executable
if self.stdin:
process_args['input'] = self.stdin
if self.stdout:
process_args['output'] = self.stdout
-
+ if self.simpoint:
+ process_args['simpoint'] = self.simpoint
# explicit keywords override defaults
process_args.update(kwargs)
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:
- from m5.main import options
+ from m5 import options
cwd = options.outdir
process_args['cwd'] = cwd
if not isdir(cwd):
# 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
name = 'ammp'
number = 188
lang = 'C'
+ simpoint = 108*100E6
class applu(MinneDefaultBenchmark):
name = 'applu'
number = 173
lang = 'F77'
+ simpoint = 2179*100E6
class apsi(MinneDefaultBenchmark):
name = 'apsi'
number = 301
lang = 'F77'
+ simpoint = 3408*100E6
class art(DefaultBenchmark):
name = 'art'
'-endy', '240',
'-objects', '10' ]
self.output = 'ref.1.out'
+ self.simpoint = 340*100E6
class art470(art):
def ref(self, isa, os):
'-endy', '180',
'-objects', '10' ]
self.output = 'ref.2.out'
+ self.simpoint = 365*100E6
class equake(DefaultBenchmark):
name = 'equake'
number = 183
lang = 'C'
+ simpoint = 812*100E6
def lgred(self, isa, os): pass
name = 'facerec'
number = 187
lang = 'F'
+ simpoint = 375*100E6
class fma3d(MinneDefaultBenchmark):
name = 'fma3d'
number = 191
lang = 'F'
+ simpoint = 2541*100E6
class galgel(MinneDefaultBenchmark):
name = 'galgel'
number = 178
lang = 'F'
+ simpoint = 2491*100E6
class lucas(MinneDefaultBenchmark):
name = 'lucas'
number = 189
lang = 'F'
+ simpoint = 545*100E6
class mesa(Benchmark):
name = 'mesa'
def ref(self, isa, os):
self.__set_args('1000')
+ self.simpoint = 1135*100E6
def lgred(self, isa, os):
self.__set_args('1')
name = 'mgrid'
number = 172
lang = 'F77'
+ simpoint = 3292*100E6
class sixtrack(DefaultBenchmark):
name = 'sixtrack'
number = 200
lang = 'F77'
+ simpoint = 3043*100E6
def lgred(self, isa, os): pass
name = 'swim'
number = 171
lang = 'F77'
+ simpoint = 2079*100E6
class wupwise(DefaultBenchmark):
name = 'wupwise'
number = 168
lang = 'F77'
+ simpoint = 3237*100E6
def lgred(self, isa, os): pass
class bzip2_source(bzip2):
def ref(self, isa, os):
+ self.simpoint = 977*100E6
self.args = [ 'input.source', '58' ]
def lgred(self, isa, os):
class bzip2_graphic(bzip2):
def ref(self, isa, os):
+ self.simpoint = 718*100E6
self.args = [ 'input.graphic', '58' ]
def lgred(self, isa, os):
class bzip2_program(bzip2):
def ref(self, isa, os):
+ self.simpoint = 458*100E6
self.args = [ 'input.program', '58' ]
def lgred(self, isa, os):
name = 'crafty'
number = 186
lang = 'C'
+ simpoint = 774*100E6
class eon(MinneDefaultBenchmark):
name = 'eon'
args = [ 'chair.control.rushmeier', 'chair.camera', 'chair.surfaces',
'chair.rushmeier.ppm', 'ppm', 'pixels_out.rushmeier' ]
output = 'rushmeier_log.out'
+ simpoint = 403*100E6
class gap(DefaultBenchmark):
name = 'gap'
def ref(self, isa, os):
self.__set_args('192M')
+ self.simpoint = 674*100E6
def lgred(self, isa, os):
self.__set_args('64M')
class gcc_166(gcc):
def ref(self, isa, os):
+ self.simpoint = 389*100E6
self.args = [ '166.i', '-o', '166.s' ]
class gcc_200(gcc):
def ref(self, isa, os):
+ self.simpoint = 736*100E6
self.args = [ '200.i', '-o', '200.s' ]
class gcc_expr(gcc):
def ref(self, isa, os):
+ self.simpoint = 36*100E6
self.args = [ 'expr.i', '-o', 'expr.s' ]
class gcc_integrate(gcc):
def ref(self, isa, os):
+ self.simpoint = 4*100E6
self.args = [ 'integrate.i', '-o', 'integrate.s' ]
class gcc_scilab(gcc):
def ref(self, isa, os):
+ self.simpoint = 207*100E6
self.args = [ 'scilab.i', '-o', 'scilab.s' ]
class gzip(DefaultBenchmark):
class gzip_source(gzip):
def ref(self, isa, os):
+ self.simpoint = 334*100E6
self.args = [ 'input.source', '1' ]
def smred(self, isa, os):
self.args = [ 'input.source', '1' ]
class gzip_log(gzip):
def ref(self, isa, os):
+ self.simpoint = 265*100E6
self.args = [ 'input.log', '60' ]
def smred(self, isa, os):
self.args = [ 'input.log', '1' ]
class gzip_graphic(gzip):
def ref(self, isa, os):
+ self.simpoint = 653*100E6
self.args = [ 'input.graphic', '60' ]
def smred(self, isa, os):
self.args = [ 'input.graphic', '1' ]
class gzip_random(gzip):
def ref(self, isa, os):
+ self.simpoint = 623*100E6
self.args = [ 'input.random', '60' ]
def smred(self, isa, os):
self.args = [ 'input.random', '1' ]
class gzip_program(gzip):
def ref(self, isa, os):
+ self.simpoint = 1189*100E6
self.args = [ 'input.program', '60' ]
def smred(self, isa, os):
self.args = [ 'input.program', '1' ]
number = 181
lang = 'C'
args = [ 'mcf.in' ]
+ simpoint = 553*100E6
class parser(MinneDefaultBenchmark):
name = 'parser'
number = 197
lang = 'C'
args = [ '2.1.dict', '-batch' ]
+ simpoint = 1146*100E6
class perlbmk(DefaultBenchmark):
name = 'perlbmk'
class perlbmk_diffmail(perlbmk):
def ref(self, isa, os):
+ self.simpoint = 141*100E6
self.args = [ '-I', 'lib', 'diffmail.pl', '2', '550', '15', '24',
'23', '100' ]
class perlbmk_makerand(perlbmk):
def ref(self, isa, os):
+ self.simpoint = 11*100E6
self.args = [ '-I', 'lib', 'makerand.pl' ]
def lgred(self, isa, os):
class perlbmk_perfect(perlbmk):
def ref(self, isa, os):
+ self.simpoint = 5*100E6
self.args = [ '-I', 'lib', 'perfect.pl', 'b', '3', 'm', '4' ]
def train(self, isa, os):
class perlbmk_splitmail1(perlbmk):
def ref(self, isa, os):
+ self.simpoint = 405*100E6
self.args = [ '-I', 'lib', 'splitmail.pl', '850', '5', '19',
'18', '1500' ]
self.args = [ 'train' ]
def ref(self, isa, os):
+ self.simpoint = 1066*100E6
self.args = [ 'ref' ]
def smred(self, isa, os):
stdin = None
def __init__(self, isa, os, input_set):
- if isa == 'alpha':
+ 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)
def ref(self, isa, os):
self.args = [ '%s1.raw' % self.endian ]
self.output = 'vortex1.out'
+ self.simpoint = 271*100E6
class vortex2(vortex):
def ref(self, isa, os):
+ self.simpoint = 1024*100E6
self.args = [ '%s2.raw' % self.endian ]
self.output = 'vortex2.out'
class vortex3(vortex):
def ref(self, isa, os):
+ self.simpoint = 564*100E6
self.args = [ '%s3.raw' % self.endian ]
self.output = 'vortex3.out'
output = 'place_log.out'
class vpr_route(vpr):
+ simpoint = 476*100E6
args = [ 'net.in', 'arch.in', 'place.in', 'route.out', '-nodisp',
'-route_only', '-route_chan_width', '15',
'-pres_fac_mult', '2', '-acc_fac', '1',
'-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,
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()