system.hh revision 6029
12391SN/A/*
22391SN/A * Copyright (c) 2002-2005 The Regents of The University of Michigan
32391SN/A * All rights reserved.
42391SN/A *
52391SN/A * Redistribution and use in source and binary forms, with or without
62391SN/A * modification, are permitted provided that the following conditions are
72391SN/A * met: redistributions of source code must retain the above copyright
82391SN/A * notice, this list of conditions and the following disclaimer;
92391SN/A * redistributions in binary form must reproduce the above copyright
102391SN/A * notice, this list of conditions and the following disclaimer in the
112391SN/A * documentation and/or other materials provided with the distribution;
122391SN/A * neither the name of the copyright holders nor the names of its
132391SN/A * contributors may be used to endorse or promote products derived from
142391SN/A * this software without specific prior written permission.
152391SN/A *
162391SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
172391SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
182391SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
192391SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
202391SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
212391SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
222391SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
232391SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
242391SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
252391SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
262391SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
272665Ssaidi@eecs.umich.edu *
282665Ssaidi@eecs.umich.edu * Authors: Ali Saidi
292914Ssaidi@eecs.umich.edu */
302391SN/A
312391SN/A#ifndef __ARCH_SPARC_SYSTEM_HH__
322391SN/A#define __ARCH_SPARC_SYSTEM_HH__
332391SN/A
342391SN/A#include <string>
352391SN/A#include <vector>
362391SN/A
372391SN/A#include "base/loader/symtab.hh"
382391SN/A#include "cpu/pc_event.hh"
392391SN/A#include "kern/system_events.hh"
402391SN/A#include "params/SparcSystem.hh"
412391SN/A#include "sim/sim_object.hh"
423348Sbinkertn@umich.edu#include "sim/system.hh"
432391SN/A
445399Ssaidi@eecs.umich.educlass SparcSystem : public System
452391SN/A{
463879Ssaidi@eecs.umich.edu  public:
472394SN/A    typedef SparcSystemParams Params;
482415SN/A    SparcSystem(Params *p);
493348Sbinkertn@umich.edu    ~SparcSystem();
502394SN/A
512391SN/A/**
522423SN/A * Serialization stuff
532391SN/A */
544762Snate@binkert.org  public:
555399Ssaidi@eecs.umich.edu    virtual void serialize(std::ostream &os);
565399Ssaidi@eecs.umich.edu    virtual void unserialize(Checkpoint *cp, const std::string &section);
572391SN/A
584762Snate@binkert.org    /** reset binary symbol table */
592391SN/A    SymbolTable *resetSymtab;
602391SN/A
612391SN/A    /** hypervison binary symbol table */
624918Snate@binkert.org    SymbolTable *hypervisorSymtab;
634918Snate@binkert.org
642391SN/A    /** openboot symbol table */
653012Ssaidi@eecs.umich.edu    SymbolTable *openbootSymtab;
662391SN/A
672391SN/A    /** nvram symbol table? */
682391SN/A    SymbolTable *nvramSymtab;
692391SN/A
703751Sgblack@eecs.umich.edu    /** hypervisor desc symbol table? */
714762Snate@binkert.org    SymbolTable *hypervisorDescSymtab;
724762Snate@binkert.org
733751Sgblack@eecs.umich.edu    /** partition desc symbol table? */
743012Ssaidi@eecs.umich.edu    SymbolTable *partitionDescSymtab;
755275Ssaidi@eecs.umich.edu
765275Ssaidi@eecs.umich.edu    /** Object pointer for the reset binary */
775275Ssaidi@eecs.umich.edu    ObjectFile *reset;
785275Ssaidi@eecs.umich.edu
792391SN/A    /** Object pointer for the hypervisor code */
802391SN/A    ObjectFile *hypervisor;
812541SN/A
822541SN/A    /** Object pointer for the openboot code */
832541SN/A    ObjectFile *openboot;
844470Sstever@eecs.umich.edu
854470Sstever@eecs.umich.edu    /** Object pointer for the nvram image */
864470Sstever@eecs.umich.edu    ObjectFile *nvram;
874470Sstever@eecs.umich.edu
884467Sstever@eecs.umich.edu    /** Object pointer for the hypervisor description image */
894467Sstever@eecs.umich.edu    ObjectFile *hypervisor_desc;
904467Sstever@eecs.umich.edu
914467Sstever@eecs.umich.edu    /** Object pointer for the partition description image */
922541SN/A    ObjectFile *partition_desc;
932541SN/A
942391SN/A    /** System Tick for syncronized tick across all cpus. */
952391SN/A    Tick sysTick;
963012Ssaidi@eecs.umich.edu
974762Snate@binkert.org    /** functional port to ROM */
982416SN/A    FunctionalPort funcRomPort;
992391SN/A
1002391SN/A    /** functional port to nvram */
1012391SN/A    FunctionalPort funcNvramPort;
1022391SN/A
1032391SN/A    /** functional port to hypervisor description */
1043012Ssaidi@eecs.umich.edu    FunctionalPort funcHypDescPort;
1054040Ssaidi@eecs.umich.edu
1062391SN/A    /** functional port to partition description */
1073012Ssaidi@eecs.umich.edu    FunctionalPort funcPartDescPort;
1082391SN/A
1092391SN/A  protected:
1102391SN/A    const Params *params() const { return (const Params *)_params; }
1112408SN/A
1122408SN/A    /** Add a function-based event to reset binary. */
1132408SN/A    template <class T>
1142409SN/A    T *addResetFuncEvent(const char *lbl)
1152409SN/A    {
1162408SN/A        return addFuncEvent<T>(resetSymtab, lbl);
1172408SN/A    }
1183012Ssaidi@eecs.umich.edu
1193349Sbinkertn@umich.edu    /** Add a function-based event to the hypervisor. */
1203012Ssaidi@eecs.umich.edu    template <class T>
1215399Ssaidi@eecs.umich.edu    T *addHypervisorFuncEvent(const char *lbl)
1225399Ssaidi@eecs.umich.edu    {
1235399Ssaidi@eecs.umich.edu        return addFuncEvent<T>(hypervisorSymtab, lbl);
1245399Ssaidi@eecs.umich.edu    }
1253012Ssaidi@eecs.umich.edu
1262413SN/A    /** Add a function-based event to the openboot. */
1273170Sstever@eecs.umich.edu    template <class T>
1283170Sstever@eecs.umich.edu    T *addOpenbootFuncEvent(const char *lbl)
1293170Sstever@eecs.umich.edu    {
1303170Sstever@eecs.umich.edu        return addFuncEvent<T>(openbootSymtab, lbl);
1313170Sstever@eecs.umich.edu    }
1324626Sstever@eecs.umich.edu
1333170Sstever@eecs.umich.edu    virtual Addr fixFuncEventAddr(Addr addr)
1344626Sstever@eecs.umich.edu    {
1353170Sstever@eecs.umich.edu        //XXX This may eventually have to do something useful.
1363170Sstever@eecs.umich.edu        return addr;
1373170Sstever@eecs.umich.edu    }
1383170Sstever@eecs.umich.edu};
1393170Sstever@eecs.umich.edu
1403170Sstever@eecs.umich.edu#endif
1413170Sstever@eecs.umich.edu
1423170Sstever@eecs.umich.edu