fs_bigLITTLE.py (14032:f65b663b0df8) fs_bigLITTLE.py (14178:f68430623245)
1# Copyright (c) 2016-2017 ARM Limited
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
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
57from common.cores.arm import ex5_big, ex5_LITTLE
58
59import devices
60from devices import AtomicCluster, KvmCluster
61
62
58from common.cores.arm import ex5_big, ex5_LITTLE
59
60import devices
61from devices import AtomicCluster, KvmCluster
62
63
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
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,
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(),
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")
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")
160 parser.add_argument("--kernel", type=str, default=default_kernel,
164 parser.add_argument("--kernel", type=str, required=True,
161 help="Linux kernel")
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")
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,
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,
206 "root=/dev/vda1",
216 "root=%s" % options.root,
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,
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,
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 ---
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 ---