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 |
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: |
72 print("Error: script doesn't take any positional arguments") |
73 sys.exit(1) 74 75if not options.numcpus: |
76 print("Specify the number of cpus with -n") |
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: |
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) |
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 |
287print('Exiting @ tick', m5.curTick(), 'because', exit_event.getCause()) |
288 |