system.hh revision 5222:bb733a878f85
11689SN/A/* 22325SN/A * Copyright (c) 2007 MIPS Technologies, Inc. 31689SN/A * All rights reserved. 41689SN/A * 51689SN/A * Redistribution and use in source and binary forms, with or without 61689SN/A * modification, are permitted provided that the following conditions are 71689SN/A * met: redistributions of source code must retain the above copyright 81689SN/A * notice, this list of conditions and the following disclaimer; 91689SN/A * redistributions in binary form must reproduce the above copyright 101689SN/A * notice, this list of conditions and the following disclaimer in the 111689SN/A * documentation and/or other materials provided with the distribution; 121689SN/A * neither the name of the copyright holders nor the names of its 131689SN/A * contributors may be used to endorse or promote products derived from 141689SN/A * this software without specific prior written permission. 151689SN/A * 161689SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 171689SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 181689SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 191689SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 201689SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 211689SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 221689SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 231689SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 241689SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 251689SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 261689SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 272665Ssaidi@eecs.umich.edu * 282665Ssaidi@eecs.umich.edu * Authors: Ali Saidi 292756Sksewell@umich.edu * Nathan Binkert 301689SN/A * Jaidev Patwardhan 311689SN/A */ 321858SN/A 332733Sktlim@umich.edu#ifndef __ARCH_MIPS_SYSTEM_HH__ 341858SN/A#define __ARCH_MIPS_SYSTEM_HH__ 354762Snate@binkert.org 364762Snate@binkert.org#include <string> 374762Snate@binkert.org#include <vector> 384762Snate@binkert.org 394762Snate@binkert.org#include "sim/system.hh" 404762Snate@binkert.org#include "base/loader/symtab.hh" 414762Snate@binkert.org#include "base/loader/hex_file.hh" 424762Snate@binkert.org#include "cpu/pc_event.hh" 434762Snate@binkert.org#include "kern/system_events.hh" 441858SN/A#include "params/MipsSystem.hh" 452356SN/A#include "sim/sim_object.hh" 461060SN/A 471060SN/Aclass MipsSystem : public System 481060SN/A{ 491060SN/A public: 501060SN/A typedef MipsSystemParams Params; 512794Sktlim@umich.edu MipsSystem(Params *p); 522794Sktlim@umich.edu ~MipsSystem(); 532794Sktlim@umich.edu 542794Sktlim@umich.edu virtual bool breakpoint(); 555529Snate@binkert.org 565529Snate@binkert.org/** 572669Sktlim@umich.edu * Serialization stuff 581060SN/A */ 595529Snate@binkert.org public: 602292SN/A virtual void serialize(std::ostream &os); 611060SN/A virtual void unserialize(Checkpoint *cp, const std::string §ion); 621060SN/A 631060SN/A /** 642292SN/A * Set the m5MipsAccess pointer in the console 652733Sktlim@umich.edu */ 662292SN/A void setMipsAccess(Addr access); 672292SN/A 682292SN/A#if FULL_SYSTEM 692292SN/A /** console symbol table */ 701060SN/A SymbolTable *consoleSymtab; 711755SN/A 721060SN/A /** Object pointer for the console code */ 731060SN/A ObjectFile *console; 741060SN/A 751060SN/A /** Used by some Bare Iron Configurations */ 761060SN/A HexFile *hexFile; 771060SN/A#endif 781755SN/A 791060SN/A#ifndef NDEBUG 801060SN/A /** Event to halt the simulator if the console calls panic() */ 811060SN/A BreakPCEvent *consolePanicEvent; 821060SN/A#endif 831060SN/A 841060SN/A protected: 855336Shines@cs.fsu.edu const Params *params() const { return (const Params *)_params; } 861060SN/A 874873Sstever@eecs.umich.edu 881060SN/A#if FULL_SYSTEM 891060SN/A /** Add a function-based event to the console code. */ 901060SN/A template <class T> 912829Sksewell@umich.edu T *addConsoleFuncEvent(const char *lbl) 923221Sktlim@umich.edu { 932829Sksewell@umich.edu return addFuncEvent<T>(consoleSymtab, lbl); 942829Sksewell@umich.edu } 952829Sksewell@umich.edu 962829Sksewell@umich.edu virtual Addr fixFuncEventAddr(Addr addr); 972829Sksewell@umich.edu#endif 982829Sksewell@umich.edu 992829Sksewell@umich.edu}; 1002829Sksewell@umich.edu 1012829Sksewell@umich.edu#endif 1022829Sksewell@umich.edu 1032829Sksewell@umich.edu