se.py (12395:322bb93e5f06) | se.py (12564:2778478ca882) |
---|---|
1# Copyright (c) 2012-2013 ARM Limited 2# All rights reserved. 3# 4# The license below extends only to copyright in the software and shall 5# not be construed as granting a license to any other intellectual 6# property including but not limited to intellectual property relating 7# to a hardware implementation of the functionality of the software 8# licensed hereunder. You may use the software subject to the license --- 28 unchanged lines hidden (view full) --- 37# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 38# 39# Authors: Steve Reinhardt 40 41# Simple test script 42# 43# "m5 test.py" 44 | 1# Copyright (c) 2012-2013 ARM Limited 2# All rights reserved. 3# 4# The license below extends only to copyright in the software and shall 5# not be construed as granting a license to any other intellectual 6# property including but not limited to intellectual property relating 7# to a hardware implementation of the functionality of the software 8# licensed hereunder. You may use the software subject to the license --- 28 unchanged lines hidden (view full) --- 37# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 38# 39# Authors: Steve Reinhardt 40 41# Simple test script 42# 43# "m5 test.py" 44 |
45from __future__ import print_function 46 |
|
45import optparse 46import sys 47import os 48 49import m5 50from m5.defines import buildEnv 51from m5.objects import * 52from m5.util import addToPath, fatal, warn --- 73 unchanged lines hidden (view full) --- 126Options.addSEOptions(parser) 127 128if '--ruby' in sys.argv: 129 Ruby.define_options(parser) 130 131(options, args) = parser.parse_args() 132 133if args: | 47import optparse 48import sys 49import os 50 51import m5 52from m5.defines import buildEnv 53from m5.objects import * 54from m5.util import addToPath, fatal, warn --- 73 unchanged lines hidden (view full) --- 128Options.addSEOptions(parser) 129 130if '--ruby' in sys.argv: 131 Ruby.define_options(parser) 132 133(options, args) = parser.parse_args() 134 135if args: |
134 print "Error: script doesn't take any positional arguments" | 136 print("Error: script doesn't take any positional arguments") |
135 sys.exit(1) 136 137multiprocesses = [] 138numThreads = 1 139 140if options.bench: 141 apps = options.bench.split("-") 142 if len(apps) != options.num_cpus: | 137 sys.exit(1) 138 139multiprocesses = [] 140numThreads = 1 141 142if options.bench: 143 apps = options.bench.split("-") 144 if len(apps) != options.num_cpus: |
143 print "number of benchmarks not equal to set num_cpus!" | 145 print("number of benchmarks not equal to set num_cpus!") |
144 sys.exit(1) 145 146 for app in apps: 147 try: 148 if buildEnv['TARGET_ISA'] == 'alpha': 149 exec("workload = %s('alpha', 'tru64', '%s')" % ( 150 app, options.spec_input)) 151 elif buildEnv['TARGET_ISA'] == 'arm': 152 exec("workload = %s('arm_%s', 'linux', '%s')" % ( 153 app, options.arm_iset, options.spec_input)) 154 else: 155 exec("workload = %s(buildEnv['TARGET_ISA', 'linux', '%s')" % ( 156 app, options.spec_input)) 157 multiprocesses.append(workload.makeProcess()) 158 except: | 146 sys.exit(1) 147 148 for app in apps: 149 try: 150 if buildEnv['TARGET_ISA'] == 'alpha': 151 exec("workload = %s('alpha', 'tru64', '%s')" % ( 152 app, options.spec_input)) 153 elif buildEnv['TARGET_ISA'] == 'arm': 154 exec("workload = %s('arm_%s', 'linux', '%s')" % ( 155 app, options.arm_iset, options.spec_input)) 156 else: 157 exec("workload = %s(buildEnv['TARGET_ISA', 'linux', '%s')" % ( 158 app, options.spec_input)) 159 multiprocesses.append(workload.makeProcess()) 160 except: |
159 print >>sys.stderr, "Unable to find workload for %s: %s" % ( 160 buildEnv['TARGET_ISA'], app) | 161 print("Unable to find workload for %s: %s" % 162 (buildEnv['TARGET_ISA'], app), 163 file=sys.stderr) |
161 sys.exit(1) 162elif options.cmd: 163 multiprocesses, numThreads = get_processes(options) 164else: | 164 sys.exit(1) 165elif options.cmd: 166 multiprocesses, numThreads = get_processes(options) 167else: |
165 print >> sys.stderr, "No workload specified. Exiting!\n" | 168 print("No workload specified. Exiting!\n", file=sys.stderr) |
166 sys.exit(1) 167 168 169(CPUClass, test_mem_mode, FutureClass) = Simulation.setCPUClass(options) 170CPUClass.numThreads = numThreads 171 172# Check -- do not allow SMT with multiple CPUs 173if options.smt and options.num_cpus > 1: --- 110 unchanged lines hidden --- | 169 sys.exit(1) 170 171 172(CPUClass, test_mem_mode, FutureClass) = Simulation.setCPUClass(options) 173CPUClass.numThreads = numThreads 174 175# Check -- do not allow SMT with multiple CPUs 176if options.smt and options.num_cpus > 1: --- 110 unchanged lines hidden --- |