base.hh revision 8887
12SN/A/*
28733Sgeoffrey.blake@arm.com * Copyright (c) 2011 ARM Limited
38733Sgeoffrey.blake@arm.com * All rights reserved
48733Sgeoffrey.blake@arm.com *
58733Sgeoffrey.blake@arm.com * The license below extends only to copyright in the software and shall
68733Sgeoffrey.blake@arm.com * not be construed as granting a license to any other intellectual
78733Sgeoffrey.blake@arm.com * property including but not limited to intellectual property relating
88733Sgeoffrey.blake@arm.com * to a hardware implementation of the functionality of the software
98733Sgeoffrey.blake@arm.com * licensed hereunder.  You may use the software subject to the license
108733Sgeoffrey.blake@arm.com * terms below provided that you ensure that this notice is replicated
118733Sgeoffrey.blake@arm.com * unmodified and in its entirety in all distributions of the software,
128733Sgeoffrey.blake@arm.com * modified or unmodified, in source code or in binary form.
138733Sgeoffrey.blake@arm.com *
141762SN/A * Copyright (c) 2002-2005 The Regents of The University of Michigan
152SN/A * All rights reserved.
162SN/A *
172SN/A * Redistribution and use in source and binary forms, with or without
182SN/A * modification, are permitted provided that the following conditions are
192SN/A * met: redistributions of source code must retain the above copyright
202SN/A * notice, this list of conditions and the following disclaimer;
212SN/A * redistributions in binary form must reproduce the above copyright
222SN/A * notice, this list of conditions and the following disclaimer in the
232SN/A * documentation and/or other materials provided with the distribution;
242SN/A * neither the name of the copyright holders nor the names of its
252SN/A * contributors may be used to endorse or promote products derived from
262SN/A * this software without specific prior written permission.
272SN/A *
282SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
292SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
302SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
312SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
322SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
332SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
342SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
352SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
362SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
372SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
382SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
392665Ssaidi@eecs.umich.edu *
402665Ssaidi@eecs.umich.edu * Authors: Steve Reinhardt
412665Ssaidi@eecs.umich.edu *          Dave Greene
422665Ssaidi@eecs.umich.edu *          Nathan Binkert
432SN/A */
442SN/A
452623SN/A#ifndef __CPU_SIMPLE_BASE_HH__
462623SN/A#define __CPU_SIMPLE_BASE_HH__
472SN/A
484182Sgblack@eecs.umich.edu#include "arch/predecoder.hh"
491354SN/A#include "base/statistics.hh"
506658Snate@binkert.org#include "config/the_isa.hh"
511717SN/A#include "cpu/base.hh"
528887Sgeoffrey.blake@arm.com#include "cpu/checker/cpu.hh"
538541Sgblack@eecs.umich.edu#include "cpu/decode.hh"
548229Snate@binkert.org#include "cpu/pc_event.hh"
552683Sktlim@umich.edu#include "cpu/simple_thread.hh"
561354SN/A#include "cpu/static_inst.hh"
572387SN/A#include "mem/packet.hh"
582387SN/A#include "mem/port.hh"
592387SN/A#include "mem/request.hh"
6056SN/A#include "sim/eventq.hh"
618779Sgblack@eecs.umich.edu#include "sim/full_system.hh"
625348Ssaidi@eecs.umich.edu#include "sim/system.hh"
632SN/A
642SN/A// forward declarations
658779Sgblack@eecs.umich.educlass Checkpoint;
668779Sgblack@eecs.umich.educlass Process;
672SN/Aclass Processor;
688779Sgblack@eecs.umich.educlass ThreadContext;
692SN/A
704182Sgblack@eecs.umich.edunamespace TheISA
714182Sgblack@eecs.umich.edu{
728779Sgblack@eecs.umich.edu    class DTB;
738779Sgblack@eecs.umich.edu    class ITB;
744182Sgblack@eecs.umich.edu    class Predecoder;
754182Sgblack@eecs.umich.edu}
762SN/A
772SN/Anamespace Trace {
782SN/A    class InstRecord;
792SN/A}
802SN/A
818737Skoansin.tan@gmail.comstruct BaseSimpleCPUParams;
825529Snate@binkert.org
832420SN/A
842623SN/Aclass BaseSimpleCPU : public BaseCPU
852SN/A{
862107SN/A  protected:
872159SN/A    typedef TheISA::MiscReg MiscReg;
882455SN/A    typedef TheISA::FloatReg FloatReg;
892455SN/A    typedef TheISA::FloatRegBits FloatRegBits;
902386SN/A
912623SN/A  protected:
922SN/A    Trace::InstRecord *traceData;
931371SN/A
945348Ssaidi@eecs.umich.edu    inline void checkPcEventQueue() {
957720Sgblack@eecs.umich.edu        Addr oldpc, pc = thread->instAddr();
965348Ssaidi@eecs.umich.edu        do {
977720Sgblack@eecs.umich.edu            oldpc = pc;
985348Ssaidi@eecs.umich.edu            system->pcEventQueue.service(tc);
997720Sgblack@eecs.umich.edu            pc = thread->instAddr();
1007720Sgblack@eecs.umich.edu        } while (oldpc != pc);
1015348Ssaidi@eecs.umich.edu    }
1025348Ssaidi@eecs.umich.edu
1032SN/A  public:
1045807Snate@binkert.org    void wakeup();
1052SN/A
1062SN/A    void zero_fill_64(Addr addr) {
1072SN/A      static int warned = 0;
1082SN/A      if (!warned) {
1092SN/A        warn ("WH64 is not implemented");
1102SN/A        warned = 1;
1112SN/A      }
1122SN/A    };
1132SN/A
1141400SN/A  public:
1155529Snate@binkert.org    BaseSimpleCPU(BaseSimpleCPUParams *params);
1162623SN/A    virtual ~BaseSimpleCPU();
1172SN/A
1181400SN/A  public:
1192683Sktlim@umich.edu    /** SimpleThread object, provides all the architectural state. */
1202683Sktlim@umich.edu    SimpleThread *thread;
1212190SN/A
1222683Sktlim@umich.edu    /** ThreadContext object, provides an interface for external
1232683Sktlim@umich.edu     * objects to modify this thread's state.
1242683Sktlim@umich.edu     */
1252680Sktlim@umich.edu    ThreadContext *tc;
1268733Sgeoffrey.blake@arm.com
1278733Sgeoffrey.blake@arm.com    CheckerCPU *checker;
1288887Sgeoffrey.blake@arm.com
1295169Ssaidi@eecs.umich.edu  protected:
1305169Ssaidi@eecs.umich.edu
1315496Ssaidi@eecs.umich.edu    enum Status {
1325496Ssaidi@eecs.umich.edu        Idle,
1335496Ssaidi@eecs.umich.edu        Running,
1348276SAli.Saidi@ARM.com        Faulting,
1355894Sgblack@eecs.umich.edu        ITBWaitResponse,
1365496Ssaidi@eecs.umich.edu        IcacheRetry,
1375496Ssaidi@eecs.umich.edu        IcacheWaitResponse,
1385496Ssaidi@eecs.umich.edu        IcacheWaitSwitch,
1395894Sgblack@eecs.umich.edu        DTBWaitResponse,
1405496Ssaidi@eecs.umich.edu        DcacheRetry,
1415496Ssaidi@eecs.umich.edu        DcacheWaitResponse,
1425496Ssaidi@eecs.umich.edu        DcacheWaitSwitch,
1435496Ssaidi@eecs.umich.edu        SwitchedOut
1445496Ssaidi@eecs.umich.edu    };
1455496Ssaidi@eecs.umich.edu
1465496Ssaidi@eecs.umich.edu    Status _status;
1475496Ssaidi@eecs.umich.edu
1485169Ssaidi@eecs.umich.edu  public:
1492SN/A
1502SN/A    Addr dbg_vtophys(Addr addr);
1512SN/A
1522SN/A    bool interval_stats;
1532SN/A
1542SN/A    // current instruction
1554181Sgblack@eecs.umich.edu    TheISA::MachInst inst;
1564181Sgblack@eecs.umich.edu
1574182Sgblack@eecs.umich.edu    // The predecoder
1584182Sgblack@eecs.umich.edu    TheISA::Predecoder predecoder;
1592SN/A
1602107SN/A    StaticInstPtr curStaticInst;
1613276Sgblack@eecs.umich.edu    StaticInstPtr curMacroStaticInst;
1621469SN/A
1634377Sgblack@eecs.umich.edu    //This is the offset from the current pc that fetch should be performed at
1644377Sgblack@eecs.umich.edu    Addr fetchOffset;
1654377Sgblack@eecs.umich.edu    //This flag says to stay at the current pc. This is useful for
1664377Sgblack@eecs.umich.edu    //instructions which go beyond MachInst boundaries.
1674377Sgblack@eecs.umich.edu    bool stayAtPC;
1684377Sgblack@eecs.umich.edu
1692623SN/A    void checkForInterrupts();
1705894Sgblack@eecs.umich.edu    void setupFetchRequest(Request *req);
1712623SN/A    void preExecute();
1722623SN/A    void postExecute();
1732623SN/A    void advancePC(Fault fault);
174180SN/A
1758737Skoansin.tan@gmail.com    virtual void deallocateContext(ThreadID thread_num);
1768737Skoansin.tan@gmail.com    virtual void haltContext(ThreadID thread_num);
1772SN/A
1782SN/A    // statistics
179334SN/A    virtual void regStats();
180334SN/A    virtual void resetStats();
1812SN/A
1822SN/A    // number of simulated instructions
1832SN/A    Counter numInst;
184334SN/A    Counter startNumInst;
1855999Snate@binkert.org    Stats::Scalar numInsts;
1868834Satgutier@umich.edu    Counter numOp;
1878834Satgutier@umich.edu    Counter startNumOp;
1888834Satgutier@umich.edu    Stats::Scalar numOps;
189707SN/A
1904998Sgblack@eecs.umich.edu    void countInst()
1914998Sgblack@eecs.umich.edu    {
1928834Satgutier@umich.edu        if (!curStaticInst->isMicroop() || curStaticInst->isLastMicroop()) {
1938834Satgutier@umich.edu            numInst++;
1948834Satgutier@umich.edu            numInsts++;
1958834Satgutier@umich.edu        }
1968834Satgutier@umich.edu        numOp++;
1978834Satgutier@umich.edu        numOps++;
1988834Satgutier@umich.edu
1997897Shestness@cs.utexas.edu        system->totalNumInsts++;
2004998Sgblack@eecs.umich.edu        thread->funcExeInst++;
2014998Sgblack@eecs.umich.edu    }
2024998Sgblack@eecs.umich.edu
2038834Satgutier@umich.edu    virtual Counter totalInsts() const
204707SN/A    {
205707SN/A        return numInst - startNumInst;
206707SN/A    }
2072SN/A
2088834Satgutier@umich.edu    virtual Counter totalOps() const
2098834Satgutier@umich.edu    {
2108834Satgutier@umich.edu        return numOp - startNumOp;
2118834Satgutier@umich.edu    }
2128834Satgutier@umich.edu
2137897Shestness@cs.utexas.edu    //number of integer alu accesses
2147897Shestness@cs.utexas.edu    Stats::Scalar numIntAluAccesses;
2157897Shestness@cs.utexas.edu
2167897Shestness@cs.utexas.edu    //number of float alu accesses
2177897Shestness@cs.utexas.edu    Stats::Scalar numFpAluAccesses;
2187897Shestness@cs.utexas.edu
2197897Shestness@cs.utexas.edu    //number of function calls/returns
2207897Shestness@cs.utexas.edu    Stats::Scalar numCallsReturns;
2217897Shestness@cs.utexas.edu
2227897Shestness@cs.utexas.edu    //conditional control instructions;
2237897Shestness@cs.utexas.edu    Stats::Scalar numCondCtrlInsts;
2247897Shestness@cs.utexas.edu
2257897Shestness@cs.utexas.edu    //number of int instructions
2267897Shestness@cs.utexas.edu    Stats::Scalar numIntInsts;
2277897Shestness@cs.utexas.edu
2287897Shestness@cs.utexas.edu    //number of float instructions
2297897Shestness@cs.utexas.edu    Stats::Scalar numFpInsts;
2307897Shestness@cs.utexas.edu
2317897Shestness@cs.utexas.edu    //number of integer register file accesses
2327897Shestness@cs.utexas.edu    Stats::Scalar numIntRegReads;
2337897Shestness@cs.utexas.edu    Stats::Scalar numIntRegWrites;
2347897Shestness@cs.utexas.edu
2357897Shestness@cs.utexas.edu    //number of float register file accesses
2367897Shestness@cs.utexas.edu    Stats::Scalar numFpRegReads;
2377897Shestness@cs.utexas.edu    Stats::Scalar numFpRegWrites;
2387897Shestness@cs.utexas.edu
2392SN/A    // number of simulated memory references
2405999Snate@binkert.org    Stats::Scalar numMemRefs;
2417897Shestness@cs.utexas.edu    Stats::Scalar numLoadInsts;
2427897Shestness@cs.utexas.edu    Stats::Scalar numStoreInsts;
2437897Shestness@cs.utexas.edu
2447897Shestness@cs.utexas.edu    // number of idle cycles
2457897Shestness@cs.utexas.edu    Stats::Formula numIdleCycles;
2467897Shestness@cs.utexas.edu
2477897Shestness@cs.utexas.edu    // number of busy cycles
2487897Shestness@cs.utexas.edu    Stats::Formula numBusyCycles;
2492SN/A
250124SN/A    // number of simulated loads
251124SN/A    Counter numLoad;
252334SN/A    Counter startNumLoad;
253124SN/A
2542SN/A    // number of idle cycles
2555999Snate@binkert.org    Stats::Average notIdleFraction;
256729SN/A    Stats::Formula idleFraction;
2572SN/A
2582390SN/A    // number of cycles stalled for I-cache responses
2595999Snate@binkert.org    Stats::Scalar icacheStallCycles;
2602SN/A    Counter lastIcacheStall;
2612SN/A
2622390SN/A    // number of cycles stalled for I-cache retries
2635999Snate@binkert.org    Stats::Scalar icacheRetryCycles;
2642390SN/A    Counter lastIcacheRetry;
2652390SN/A
2662390SN/A    // number of cycles stalled for D-cache responses
2675999Snate@binkert.org    Stats::Scalar dcacheStallCycles;
2682SN/A    Counter lastDcacheStall;
2692SN/A
2702390SN/A    // number of cycles stalled for D-cache retries
2715999Snate@binkert.org    Stats::Scalar dcacheRetryCycles;
2722390SN/A    Counter lastDcacheRetry;
2732390SN/A
274217SN/A    virtual void serialize(std::ostream &os);
275237SN/A    virtual void unserialize(Checkpoint *cp, const std::string &section);
2762SN/A
2771371SN/A    // These functions are only used in CPU models that split
2781371SN/A    // effective address computation from the actual memory access.
2792623SN/A    void setEA(Addr EA) { panic("BaseSimpleCPU::setEA() not implemented\n"); }
2805543Ssaidi@eecs.umich.edu    Addr getEA()        { panic("BaseSimpleCPU::getEA() not implemented\n");
2813918Ssaidi@eecs.umich.edu        M5_DUMMY_RETURN}
2821371SN/A
283726SN/A    // The register accessor methods provide the index of the
284726SN/A    // instruction's operand (e.g., 0 or 1), not the architectural
285726SN/A    // register index, to simplify the implementation of register
286726SN/A    // renaming.  We find the architectural register index by indexing
287726SN/A    // into the instruction's own operand index table.  Note that a
288726SN/A    // raw pointer to the StaticInst is provided instead of a
289726SN/A    // ref-counted StaticInstPtr to redice overhead.  This is fine as
290726SN/A    // long as these methods don't copy the pointer into any long-term
291726SN/A    // storage (which is pretty hard to imagine they would have reason
292726SN/A    // to do).
293705SN/A
2943735Sstever@eecs.umich.edu    uint64_t readIntRegOperand(const StaticInst *si, int idx)
295726SN/A    {
2967897Shestness@cs.utexas.edu        numIntRegReads++;
2972683Sktlim@umich.edu        return thread->readIntReg(si->srcRegIdx(idx));
298726SN/A    }
299705SN/A
3003735Sstever@eecs.umich.edu    FloatReg readFloatRegOperand(const StaticInst *si, int idx)
301726SN/A    {
3027897Shestness@cs.utexas.edu        numFpRegReads++;
303726SN/A        int reg_idx = si->srcRegIdx(idx) - TheISA::FP_Base_DepTag;
3042683Sktlim@umich.edu        return thread->readFloatReg(reg_idx);
305726SN/A    }
306705SN/A
3073735Sstever@eecs.umich.edu    FloatRegBits readFloatRegOperandBits(const StaticInst *si, int idx)
3082455SN/A    {
3097897Shestness@cs.utexas.edu        numFpRegReads++;
3102455SN/A        int reg_idx = si->srcRegIdx(idx) - TheISA::FP_Base_DepTag;
3112683Sktlim@umich.edu        return thread->readFloatRegBits(reg_idx);
312726SN/A    }
313705SN/A
3143735Sstever@eecs.umich.edu    void setIntRegOperand(const StaticInst *si, int idx, uint64_t val)
315726SN/A    {
3167897Shestness@cs.utexas.edu        numIntRegWrites++;
3172683Sktlim@umich.edu        thread->setIntReg(si->destRegIdx(idx), val);
318726SN/A    }
319705SN/A
3203735Sstever@eecs.umich.edu    void setFloatRegOperand(const StaticInst *si, int idx, FloatReg val)
321726SN/A    {
3227897Shestness@cs.utexas.edu        numFpRegWrites++;
323726SN/A        int reg_idx = si->destRegIdx(idx) - TheISA::FP_Base_DepTag;
3242683Sktlim@umich.edu        thread->setFloatReg(reg_idx, val);
325726SN/A    }
326726SN/A
3273735Sstever@eecs.umich.edu    void setFloatRegOperandBits(const StaticInst *si, int idx,
3283735Sstever@eecs.umich.edu                                FloatRegBits val)
3292455SN/A    {
3307897Shestness@cs.utexas.edu        numFpRegWrites++;
3312455SN/A        int reg_idx = si->destRegIdx(idx) - TheISA::FP_Base_DepTag;
3322683Sktlim@umich.edu        thread->setFloatRegBits(reg_idx, val);
333726SN/A    }
334705SN/A
3357597Sminkyu.jeong@arm.com    bool readPredicate() { return thread->readPredicate(); }
3367597Sminkyu.jeong@arm.com    void setPredicate(bool val)
3377600Sminkyu.jeong@arm.com    {
3387600Sminkyu.jeong@arm.com        thread->setPredicate(val);
3397600Sminkyu.jeong@arm.com        if (traceData) {
3407600Sminkyu.jeong@arm.com            traceData->setPredicate(val);
3417600Sminkyu.jeong@arm.com        }
3427600Sminkyu.jeong@arm.com    }
3437720Sgblack@eecs.umich.edu    TheISA::PCState pcState() { return thread->pcState(); }
3447720Sgblack@eecs.umich.edu    void pcState(const TheISA::PCState &val) { thread->pcState(val); }
3457720Sgblack@eecs.umich.edu    Addr instAddr() { return thread->instAddr(); }
3467720Sgblack@eecs.umich.edu    Addr nextInstAddr() { return thread->nextInstAddr(); }
3477720Sgblack@eecs.umich.edu    MicroPC microPC() { return thread->microPC(); }
348705SN/A
3494172Ssaidi@eecs.umich.edu    MiscReg readMiscRegNoEffect(int misc_reg)
3504172Ssaidi@eecs.umich.edu    {
3514172Ssaidi@eecs.umich.edu        return thread->readMiscRegNoEffect(misc_reg);
3524172Ssaidi@eecs.umich.edu    }
3534172Ssaidi@eecs.umich.edu
3542159SN/A    MiscReg readMiscReg(int misc_reg)
3552159SN/A    {
3567897Shestness@cs.utexas.edu        numIntRegReads++;
3572683Sktlim@umich.edu        return thread->readMiscReg(misc_reg);
3582159SN/A    }
359705SN/A
3603468Sgblack@eecs.umich.edu    void setMiscReg(int misc_reg, const MiscReg &val)
3612159SN/A    {
3627897Shestness@cs.utexas.edu        numIntRegWrites++;
3632683Sktlim@umich.edu        return thread->setMiscReg(misc_reg, val);
3642159SN/A    }
3652159SN/A
3664185Ssaidi@eecs.umich.edu    MiscReg readMiscRegOperand(const StaticInst *si, int idx)
3673792Sgblack@eecs.umich.edu    {
3687897Shestness@cs.utexas.edu        numIntRegReads++;
3693792Sgblack@eecs.umich.edu        int reg_idx = si->srcRegIdx(idx) - TheISA::Ctrl_Base_DepTag;
3703792Sgblack@eecs.umich.edu        return thread->readMiscReg(reg_idx);
3713792Sgblack@eecs.umich.edu    }
3723792Sgblack@eecs.umich.edu
3734185Ssaidi@eecs.umich.edu    void setMiscRegOperand(
3743792Sgblack@eecs.umich.edu            const StaticInst *si, int idx, const MiscReg &val)
3753792Sgblack@eecs.umich.edu    {
3767897Shestness@cs.utexas.edu        numIntRegWrites++;
3773792Sgblack@eecs.umich.edu        int reg_idx = si->destRegIdx(idx) - TheISA::Ctrl_Base_DepTag;
3784172Ssaidi@eecs.umich.edu        return thread->setMiscReg(reg_idx, val);
3793792Sgblack@eecs.umich.edu    }
3803792Sgblack@eecs.umich.edu
3815358Sgblack@eecs.umich.edu    void demapPage(Addr vaddr, uint64_t asn)
3825358Sgblack@eecs.umich.edu    {
3835358Sgblack@eecs.umich.edu        thread->demapPage(vaddr, asn);
3845358Sgblack@eecs.umich.edu    }
3855358Sgblack@eecs.umich.edu
3865358Sgblack@eecs.umich.edu    void demapInstPage(Addr vaddr, uint64_t asn)
3875358Sgblack@eecs.umich.edu    {
3885358Sgblack@eecs.umich.edu        thread->demapInstPage(vaddr, asn);
3895358Sgblack@eecs.umich.edu    }
3905358Sgblack@eecs.umich.edu
3915358Sgblack@eecs.umich.edu    void demapDataPage(Addr vaddr, uint64_t asn)
3925358Sgblack@eecs.umich.edu    {
3935358Sgblack@eecs.umich.edu        thread->demapDataPage(vaddr, asn);
3945358Sgblack@eecs.umich.edu    }
3955358Sgblack@eecs.umich.edu
3964027Sstever@eecs.umich.edu    unsigned readStCondFailures() {
3974027Sstever@eecs.umich.edu        return thread->readStCondFailures();
3984027Sstever@eecs.umich.edu    }
3994027Sstever@eecs.umich.edu
4004027Sstever@eecs.umich.edu    void setStCondFailures(unsigned sc_failures) {
4014027Sstever@eecs.umich.edu        thread->setStCondFailures(sc_failures);
4024027Sstever@eecs.umich.edu    }
4034027Sstever@eecs.umich.edu
4046221Snate@binkert.org     MiscReg readRegOtherThread(int regIdx, ThreadID tid = InvalidThreadID)
4054661Sksewell@umich.edu     {
4064661Sksewell@umich.edu        panic("Simple CPU models do not support multithreaded "
4074661Sksewell@umich.edu              "register access.\n");
4084661Sksewell@umich.edu     }
4094661Sksewell@umich.edu
4106221Snate@binkert.org     void setRegOtherThread(int regIdx, const MiscReg &val,
4116221Snate@binkert.org                            ThreadID tid = InvalidThreadID)
4124661Sksewell@umich.edu     {
4134661Sksewell@umich.edu        panic("Simple CPU models do not support multithreaded "
4144661Sksewell@umich.edu              "register access.\n");
4154661Sksewell@umich.edu     }
4164661Sksewell@umich.edu
4175250Sksewell@umich.edu    //Fault CacheOp(uint8_t Op, Addr EA);
4185222Sksewell@umich.edu
4195702Ssaidi@eecs.umich.edu    Fault hwrei() { return thread->hwrei(); }
4205702Ssaidi@eecs.umich.edu    bool simPalCheck(int palFunc) { return thread->simPalCheck(palFunc); }
4218557Sgblack@eecs.umich.edu
4228557Sgblack@eecs.umich.edu    void
4238557Sgblack@eecs.umich.edu    syscall(int64_t callnum)
4248557Sgblack@eecs.umich.edu    {
4258779Sgblack@eecs.umich.edu        if (FullSystem)
4268779Sgblack@eecs.umich.edu            panic("Syscall emulation isn't available in FS mode.\n");
4278806Sgblack@eecs.umich.edu
4288557Sgblack@eecs.umich.edu        thread->syscall(callnum);
4298557Sgblack@eecs.umich.edu    }
430705SN/A
4312683Sktlim@umich.edu    bool misspeculating() { return thread->misspeculating(); }
4322680Sktlim@umich.edu    ThreadContext *tcBase() { return tc; }
4332SN/A};
4342SN/A
4352623SN/A#endif // __CPU_SIMPLE_BASE_HH__
436