isa.hh revision 10033
12SN/A/*
21762SN/A * Copyright (c) 2009 The Regents of The University of Michigan
32SN/A * Copyright (c) 2009 The University of Edinburgh
42SN/A * All rights reserved.
52SN/A *
62SN/A * Redistribution and use in source and binary forms, with or without
72SN/A * modification, are permitted provided that the following conditions are
82SN/A * met: redistributions of source code must retain the above copyright
92SN/A * notice, this list of conditions and the following disclaimer;
102SN/A * redistributions in binary form must reproduce the above copyright
112SN/A * notice, this list of conditions and the following disclaimer in the
122SN/A * documentation and/or other materials provided with the distribution;
132SN/A * neither the name of the copyright holders nor the names of its
142SN/A * contributors may be used to endorse or promote products derived from
152SN/A * this software without specific prior written permission.
162SN/A *
172SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
182SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
192SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
202SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
212SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
222SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
232SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
242SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
252SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
262SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
272665Ssaidi@eecs.umich.edu * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
282665Ssaidi@eecs.umich.edu *
292665Ssaidi@eecs.umich.edu * Authors: Gabe Black
302665Ssaidi@eecs.umich.edu *          Timothy M. Jones
312SN/A */
322SN/A
332SN/A#ifndef __ARCH_POWER_ISA_HH__
342SN/A#define __ARCH_POWER_ISA_HH__
352SN/A
362SN/A#include "arch/power/registers.hh"
3775SN/A#include "arch/power/types.hh"
382SN/A#include "base/misc.hh"
392439SN/A#include "sim/sim_object.hh"
402439SN/A
41603SN/Astruct PowerISAParams;
42603SN/Aclass ThreadContext;
432520SN/Aclass Checkpoint;
442378SN/Aclass EventManager;
452378SN/A
46722SN/Anamespace PowerISA
472521SN/A{
482378SN/A
49312SN/Aclass ISA : public SimObject
501634SN/A{
512680Sktlim@umich.edu  protected:
521634SN/A    MiscReg dummy;
532521SN/A    MiscReg miscRegs[NumMiscRegs];
542378SN/A
552378SN/A  public:
56803SN/A    typedef PowerISAParams Params;
572378SN/A
582SN/A    void
591070SN/A    clear()
602378SN/A    {
612SN/A    }
622SN/A
632SN/A    MiscReg
64603SN/A    readMiscRegNoEffect(int misc_reg)
652521SN/A    {
662SN/A        fatal("Power does not currently have any misc regs defined\n");
672SN/A        return dummy;
682680Sktlim@umich.edu    }
691806SN/A
701806SN/A    MiscReg
711806SN/A    readMiscReg(int misc_reg, ThreadContext *tc)
721806SN/A    {
732680Sktlim@umich.edu        fatal("Power does not currently have any misc regs defined\n");
741806SN/A        return dummy;
751806SN/A    }
761806SN/A
771806SN/A    void
78180SN/A    setMiscRegNoEffect(int misc_reg, const MiscReg &val)
792378SN/A    {
802378SN/A        fatal("Power does not currently have any misc regs defined\n");
812378SN/A    }
822378SN/A
832520SN/A    void
842520SN/A    setMiscReg(int misc_reg, const MiscReg &val, ThreadContext *tc)
852520SN/A    {
862521SN/A        fatal("Power does not currently have any misc regs defined\n");
872520SN/A    }
881885SN/A
891070SN/A    int
90954SN/A    flattenIntIndex(int reg)
911070SN/A    {
921070SN/A        return reg;
931070SN/A    }
941070SN/A
951070SN/A    int
961070SN/A    flattenFloatIndex(int reg)
971070SN/A    {
981070SN/A        return reg;
991070SN/A    }
1001070SN/A
1011070SN/A    // dummy
1021070SN/A    int
1031070SN/A    flattenCCIndex(int reg)
1041070SN/A    {
1052378SN/A        return reg;
1062378SN/A    }
1072378SN/A
1082378SN/A    int
1092378SN/A    flattenMiscIndex(int reg)
1102378SN/A    {
1112378SN/A        return reg;
1121885SN/A    }
1131885SN/A
1142424SN/A    void startup(ThreadContext *tc) {}
1151885SN/A
1161885SN/A    /// Explicitly import the otherwise hidden startup
1171885SN/A    using SimObject::startup;
1181885SN/A
1191885SN/A    const Params *params() const;
1202158SN/A
1211885SN/A    ISA(Params *p);
1221885SN/A};
1231885SN/A
1241885SN/A} // namespace PowerISA
1251885SN/A
1261885SN/A#endif // __ARCH_POWER_ISA_HH__
1271885SN/A