Benchmarks.py revision 13731:67cd980cb20f
112855Sgabeblack@google.com# Copyright (c) 2006-2007 The Regents of The University of Michigan
212855Sgabeblack@google.com# All rights reserved.
312855Sgabeblack@google.com#
412855Sgabeblack@google.com# Redistribution and use in source and binary forms, with or without
512855Sgabeblack@google.com# modification, are permitted provided that the following conditions are
612855Sgabeblack@google.com# met: redistributions of source code must retain the above copyright
712855Sgabeblack@google.com# notice, this list of conditions and the following disclaimer;
812855Sgabeblack@google.com# redistributions in binary form must reproduce the above copyright
912855Sgabeblack@google.com# notice, this list of conditions and the following disclaimer in the
1012855Sgabeblack@google.com# documentation and/or other materials provided with the distribution;
1112855Sgabeblack@google.com# neither the name of the copyright holders nor the names of its
1212855Sgabeblack@google.com# contributors may be used to endorse or promote products derived from
1312855Sgabeblack@google.com# this software without specific prior written permission.
1412855Sgabeblack@google.com#
1512855Sgabeblack@google.com# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1612855Sgabeblack@google.com# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
1712855Sgabeblack@google.com# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
1812855Sgabeblack@google.com# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
1912855Sgabeblack@google.com# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
2012855Sgabeblack@google.com# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
2112855Sgabeblack@google.com# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2212855Sgabeblack@google.com# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2312855Sgabeblack@google.com# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2412855Sgabeblack@google.com# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2512855Sgabeblack@google.com# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2612855Sgabeblack@google.com#
2712855Sgabeblack@google.com# Authors: Ali Saidi
2812855Sgabeblack@google.com
2912855Sgabeblack@google.comfrom __future__ import print_function
3012855Sgabeblack@google.com
3112855Sgabeblack@google.comfrom SysPaths import script, disk, binary
3212855Sgabeblack@google.comfrom os import environ as env
3312855Sgabeblack@google.comfrom m5.defines import buildEnv
3412855Sgabeblack@google.com
3512855Sgabeblack@google.comclass SysConfig:
3612855Sgabeblack@google.com    def __init__(self, script=None, mem=None, disk=None, rootdev=None,
3712855Sgabeblack@google.com                 os_type='linux'):
3812855Sgabeblack@google.com        self.scriptname = script
3912855Sgabeblack@google.com        self.diskname = disk
4012855Sgabeblack@google.com        self.memsize = mem
4112855Sgabeblack@google.com        self.root = rootdev
4212855Sgabeblack@google.com        self.ostype = os_type
4312855Sgabeblack@google.com
4412855Sgabeblack@google.com    def script(self):
4512855Sgabeblack@google.com        if self.scriptname:
4612855Sgabeblack@google.com            return script(self.scriptname)
4712855Sgabeblack@google.com        else:
4812855Sgabeblack@google.com            return ''
4912855Sgabeblack@google.com
5012855Sgabeblack@google.com    def mem(self):
5112855Sgabeblack@google.com        if self.memsize:
5212855Sgabeblack@google.com            return self.memsize
5312855Sgabeblack@google.com        else:
5412855Sgabeblack@google.com            return '128MB'
5512855Sgabeblack@google.com
5612855Sgabeblack@google.com    def disk(self):
5712855Sgabeblack@google.com        if self.diskname:
5812855Sgabeblack@google.com            return disk(self.diskname)
5912855Sgabeblack@google.com        elif buildEnv['TARGET_ISA'] == 'alpha':
6012855Sgabeblack@google.com            return env.get('LINUX_IMAGE', disk('linux-latest.img'))
6112855Sgabeblack@google.com        elif buildEnv['TARGET_ISA'] == 'x86':
6212855Sgabeblack@google.com            return env.get('LINUX_IMAGE', disk('x86root.img'))
6312855Sgabeblack@google.com        elif buildEnv['TARGET_ISA'] == 'arm':
6412855Sgabeblack@google.com            return env.get('LINUX_IMAGE', disk('linux-aarch32-ael.img'))
6512855Sgabeblack@google.com        elif buildEnv['TARGET_ISA'] == 'sparc':
6612855Sgabeblack@google.com            return env.get('LINUX_IMAGE', disk('disk.s10hw2'))
6712855Sgabeblack@google.com        else:
6812855Sgabeblack@google.com            print("Don't know what default disk image to use for %s ISA" %
6912855Sgabeblack@google.com                buildEnv['TARGET_ISA'])
7012855Sgabeblack@google.com            exit(1)
7112855Sgabeblack@google.com
7212855Sgabeblack@google.com    def rootdev(self):
7312855Sgabeblack@google.com        if self.root:
7412855Sgabeblack@google.com            return self.root
7512855Sgabeblack@google.com        else:
7612855Sgabeblack@google.com            return '/dev/sda1'
7712855Sgabeblack@google.com
7812855Sgabeblack@google.com    def os_type(self):
7912855Sgabeblack@google.com        return self.ostype
8012855Sgabeblack@google.com
8112855Sgabeblack@google.com# Benchmarks are defined as a key in a dict which is a list of SysConfigs
8212855Sgabeblack@google.com# The first defined machine is the test system, the others are driving systems
8312855Sgabeblack@google.com
8412855Sgabeblack@google.comBenchmarks = {
8512855Sgabeblack@google.com    'PovrayBench':  [SysConfig('povray-bench.rcS', '512MB', 'povray.img')],
8612855Sgabeblack@google.com    'PovrayAutumn': [SysConfig('povray-autumn.rcS', '512MB', 'povray.img')],
8712855Sgabeblack@google.com
88    'NetperfStream':    [SysConfig('netperf-stream-client.rcS'),
89                         SysConfig('netperf-server.rcS')],
90    'NetperfStreamUdp': [SysConfig('netperf-stream-udp-client.rcS'),
91                         SysConfig('netperf-server.rcS')],
92    'NetperfUdpLocal':  [SysConfig('netperf-stream-udp-local.rcS')],
93    'NetperfStreamNT':  [SysConfig('netperf-stream-nt-client.rcS'),
94                         SysConfig('netperf-server.rcS')],
95    'NetperfMaerts':    [SysConfig('netperf-maerts-client.rcS'),
96                         SysConfig('netperf-server.rcS')],
97    'SurgeStandard':    [SysConfig('surge-server.rcS', '512MB'),
98                         SysConfig('surge-client.rcS', '256MB')],
99    'SurgeSpecweb':     [SysConfig('spec-surge-server.rcS', '512MB'),
100                         SysConfig('spec-surge-client.rcS', '256MB')],
101    'Nhfsstone':        [SysConfig('nfs-server-nhfsstone.rcS', '512MB'),
102                         SysConfig('nfs-client-nhfsstone.rcS')],
103    'Nfs':              [SysConfig('nfs-server.rcS', '900MB'),
104                         SysConfig('nfs-client-dbench.rcS')],
105    'NfsTcp':           [SysConfig('nfs-server.rcS', '900MB'),
106                         SysConfig('nfs-client-tcp.rcS')],
107    'IScsiInitiator':   [SysConfig('iscsi-client.rcS', '512MB'),
108                         SysConfig('iscsi-server.rcS', '512MB')],
109    'IScsiTarget':      [SysConfig('iscsi-server.rcS', '512MB'),
110                         SysConfig('iscsi-client.rcS', '512MB')],
111    'Validation':       [SysConfig('iscsi-server.rcS', '512MB'),
112                         SysConfig('iscsi-client.rcS', '512MB')],
113    'Ping':             [SysConfig('ping-server.rcS',),
114                         SysConfig('ping-client.rcS')],
115
116    'ValAccDelay':      [SysConfig('devtime.rcS', '512MB')],
117    'ValAccDelay2':     [SysConfig('devtimewmr.rcS', '512MB')],
118    'ValMemLat':        [SysConfig('micro_memlat.rcS', '512MB')],
119    'ValMemLat2MB':     [SysConfig('micro_memlat2mb.rcS', '512MB')],
120    'ValMemLat8MB':     [SysConfig('micro_memlat8mb.rcS', '512MB')],
121    'ValMemLat':        [SysConfig('micro_memlat8.rcS', '512MB')],
122    'ValTlbLat':        [SysConfig('micro_tlblat.rcS', '512MB')],
123    'ValSysLat':        [SysConfig('micro_syscall.rcS', '512MB')],
124    'ValCtxLat':        [SysConfig('micro_ctx.rcS', '512MB')],
125    'ValStream':        [SysConfig('micro_stream.rcS', '512MB')],
126    'ValStreamScale':   [SysConfig('micro_streamscale.rcS', '512MB')],
127    'ValStreamCopy':    [SysConfig('micro_streamcopy.rcS', '512MB')],
128
129    'MutexTest':        [SysConfig('mutex-test.rcS', '128MB')],
130    'ArmAndroid-GB':    [SysConfig('null.rcS', '256MB',
131                    'ARMv7a-Gingerbread-Android.SMP.mouse.nolock.clean.img',
132                    None, 'android-gingerbread')],
133    'bbench-gb':        [SysConfig('bbench-gb.rcS', '256MB',
134                            'ARMv7a-Gingerbread-Android.SMP.mouse.nolock.img',
135                            None, 'android-gingerbread')],
136    'ArmAndroid-ICS':   [SysConfig('null.rcS', '256MB',
137                            'ARMv7a-ICS-Android.SMP.nolock.clean.img',
138                            None, 'android-ics')],
139    'bbench-ics':       [SysConfig('bbench-ics.rcS', '256MB',
140                            'ARMv7a-ICS-Android.SMP.nolock.img',
141                            None, 'android-ics')]
142}
143
144benchs = list(Benchmarks.keys())
145benchs.sort()
146DefinedBenchmarks = ", ".join(benchs)
147