Benchmarks.py revision 10747:3fe41011333d
12207SN/A# Copyright (c) 2006-2007 The Regents of The University of Michigan
22207SN/A# All rights reserved.
32207SN/A#
42207SN/A# Redistribution and use in source and binary forms, with or without
52207SN/A# modification, are permitted provided that the following conditions are
62207SN/A# met: redistributions of source code must retain the above copyright
72207SN/A# notice, this list of conditions and the following disclaimer;
82207SN/A# redistributions in binary form must reproduce the above copyright
92207SN/A# notice, this list of conditions and the following disclaimer in the
102207SN/A# documentation and/or other materials provided with the distribution;
112207SN/A# neither the name of the copyright holders nor the names of its
122207SN/A# contributors may be used to endorse or promote products derived from
132207SN/A# this software without specific prior written permission.
142207SN/A#
152207SN/A# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
162207SN/A# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
172207SN/A# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
182207SN/A# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
192207SN/A# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
202207SN/A# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
212207SN/A# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
222207SN/A# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
232207SN/A# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
242207SN/A# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
252207SN/A# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
262207SN/A#
272665Ssaidi@eecs.umich.edu# Authors: Ali Saidi
282665Ssaidi@eecs.umich.edu
292665Ssaidi@eecs.umich.edufrom SysPaths import script, disk, binary
302207SN/Afrom os import environ as env
312207SN/Afrom m5.defines import buildEnv
322972Sgblack@eecs.umich.edu
332207SN/Aclass SysConfig:
342454SN/A    def __init__(self, script=None, mem=None, disk=None, rootdev=None,
352454SN/A                 os_type='linux'):
362680Sktlim@umich.edu        self.scriptname = script
372474SN/A        self.diskname = disk
382207SN/A        self.memsize = mem
392207SN/A        self.root = rootdev
402474SN/A        self.ostype = os_type
412474SN/A
422474SN/A    def script(self):
432474SN/A        if self.scriptname:
442474SN/A            return script(self.scriptname)
453114Sgblack@eecs.umich.edu        else:
463114Sgblack@eecs.umich.edu            return ''
473114Sgblack@eecs.umich.edu
482474SN/A    def mem(self):
493114Sgblack@eecs.umich.edu        if self.memsize:
502474SN/A            return self.memsize
512474SN/A        else:
522474SN/A            return '128MB'
532474SN/A
542474SN/A    def disk(self):
552474SN/A        if self.diskname:
562474SN/A            return disk(self.diskname)
572474SN/A        elif buildEnv['TARGET_ISA'] == 'alpha':
582474SN/A            return env.get('LINUX_IMAGE', disk('linux-latest.img'))
592474SN/A        elif buildEnv['TARGET_ISA'] == 'x86':
602474SN/A            return env.get('LINUX_IMAGE', disk('x86root.img'))
612474SN/A        elif buildEnv['TARGET_ISA'] == 'arm':
622474SN/A            return env.get('LINUX_IMAGE', disk('linux-aarch32-ael.img'))
632474SN/A        else:
642474SN/A            print "Don't know what default disk image to use for %s ISA" % \
652474SN/A                buildEnv['TARGET_ISA']
662474SN/A            exit(1)
672474SN/A
682474SN/A    def rootdev(self):
692474SN/A        if self.root:
702474SN/A            return self.root
712474SN/A        else:
722680Sktlim@umich.edu            return '/dev/sda1'
732474SN/A
742474SN/A    def os_type(self):
752474SN/A        return self.ostype
76
77# Benchmarks are defined as a key in a dict which is a list of SysConfigs
78# The first defined machine is the test system, the others are driving systems
79
80Benchmarks = {
81    'PovrayBench':  [SysConfig('povray-bench.rcS', '512MB', 'povray.img')],
82    'PovrayAutumn': [SysConfig('povray-autumn.rcS', '512MB', 'povray.img')],
83
84    'NetperfStream':    [SysConfig('netperf-stream-client.rcS'),
85                         SysConfig('netperf-server.rcS')],
86    'NetperfStreamUdp': [SysConfig('netperf-stream-udp-client.rcS'),
87                         SysConfig('netperf-server.rcS')],
88    'NetperfUdpLocal':  [SysConfig('netperf-stream-udp-local.rcS')],
89    'NetperfStreamNT':  [SysConfig('netperf-stream-nt-client.rcS'),
90                         SysConfig('netperf-server.rcS')],
91    'NetperfMaerts':    [SysConfig('netperf-maerts-client.rcS'),
92                         SysConfig('netperf-server.rcS')],
93    'SurgeStandard':    [SysConfig('surge-server.rcS', '512MB'),
94                         SysConfig('surge-client.rcS', '256MB')],
95    'SurgeSpecweb':     [SysConfig('spec-surge-server.rcS', '512MB'),
96                         SysConfig('spec-surge-client.rcS', '256MB')],
97    'Nhfsstone':        [SysConfig('nfs-server-nhfsstone.rcS', '512MB'),
98                         SysConfig('nfs-client-nhfsstone.rcS')],
99    'Nfs':              [SysConfig('nfs-server.rcS', '900MB'),
100                         SysConfig('nfs-client-dbench.rcS')],
101    'NfsTcp':           [SysConfig('nfs-server.rcS', '900MB'),
102                         SysConfig('nfs-client-tcp.rcS')],
103    'IScsiInitiator':   [SysConfig('iscsi-client.rcS', '512MB'),
104                         SysConfig('iscsi-server.rcS', '512MB')],
105    'IScsiTarget':      [SysConfig('iscsi-server.rcS', '512MB'),
106                         SysConfig('iscsi-client.rcS', '512MB')],
107    'Validation':       [SysConfig('iscsi-server.rcS', '512MB'),
108                         SysConfig('iscsi-client.rcS', '512MB')],
109    'Ping':             [SysConfig('ping-server.rcS',),
110                         SysConfig('ping-client.rcS')],
111
112    'ValAccDelay':      [SysConfig('devtime.rcS', '512MB')],
113    'ValAccDelay2':     [SysConfig('devtimewmr.rcS', '512MB')],
114    'ValMemLat':        [SysConfig('micro_memlat.rcS', '512MB')],
115    'ValMemLat2MB':     [SysConfig('micro_memlat2mb.rcS', '512MB')],
116    'ValMemLat8MB':     [SysConfig('micro_memlat8mb.rcS', '512MB')],
117    'ValMemLat':        [SysConfig('micro_memlat8.rcS', '512MB')],
118    'ValTlbLat':        [SysConfig('micro_tlblat.rcS', '512MB')],
119    'ValSysLat':        [SysConfig('micro_syscall.rcS', '512MB')],
120    'ValCtxLat':        [SysConfig('micro_ctx.rcS', '512MB')],
121    'ValStream':        [SysConfig('micro_stream.rcS', '512MB')],
122    'ValStreamScale':   [SysConfig('micro_streamscale.rcS', '512MB')],
123    'ValStreamCopy':    [SysConfig('micro_streamcopy.rcS', '512MB')],
124
125    'MutexTest':        [SysConfig('mutex-test.rcS', '128MB')],
126    'ArmAndroid-GB':    [SysConfig('null.rcS', '256MB',
127                    'ARMv7a-Gingerbread-Android.SMP.mouse.nolock.clean.img',
128                    None, 'android-gingerbread')],
129    'bbench-gb':        [SysConfig('bbench-gb.rcS', '256MB',
130                            'ARMv7a-Gingerbread-Android.SMP.mouse.nolock.img',
131                            None, 'android-gingerbread')],
132    'ArmAndroid-ICS':   [SysConfig('null.rcS', '256MB',
133                            'ARMv7a-ICS-Android.SMP.nolock.clean.img',
134                            None, 'android-ics')],
135    'bbench-ics':       [SysConfig('bbench-ics.rcS', '256MB',
136                            'ARMv7a-ICS-Android.SMP.nolock.img',
137                            None, 'android-ics')]
138}
139
140benchs = Benchmarks.keys()
141benchs.sort()
142DefinedBenchmarks = ", ".join(benchs)
143