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 |
46from __future__ import print_function 47 |
48import os 49import m5 50from m5.util import addToPath 51from m5.objects import * 52import argparse 53import shlex 54 55m5.util.addToPath('../..') --- 86 unchanged lines hidden (view full) --- 142 143 cwd = os.getcwd() 144 multiprocesses = [] 145 for idx, c in enumerate(cmd): 146 argv = shlex.split(c) 147 148 process = Process(pid=100 + idx, cwd=cwd, cmd=argv, executable=argv[0]) 149 |
150 print("info: %d. command and arguments: %s" % (idx + 1, process.cmd)) |
151 multiprocesses.append(process) 152 153 return multiprocesses 154 155 156def create(args): 157 ''' Create and configure the system object. ''' 158 --- 6 unchanged lines hidden (view full) --- 165 166 # Configure the off-chip memory system. 167 MemConfig.config_mem(args, system) 168 169 # Parse the command line and get a list of Processes instances 170 # that we can pass to gem5. 171 processes = get_processes(args.commands_to_run) 172 if len(processes) != args.num_cores: |
173 print("Error: Cannot map %d command(s) onto %d CPU(s)" % 174 (len(processes), args.num_cores)) |
175 sys.exit(1) 176 177 # Assign one workload to each CPU 178 for cpu, workload in zip(system.cpu_cluster.cpus, processes): 179 cpu.workload = workload 180 181 return system 182 --- 39 unchanged lines hidden (view full) --- 222 # Start the simulator. This gives control to the C++ world and 223 # starts the simulator. The returned event tells the simulation 224 # script why the simulator exited. 225 event = m5.simulate() 226 227 # Print the reason for the simulation exit. Some exit codes are 228 # requests for service (e.g., checkpoints) from the simulation 229 # script. We'll just ignore them here and exit. |
230 print(event.getCause(), " @ ", m5.curTick()) |
231 sys.exit(event.getCode()) 232 233 234if __name__ == "__m5_main__": 235 main() |