se.py (8168:5cbb0a68dce1) se.py (8169:89cd8302abd3)
1# Copyright (c) 2006-2008 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

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

39from m5.defines import buildEnv
40from m5.objects import *
41from m5.util import addToPath, fatal
42
43if buildEnv['FULL_SYSTEM']:
44 fatal("This script requires syscall emulation mode (*_SE).")
45
46addToPath('../common')
1# Copyright (c) 2006-2008 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

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

39from m5.defines import buildEnv
40from m5.objects import *
41from m5.util import addToPath, fatal
42
43if buildEnv['FULL_SYSTEM']:
44 fatal("This script requires syscall emulation mode (*_SE).")
45
46addToPath('../common')
47addToPath('../ruby')
47
48
49import Ruby
50
48import Simulation
49import CacheConfig
50from Caches import *
51from cpu2000 import *
52
53# Get paths we might need. It's expected this file is in m5/configs/example.
54config_path = os.path.dirname(os.path.abspath(__file__))
55config_root = os.path.dirname(config_path)

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

62 default=joinpath(m5_root, "tests/test-progs/hello/bin/%s/linux/hello" % \
63 buildEnv['TARGET_ISA']),
64 help="The binary to run in syscall emulation mode.")
65parser.add_option("-o", "--options", default="",
66 help='The options to pass to the binary, use " " around the entire string')
67parser.add_option("-i", "--input", default="", help="Read stdin from a file.")
68parser.add_option("--output", default="", help="Redirect stdout to a file.")
69parser.add_option("--errout", default="", help="Redirect stderr to a file.")
51import Simulation
52import CacheConfig
53from Caches import *
54from cpu2000 import *
55
56# Get paths we might need. It's expected this file is in m5/configs/example.
57config_path = os.path.dirname(os.path.abspath(__file__))
58config_root = os.path.dirname(config_path)

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

65 default=joinpath(m5_root, "tests/test-progs/hello/bin/%s/linux/hello" % \
66 buildEnv['TARGET_ISA']),
67 help="The binary to run in syscall emulation mode.")
68parser.add_option("-o", "--options", default="",
69 help='The options to pass to the binary, use " " around the entire string')
70parser.add_option("-i", "--input", default="", help="Read stdin from a file.")
71parser.add_option("--output", default="", help="Redirect stdout to a file.")
72parser.add_option("--errout", default="", help="Redirect stderr to a file.")
73parser.add_option("--ruby", action="store_true")
70
71execfile(os.path.join(config_root, "common", "Options.py"))
72
73(options, args) = parser.parse_args()
74
74
75execfile(os.path.join(config_root, "common", "Options.py"))
76
77(options, args) = parser.parse_args()
78
79if options.ruby:
80 Ruby.define_options(parser)
81 (options, args) = parser.parse_args()
82
75if args:
76 print "Error: script doesn't take any positional arguments"
77 sys.exit(1)
78
79multiprocesses = []
80apps = []
81
82if options.bench:

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

140 if outputs and outputs[smt_idx]:
141 smt_process.output = outputs[smt_idx]
142 if errouts and errouts[smt_idx]:
143 smt_process.errout = errouts[smt_idx]
144 process += [smt_process, ]
145 smt_idx += 1
146 numThreads = len(workloads)
147
83if args:
84 print "Error: script doesn't take any positional arguments"
85 sys.exit(1)
86
87multiprocesses = []
88apps = []
89
90if options.bench:

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

148 if outputs and outputs[smt_idx]:
149 smt_process.output = outputs[smt_idx]
150 if errouts and errouts[smt_idx]:
151 smt_process.errout = errouts[smt_idx]
152 process += [smt_process, ]
153 smt_idx += 1
154 numThreads = len(workloads)
155
148(CPUClass, test_mem_mode, FutureClass) = Simulation.setCPUClass(options)
156if options.ruby:
157 if options.detailed:
158 print >> sys.stderr, "Ruby only works with TimingSimpleCPU!!"
159 sys.exit(1)
160 elif not options.timing:
161 print >> sys.stderr, "****WARN: using Timing CPU since it's needed by Ruby"
149
162
163 class CPUClass(TimingSimpleCPU): pass
164 test_mem_mode = 'timing'
165 FutureClass = None
166else:
167 (CPUClass, test_mem_mode, FutureClass) = Simulation.setCPUClass(options)
168
150CPUClass.clock = '2GHz'
151CPUClass.numThreads = numThreads;
152
153np = options.num_cpus
154
155system = System(cpu = [CPUClass(cpu_id=i) for i in xrange(np)],
156 physmem = PhysicalMemory(range=AddrRange("512MB")),
157 membus = Bus(), mem_mode = test_mem_mode)
158
169CPUClass.clock = '2GHz'
170CPUClass.numThreads = numThreads;
171
172np = options.num_cpus
173
174system = System(cpu = [CPUClass(cpu_id=i) for i in xrange(np)],
175 physmem = PhysicalMemory(range=AddrRange("512MB")),
176 membus = Bus(), mem_mode = test_mem_mode)
177
159system.physmem.port = system.membus.port
178if options.ruby:
179 options.use_map = True
180 system.ruby = Ruby.create_system(options, system)
181 assert(options.num_cpus == len(system.ruby.cpu_ruby_ports))
182else:
183 system.physmem.port = system.membus.port
184 CacheConfig.config_cache(options, system)
160
185
161CacheConfig.config_cache(options, system)
162
163for i in xrange(np):
164 system.cpu[i].workload = multiprocesses[i]
165
186for i in xrange(np):
187 system.cpu[i].workload = multiprocesses[i]
188
189 if options.ruby:
190 system.cpu[i].icache_port = system.ruby.cpu_ruby_ports[i].port
191 system.cpu[i].dcache_port = system.ruby.cpu_ruby_ports[i].port
192
166 if options.fastmem:
167 system.cpu[0].physmem_port = system.physmem.port
168
169root = Root(system = system)
170
171Simulation.run(options, root, system, FutureClass)
193 if options.fastmem:
194 system.cpu[0].physmem_port = system.physmem.port
195
196root = Root(system = system)
197
198Simulation.run(options, root, system, FutureClass)