system.hh revision 8601
14202Sbinkertn@umich.edu/* 212966SMatteo.Andreozzi@arm.com * Copyright (c) 2010 ARM Limited 312966SMatteo.Andreozzi@arm.com * All rights reserved 412966SMatteo.Andreozzi@arm.com * 512966SMatteo.Andreozzi@arm.com * The license below extends only to copyright in the software and shall 612966SMatteo.Andreozzi@arm.com * not be construed as granting a license to any other intellectual 712966SMatteo.Andreozzi@arm.com * property including but not limited to intellectual property relating 812966SMatteo.Andreozzi@arm.com * to a hardware implementation of the functionality of the software 912966SMatteo.Andreozzi@arm.com * licensed hereunder. You may use the software subject to the license 1012966SMatteo.Andreozzi@arm.com * terms below provided that you ensure that this notice is replicated 1112966SMatteo.Andreozzi@arm.com * unmodified and in its entirety in all distributions of the software, 1212966SMatteo.Andreozzi@arm.com * modified or unmodified, in source code or in binary form. 1312966SMatteo.Andreozzi@arm.com * 1412966SMatteo.Andreozzi@arm.com * Copyright (c) 2002-2005 The Regents of The University of Michigan 154202Sbinkertn@umich.edu * All rights reserved. 164202Sbinkertn@umich.edu * 174202Sbinkertn@umich.edu * Redistribution and use in source and binary forms, with or without 184202Sbinkertn@umich.edu * modification, are permitted provided that the following conditions are 194202Sbinkertn@umich.edu * met: redistributions of source code must retain the above copyright 204202Sbinkertn@umich.edu * notice, this list of conditions and the following disclaimer; 214202Sbinkertn@umich.edu * redistributions in binary form must reproduce the above copyright 224202Sbinkertn@umich.edu * notice, this list of conditions and the following disclaimer in the 234202Sbinkertn@umich.edu * documentation and/or other materials provided with the distribution; 244202Sbinkertn@umich.edu * neither the name of the copyright holders nor the names of its 254202Sbinkertn@umich.edu * contributors may be used to endorse or promote products derived from 264202Sbinkertn@umich.edu * this software without specific prior written permission. 274202Sbinkertn@umich.edu * 284202Sbinkertn@umich.edu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 294202Sbinkertn@umich.edu * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 304202Sbinkertn@umich.edu * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 314202Sbinkertn@umich.edu * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 324202Sbinkertn@umich.edu * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 334202Sbinkertn@umich.edu * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 344202Sbinkertn@umich.edu * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 354202Sbinkertn@umich.edu * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 364202Sbinkertn@umich.edu * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 374202Sbinkertn@umich.edu * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 384202Sbinkertn@umich.edu * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 394202Sbinkertn@umich.edu * 404202Sbinkertn@umich.edu * Authors: Ali Saidi 414202Sbinkertn@umich.edu */ 424202Sbinkertn@umich.edu 434202Sbinkertn@umich.edu#ifndef __ARCH_ARM_SYSTEM_HH__ 444202Sbinkertn@umich.edu#define __ARCH_ARM_SYSTEM_HH__ 4510996Sandreas.sandberg@arm.com 4610996Sandreas.sandberg@arm.com#include <string> 479398Sandreas.hansson@arm.com#include <vector> 489850Sandreas.hansson@arm.com 499259SAli.Saidi@ARM.com#include "kern/linux/events.hh" 504486Sbinkertn@umich.edu#include "params/ArmSystem.hh" 5110146Sandreas.hansson@arm.com#include "sim/sim_object.hh" 5210478SAndrew.Bardsley@arm.com#include "sim/system.hh" 5310478SAndrew.Bardsley@arm.com 546165Ssanchezd@stanford.educlass ArmSystem : public System 559850Sandreas.hansson@arm.com{ 5610405Sandreas.hansson@arm.com protected: 5711184Serfan.azarkhish@unibo.it /** 5811185Serfan.azarkhish@unibo.it * PC based event to skip the dprink() call and emulate its 5912802Sandreas.sandberg@arm.com * functionality 606168Snate@binkert.org */ 619850Sandreas.hansson@arm.com Linux::DebugPrintkEvent *debugPrintkEvent; 629259SAli.Saidi@ARM.com 634202Sbinkertn@umich.edu /** 6410405Sandreas.hansson@arm.com * Pointer to the bootloader object 6510431SOmar.Naji@arm.com */ 6610146Sandreas.hansson@arm.com ObjectFile *bootldr; 6710478SAndrew.Bardsley@arm.com 6810478SAndrew.Bardsley@arm.com public: 694202Sbinkertn@umich.edu typedef ArmSystemParams Params; 708761Sgblack@eecs.umich.edu const Params * 7110405Sandreas.hansson@arm.com params() const 724202Sbinkertn@umich.edu { 734202Sbinkertn@umich.edu return dynamic_cast<const Params *>(_params); 748914Sandreas.hansson@arm.com } 7510405Sandreas.hansson@arm.com 7610405Sandreas.hansson@arm.com ArmSystem(Params *p); 7710405Sandreas.hansson@arm.com ~ArmSystem(); 7810405Sandreas.hansson@arm.com 7910614Skanishk.sugand@arm.com void initState(); 804202Sbinkertn@umich.edu 8110405Sandreas.hansson@arm.com /** Check if an address should be uncacheable until all caches are enabled. 8211184Serfan.azarkhish@unibo.it * This exits because coherence on some addresses at boot is maintained via 8311185Serfan.azarkhish@unibo.it * sw coherence until the caches are enbaled. Since we don't support sw 8412802Sandreas.sandberg@arm.com * coherence operations in gem5, this is a method that allows a system 856168Snate@binkert.org * type to designate certain addresses that should remain uncachebale 869850Sandreas.hansson@arm.com * for a while. 879850Sandreas.hansson@arm.com */ 889850Sandreas.hansson@arm.com virtual bool adderBootUncacheable(Addr a) { return false; } 898763Sgblack@eecs.umich.edu 907768SAli.Saidi@ARM.com virtual Addr fixFuncEventAddr(Addr addr) 9110131Sandreas.hansson@arm.com { 9210131Sandreas.hansson@arm.com // Remove the low bit that thumb symbols have set 9310131Sandreas.hansson@arm.com // but that aren't actually odd aligned 9410131Sandreas.hansson@arm.com if (addr & 0x1) 9510066Sandreas.hansson@arm.com return addr & ~1; 9610612SMarco.Elver@ARM.com return addr; 9710612SMarco.Elver@ARM.com } 9810612SMarco.Elver@ARM.com}; 9910612SMarco.Elver@ARM.com 10010405Sandreas.hansson@arm.com#endif 10110405Sandreas.hansson@arm.com 10210405Sandreas.hansson@arm.com