cpu2000.py revision 5361
1695SN/A# Copyright (c) 2006-2008 The Regents of The University of Michigan
29262Ssascha.bischoff@arm.com# All rights reserved.
39262Ssascha.bischoff@arm.com#
49262Ssascha.bischoff@arm.com# Redistribution and use in source and binary forms, with or without
59262Ssascha.bischoff@arm.com# modification, are permitted provided that the following conditions are
69262Ssascha.bischoff@arm.com# met: redistributions of source code must retain the above copyright
79262Ssascha.bischoff@arm.com# notice, this list of conditions and the following disclaimer;
89262Ssascha.bischoff@arm.com# redistributions in binary form must reproduce the above copyright
99262Ssascha.bischoff@arm.com# notice, this list of conditions and the following disclaimer in the
109262Ssascha.bischoff@arm.com# documentation and/or other materials provided with the distribution;
119262Ssascha.bischoff@arm.com# neither the name of the copyright holders nor the names of its
129262Ssascha.bischoff@arm.com# contributors may be used to endorse or promote products derived from
139262Ssascha.bischoff@arm.com# this software without specific prior written permission.
141762SN/A#
15695SN/A# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16695SN/A# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17695SN/A# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
18695SN/A# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
19695SN/A# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
20695SN/A# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
21695SN/A# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22695SN/A# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23695SN/A# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24695SN/A# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25695SN/A# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26695SN/A#
27695SN/A# Authors: Nathan Binkert
28695SN/A
29695SN/Aimport os
30695SN/Aimport sys
31695SN/Afrom os.path import basename, exists, join as joinpath, normpath
32695SN/Afrom os.path import isdir, isfile, islink
33695SN/A
34695SN/Aspec_dist = '/dist/m5/cpu2000'
35695SN/A
36695SN/Adef copyfiles(srcdir, dstdir):
37695SN/A    from filecmp import cmp as filecmp
38695SN/A    from shutil import copyfile
392665Ssaidi@eecs.umich.edu
402665Ssaidi@eecs.umich.edu    srcdir = normpath(srcdir)
419262Ssascha.bischoff@arm.com    dstdir = normpath(dstdir)
42695SN/A
43695SN/A    if not isdir(dstdir):
44695SN/A        os.mkdir(dstdir)
45695SN/A
46695SN/A    for root, dirs, files in os.walk(srcdir):
47695SN/A        root = normpath(root)
48695SN/A        prefix = os.path.commonprefix([root, srcdir])
49695SN/A
50695SN/A        root = root[len(prefix):]
51695SN/A        if root.startswith('/'):
52695SN/A            root = root[1:]
53695SN/A
54695SN/A        for entry in dirs:
557768SAli.Saidi@ARM.com            newdir = joinpath(dstdir, root, entry)
567768SAli.Saidi@ARM.com            if not isdir(newdir):
577768SAli.Saidi@ARM.com                os.mkdir(newdir)
587768SAli.Saidi@ARM.com
591717SN/A        for entry in files:
607768SAli.Saidi@ARM.com            dest = normpath(joinpath(dstdir, root, entry))
617768SAli.Saidi@ARM.com            src = normpath(joinpath(srcdir, root, entry))
62695SN/A            if not isfile(dest) or not filecmp(src, dest):
637822Ssteve.reinhardt@amd.com                copyfile(src, dest)
64695SN/A
65695SN/A    # some of the spec benchmarks expect to be run from one directory up.
66695SN/A    # just create some symlinks that solve the problem
67729SN/A    inlink = joinpath(dstdir, 'input')
687068Snate@binkert.org    outlink = joinpath(dstdir, 'output')
698720SAli.Saidi@ARM.com    if not exists(inlink):
707068Snate@binkert.org        os.symlink('.', inlink)
71695SN/A    if not exists(outlink):
72729SN/A        os.symlink('.', outlink)
73695SN/A
74695SN/Aclass Benchmark(object):
75695SN/A    def __init__(self, isa, os, input_set):
76695SN/A        if not hasattr(self.__class__, 'name'):
779262Ssascha.bischoff@arm.com            self.name = self.__class__.__name__
789262Ssascha.bischoff@arm.com
794078Sbinkertn@umich.edu        if not hasattr(self.__class__, 'binary'):
80695SN/A            self.binary = self.name
81695SN/A
82695SN/A        if not hasattr(self.__class__, 'args'):
837840Snate@binkert.org            self.args = []
847823Ssteve.reinhardt@amd.com
85695SN/A        if not hasattr(self.__class__, 'output'):
86695SN/A            self.output = '%s.out' % self.name
87695SN/A
88695SN/A        if not hasattr(self.__class__, 'simpoint'):
89695SN/A            self.simpoint = None
90695SN/A
917840Snate@binkert.org        try:
927840Snate@binkert.org            func = getattr(self.__class__, input_set)
937840Snate@binkert.org        except AttributeError:
94695SN/A            raise AttributeError, \
957840Snate@binkert.org                  'The benchmark %s does not have the %s input set' % \
96695SN/A                  (self.name, input_set)
97695SN/A
981020SN/A        executable = joinpath(spec_dist, 'binaries', isa, os, self.binary)
991020SN/A        if not isfile(executable):
1001020SN/A            raise AttributeError, '%s not found' % executable
1017823Ssteve.reinhardt@amd.com        self.executable = executable
1021020SN/A
1031020SN/A        # root of tree for input & output data files
1048720SAli.Saidi@ARM.com        data_dir = joinpath(spec_dist, 'data', self.name)
1058720SAli.Saidi@ARM.com        # optional subtree with files shared across input sets
1068720SAli.Saidi@ARM.com        all_dir = joinpath(data_dir, 'all')
1078720SAli.Saidi@ARM.com        # dirs for input & output files for this input set
1088720SAli.Saidi@ARM.com        inputs_dir = joinpath(data_dir, input_set, 'input')
1098720SAli.Saidi@ARM.com        outputs_dir = joinpath(data_dir, input_set, 'output')
110695SN/A        # keep around which input set was specified
111695SN/A        self.input_set = input_set
1125883Snate@binkert.org
1135883Snate@binkert.org        if not isdir(inputs_dir):
1145883Snate@binkert.org            raise AttributeError, '%s not found' % inputs_dir
1158834Satgutier@umich.edu
1165883Snate@binkert.org        self.inputs_dir = [ inputs_dir ]
1175883Snate@binkert.org        if isdir(all_dir):
1185883Snate@binkert.org            self.inputs_dir += [ joinpath(all_dir, 'input') ]
1195883Snate@binkert.org        if isdir(outputs_dir):
1205883Snate@binkert.org            self.outputs_dir = outputs_dir
1218834Satgutier@umich.edu
1225883Snate@binkert.org        if not hasattr(self.__class__, 'stdin'):
1235883Snate@binkert.org            self.stdin = joinpath(inputs_dir, '%s.in' % self.name)
1245883Snate@binkert.org            if not isfile(self.stdin):
1255883Snate@binkert.org                self.stdin = None
1265883Snate@binkert.org
127695SN/A        if not hasattr(self.__class__, 'stdout'):
128695SN/A            self.stdout = joinpath(outputs_dir, '%s.out' % self.name)
1298834Satgutier@umich.edu            if not isfile(self.stdout):
130695SN/A                self.stdout = None
131695SN/A
132695SN/A        func(self, isa, os)
133695SN/A
134695SN/A    def makeLiveProcessArgs(self, **kwargs):
135695SN/A        # set up default args for LiveProcess object
1368834Satgutier@umich.edu        process_args = {}
1378834Satgutier@umich.edu        process_args['cmd'] = [ self.name ] + self.args
1388834Satgutier@umich.edu        process_args['executable'] = self.executable
1398834Satgutier@umich.edu        if self.stdin:
1408834Satgutier@umich.edu            process_args['input'] = self.stdin
1418834Satgutier@umich.edu        if self.stdout:
1428834Satgutier@umich.edu            process_args['output'] = self.stdout
1438834Satgutier@umich.edu        process_args['simpoint'] = self.simpoint
144695SN/A        # explicit keywords override defaults
145695SN/A        process_args.update(kwargs)
146695SN/A
147695SN/A        return process_args
148695SN/A
149707SN/A    def makeLiveProcess(self, **kwargs):
1507064Snate@binkert.org        process_args = self.makeLiveProcessArgs(**kwargs)
151707SN/A
152707SN/A        # figure out working directory: use m5's outdir unless
153707SN/A        # overridden by LiveProcess's cwd param
154707SN/A        cwd = process_args.get('cwd')
155695SN/A
1561020SN/A        if not cwd:
157695SN/A            from m5.main import options
158695SN/A            cwd = options.outdir
159695SN/A            process_args['cwd'] = cwd
160695SN/A        if not isdir(cwd):
1618720SAli.Saidi@ARM.com            os.makedirs(cwd)
1628720SAli.Saidi@ARM.com        # copy input files to working directory
1638720SAli.Saidi@ARM.com        for d in self.inputs_dir:
1648720SAli.Saidi@ARM.com            copyfiles(d, cwd)
1658720SAli.Saidi@ARM.com        # generate LiveProcess object
1668720SAli.Saidi@ARM.com        from m5.objects import LiveProcess
1678720SAli.Saidi@ARM.com        return LiveProcess(**process_args)
168695SN/A
169695SN/A    def __str__(self):
170695SN/A        return self.name
171695SN/A
172695SN/Aclass DefaultBenchmark(Benchmark):
173695SN/A    def ref(self, isa, os): pass
174695SN/A    def test(self, isa, os): pass
1758834Satgutier@umich.edu    def train(self, isa, os): pass
1768834Satgutier@umich.edu
1778834Satgutier@umich.educlass MinneDefaultBenchmark(DefaultBenchmark):
1788834Satgutier@umich.edu    def smred(self, isa, os): pass
1798834Satgutier@umich.edu    def mdred(self, isa, os): pass
1808834Satgutier@umich.edu    def lgred(self, isa, os): pass
1818834Satgutier@umich.edu
182695SN/Aclass ammp(MinneDefaultBenchmark):
183707SN/A    name = 'ammp'
184695SN/A    number = 188
185695SN/A    lang = 'C'
186695SN/A    simpoint = 108*100E6
187695SN/A
188695SN/Aclass applu(MinneDefaultBenchmark):
189695SN/A    name = 'applu'
190707SN/A    number = 173
191695SN/A    lang = 'F77'
192695SN/A    simpoint = 2179*100E6
193695SN/A
194695SN/Aclass apsi(MinneDefaultBenchmark):
195695SN/A    name = 'apsi'
196695SN/A    number = 301
197695SN/A    lang = 'F77'
198695SN/A    simpoint = 3408*100E6
199695SN/A
200695SN/Aclass art(DefaultBenchmark):
201695SN/A    name = 'art'
202707SN/A    number = 179
203695SN/A    lang = 'C'
2048834Satgutier@umich.edu
205695SN/A    def test(self, isa, os):
206695SN/A        self.args = [ '-scanfile', 'c756hel.in',
207695SN/A                      '-trainfile1', 'a10.img',
208695SN/A                      '-stride', '2',
209695SN/A                      '-startx', '134',
2105883Snate@binkert.org                      '-starty', '220',
2115883Snate@binkert.org                      '-endx', '139',
2125883Snate@binkert.org                      '-endy', '225',
2135883Snate@binkert.org                      '-objects', '1' ]
2145883Snate@binkert.org        self.output = 'test.out'
2155883Snate@binkert.org
2169262Ssascha.bischoff@arm.com    def train(self, isa, os):
2179262Ssascha.bischoff@arm.com        self.args = [ '-scanfile', 'c756hel.in',
2189262Ssascha.bischoff@arm.com                      '-trainfile1', 'a10.img',
2197822Ssteve.reinhardt@amd.com                      '-stride', '2',
220695SN/A                      '-startx', '134',
2214078Sbinkertn@umich.edu                      '-starty', '220',
2224078Sbinkertn@umich.edu                      '-endx', '184',
2234078Sbinkertn@umich.edu                      '-endy', '240',
224695SN/A                      '-objects', '3' ]
225695SN/A        self.output = 'train.out'
226695SN/A
2277822Ssteve.reinhardt@amd.com    def lgred(self, isa, os):
2288581Ssteve.reinhardt@amd.com        self.args = ['-scanfile', 'c756hel.in',
2298581Ssteve.reinhardt@amd.com                     '-trainfile1', 'a10.img',
2304078Sbinkertn@umich.edu                     '-stride', '5',
2314078Sbinkertn@umich.edu                     '-startx', '134',
2324078Sbinkertn@umich.edu                     '-starty', '220',
2334078Sbinkertn@umich.edu                     '-endx', '184',
2344078Sbinkertn@umich.edu                     '-endy', '240',
2354078Sbinkertn@umich.edu                     '-objects', '1' ]
2364078Sbinkertn@umich.edu        self.output = 'lgred.out'
2374078Sbinkertn@umich.edu
2384078Sbinkertn@umich.edu
2394078Sbinkertn@umich.educlass art110(art):
2404078Sbinkertn@umich.edu    def ref(self, isa, os):
2414078Sbinkertn@umich.edu        self.args = [ '-scanfile', 'c756hel.in',
2425606Snate@binkert.org                      '-trainfile1', 'a10.img',
2437823Ssteve.reinhardt@amd.com                      '-trainfile2', 'hc.img',
2445606Snate@binkert.org                      '-stride', '2',
2454078Sbinkertn@umich.edu                      '-startx', '110',
246695SN/A                      '-starty', '200',
247695SN/A                      '-endx', '160',
2484078Sbinkertn@umich.edu                      '-endy', '240',
2497822Ssteve.reinhardt@amd.com                      '-objects', '10' ]
250695SN/A        self.output = 'ref.1.out'
2519262Ssascha.bischoff@arm.com        self.simpoint = 340*100E6
2529262Ssascha.bischoff@arm.com
2539262Ssascha.bischoff@arm.comclass art470(art):
2549262Ssascha.bischoff@arm.com    def ref(self, isa, os):
2559262Ssascha.bischoff@arm.com        self.args = [ '-scanfile', 'c756hel.in',
2569262Ssascha.bischoff@arm.com                      '-trainfile1', 'a10.img',
2579262Ssascha.bischoff@arm.com                      '-trainfile2', 'hc.img',
2589262Ssascha.bischoff@arm.com                      '-stride', '2',
2599262Ssascha.bischoff@arm.com                      '-startx', '470',
2609262Ssascha.bischoff@arm.com                      '-starty', '140',
2619262Ssascha.bischoff@arm.com                      '-endx', '520',
2629262Ssascha.bischoff@arm.com                      '-endy', '180',
2639262Ssascha.bischoff@arm.com                      '-objects', '10' ]
2649262Ssascha.bischoff@arm.com        self.output = 'ref.2.out'
2659262Ssascha.bischoff@arm.com        self.simpoint = 365*100E6
2669262Ssascha.bischoff@arm.com
2679262Ssascha.bischoff@arm.comclass equake(DefaultBenchmark):
2689262Ssascha.bischoff@arm.com    name = 'equake'
2699262Ssascha.bischoff@arm.com    number = 183
2709262Ssascha.bischoff@arm.com    lang = 'C'
2719262Ssascha.bischoff@arm.com    simpoint = 812*100E6
2729262Ssascha.bischoff@arm.com
2739262Ssascha.bischoff@arm.com    def lgred(self, isa, os): pass
2749262Ssascha.bischoff@arm.com
2759262Ssascha.bischoff@arm.comclass facerec(MinneDefaultBenchmark):
2769262Ssascha.bischoff@arm.com    name = 'facerec'
2779262Ssascha.bischoff@arm.com    number = 187
2789262Ssascha.bischoff@arm.com    lang = 'F'
2799262Ssascha.bischoff@arm.com    simpoint = 375*100E6
2809262Ssascha.bischoff@arm.com
2819262Ssascha.bischoff@arm.comclass fma3d(MinneDefaultBenchmark):
2829262Ssascha.bischoff@arm.com    name = 'fma3d'
2839262Ssascha.bischoff@arm.com    number = 191
2849262Ssascha.bischoff@arm.com    lang = 'F'
2859262Ssascha.bischoff@arm.com    simpoint = 2541*100E6
2869262Ssascha.bischoff@arm.com
2879262Ssascha.bischoff@arm.comclass galgel(MinneDefaultBenchmark):
2889262Ssascha.bischoff@arm.com    name = 'galgel'
2899262Ssascha.bischoff@arm.com    number = 178
2909262Ssascha.bischoff@arm.com    lang = 'F'
2919262Ssascha.bischoff@arm.com    simpoint = 2491*100E6
2929262Ssascha.bischoff@arm.com
2939262Ssascha.bischoff@arm.comclass lucas(MinneDefaultBenchmark):
2949262Ssascha.bischoff@arm.com    name = 'lucas'
2959262Ssascha.bischoff@arm.com    number = 189
2969262Ssascha.bischoff@arm.com    lang = 'F'
2979262Ssascha.bischoff@arm.com    simpoint = 545*100E6
2989262Ssascha.bischoff@arm.com
299695SN/Aclass mesa(Benchmark):
300695SN/A    name = 'mesa'
3017811Ssteve.reinhardt@amd.com    number = 177
302    lang = 'C'
303    stdin = None
304
305    def __set_args(self, frames):
306        self.args = [ '-frames', frames, '-meshfile', '%s.in' % self.name,
307                      '-ppmfile', '%s.ppm' % self.name ]
308
309    def test(self, isa, os):
310        self.__set_args('10')
311
312    def train(self, isa, os):
313        self.__set_args('500')
314
315    def ref(self, isa, os):
316        self.__set_args('1000')
317        self.simpoint = 1135*100E6
318
319    def lgred(self, isa, os):
320        self.__set_args('1')
321
322class mgrid(MinneDefaultBenchmark):
323    name = 'mgrid'
324    number = 172
325    lang = 'F77'
326    simpoint = 3292*100E6
327
328class sixtrack(DefaultBenchmark):
329    name = 'sixtrack'
330    number = 200
331    lang = 'F77'
332    simpoint = 3043*100E6
333
334    def lgred(self, isa, os): pass
335
336class swim(MinneDefaultBenchmark):
337    name = 'swim'
338    number = 171
339    lang = 'F77'
340    simpoint = 2079*100E6
341
342class wupwise(DefaultBenchmark):
343    name = 'wupwise'
344    number = 168
345    lang = 'F77'
346    simpoint = 3237*100E6
347
348    def lgred(self, isa, os): pass
349
350class bzip2(DefaultBenchmark):
351    name = 'bzip2'
352    number = 256
353    lang = 'C'
354
355    def test(self, isa, os):
356        self.args = [ 'input.random' ]
357
358    def train(self, isa, os):
359        self.args = [ 'input.compressed' ]
360
361class bzip2_source(bzip2):
362    def ref(self, isa, os):
363        self.simpoint = 977*100E6
364        self.args = [ 'input.source', '58' ]
365
366    def lgred(self, isa, os):
367        self.args = [ 'input.source', '1' ]
368
369class bzip2_graphic(bzip2):
370    def ref(self, isa, os):
371        self.simpoint = 718*100E6
372        self.args = [ 'input.graphic', '58' ]
373
374    def lgred(self, isa, os):
375        self.args = [ 'input.graphic', '1' ]
376
377class bzip2_program(bzip2):
378    def ref(self, isa, os):
379        self.simpoint = 458*100E6
380        self.args = [ 'input.program', '58' ]
381
382    def lgred(self, isa, os):
383        self.args = [ 'input.program', '1' ]
384
385class crafty(MinneDefaultBenchmark):
386    name = 'crafty'
387    number = 186
388    lang = 'C'
389    simpoint = 774*100E6
390
391class eon(MinneDefaultBenchmark):
392    name = 'eon'
393    number = 252
394    lang = 'CXX'
395    stdin = None
396
397class eon_kajiya(eon):
398    args = [ 'chair.control.kajiya', 'chair.camera', 'chair.surfaces',
399             'chair.kajiya.ppm', 'ppm', 'pixels_out.kajiya']
400    output = 'kajiya_log.out'
401
402
403class eon_cook(eon):
404    args = [ 'chair.control.cook', 'chair.camera', 'chair.surfaces',
405             'chair.cook.ppm', 'ppm', 'pixels_out.cook' ]
406    output = 'cook_log.out'
407
408class eon_rushmeier(eon):
409    args = [ 'chair.control.rushmeier', 'chair.camera', 'chair.surfaces',
410             'chair.rushmeier.ppm', 'ppm', 'pixels_out.rushmeier' ]
411    output = 'rushmeier_log.out'
412    simpoint = 403*100E6
413
414class gap(DefaultBenchmark):
415    name = 'gap'
416    number = 254
417    lang = 'C'
418
419    def __set_args(self, size):
420        self.args = [ '-l', './', '-q', '-m', size ]
421
422    def test(self, isa, os):
423        self.__set_args('64M')
424
425    def train(self, isa, os):
426        self.__set_args('128M')
427
428    def ref(self, isa, os):
429        self.__set_args('192M')
430        self.simpoint = 674*100E6
431
432    def lgred(self, isa, os):
433        self.__set_args('64M')
434
435    def mdred(self, isa, os):
436        self.__set_args('64M')
437
438    def smred(self, isa, os):
439        self.__set_args('64M')
440
441class gcc(DefaultBenchmark):
442    name = 'gcc'
443    number = 176
444    lang = 'C'
445
446    def test(self, isa, os):
447        self.args = [ 'cccp.i', '-o', 'cccp.s' ]
448
449    def train(self, isa, os):
450        self.args = [ 'cp-decl.i', '-o', 'cp-decl.s' ]
451
452    def smred(self, isa, os):
453        self.args = [ 'c-iterate.i', '-o', 'c-iterate.s' ]
454
455    def mdred(self, isa, os):
456        self.args = [ 'rdlanal.i', '-o', 'rdlanal.s' ]
457
458    def lgred(self, isa, os):
459        self.args = [ 'cp-decl.i', '-o', 'cp-decl.s' ]
460
461class gcc_166(gcc):
462    def ref(self, isa, os):
463        self.simpoint = 389*100E6
464        self.args = [ '166.i', '-o', '166.s' ]
465
466class gcc_200(gcc):
467    def ref(self, isa, os):
468        self.simpoint = 736*100E6
469        self.args = [ '200.i', '-o', '200.s' ]
470
471class gcc_expr(gcc):
472    def ref(self, isa, os):
473        self.simpoint = 36*100E6
474        self.args = [ 'expr.i', '-o', 'expr.s' ]
475
476class gcc_integrate(gcc):
477    def ref(self, isa, os):
478        self.simpoint = 4*100E6
479        self.args = [ 'integrate.i', '-o', 'integrate.s' ]
480
481class gcc_scilab(gcc):
482    def ref(self, isa, os):
483        self.simpoint = 207*100E6
484        self.args = [ 'scilab.i', '-o', 'scilab.s' ]
485
486class gzip(DefaultBenchmark):
487    name = 'gzip'
488    number = 164
489    lang = 'C'
490
491    def test(self, isa, os):
492        self.args = [ 'input.compressed', '2' ]
493
494    def train(self, isa, os):
495        self.args = [ 'input.combined', '32' ]
496
497class gzip_source(gzip):
498    def ref(self, isa, os):
499        self.simpoint = 334*100E6
500        self.args = [ 'input.source', '1' ]
501    def smred(self, isa, os):
502        self.args = [ 'input.source', '1' ]
503    def mdred(self, isa, os):
504        self.args = [ 'input.source', '1' ]
505    def lgred(self, isa, os):
506        self.args = [ 'input.source', '1' ]
507
508class gzip_log(gzip):
509    def ref(self, isa, os):
510        self.simpoint = 265*100E6
511        self.args = [ 'input.log', '60' ]
512    def smred(self, isa, os):
513        self.args = [ 'input.log', '1' ]
514    def mdred(self, isa, os):
515        self.args = [ 'input.log', '1' ]
516    def lgred(self, isa, os):
517        self.args = [ 'input.log', '1' ]
518
519class gzip_graphic(gzip):
520    def ref(self, isa, os):
521        self.simpoint = 653*100E6
522        self.args = [ 'input.graphic', '60' ]
523    def smred(self, isa, os):
524        self.args = [ 'input.graphic', '1' ]
525    def mdred(self, isa, os):
526        self.args = [ 'input.graphic', '1' ]
527    def lgred(self, isa, os):
528        self.args = [ 'input.graphic', '1' ]
529
530class gzip_random(gzip):
531    def ref(self, isa, os):
532        self.simpoint = 623*100E6
533        self.args = [ 'input.random', '60' ]
534    def smred(self, isa, os):
535        self.args = [ 'input.random', '1' ]
536    def mdred(self, isa, os):
537        self.args = [ 'input.random', '1' ]
538    def lgred(self, isa, os):
539        self.args = [ 'input.random', '1' ]
540
541class gzip_program(gzip):
542    def ref(self, isa, os):
543        self.simpoint = 1189*100E6
544        self.args = [ 'input.program', '60' ]
545    def smred(self, isa, os):
546        self.args = [ 'input.program', '1' ]
547    def mdred(self, isa, os):
548        self.args = [ 'input.program', '1' ]
549    def lgred(self, isa, os):
550        self.args = [ 'input.program', '1' ]
551
552class mcf(MinneDefaultBenchmark):
553    name = 'mcf'
554    number = 181
555    lang = 'C'
556    args = [ 'mcf.in' ]
557    simpoint = 553*100E6
558
559class parser(MinneDefaultBenchmark):
560    name = 'parser'
561    number = 197
562    lang = 'C'
563    args = [ '2.1.dict', '-batch' ]
564    simpoint = 1146*100E6
565
566class perlbmk(DefaultBenchmark):
567    name = 'perlbmk'
568    number = 253
569    lang = 'C'
570
571    def test(self, isa, os):
572        self.args = [ '-I.', '-I', 'lib', 'test.pl' ]
573        self.stdin = 'test.in'
574
575class perlbmk_diffmail(perlbmk):
576    def ref(self, isa, os):
577        self.simpoint = 141*100E6
578        self.args = [ '-I', 'lib', 'diffmail.pl', '2', '550', '15', '24',
579                      '23', '100' ]
580
581    def train(self, isa, os):
582        self.args = [ '-I', 'lib', 'diffmail.pl', '2', '350', '15', '24',
583                      '23', '150' ]
584
585class perlbmk_scrabbl(perlbmk):
586    def train(self, isa, os):
587        self.args = [ '-I.', '-I', 'lib', 'scrabbl.pl' ]
588        self.stdin = 'scrabbl.in'
589
590class perlbmk_makerand(perlbmk):
591    def ref(self, isa, os):
592        self.simpoint = 11*100E6
593        self.args = [ '-I', 'lib',  'makerand.pl' ]
594
595    def lgred(self, isa, os):
596        self.args = [ '-I.', '-I', 'lib', 'lgred.makerand.pl' ]
597
598    def mdred(self, isa, os):
599        self.args = [ '-I.', '-I', 'lib', 'mdred.makerand.pl' ]
600
601    def smred(self, isa, os):
602        self.args = [ '-I.', '-I', 'lib', 'smred.makerand.pl' ]
603
604class perlbmk_perfect(perlbmk):
605    def ref(self, isa, os):
606        self.simpoint = 5*100E6
607        self.args = [ '-I', 'lib',  'perfect.pl', 'b', '3', 'm', '4' ]
608
609    def train(self, isa, os):
610        self.args = [ '-I', 'lib', 'perfect.pl', 'b',  '3' ]
611
612class perlbmk_splitmail1(perlbmk):
613    def ref(self, isa, os):
614        self.simpoint = 405*100E6
615        self.args = [ '-I', 'lib', 'splitmail.pl', '850', '5', '19',
616                      '18', '1500' ]
617
618class perlbmk_splitmail2(perlbmk):
619    def ref(self, isa, os):
620        self.args = [ '-I', 'lib', 'splitmail.pl', '704', '12', '26',
621                      '16', '836' ]
622
623class perlbmk_splitmail3(perlbmk):
624    def ref(self, isa, os):
625        self.args = [ '-I', 'lib', 'splitmail.pl', '535', '13', '25',
626                      '24', '1091' ]
627
628class perlbmk_splitmail4(perlbmk):
629    def ref(self, isa, os):
630        self.args = [ '-I', 'lib', 'splitmail.pl', '957', '12', '23',
631                      '26', '1014' ]
632
633class twolf(Benchmark):
634    name = 'twolf'
635    number = 300
636    lang = 'C'
637    stdin = None
638
639    def test(self, isa, os):
640        self.args = [ 'test' ]
641
642    def train(self, isa, os):
643        self.args = [ 'train' ]
644
645    def ref(self, isa, os):
646        self.simpoint = 1066*100E6
647        self.args = [ 'ref' ]
648
649    def smred(self, isa, os):
650        self.args = [ 'smred' ]
651
652    def mdred(self, isa, os):
653        self.args = [ 'mdred' ]
654
655    def lgred(self, isa, os):
656        self.args = [ 'lgred' ]
657
658class vortex(Benchmark):
659    name = 'vortex'
660    number = 255
661    lang = 'C'
662    stdin = None
663
664    def __init__(self, isa, os, input_set):
665        if isa == 'alpha':
666            self.endian = 'lendian'
667        elif (isa == 'sparc' or isa == 'sparc32'):
668            self.endian = 'bendian'
669        else:
670            raise AttributeError, "unknown ISA %s" % isa
671
672        super(vortex, self).__init__(isa, os, input_set)
673
674    def test(self, isa, os):
675        self.args = [ '%s.raw' % self.endian ]
676        self.output = 'vortex.out'
677
678    def train(self, isa, os):
679        self.args = [ '%s.raw' % self.endian ]
680        self.output = 'vortex.out'
681
682    def smred(self, isa, os):
683        self.args = [ '%s.raw' % self.endian ]
684        self.output = 'vortex.out'
685
686    def mdred(self, isa, os):
687        self.args = [ '%s.raw' % self.endian ]
688        self.output = 'vortex.out'
689
690    def lgred(self, isa, os):
691        self.args = [ '%s.raw' % self.endian ]
692        self.output = 'vortex.out'
693
694class vortex1(vortex):
695    def ref(self, isa, os):
696        self.args = [ '%s1.raw' % self.endian ]
697        self.output = 'vortex1.out'
698        self.simpoint = 271*100E6
699
700
701class vortex2(vortex):
702    def ref(self, isa, os):
703        self.simpoint = 1024*100E6
704        self.args = [ '%s2.raw' % self.endian ]
705        self.output = 'vortex2.out'
706
707class vortex3(vortex):
708    def ref(self, isa, os):
709        self.simpoint = 564*100E6
710        self.args = [ '%s3.raw' % self.endian ]
711        self.output = 'vortex3.out'
712
713class vpr(MinneDefaultBenchmark):
714    name = 'vpr'
715    number = 175
716    lang = 'C'
717
718# not sure about vpr minnespec place.in
719class vpr_place(vpr):
720    args = [ 'net.in', 'arch.in', 'place.out', 'dum.out', '-nodisp',
721             '-place_only', '-init_t', '5', '-exit_t', '0.005',
722             '-alpha_t', '0.9412', '-inner_num', '2' ]
723    output = 'place_log.out'
724
725class vpr_route(vpr):
726    simpoint = 476*100E6
727    args = [ 'net.in', 'arch.in', 'place.in', 'route.out', '-nodisp',
728             '-route_only', '-route_chan_width', '15',
729             '-pres_fac_mult', '2', '-acc_fac', '1',
730             '-first_iter_pres_fac', '4', '-initial_pres_fac', '8' ]
731    output = 'route_log.out'
732
733all = [ ammp, applu, apsi, art110, art470, equake, facerec, fma3d, galgel,
734        lucas, mesa, mgrid, sixtrack, swim, wupwise, bzip2_source,
735        bzip2_graphic, bzip2_program, crafty, eon_kajiya, eon_cook,
736        eon_rushmeier, gap, gcc_166, gcc_200, gcc_expr, gcc_integrate,
737        gcc_scilab, gzip_source, gzip_log, gzip_graphic, gzip_random,
738        gzip_program, mcf, parser, perlbmk_diffmail, perlbmk_makerand,
739        perlbmk_perfect, perlbmk_splitmail1, perlbmk_splitmail2,
740        perlbmk_splitmail3, perlbmk_splitmail4, twolf, vortex1, vortex2,
741        vortex3, vpr_place, vpr_route ]
742
743__all__ = [ x.__name__ for x in all ]
744
745if __name__ == '__main__':
746    from pprint import pprint
747    for bench in all:
748        for input_set in 'ref', 'test', 'train':
749            print 'class: %s' % bench.__name__
750            x = bench('alpha', 'tru64', input_set)
751            print '%s: %s' % (x, input_set)
752            pprint(x.makeLiveProcessArgs())
753            print
754