arm_generic.py revision 9447:156f74caf0d4
12817Sksewell@umich.edu# Copyright (c) 2012 ARM Limited 29426SAndreas.Sandberg@ARM.com# All rights reserved. 39920Syasuko.eckert@amd.com# 48733Sgeoffrey.blake@arm.com# The license below extends only to copyright in the software and shall 58733Sgeoffrey.blake@arm.com# not be construed as granting a license to any other intellectual 68733Sgeoffrey.blake@arm.com# property including but not limited to intellectual property relating 78733Sgeoffrey.blake@arm.com# to a hardware implementation of the functionality of the software 88733Sgeoffrey.blake@arm.com# licensed hereunder. You may use the software subject to the license 98733Sgeoffrey.blake@arm.com# terms below provided that you ensure that this notice is replicated 108733Sgeoffrey.blake@arm.com# unmodified and in its entirety in all distributions of the software, 118733Sgeoffrey.blake@arm.com# modified or unmodified, in source code or in binary form. 128733Sgeoffrey.blake@arm.com# 138733Sgeoffrey.blake@arm.com# Redistribution and use in source and binary forms, with or without 148733Sgeoffrey.blake@arm.com# modification, are permitted provided that the following conditions are 152817Sksewell@umich.edu# met: redistributions of source code must retain the above copyright 162817Sksewell@umich.edu# notice, this list of conditions and the following disclaimer; 172817Sksewell@umich.edu# redistributions in binary form must reproduce the above copyright 182817Sksewell@umich.edu# notice, this list of conditions and the following disclaimer in the 192817Sksewell@umich.edu# documentation and/or other materials provided with the distribution; 202817Sksewell@umich.edu# neither the name of the copyright holders nor the names of its 212817Sksewell@umich.edu# contributors may be used to endorse or promote products derived from 222817Sksewell@umich.edu# this software without specific prior written permission. 232817Sksewell@umich.edu# 242817Sksewell@umich.edu# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 252817Sksewell@umich.edu# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 262817Sksewell@umich.edu# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 272817Sksewell@umich.edu# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 282817Sksewell@umich.edu# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 292817Sksewell@umich.edu# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 302817Sksewell@umich.edu# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 312817Sksewell@umich.edu# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 322817Sksewell@umich.edu# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 332817Sksewell@umich.edu# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 342817Sksewell@umich.edu# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 352817Sksewell@umich.edu# 362817Sksewell@umich.edu# Authors: Andreas Sandberg 372817Sksewell@umich.edu 382817Sksewell@umich.edufrom abc import ABCMeta, abstractmethod 392817Sksewell@umich.eduimport m5 402817Sksewell@umich.edufrom m5.objects import * 412817Sksewell@umich.edufrom m5.proxy import * 422817Sksewell@umich.edum5.util.addToPath('../configs/common') 432817Sksewell@umich.eduimport FSConfig 442817Sksewell@umich.edufrom Caches import * 452817Sksewell@umich.edufrom base_config import * 462817Sksewell@umich.edu 476658Snate@binkert.orgclass LinuxArmSystemBuilder(object): 488229Snate@binkert.org """Mix-in that implements create_system. 492935Sksewell@umich.edu 502817Sksewell@umich.edu This mix-in is intended as a convenient way of adding an 512834Sksewell@umich.edu ARM-specific create_system method to a class deriving from one of 522834Sksewell@umich.edu the generic base systems. 532834Sksewell@umich.edu """ 548902Sandreas.hansson@arm.com def __init__(self, machine_type): 552834Sksewell@umich.edu """ 562817Sksewell@umich.edu Arguments: 572817Sksewell@umich.edu machine_type -- String describing the platform to simulate 582817Sksewell@umich.edu """ 592817Sksewell@umich.edu self.machine_type = machine_type 602817Sksewell@umich.edu 612817Sksewell@umich.edu def create_system(self): 622817Sksewell@umich.edu system = FSConfig.makeArmSystem(self.mem_mode, 632817Sksewell@umich.edu self.machine_type, 642817Sksewell@umich.edu None, False) 652817Sksewell@umich.edu self.init_system(system) 662817Sksewell@umich.edu return system 672817Sksewell@umich.edu 682817Sksewell@umich.educlass LinuxArmFSSystem(LinuxArmSystemBuilder, 692817Sksewell@umich.edu BaseFSSystem): 702817Sksewell@umich.edu """Basic ARM full system builder.""" 712817Sksewell@umich.edu 722817Sksewell@umich.edu def __init__(self, machine_type='RealView_PBX', **kwargs): 732817Sksewell@umich.edu """Initialize an ARM system that supports full system simulation. 742817Sksewell@umich.edu 752817Sksewell@umich.edu Note: Keyword arguments that are not listed below will be 762817Sksewell@umich.edu passed to the BaseFSSystem. 772817Sksewell@umich.edu 782817Sksewell@umich.edu Keyword Arguments: 792817Sksewell@umich.edu machine_type -- String describing the platform to simulate 802817Sksewell@umich.edu """ 813784Sgblack@eecs.umich.edu BaseSystem.__init__(self, **kwargs) 826022Sgblack@eecs.umich.edu LinuxArmSystemBuilder.__init__(self, machine_type) 833784Sgblack@eecs.umich.edu 843784Sgblack@eecs.umich.educlass LinuxArmFSSystemUniprocessor(LinuxArmSystemBuilder, 856022Sgblack@eecs.umich.edu BaseFSSystemUniprocessor): 863784Sgblack@eecs.umich.edu """Basic ARM full system builder for uniprocessor systems. 878887Sgeoffrey.blake@arm.com 888733Sgeoffrey.blake@arm.com Note: This class is a specialization of the ArmFSSystem and is 899023Sgblack@eecs.umich.edu only really needed to provide backwards compatibility for existing 909023Sgblack@eecs.umich.edu test cases. 919023Sgblack@eecs.umich.edu """ 929023Sgblack@eecs.umich.edu 939023Sgblack@eecs.umich.edu def __init__(self, machine_type='RealView_PBX', **kwargs): 948541Sgblack@eecs.umich.edu BaseFSSystemUniprocessor.__init__(self, **kwargs) 952817Sksewell@umich.edu LinuxArmSystemBuilder.__init__(self, machine_type) 962817Sksewell@umich.edu 972817Sksewell@umich.edu 982817Sksewell@umich.educlass LinuxArmFSSwitcheroo(LinuxArmSystemBuilder, BaseFSSwitcheroo): 9910110Sandreas.hansson@arm.com """Uniprocessor ARM system prepared for CPU switching""" 1002817Sksewell@umich.edu 10110190Sakash.bagdia@arm.com def __init__(self, machine_type='RealView_PBX', **kwargs): 10210190Sakash.bagdia@arm.com BaseFSSwitcheroo.__init__(self, **kwargs) 10310190Sakash.bagdia@arm.com LinuxArmSystemBuilder.__init__(self, machine_type) 10411005Sandreas.sandberg@arm.com