system.hh revision 3553
14120Sgblack@eecs.umich.edu/*
24120Sgblack@eecs.umich.edu * Copyright (c) 2002-2005 The Regents of The University of Michigan
37087Snate@binkert.org * All rights reserved.
47087Snate@binkert.org *
57087Snate@binkert.org * Redistribution and use in source and binary forms, with or without
67087Snate@binkert.org * modification, are permitted provided that the following conditions are
77087Snate@binkert.org * met: redistributions of source code must retain the above copyright
87087Snate@binkert.org * notice, this list of conditions and the following disclaimer;
97087Snate@binkert.org * redistributions in binary form must reproduce the above copyright
107087Snate@binkert.org * notice, this list of conditions and the following disclaimer in the
117087Snate@binkert.org * documentation and/or other materials provided with the distribution;
127087Snate@binkert.org * neither the name of the copyright holders nor the names of its
137087Snate@binkert.org * contributors may be used to endorse or promote products derived from
147087Snate@binkert.org * this software without specific prior written permission.
154120Sgblack@eecs.umich.edu *
164120Sgblack@eecs.umich.edu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
174120Sgblack@eecs.umich.edu * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
184120Sgblack@eecs.umich.edu * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
194120Sgblack@eecs.umich.edu * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
204120Sgblack@eecs.umich.edu * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
214120Sgblack@eecs.umich.edu * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
224120Sgblack@eecs.umich.edu * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
234120Sgblack@eecs.umich.edu * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
244120Sgblack@eecs.umich.edu * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
254120Sgblack@eecs.umich.edu * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
264120Sgblack@eecs.umich.edu * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
274120Sgblack@eecs.umich.edu *
284120Sgblack@eecs.umich.edu * Authors: Ali Saidi
294120Sgblack@eecs.umich.edu */
304120Sgblack@eecs.umich.edu
314120Sgblack@eecs.umich.edu#ifndef __ARCH_SPARC_SYSTEM_HH__
324120Sgblack@eecs.umich.edu#define __ARCH_SPARC_SYSTEM_HH__
334120Sgblack@eecs.umich.edu
344120Sgblack@eecs.umich.edu#include <string>
354120Sgblack@eecs.umich.edu#include <vector>
364120Sgblack@eecs.umich.edu
374120Sgblack@eecs.umich.edu#include "base/loader/symtab.hh"
384120Sgblack@eecs.umich.edu#include "cpu/pc_event.hh"
394120Sgblack@eecs.umich.edu#include "kern/system_events.hh"
404120Sgblack@eecs.umich.edu#include "sim/sim_object.hh"
414120Sgblack@eecs.umich.edu#include "sim/system.hh"
424120Sgblack@eecs.umich.edu
434202Sbinkertn@umich.educlass SparcSystem : public System
445069Sgblack@eecs.umich.edu{
454202Sbinkertn@umich.edu  public:
465659Sgblack@eecs.umich.edu    struct Params : public System::Params
474601Sgblack@eecs.umich.edu    {
485124Sgblack@eecs.umich.edu        std::string reset_bin;
497966Sgblack@eecs.umich.edu        std::string hypervisor_bin;
505083Sgblack@eecs.umich.edu        std::string openboot_bin;
514679Sgblack@eecs.umich.edu        std::string boot_osflags;
526515Sgblack@eecs.umich.edu        uint64_t system_type;
535083Sgblack@eecs.umich.edu        uint64_t system_rev;
544679Sgblack@eecs.umich.edu    };
554679Sgblack@eecs.umich.edu
568745Sgblack@eecs.umich.edu    SparcSystem(Params *p);
576313Sgblack@eecs.umich.edu
586365Sgblack@eecs.umich.edu    ~SparcSystem();
595124Sgblack@eecs.umich.edu
608752Sgblack@eecs.umich.edu    virtual bool breakpoint();
614249Sgblack@eecs.umich.edu
624240Sgblack@eecs.umich.edu/**
634202Sbinkertn@umich.edu * Serialization stuff
644997Sgblack@eecs.umich.edu */
657624Sgblack@eecs.umich.edu  public:
665135Sgblack@eecs.umich.edu    virtual void serialize(std::ostream &os);
678753Sgblack@eecs.umich.edu    virtual void unserialize(Checkpoint *cp, const std::string &section);
684997Sgblack@eecs.umich.edu
698745Sgblack@eecs.umich.edu    /** reset binary symbol table */
706365Sgblack@eecs.umich.edu    SymbolTable *resetSymtab;
718740Sgblack@eecs.umich.edu
726365Sgblack@eecs.umich.edu    /** hypervison binary symbol table */
738740Sgblack@eecs.umich.edu    SymbolTable *hypervisorSymtab;
748745Sgblack@eecs.umich.edu
758752Sgblack@eecs.umich.edu    /** openboot symbol table */
768752Sgblack@eecs.umich.edu    SymbolTable *openbootSymtab;
778335Snate@binkert.org
788335Snate@binkert.org    /** Object pointer for the reset binary */
794120Sgblack@eecs.umich.edu    ObjectFile *reset;
804202Sbinkertn@umich.edu
815649Sgblack@eecs.umich.edu    /** Object pointer for the hypervisor code */
825132Sgblack@eecs.umich.edu    ObjectFile *hypervisor;
835132Sgblack@eecs.umich.edu
844202Sbinkertn@umich.edu    /** Object pointer for the openboot code */
855299Sgblack@eecs.umich.edu    ObjectFile *openboot;
865132Sgblack@eecs.umich.edu
875086Sgblack@eecs.umich.edu    /** System Tick for syncronized tick across all cpus. */
884202Sbinkertn@umich.edu    Tick sysTick;
894202Sbinkertn@umich.edu
904120Sgblack@eecs.umich.edu  protected:
914202Sbinkertn@umich.edu    const Params *params() const { return (const Params *)_params; }
924202Sbinkertn@umich.edu
934202Sbinkertn@umich.edu    /** Add a function-based event to reset binary. */
944120Sgblack@eecs.umich.edu    template <class T>
955069Sgblack@eecs.umich.edu    T *SparcSystem::addResetFuncEvent(const char *lbl)
965081Sgblack@eecs.umich.edu    {
975081Sgblack@eecs.umich.edu        return addFuncEvent<T>(resetSymtab, lbl);
985081Sgblack@eecs.umich.edu    }
995081Sgblack@eecs.umich.edu
1005081Sgblack@eecs.umich.edu    /** Add a function-based event to the hypervisor. */
1015081Sgblack@eecs.umich.edu    template <class T>
1025081Sgblack@eecs.umich.edu    T *SparcSystem::addHypervisorFuncEvent(const char *lbl)
1035081Sgblack@eecs.umich.edu    {
1045081Sgblack@eecs.umich.edu        return addFuncEvent<T>(hypervisorSymtab, lbl);
1055081Sgblack@eecs.umich.edu    }
1065081Sgblack@eecs.umich.edu
1075081Sgblack@eecs.umich.edu    /** Add a function-based event to the openboot. */
1085081Sgblack@eecs.umich.edu    template <class T>
1095081Sgblack@eecs.umich.edu    T *SparcSystem::addOpenbootFuncEvent(const char *lbl)
1105081Sgblack@eecs.umich.edu    {
1115081Sgblack@eecs.umich.edu        return addFuncEvent<T>(openbootSymtab, lbl);
1125081Sgblack@eecs.umich.edu    }
1135081Sgblack@eecs.umich.edu
1145081Sgblack@eecs.umich.edu    virtual Addr fixFuncEventAddr(Addr addr)
1155081Sgblack@eecs.umich.edu    {
1165081Sgblack@eecs.umich.edu        //XXX This may eventually have to do something useful.
1175081Sgblack@eecs.umich.edu        return addr;
1185081Sgblack@eecs.umich.edu    }
1195081Sgblack@eecs.umich.edu};
1205081Sgblack@eecs.umich.edu
1215081Sgblack@eecs.umich.edu#endif
1225081Sgblack@eecs.umich.edu
1235081Sgblack@eecs.umich.edu