system.hh revision 11168
12158SN/A/* 22158SN/A * Copyright (c) 2002-2005 The Regents of The University of Michigan 32158SN/A * All rights reserved. 42158SN/A * 52158SN/A * Redistribution and use in source and binary forms, with or without 62158SN/A * modification, are permitted provided that the following conditions are 72158SN/A * met: redistributions of source code must retain the above copyright 82158SN/A * notice, this list of conditions and the following disclaimer; 92158SN/A * redistributions in binary form must reproduce the above copyright 102158SN/A * notice, this list of conditions and the following disclaimer in the 112158SN/A * documentation and/or other materials provided with the distribution; 122158SN/A * neither the name of the copyright holders nor the names of its 132158SN/A * contributors may be used to endorse or promote products derived from 142158SN/A * this software without specific prior written permission. 152158SN/A * 162158SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 172158SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 182158SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 192158SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 202158SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 212158SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 222158SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 232158SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 242158SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 252158SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 262158SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 272665Ssaidi@eecs.umich.edu * 282665Ssaidi@eecs.umich.edu * Authors: Ali Saidi 292760Sbinkertn@umich.edu * Nathan Binkert 302158SN/A */ 312158SN/A 322158SN/A#ifndef __ARCH_ALPHA_SYSTEM_HH__ 332158SN/A#define __ARCH_ALPHA_SYSTEM_HH__ 342158SN/A 352158SN/A#include <string> 362158SN/A#include <vector> 372158SN/A 382158SN/A#include "base/loader/symtab.hh" 392158SN/A#include "cpu/pc_event.hh" 402158SN/A#include "kern/system_events.hh" 419847Sandreas.hansson@arm.com#include "mem/fs_translating_port_proxy.hh" 424762Snate@binkert.org#include "params/AlphaSystem.hh" 432158SN/A#include "sim/sim_object.hh" 444762Snate@binkert.org#include "sim/system.hh" 452158SN/A 462158SN/Aclass AlphaSystem : public System 472158SN/A{ 482158SN/A public: 494762Snate@binkert.org typedef AlphaSystemParams Params; 502158SN/A AlphaSystem(Params *p); 512158SN/A ~AlphaSystem(); 522158SN/A 532158SN/A public: 548706Sandreas.hansson@arm.com 558706Sandreas.hansson@arm.com /** 568706Sandreas.hansson@arm.com * Initialise the state of the system. 578706Sandreas.hansson@arm.com */ 588706Sandreas.hansson@arm.com virtual void initState(); 598706Sandreas.hansson@arm.com 605569Snate@binkert.org /** 615569Snate@binkert.org * Serialization stuff 625569Snate@binkert.org */ 6311168Sandreas.hansson@arm.com void serializeSymtab(CheckpointOut &cp) const override; 6411168Sandreas.hansson@arm.com void unserializeSymtab(CheckpointIn &cp) override; 652158SN/A 669153Snilay@cs.wisc.edu /** Override startup() to provide a path to call setupFuncEvents() 678885SAli.Saidi@ARM.com */ 689153Snilay@cs.wisc.edu virtual void startup(); 698885SAli.Saidi@ARM.com 702158SN/A /** 712158SN/A * Set the m5AlphaAccess pointer in the console 722158SN/A */ 732158SN/A void setAlphaAccess(Addr access); 742158SN/A 752158SN/A /** console symbol table */ 762158SN/A SymbolTable *consoleSymtab; 772158SN/A 782158SN/A /** pal symbol table */ 792158SN/A SymbolTable *palSymtab; 802158SN/A 812158SN/A /** Object pointer for the console code */ 822158SN/A ObjectFile *console; 832158SN/A 842158SN/A /** Object pointer for the PAL code */ 852158SN/A ObjectFile *pal; 862158SN/A 872158SN/A#ifndef NDEBUG 882158SN/A /** Event to halt the simulator if the console calls panic() */ 892158SN/A BreakPCEvent *consolePanicEvent; 902158SN/A#endif 915569Snate@binkert.org 922158SN/A protected: 938741Sgblack@eecs.umich.edu Tick intrFreq; 948741Sgblack@eecs.umich.edu 959847Sandreas.hansson@arm.com /** 969847Sandreas.hansson@arm.com * Proxy used to copy arguments directly into kernel memory. 979847Sandreas.hansson@arm.com */ 989847Sandreas.hansson@arm.com FSTranslatingPortProxy virtProxy; 999847Sandreas.hansson@arm.com 1002158SN/A const Params *params() const { return (const Params *)_params; } 1012158SN/A 1028885SAli.Saidi@ARM.com 1038885SAli.Saidi@ARM.com /** Setup all the function events. Must be done after init() for Alpha since 1048885SAli.Saidi@ARM.com * fixFuncEvent() requires a function port 1058885SAli.Saidi@ARM.com */ 1068885SAli.Saidi@ARM.com virtual void setupFuncEvents(); 1078885SAli.Saidi@ARM.com 1082158SN/A /** Add a function-based event to PALcode. */ 1092158SN/A template <class T> 1105569Snate@binkert.org T * 1115569Snate@binkert.org addPalFuncEvent(const char *lbl) 1122158SN/A { 1132158SN/A return addFuncEvent<T>(palSymtab, lbl); 1142158SN/A } 1152158SN/A 1162158SN/A /** Add a function-based event to the console code. */ 1172158SN/A template <class T> 1185569Snate@binkert.org T * 1195569Snate@binkert.org addConsoleFuncEvent(const char *lbl) 1202158SN/A { 1212158SN/A return addFuncEvent<T>(consoleSymtab, lbl); 1222158SN/A } 1232158SN/A 1242158SN/A virtual Addr fixFuncEventAddr(Addr addr); 1258741Sgblack@eecs.umich.edu 1268741Sgblack@eecs.umich.edu public: 1278741Sgblack@eecs.umich.edu void setIntrFreq(Tick freq) { intrFreq = freq; } 1282158SN/A}; 1292158SN/A 1305569Snate@binkert.org#endif // __ARCH_ALPHA_SYSTEM_HH__ 1312158SN/A 132