1# Copyright (c) 2016-2017, 2019 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 import PlatformConfig |
58from common.cores.arm import ex5_big, ex5_LITTLE 59 60import devices 61from devices import AtomicCluster, KvmCluster 62 63 |
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, 118 machine_type="VExpress_GEM5", disks=[]): 119 platform = PlatformConfig.get(machine_type) 120 m5.util.inform("Simulated platform: %s", platform.__name__) 121 122 sys = devices.SimpleSystem(caches, default_mem_size, platform(), |
123 kernel=SysPaths.binary(kernel), 124 readfile=bootscript) 125 126 sys.mem_ctrls = [ SimpleMemory(range=r, port=sys.membus.master) 127 for r in sys.mem_ranges ] 128 129 sys.connect() 130 --- 25 unchanged lines hidden (view full) --- 156 cpu_types["kvm"] = (KvmCluster, KvmCluster) 157 158 159def addOptions(parser): 160 parser.add_argument("--restore-from", type=str, default=None, 161 help="Restore from checkpoint") 162 parser.add_argument("--dtb", type=str, default=None, 163 help="DTB file to load") |
164 parser.add_argument("--kernel", type=str, required=True, |
165 help="Linux kernel") |
166 parser.add_argument("--root", type=str, default="/dev/vda1", 167 help="Specify the kernel CLI root= argument") 168 parser.add_argument("--machine-type", type=str, 169 choices=PlatformConfig.platform_names(), 170 default="VExpress_GEM5", 171 help="Hardware platform class") |
172 parser.add_argument("--disk", action="append", type=str, default=[], 173 help="Disks to instantiate") 174 parser.add_argument("--bootscript", type=str, default=default_rcs, 175 help="Linux bootscript") 176 parser.add_argument("--cpu-type", type=str, choices=cpu_types.keys(), 177 default="timing", 178 help="CPU simulation mode. Default: %(default)s") 179 parser.add_argument("--kernel-init", type=str, default="/sbin/init", --- 28 unchanged lines hidden (view full) --- 208 209 kernel_cmd = [ 210 "earlyprintk=pl011,0x1c090000", 211 "console=ttyAMA0", 212 "lpj=19988480", 213 "norandmaps", 214 "loglevel=8", 215 "mem=%s" % default_mem_size, |
216 "root=%s" % options.root, |
217 "rw", 218 "init=%s" % options.kernel_init, 219 "vmalloc=768MB", 220 ] 221 222 root = Root(full_system=True) 223 224 disks = [default_disk] if len(options.disk) == 0 else options.disk 225 system = createSystem(options.caches, 226 options.kernel, 227 options.bootscript, |
228 options.machine_type, |
229 disks=disks) 230 231 root.system = system 232 system.boot_osflags = " ".join(kernel_cmd) 233 234 if options.big_cpus + options.little_cpus == 0: 235 m5.util.panic("Empty CPU clusters") 236 --- 114 unchanged lines hidden --- |