system.hh revision 2986
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 "sim/system.hh" 392158SN/A#include "base/loader/symtab.hh" 402158SN/A#include "cpu/pc_event.hh" 412158SN/A#include "kern/system_events.hh" 422158SN/A#include "sim/sim_object.hh" 432158SN/A 442158SN/Aclass AlphaSystem : public System 452158SN/A{ 462158SN/A public: 472158SN/A struct Params : public System::Params 482158SN/A { 492158SN/A std::string console_path; 502158SN/A std::string palcode; 512158SN/A uint64_t system_type; 522158SN/A uint64_t system_rev; 532158SN/A }; 542158SN/A 552158SN/A AlphaSystem(Params *p); 562158SN/A 572158SN/A ~AlphaSystem(); 582158SN/A 592158SN/A virtual bool breakpoint(); 602158SN/A 612158SN/A/** 622158SN/A * Serialization stuff 632158SN/A */ 642158SN/A public: 652158SN/A virtual void serialize(std::ostream &os); 662158SN/A virtual void unserialize(Checkpoint *cp, const std::string §ion); 672158SN/A 682158SN/A /** 692158SN/A * Set the m5AlphaAccess pointer in the console 702158SN/A */ 712158SN/A void setAlphaAccess(Addr access); 722158SN/A 732158SN/A /** console symbol table */ 742158SN/A SymbolTable *consoleSymtab; 752158SN/A 762158SN/A /** pal symbol table */ 772158SN/A SymbolTable *palSymtab; 782158SN/A 792158SN/A /** Object pointer for the console code */ 802158SN/A ObjectFile *console; 812158SN/A 822158SN/A /** Object pointer for the PAL code */ 832158SN/A ObjectFile *pal; 842158SN/A 852158SN/A#ifndef NDEBUG 862158SN/A /** Event to halt the simulator if the console calls panic() */ 872158SN/A BreakPCEvent *consolePanicEvent; 882158SN/A#endif 892158SN/A protected: 902158SN/A const Params *params() const { return (const Params *)_params; } 912158SN/A 922158SN/A /** Add a function-based event to PALcode. */ 932158SN/A template <class T> 942158SN/A T *AlphaSystem::addPalFuncEvent(const char *lbl) 952158SN/A { 962158SN/A return addFuncEvent<T>(palSymtab, lbl); 972158SN/A } 982158SN/A 992158SN/A /** Add a function-based event to the console code. */ 1002158SN/A template <class T> 1012158SN/A T *AlphaSystem::addConsoleFuncEvent(const char *lbl) 1022158SN/A { 1032158SN/A return addFuncEvent<T>(consoleSymtab, lbl); 1042158SN/A } 1052158SN/A 1062158SN/A virtual Addr fixFuncEventAddr(Addr addr); 1072158SN/A 1082158SN/A}; 1092158SN/A 1102158SN/A#endif 1112158SN/A 112