base.hh revision 8737
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"
501858SN/A#include "config/full_system.hh"
516658Snate@binkert.org#include "config/the_isa.hh"
528733Sgeoffrey.blake@arm.com#include "config/use_checker.hh"
531717SN/A#include "cpu/base.hh"
548541Sgblack@eecs.umich.edu#include "cpu/decode.hh"
558229Snate@binkert.org#include "cpu/pc_event.hh"
562683Sktlim@umich.edu#include "cpu/simple_thread.hh"
571354SN/A#include "cpu/static_inst.hh"
582387SN/A#include "mem/packet.hh"
592387SN/A#include "mem/port.hh"
602387SN/A#include "mem/request.hh"
6156SN/A#include "sim/eventq.hh"
625348Ssaidi@eecs.umich.edu#include "sim/system.hh"
632SN/A
648733Sgeoffrey.blake@arm.com#if USE_CHECKER
658733Sgeoffrey.blake@arm.com#include "cpu/checker/cpu.hh"
668733Sgeoffrey.blake@arm.com#endif
678733Sgeoffrey.blake@arm.com
682SN/A// forward declarations
691858SN/A#if FULL_SYSTEM
702SN/Aclass Processor;
713453Sgblack@eecs.umich.edunamespace TheISA
723453Sgblack@eecs.umich.edu{
733453Sgblack@eecs.umich.edu    class ITB;
743453Sgblack@eecs.umich.edu    class DTB;
753453Sgblack@eecs.umich.edu}
762462SN/Aclass MemObject;
772SN/A
78715SN/A#else
79715SN/A
80715SN/Aclass Process;
81715SN/A
822SN/A#endif // FULL_SYSTEM
832SN/A
844182Sgblack@eecs.umich.edunamespace TheISA
854182Sgblack@eecs.umich.edu{
864182Sgblack@eecs.umich.edu    class Predecoder;
874182Sgblack@eecs.umich.edu}
882680Sktlim@umich.educlass ThreadContext;
89237SN/Aclass Checkpoint;
902SN/A
912SN/Anamespace Trace {
922SN/A    class InstRecord;
932SN/A}
942SN/A
958737Skoansin.tan@gmail.comstruct BaseSimpleCPUParams;
965529Snate@binkert.org
972420SN/A
982623SN/Aclass BaseSimpleCPU : public BaseCPU
992SN/A{
1002107SN/A  protected:
1012159SN/A    typedef TheISA::MiscReg MiscReg;
1022455SN/A    typedef TheISA::FloatReg FloatReg;
1032455SN/A    typedef TheISA::FloatRegBits FloatRegBits;
1042386SN/A
1052623SN/A  protected:
1062SN/A    Trace::InstRecord *traceData;
1071371SN/A
1085348Ssaidi@eecs.umich.edu    inline void checkPcEventQueue() {
1097720Sgblack@eecs.umich.edu        Addr oldpc, pc = thread->instAddr();
1105348Ssaidi@eecs.umich.edu        do {
1117720Sgblack@eecs.umich.edu            oldpc = pc;
1125348Ssaidi@eecs.umich.edu            system->pcEventQueue.service(tc);
1137720Sgblack@eecs.umich.edu            pc = thread->instAddr();
1147720Sgblack@eecs.umich.edu        } while (oldpc != pc);
1155348Ssaidi@eecs.umich.edu    }
1165348Ssaidi@eecs.umich.edu
1172SN/A  public:
1185807Snate@binkert.org    void wakeup();
1192SN/A
1202SN/A    void zero_fill_64(Addr addr) {
1212SN/A      static int warned = 0;
1222SN/A      if (!warned) {
1232SN/A        warn ("WH64 is not implemented");
1242SN/A        warned = 1;
1252SN/A      }
1262SN/A    };
1272SN/A
1281400SN/A  public:
1295529Snate@binkert.org    BaseSimpleCPU(BaseSimpleCPUParams *params);
1302623SN/A    virtual ~BaseSimpleCPU();
1312SN/A
1321400SN/A  public:
1332683Sktlim@umich.edu    /** SimpleThread object, provides all the architectural state. */
1342683Sktlim@umich.edu    SimpleThread *thread;
1352190SN/A
1362683Sktlim@umich.edu    /** ThreadContext object, provides an interface for external
1372683Sktlim@umich.edu     * objects to modify this thread's state.
1382683Sktlim@umich.edu     */
1392680Sktlim@umich.edu    ThreadContext *tc;
1408733Sgeoffrey.blake@arm.com
1418733Sgeoffrey.blake@arm.com#if USE_CHECKER
1428733Sgeoffrey.blake@arm.com    CheckerCPU *checker;
1438733Sgeoffrey.blake@arm.com#endif
1445169Ssaidi@eecs.umich.edu  protected:
1455169Ssaidi@eecs.umich.edu
1465496Ssaidi@eecs.umich.edu    enum Status {
1475496Ssaidi@eecs.umich.edu        Idle,
1485496Ssaidi@eecs.umich.edu        Running,
1498276SAli.Saidi@ARM.com        Faulting,
1505894Sgblack@eecs.umich.edu        ITBWaitResponse,
1515496Ssaidi@eecs.umich.edu        IcacheRetry,
1525496Ssaidi@eecs.umich.edu        IcacheWaitResponse,
1535496Ssaidi@eecs.umich.edu        IcacheWaitSwitch,
1545894Sgblack@eecs.umich.edu        DTBWaitResponse,
1555496Ssaidi@eecs.umich.edu        DcacheRetry,
1565496Ssaidi@eecs.umich.edu        DcacheWaitResponse,
1575496Ssaidi@eecs.umich.edu        DcacheWaitSwitch,
1585496Ssaidi@eecs.umich.edu        SwitchedOut
1595496Ssaidi@eecs.umich.edu    };
1605496Ssaidi@eecs.umich.edu
1615496Ssaidi@eecs.umich.edu    Status _status;
1625496Ssaidi@eecs.umich.edu
1635169Ssaidi@eecs.umich.edu  public:
1642SN/A
1651858SN/A#if FULL_SYSTEM
1662SN/A    Addr dbg_vtophys(Addr addr);
1672SN/A
1682SN/A    bool interval_stats;
1692SN/A#endif
1702SN/A
1712SN/A    // current instruction
1724181Sgblack@eecs.umich.edu    TheISA::MachInst inst;
1734181Sgblack@eecs.umich.edu
1744182Sgblack@eecs.umich.edu    // The predecoder
1754182Sgblack@eecs.umich.edu    TheISA::Predecoder predecoder;
1762SN/A
1772107SN/A    StaticInstPtr curStaticInst;
1783276Sgblack@eecs.umich.edu    StaticInstPtr curMacroStaticInst;
1791469SN/A
1804377Sgblack@eecs.umich.edu    //This is the offset from the current pc that fetch should be performed at
1814377Sgblack@eecs.umich.edu    Addr fetchOffset;
1824377Sgblack@eecs.umich.edu    //This flag says to stay at the current pc. This is useful for
1834377Sgblack@eecs.umich.edu    //instructions which go beyond MachInst boundaries.
1844377Sgblack@eecs.umich.edu    bool stayAtPC;
1854377Sgblack@eecs.umich.edu
1862623SN/A    void checkForInterrupts();
1875894Sgblack@eecs.umich.edu    void setupFetchRequest(Request *req);
1882623SN/A    void preExecute();
1892623SN/A    void postExecute();
1902623SN/A    void advancePC(Fault fault);
191180SN/A
1928737Skoansin.tan@gmail.com    virtual void deallocateContext(ThreadID thread_num);
1938737Skoansin.tan@gmail.com    virtual void haltContext(ThreadID thread_num);
1942SN/A
1952SN/A    // statistics
196334SN/A    virtual void regStats();
197334SN/A    virtual void resetStats();
1982SN/A
1992SN/A    // number of simulated instructions
2002SN/A    Counter numInst;
201334SN/A    Counter startNumInst;
2025999Snate@binkert.org    Stats::Scalar numInsts;
203707SN/A
2044998Sgblack@eecs.umich.edu    void countInst()
2054998Sgblack@eecs.umich.edu    {
2064998Sgblack@eecs.umich.edu        numInst++;
2074998Sgblack@eecs.umich.edu        numInsts++;
2087897Shestness@cs.utexas.edu        system->totalNumInsts++;
2094998Sgblack@eecs.umich.edu        thread->funcExeInst++;
2104998Sgblack@eecs.umich.edu    }
2114998Sgblack@eecs.umich.edu
212707SN/A    virtual Counter totalInstructions() const
213707SN/A    {
214707SN/A        return numInst - startNumInst;
215707SN/A    }
2162SN/A
2177897Shestness@cs.utexas.edu    //number of integer alu accesses
2187897Shestness@cs.utexas.edu    Stats::Scalar numIntAluAccesses;
2197897Shestness@cs.utexas.edu
2207897Shestness@cs.utexas.edu    //number of float alu accesses
2217897Shestness@cs.utexas.edu    Stats::Scalar numFpAluAccesses;
2227897Shestness@cs.utexas.edu
2237897Shestness@cs.utexas.edu    //number of function calls/returns
2247897Shestness@cs.utexas.edu    Stats::Scalar numCallsReturns;
2257897Shestness@cs.utexas.edu
2267897Shestness@cs.utexas.edu    //conditional control instructions;
2277897Shestness@cs.utexas.edu    Stats::Scalar numCondCtrlInsts;
2287897Shestness@cs.utexas.edu
2297897Shestness@cs.utexas.edu    //number of int instructions
2307897Shestness@cs.utexas.edu    Stats::Scalar numIntInsts;
2317897Shestness@cs.utexas.edu
2327897Shestness@cs.utexas.edu    //number of float instructions
2337897Shestness@cs.utexas.edu    Stats::Scalar numFpInsts;
2347897Shestness@cs.utexas.edu
2357897Shestness@cs.utexas.edu    //number of integer register file accesses
2367897Shestness@cs.utexas.edu    Stats::Scalar numIntRegReads;
2377897Shestness@cs.utexas.edu    Stats::Scalar numIntRegWrites;
2387897Shestness@cs.utexas.edu
2397897Shestness@cs.utexas.edu    //number of float register file accesses
2407897Shestness@cs.utexas.edu    Stats::Scalar numFpRegReads;
2417897Shestness@cs.utexas.edu    Stats::Scalar numFpRegWrites;
2427897Shestness@cs.utexas.edu
2432SN/A    // number of simulated memory references
2445999Snate@binkert.org    Stats::Scalar numMemRefs;
2457897Shestness@cs.utexas.edu    Stats::Scalar numLoadInsts;
2467897Shestness@cs.utexas.edu    Stats::Scalar numStoreInsts;
2477897Shestness@cs.utexas.edu
2487897Shestness@cs.utexas.edu    // number of idle cycles
2497897Shestness@cs.utexas.edu    Stats::Formula numIdleCycles;
2507897Shestness@cs.utexas.edu
2517897Shestness@cs.utexas.edu    // number of busy cycles
2527897Shestness@cs.utexas.edu    Stats::Formula numBusyCycles;
2532SN/A
254124SN/A    // number of simulated loads
255124SN/A    Counter numLoad;
256334SN/A    Counter startNumLoad;
257124SN/A
2582SN/A    // number of idle cycles
2595999Snate@binkert.org    Stats::Average notIdleFraction;
260729SN/A    Stats::Formula idleFraction;
2612SN/A
2622390SN/A    // number of cycles stalled for I-cache responses
2635999Snate@binkert.org    Stats::Scalar icacheStallCycles;
2642SN/A    Counter lastIcacheStall;
2652SN/A
2662390SN/A    // number of cycles stalled for I-cache retries
2675999Snate@binkert.org    Stats::Scalar icacheRetryCycles;
2682390SN/A    Counter lastIcacheRetry;
2692390SN/A
2702390SN/A    // number of cycles stalled for D-cache responses
2715999Snate@binkert.org    Stats::Scalar dcacheStallCycles;
2722SN/A    Counter lastDcacheStall;
2732SN/A
2742390SN/A    // number of cycles stalled for D-cache retries
2755999Snate@binkert.org    Stats::Scalar dcacheRetryCycles;
2762390SN/A    Counter lastDcacheRetry;
2772390SN/A
278217SN/A    virtual void serialize(std::ostream &os);
279237SN/A    virtual void unserialize(Checkpoint *cp, const std::string &section);
2802SN/A
2811371SN/A    // These functions are only used in CPU models that split
2821371SN/A    // effective address computation from the actual memory access.
2832623SN/A    void setEA(Addr EA) { panic("BaseSimpleCPU::setEA() not implemented\n"); }
2845543Ssaidi@eecs.umich.edu    Addr getEA()        { panic("BaseSimpleCPU::getEA() not implemented\n");
2853918Ssaidi@eecs.umich.edu        M5_DUMMY_RETURN}
2861371SN/A
287726SN/A    // The register accessor methods provide the index of the
288726SN/A    // instruction's operand (e.g., 0 or 1), not the architectural
289726SN/A    // register index, to simplify the implementation of register
290726SN/A    // renaming.  We find the architectural register index by indexing
291726SN/A    // into the instruction's own operand index table.  Note that a
292726SN/A    // raw pointer to the StaticInst is provided instead of a
293726SN/A    // ref-counted StaticInstPtr to redice overhead.  This is fine as
294726SN/A    // long as these methods don't copy the pointer into any long-term
295726SN/A    // storage (which is pretty hard to imagine they would have reason
296726SN/A    // to do).
297705SN/A
2983735Sstever@eecs.umich.edu    uint64_t readIntRegOperand(const StaticInst *si, int idx)
299726SN/A    {
3007897Shestness@cs.utexas.edu        numIntRegReads++;
3012683Sktlim@umich.edu        return thread->readIntReg(si->srcRegIdx(idx));
302726SN/A    }
303705SN/A
3043735Sstever@eecs.umich.edu    FloatReg readFloatRegOperand(const StaticInst *si, int idx)
305726SN/A    {
3067897Shestness@cs.utexas.edu        numFpRegReads++;
307726SN/A        int reg_idx = si->srcRegIdx(idx) - TheISA::FP_Base_DepTag;
3082683Sktlim@umich.edu        return thread->readFloatReg(reg_idx);
309726SN/A    }
310705SN/A
3113735Sstever@eecs.umich.edu    FloatRegBits readFloatRegOperandBits(const StaticInst *si, int idx)
3122455SN/A    {
3137897Shestness@cs.utexas.edu        numFpRegReads++;
3142455SN/A        int reg_idx = si->srcRegIdx(idx) - TheISA::FP_Base_DepTag;
3152683Sktlim@umich.edu        return thread->readFloatRegBits(reg_idx);
316726SN/A    }
317705SN/A
3183735Sstever@eecs.umich.edu    void setIntRegOperand(const StaticInst *si, int idx, uint64_t val)
319726SN/A    {
3207897Shestness@cs.utexas.edu        numIntRegWrites++;
3212683Sktlim@umich.edu        thread->setIntReg(si->destRegIdx(idx), val);
322726SN/A    }
323705SN/A
3243735Sstever@eecs.umich.edu    void setFloatRegOperand(const StaticInst *si, int idx, FloatReg val)
325726SN/A    {
3267897Shestness@cs.utexas.edu        numFpRegWrites++;
327726SN/A        int reg_idx = si->destRegIdx(idx) - TheISA::FP_Base_DepTag;
3282683Sktlim@umich.edu        thread->setFloatReg(reg_idx, val);
329726SN/A    }
330726SN/A
3313735Sstever@eecs.umich.edu    void setFloatRegOperandBits(const StaticInst *si, int idx,
3323735Sstever@eecs.umich.edu                                FloatRegBits val)
3332455SN/A    {
3347897Shestness@cs.utexas.edu        numFpRegWrites++;
3352455SN/A        int reg_idx = si->destRegIdx(idx) - TheISA::FP_Base_DepTag;
3362683Sktlim@umich.edu        thread->setFloatRegBits(reg_idx, val);
337726SN/A    }
338705SN/A
3397597Sminkyu.jeong@arm.com    bool readPredicate() { return thread->readPredicate(); }
3407597Sminkyu.jeong@arm.com    void setPredicate(bool val)
3417600Sminkyu.jeong@arm.com    {
3427600Sminkyu.jeong@arm.com        thread->setPredicate(val);
3437600Sminkyu.jeong@arm.com        if (traceData) {
3447600Sminkyu.jeong@arm.com            traceData->setPredicate(val);
3457600Sminkyu.jeong@arm.com        }
3467600Sminkyu.jeong@arm.com    }
3477720Sgblack@eecs.umich.edu    TheISA::PCState pcState() { return thread->pcState(); }
3487720Sgblack@eecs.umich.edu    void pcState(const TheISA::PCState &val) { thread->pcState(val); }
3497720Sgblack@eecs.umich.edu    Addr instAddr() { return thread->instAddr(); }
3507720Sgblack@eecs.umich.edu    Addr nextInstAddr() { return thread->nextInstAddr(); }
3517720Sgblack@eecs.umich.edu    MicroPC microPC() { return thread->microPC(); }
352705SN/A
3534172Ssaidi@eecs.umich.edu    MiscReg readMiscRegNoEffect(int misc_reg)
3544172Ssaidi@eecs.umich.edu    {
3554172Ssaidi@eecs.umich.edu        return thread->readMiscRegNoEffect(misc_reg);
3564172Ssaidi@eecs.umich.edu    }
3574172Ssaidi@eecs.umich.edu
3582159SN/A    MiscReg readMiscReg(int misc_reg)
3592159SN/A    {
3607897Shestness@cs.utexas.edu        numIntRegReads++;
3612683Sktlim@umich.edu        return thread->readMiscReg(misc_reg);
3622159SN/A    }
363705SN/A
3643468Sgblack@eecs.umich.edu    void setMiscReg(int misc_reg, const MiscReg &val)
3652159SN/A    {
3667897Shestness@cs.utexas.edu        numIntRegWrites++;
3672683Sktlim@umich.edu        return thread->setMiscReg(misc_reg, val);
3682159SN/A    }
3692159SN/A
3704185Ssaidi@eecs.umich.edu    MiscReg readMiscRegOperand(const StaticInst *si, int idx)
3713792Sgblack@eecs.umich.edu    {
3727897Shestness@cs.utexas.edu        numIntRegReads++;
3733792Sgblack@eecs.umich.edu        int reg_idx = si->srcRegIdx(idx) - TheISA::Ctrl_Base_DepTag;
3743792Sgblack@eecs.umich.edu        return thread->readMiscReg(reg_idx);
3753792Sgblack@eecs.umich.edu    }
3763792Sgblack@eecs.umich.edu
3774185Ssaidi@eecs.umich.edu    void setMiscRegOperand(
3783792Sgblack@eecs.umich.edu            const StaticInst *si, int idx, const MiscReg &val)
3793792Sgblack@eecs.umich.edu    {
3807897Shestness@cs.utexas.edu        numIntRegWrites++;
3813792Sgblack@eecs.umich.edu        int reg_idx = si->destRegIdx(idx) - TheISA::Ctrl_Base_DepTag;
3824172Ssaidi@eecs.umich.edu        return thread->setMiscReg(reg_idx, val);
3833792Sgblack@eecs.umich.edu    }
3843792Sgblack@eecs.umich.edu
3855358Sgblack@eecs.umich.edu    void demapPage(Addr vaddr, uint64_t asn)
3865358Sgblack@eecs.umich.edu    {
3875358Sgblack@eecs.umich.edu        thread->demapPage(vaddr, asn);
3885358Sgblack@eecs.umich.edu    }
3895358Sgblack@eecs.umich.edu
3905358Sgblack@eecs.umich.edu    void demapInstPage(Addr vaddr, uint64_t asn)
3915358Sgblack@eecs.umich.edu    {
3925358Sgblack@eecs.umich.edu        thread->demapInstPage(vaddr, asn);
3935358Sgblack@eecs.umich.edu    }
3945358Sgblack@eecs.umich.edu
3955358Sgblack@eecs.umich.edu    void demapDataPage(Addr vaddr, uint64_t asn)
3965358Sgblack@eecs.umich.edu    {
3975358Sgblack@eecs.umich.edu        thread->demapDataPage(vaddr, asn);
3985358Sgblack@eecs.umich.edu    }
3995358Sgblack@eecs.umich.edu
4004027Sstever@eecs.umich.edu    unsigned readStCondFailures() {
4014027Sstever@eecs.umich.edu        return thread->readStCondFailures();
4024027Sstever@eecs.umich.edu    }
4034027Sstever@eecs.umich.edu
4044027Sstever@eecs.umich.edu    void setStCondFailures(unsigned sc_failures) {
4054027Sstever@eecs.umich.edu        thread->setStCondFailures(sc_failures);
4064027Sstever@eecs.umich.edu    }
4074027Sstever@eecs.umich.edu
4086221Snate@binkert.org     MiscReg readRegOtherThread(int regIdx, ThreadID tid = InvalidThreadID)
4094661Sksewell@umich.edu     {
4104661Sksewell@umich.edu        panic("Simple CPU models do not support multithreaded "
4114661Sksewell@umich.edu              "register access.\n");
4124661Sksewell@umich.edu     }
4134661Sksewell@umich.edu
4146221Snate@binkert.org     void setRegOtherThread(int regIdx, const MiscReg &val,
4156221Snate@binkert.org                            ThreadID tid = InvalidThreadID)
4164661Sksewell@umich.edu     {
4174661Sksewell@umich.edu        panic("Simple CPU models do not support multithreaded "
4184661Sksewell@umich.edu              "register access.\n");
4194661Sksewell@umich.edu     }
4204661Sksewell@umich.edu
4215250Sksewell@umich.edu    //Fault CacheOp(uint8_t Op, Addr EA);
4225222Sksewell@umich.edu
4231858SN/A#if FULL_SYSTEM
4245702Ssaidi@eecs.umich.edu    Fault hwrei() { return thread->hwrei(); }
4255702Ssaidi@eecs.umich.edu    bool simPalCheck(int palFunc) { return thread->simPalCheck(palFunc); }
4268557Sgblack@eecs.umich.edu#endif
4278557Sgblack@eecs.umich.edu
4288557Sgblack@eecs.umich.edu    void
4298557Sgblack@eecs.umich.edu    syscall(int64_t callnum)
4308557Sgblack@eecs.umich.edu    {
4318557Sgblack@eecs.umich.edu#if FULL_SYSTEM
4328557Sgblack@eecs.umich.edu        panic("Syscall emulation isn't available in FS mode.\n");
433705SN/A#else
4348557Sgblack@eecs.umich.edu        thread->syscall(callnum);
435705SN/A#endif
4368557Sgblack@eecs.umich.edu    }
437705SN/A
4382683Sktlim@umich.edu    bool misspeculating() { return thread->misspeculating(); }
4392680Sktlim@umich.edu    ThreadContext *tcBase() { return tc; }
4402SN/A};
4412SN/A
4422623SN/A#endif // __CPU_SIMPLE_BASE_HH__
443