system.hh revision 2632:1bb2f91485ea
16019Shines@cs.fsu.edu/* 26019Shines@cs.fsu.edu * Copyright (c) 2002-2005 The Regents of The University of Michigan 36019Shines@cs.fsu.edu * All rights reserved. 46019Shines@cs.fsu.edu * 56019Shines@cs.fsu.edu * Redistribution and use in source and binary forms, with or without 66019Shines@cs.fsu.edu * modification, are permitted provided that the following conditions are 76019Shines@cs.fsu.edu * met: redistributions of source code must retain the above copyright 86019Shines@cs.fsu.edu * notice, this list of conditions and the following disclaimer; 96019Shines@cs.fsu.edu * redistributions in binary form must reproduce the above copyright 106019Shines@cs.fsu.edu * notice, this list of conditions and the following disclaimer in the 116019Shines@cs.fsu.edu * documentation and/or other materials provided with the distribution; 126019Shines@cs.fsu.edu * neither the name of the copyright holders nor the names of its 136019Shines@cs.fsu.edu * contributors may be used to endorse or promote products derived from 146019Shines@cs.fsu.edu * this software without specific prior written permission. 156019Shines@cs.fsu.edu * 166019Shines@cs.fsu.edu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 176019Shines@cs.fsu.edu * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 186019Shines@cs.fsu.edu * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 196019Shines@cs.fsu.edu * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 206019Shines@cs.fsu.edu * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 216019Shines@cs.fsu.edu * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 226019Shines@cs.fsu.edu * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 236019Shines@cs.fsu.edu * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 246019Shines@cs.fsu.edu * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 256019Shines@cs.fsu.edu * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 266019Shines@cs.fsu.edu * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 276019Shines@cs.fsu.edu */ 286019Shines@cs.fsu.edu 296019Shines@cs.fsu.edu#ifndef __ARCH_ALPHA_SYSTEM_HH__ 306019Shines@cs.fsu.edu#define __ARCH_ALPHA_SYSTEM_HH__ 316019Shines@cs.fsu.edu 326019Shines@cs.fsu.edu#include <string> 336019Shines@cs.fsu.edu#include <vector> 346019Shines@cs.fsu.edu 356019Shines@cs.fsu.edu#include "sim/system.hh" 366019Shines@cs.fsu.edu#include "base/loader/symtab.hh" 376019Shines@cs.fsu.edu#include "cpu/pc_event.hh" 386019Shines@cs.fsu.edu#include "kern/system_events.hh" 396019Shines@cs.fsu.edu#include "sim/sim_object.hh" 406019Shines@cs.fsu.edu 416019Shines@cs.fsu.educlass AlphaSystem : public System 426019Shines@cs.fsu.edu{ 436019Shines@cs.fsu.edu public: 446019Shines@cs.fsu.edu struct Params : public System::Params 456019Shines@cs.fsu.edu { 466019Shines@cs.fsu.edu std::string console_path; 476019Shines@cs.fsu.edu std::string palcode; 486019Shines@cs.fsu.edu uint64_t system_type; 496019Shines@cs.fsu.edu uint64_t system_rev; 506019Shines@cs.fsu.edu }; 516019Shines@cs.fsu.edu 526019Shines@cs.fsu.edu AlphaSystem(Params *p); 536019Shines@cs.fsu.edu 546019Shines@cs.fsu.edu ~AlphaSystem(); 556019Shines@cs.fsu.edu 566019Shines@cs.fsu.edu virtual bool breakpoint(); 576019Shines@cs.fsu.edu 586019Shines@cs.fsu.edu/** 596019Shines@cs.fsu.edu * Serialization stuff 606019Shines@cs.fsu.edu */ 616019Shines@cs.fsu.edu public: 626019Shines@cs.fsu.edu virtual void serialize(std::ostream &os); 636019Shines@cs.fsu.edu virtual void unserialize(Checkpoint *cp, const std::string §ion); 646019Shines@cs.fsu.edu 65 /** 66 * Set the m5AlphaAccess pointer in the console 67 */ 68 void setAlphaAccess(Addr access); 69 70 /** console symbol table */ 71 SymbolTable *consoleSymtab; 72 73 /** pal symbol table */ 74 SymbolTable *palSymtab; 75 76 /** Object pointer for the console code */ 77 ObjectFile *console; 78 79 /** Object pointer for the PAL code */ 80 ObjectFile *pal; 81 82#ifndef NDEBUG 83 /** Event to halt the simulator if the console calls panic() */ 84 BreakPCEvent *consolePanicEvent; 85#endif 86 protected: 87 const Params *params() const { return (const Params *)_params; } 88 89 /** Add a function-based event to PALcode. */ 90 template <class T> 91 T *AlphaSystem::addPalFuncEvent(const char *lbl) 92 { 93 return addFuncEvent<T>(palSymtab, lbl); 94 } 95 96 /** Add a function-based event to the console code. */ 97 template <class T> 98 T *AlphaSystem::addConsoleFuncEvent(const char *lbl) 99 { 100 return addFuncEvent<T>(consoleSymtab, lbl); 101 } 102 103 virtual Addr fixFuncEventAddr(Addr addr); 104 105}; 106 107#endif 108 109