run.py (11851:824055fe6b30) run.py (12564:2778478ca882)
1# Copyright (c) 2005-2007 The Regents of The University of Michigan
2# All rights reserved.
3#
4# Redistribution and use in source and binary forms, with or without
5# modification, are permitted provided that the following conditions are
6# met: redistributions of source code must retain the above copyright
7# notice, this list of conditions and the following disclaimer;
8# redistributions in binary form must reproduce the above copyright

--- 15 unchanged lines hidden (view full) ---

24# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26#
27# Authors: Ron Dreslinski
28
29# Splash2 Run Script
30#
31
1# Copyright (c) 2005-2007 The Regents of The University of Michigan
2# All rights reserved.
3#
4# Redistribution and use in source and binary forms, with or without
5# modification, are permitted provided that the following conditions are
6# met: redistributions of source code must retain the above copyright
7# notice, this list of conditions and the following disclaimer;
8# redistributions in binary form must reproduce the above copyright

--- 15 unchanged lines hidden (view full) ---

24# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26#
27# Authors: Ron Dreslinski
28
29# Splash2 Run Script
30#
31
32from __future__ import print_function
33
32import os
33import optparse
34import sys
35
36import m5
37from m5.objects import *
38
39# --------------------

--- 22 unchanged lines hidden (view full) ---

62 help="Root directory of Splash2",
63 default="/dist/splash2/codes")
64parser.add_option("-b", "--benchmark",
65 help="Splash 2 benchmark to run")
66
67(options, args) = parser.parse_args()
68
69if args:
34import os
35import optparse
36import sys
37
38import m5
39from m5.objects import *
40
41# --------------------

--- 22 unchanged lines hidden (view full) ---

64 help="Root directory of Splash2",
65 default="/dist/splash2/codes")
66parser.add_option("-b", "--benchmark",
67 help="Splash 2 benchmark to run")
68
69(options, args) = parser.parse_args()
70
71if args:
70 print "Error: script doesn't take any positional arguments"
72 print("Error: script doesn't take any positional arguments")
71 sys.exit(1)
72
73if not options.numcpus:
73 sys.exit(1)
74
75if not options.numcpus:
74 print "Specify the number of cpus with -n"
76 print("Specify the number of cpus with -n")
75 sys.exit(1)
76
77# --------------------
78# Define Splash2 Benchmarks
79# ====================
80class Cholesky(Process):
81 cwd = options.rootdir + '/kernels/cholesky'
82 executable = options.rootdir + '/kernels/cholesky/CHOLESKY'

--- 165 unchanged lines hidden (view full) ---

248 root.workload = Ocean_noncontig()
249elif options.benchmark == 'Raytrace':
250 root.workload = Raytrace()
251elif options.benchmark == 'WaterNSquared':
252 root.workload = Water_nsquared()
253elif options.benchmark == 'WaterSpatial':
254 root.workload = Water_spatial()
255else:
77 sys.exit(1)
78
79# --------------------
80# Define Splash2 Benchmarks
81# ====================
82class Cholesky(Process):
83 cwd = options.rootdir + '/kernels/cholesky'
84 executable = options.rootdir + '/kernels/cholesky/CHOLESKY'

--- 165 unchanged lines hidden (view full) ---

250 root.workload = Ocean_noncontig()
251elif options.benchmark == 'Raytrace':
252 root.workload = Raytrace()
253elif options.benchmark == 'WaterNSquared':
254 root.workload = Water_nsquared()
255elif options.benchmark == 'WaterSpatial':
256 root.workload = Water_spatial()
257else:
256 print >> sys.stderr, """The --benchmark environment variable was set to something improper.
257Use Cholesky, FFT, LUContig, LUNoncontig, Radix, Barnes, FMM, OceanContig,
258OceanNoncontig, Raytrace, WaterNSquared, or WaterSpatial"""
258 print("The --benchmark environment variable was set to something "
259 "improper. Use Cholesky, FFT, LUContig, LUNoncontig, Radix, "
260 "Barnes, FMM, OceanContig, OceanNoncontig, Raytrace, WaterNSquared, "
261 "or WaterSpatial", file=sys.stderr)
259 sys.exit(1)
260
261# --------------------
262# Assign the workload to the cpus
263# ====================
264
265for cpu in cpus:
266 cpu.workload = root.workload

--- 9 unchanged lines hidden (view full) ---

276m5.instantiate()
277
278# simulate until program terminates
279if options.maxtick:
280 exit_event = m5.simulate(options.maxtick)
281else:
282 exit_event = m5.simulate(m5.MaxTick)
283
262 sys.exit(1)
263
264# --------------------
265# Assign the workload to the cpus
266# ====================
267
268for cpu in cpus:
269 cpu.workload = root.workload

--- 9 unchanged lines hidden (view full) ---

279m5.instantiate()
280
281# simulate until program terminates
282if options.maxtick:
283 exit_event = m5.simulate(options.maxtick)
284else:
285 exit_event = m5.simulate(m5.MaxTick)
286
284print 'Exiting @ tick', m5.curTick(), 'because', exit_event.getCause()
287print('Exiting @ tick', m5.curTick(), 'because', exit_event.getCause())
285
288