Deleted Added
sdiff udiff text old ( 12151:52ac7a63ca39 ) new ( 12564:2778478ca882 )
full compact
1# Copyright (c) 2016-2017 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

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

38# Gabor Dozsa
39#
40
41"""This script is the syscall emulation example script from the ARM
42Research Starter Kit on System Modeling. More information can be found
43at: http://www.arm.com/ResearchEnablement/SystemModeling
44"""
45
46import os
47import m5
48from m5.util import addToPath
49from m5.objects import *
50import argparse
51import shlex
52
53m5.util.addToPath('../..')

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

140
141 cwd = os.getcwd()
142 multiprocesses = []
143 for idx, c in enumerate(cmd):
144 argv = shlex.split(c)
145
146 process = Process(pid=100 + idx, cwd=cwd, cmd=argv, executable=argv[0])
147
148 print "info: %d. command and arguments: %s" % (idx + 1, process.cmd)
149 multiprocesses.append(process)
150
151 return multiprocesses
152
153
154def create(args):
155 ''' Create and configure the system object. '''
156

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

163
164 # Configure the off-chip memory system.
165 MemConfig.config_mem(args, system)
166
167 # Parse the command line and get a list of Processes instances
168 # that we can pass to gem5.
169 processes = get_processes(args.commands_to_run)
170 if len(processes) != args.num_cores:
171 print "Error: Cannot map %d command(s) onto %d " \
172 "CPU(s)" % (len(processes), args.num_cores)
173 sys.exit(1)
174
175 # Assign one workload to each CPU
176 for cpu, workload in zip(system.cpu_cluster.cpus, processes):
177 cpu.workload = workload
178
179 return system
180

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

220 # Start the simulator. This gives control to the C++ world and
221 # starts the simulator. The returned event tells the simulation
222 # script why the simulator exited.
223 event = m5.simulate()
224
225 # Print the reason for the simulation exit. Some exit codes are
226 # requests for service (e.g., checkpoints) from the simulation
227 # script. We'll just ignore them here and exit.
228 print event.getCause(), " @ ", m5.curTick()
229 sys.exit(event.getCode())
230
231
232if __name__ == "__m5_main__":
233 main()