starter_se.py (12151:52ac7a63ca39) | starter_se.py (12564:2778478ca882) |
---|---|
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 | 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 |
|
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 | 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 |
148 print "info: %d. command and arguments: %s" % (idx + 1, process.cmd) | 150 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: | 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: |
171 print "Error: Cannot map %d command(s) onto %d " \ 172 "CPU(s)" % (len(processes), args.num_cores) | 173 print("Error: Cannot map %d command(s) onto %d CPU(s)" % 174 (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. | 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. |
228 print event.getCause(), " @ ", m5.curTick() | 230 print(event.getCause(), " @ ", m5.curTick()) |
229 sys.exit(event.getCode()) 230 231 232if __name__ == "__m5_main__": 233 main() | 231 sys.exit(event.getCode()) 232 233 234if __name__ == "__m5_main__": 235 main() |