1# Copyright (c) 2010-2012, 2015 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 --- 28 unchanged lines hidden (view full) --- 37# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 38# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39# 40# Authors: Kevin Lim 41 42from m5.objects import * 43from Benchmarks import * 44from m5.util import * |
45import PlatformConfig |
46 47# Populate to reflect supported os types per target ISA 48os_types = { 'alpha' : [ 'linux' ], 49 'mips' : [ 'linux' ], 50 'sparc' : [ 'linux' ], 51 'x86' : [ 'linux' ], 52 'arm' : [ 'linux', 53 'android-gingerbread', --- 149 unchanged lines hidden (view full) --- 203 204 return self 205 206def makeArmSystem(mem_mode, machine_type, num_cpus=1, mdesc=None, 207 dtb_filename=None, bare_metal=False, cmdline=None, 208 external_memory=""): 209 assert machine_type 210 |
211 default_dtbs = { 212 "RealViewEB": None, 213 "RealViewPBX": None, 214 "VExpress_EMM": "vexpress.aarch32.ll_20131205.0-gem5.%dcpu.dtb" % num_cpus, 215 "VExpress_EMM64": "vexpress.aarch64.20140821.dtb", 216 } 217 218 default_kernels = { 219 "RealViewEB": "vmlinux.arm.smp.fb.2.6.38.8", 220 "RealViewPBX": "vmlinux.arm.smp.fb.2.6.38.8", 221 "VExpress_EMM": "vmlinux.aarch32.ll_20131205.0-gem5", 222 "VExpress_EMM64": "vmlinux.aarch64.20140821", 223 } 224 |
225 if bare_metal: 226 self = ArmSystem() 227 else: 228 self = LinuxArmSystem() 229 230 if not mdesc: 231 # generic system 232 mdesc = SysConfig() 233 234 self.readfile = mdesc.script() 235 self.iobus = IOXBar() 236 self.membus = MemBus() 237 self.membus.badaddr_responder.warn_access = "warn" 238 self.bridge = Bridge(delay='50ns') 239 self.bridge.master = self.iobus.slave 240 self.bridge.slave = self.membus.master 241 242 self.mem_mode = mem_mode 243 |
244 platform_class = PlatformConfig.get(machine_type) 245 # Resolve the real platform name, the original machine_type 246 # variable might have been an alias. 247 machine_type = platform_class.__name__ 248 self.realview = platform_class() 249 250 if not dtb_filename and not bare_metal: 251 try: 252 dtb_filename = default_dtbs[machine_type] 253 except KeyError: 254 fatal("No DTB specified and no default DTB known for '%s'" % \ 255 machine_type) 256 257 if isinstance(self.realview, VExpress_EMM64): |
258 if os.path.split(mdesc.disk())[-1] == 'linux-aarch32-ael.img': 259 print "Selected 64-bit ARM architecture, updating default disk image..." 260 mdesc.diskname = 'linaro-minimal-aarch64.img' |
261 262 self.cf0 = CowIdeDisk(driveID='master') 263 self.cf0.childImage(mdesc.disk()) 264 265 # Attach any PCI devices this platform supports 266 self.realview.attachPciDevices() 267 # default to an IDE controller rather than a CF one 268 try: --- 18 unchanged lines hidden (view full) --- 287 fatal("The currently selected ARM platforms doesn't support" \ 288 " the amount of DRAM you've selected. Please try" \ 289 " another platform") 290 291 if bare_metal: 292 # EOT character on UART will end the simulation 293 self.realview.uart.end_on_eot = True 294 else: |
295 if machine_type in default_kernels: 296 self.kernel = binary(default_kernels[machine_type]) |
297 298 if dtb_filename: 299 self.dtb_filename = binary(dtb_filename) |
300 301 self.machine_type = machine_type if machine_type in ArmMachineType.map \ 302 else "DTOnly" 303 |
304 # Ensure that writes to the UART actually go out early in the boot 305 if not cmdline: 306 cmdline = 'earlyprintk=pl011,0x1c090000 console=ttyAMA0 ' + \ 307 'lpj=19988480 norandmaps rw loglevel=8 ' + \ 308 'mem=%(mem)s root=%(rootdev)s' 309 310 # When using external memory, gem5 writes the boot loader to nvmem 311 # and then SST will read from it, but SST can only get to nvmem from --- 349 unchanged lines hidden --- |