Deleted Added
sdiff udiff text old ( 14032:f65b663b0df8 ) new ( 14178:f68430623245 )
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
9# terms below provided that you ensure that this notice is replicated

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

49import m5
50import m5.util
51from m5.objects import *
52
53m5.util.addToPath("../../")
54
55from common import SysPaths
56from common import CpuConfig
57from common.cores.arm import ex5_big, ex5_LITTLE
58
59import devices
60from devices import AtomicCluster, KvmCluster
61
62
63default_kernel = 'vmlinux4.3.aarch64'
64default_disk = 'aarch64-ubuntu-trusty-headless.img'
65default_rcs = 'bootscript.rcS'
66
67default_mem_size= "2GB"
68
69def _to_ticks(value):
70 """Helper function to convert a latency from string format to Ticks"""
71

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

109class Ex5LittleCluster(devices.CpuCluster):
110 def __init__(self, system, num_cpus, cpu_clock,
111 cpu_voltage="1.0V"):
112 cpu_config = [ CpuConfig.get("ex5_LITTLE"), ex5_LITTLE.L1I,
113 ex5_LITTLE.L1D, ex5_LITTLE.WalkCache, ex5_LITTLE.L2 ]
114 super(Ex5LittleCluster, self).__init__(system, num_cpus, cpu_clock,
115 cpu_voltage, *cpu_config)
116
117def createSystem(caches, kernel, bootscript, disks=[]):
118 sys = devices.SimpleSystem(caches, default_mem_size,
119 kernel=SysPaths.binary(kernel),
120 readfile=bootscript)
121
122 sys.mem_ctrls = [ SimpleMemory(range=r, port=sys.membus.master)
123 for r in sys.mem_ranges ]
124
125 sys.connect()
126

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

152 cpu_types["kvm"] = (KvmCluster, KvmCluster)
153
154
155def addOptions(parser):
156 parser.add_argument("--restore-from", type=str, default=None,
157 help="Restore from checkpoint")
158 parser.add_argument("--dtb", type=str, default=None,
159 help="DTB file to load")
160 parser.add_argument("--kernel", type=str, default=default_kernel,
161 help="Linux kernel")
162 parser.add_argument("--disk", action="append", type=str, default=[],
163 help="Disks to instantiate")
164 parser.add_argument("--bootscript", type=str, default=default_rcs,
165 help="Linux bootscript")
166 parser.add_argument("--cpu-type", type=str, choices=cpu_types.keys(),
167 default="timing",
168 help="CPU simulation mode. Default: %(default)s")
169 parser.add_argument("--kernel-init", type=str, default="/sbin/init",

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

198
199 kernel_cmd = [
200 "earlyprintk=pl011,0x1c090000",
201 "console=ttyAMA0",
202 "lpj=19988480",
203 "norandmaps",
204 "loglevel=8",
205 "mem=%s" % default_mem_size,
206 "root=/dev/vda1",
207 "rw",
208 "init=%s" % options.kernel_init,
209 "vmalloc=768MB",
210 ]
211
212 root = Root(full_system=True)
213
214 disks = [default_disk] if len(options.disk) == 0 else options.disk
215 system = createSystem(options.caches,
216 options.kernel,
217 options.bootscript,
218 disks=disks)
219
220 root.system = system
221 system.boot_osflags = " ".join(kernel_cmd)
222
223 if options.big_cpus + options.little_cpus == 0:
224 m5.util.panic("Empty CPU clusters")
225

--- 114 unchanged lines hidden ---