base.hh revision 9918
12SN/A/*
29448SAndreas.Sandberg@ARM.com * Copyright (c) 2011-2012 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
481354SN/A#include "base/statistics.hh"
496658Snate@binkert.org#include "config/the_isa.hh"
501717SN/A#include "cpu/base.hh"
518887Sgeoffrey.blake@arm.com#include "cpu/checker/cpu.hh"
528229Snate@binkert.org#include "cpu/pc_event.hh"
532683Sktlim@umich.edu#include "cpu/simple_thread.hh"
541354SN/A#include "cpu/static_inst.hh"
552387SN/A#include "mem/packet.hh"
562387SN/A#include "mem/port.hh"
572387SN/A#include "mem/request.hh"
5856SN/A#include "sim/eventq.hh"
598779Sgblack@eecs.umich.edu#include "sim/full_system.hh"
605348Ssaidi@eecs.umich.edu#include "sim/system.hh"
612SN/A
622SN/A// forward declarations
638779Sgblack@eecs.umich.educlass Checkpoint;
648779Sgblack@eecs.umich.educlass Process;
652SN/Aclass Processor;
668779Sgblack@eecs.umich.educlass ThreadContext;
672SN/A
684182Sgblack@eecs.umich.edunamespace TheISA
694182Sgblack@eecs.umich.edu{
708779Sgblack@eecs.umich.edu    class DTB;
718779Sgblack@eecs.umich.edu    class ITB;
724182Sgblack@eecs.umich.edu}
732SN/A
742SN/Anamespace Trace {
752SN/A    class InstRecord;
762SN/A}
772SN/A
788737Skoansin.tan@gmail.comstruct BaseSimpleCPUParams;
795529Snate@binkert.org
802420SN/A
812623SN/Aclass BaseSimpleCPU : public BaseCPU
822SN/A{
832107SN/A  protected:
842159SN/A    typedef TheISA::MiscReg MiscReg;
852455SN/A    typedef TheISA::FloatReg FloatReg;
862455SN/A    typedef TheISA::FloatRegBits FloatRegBits;
872386SN/A
882623SN/A  protected:
892SN/A    Trace::InstRecord *traceData;
901371SN/A
915348Ssaidi@eecs.umich.edu    inline void checkPcEventQueue() {
927720Sgblack@eecs.umich.edu        Addr oldpc, pc = thread->instAddr();
935348Ssaidi@eecs.umich.edu        do {
947720Sgblack@eecs.umich.edu            oldpc = pc;
955348Ssaidi@eecs.umich.edu            system->pcEventQueue.service(tc);
967720Sgblack@eecs.umich.edu            pc = thread->instAddr();
977720Sgblack@eecs.umich.edu        } while (oldpc != pc);
985348Ssaidi@eecs.umich.edu    }
995348Ssaidi@eecs.umich.edu
1002SN/A  public:
1015807Snate@binkert.org    void wakeup();
1022SN/A
1032SN/A    void zero_fill_64(Addr addr) {
1042SN/A      static int warned = 0;
1052SN/A      if (!warned) {
1062SN/A        warn ("WH64 is not implemented");
1072SN/A        warned = 1;
1082SN/A      }
1092SN/A    };
1102SN/A
1111400SN/A  public:
1125529Snate@binkert.org    BaseSimpleCPU(BaseSimpleCPUParams *params);
1132623SN/A    virtual ~BaseSimpleCPU();
1142SN/A
1151400SN/A  public:
1162683Sktlim@umich.edu    /** SimpleThread object, provides all the architectural state. */
1172683Sktlim@umich.edu    SimpleThread *thread;
1182190SN/A
1192683Sktlim@umich.edu    /** ThreadContext object, provides an interface for external
1202683Sktlim@umich.edu     * objects to modify this thread's state.
1212683Sktlim@umich.edu     */
1222680Sktlim@umich.edu    ThreadContext *tc;
1238733Sgeoffrey.blake@arm.com
1248733Sgeoffrey.blake@arm.com    CheckerCPU *checker;
1258887Sgeoffrey.blake@arm.com
1265169Ssaidi@eecs.umich.edu  protected:
1275169Ssaidi@eecs.umich.edu
1285496Ssaidi@eecs.umich.edu    enum Status {
1295496Ssaidi@eecs.umich.edu        Idle,
1305496Ssaidi@eecs.umich.edu        Running,
1318276SAli.Saidi@ARM.com        Faulting,
1325894Sgblack@eecs.umich.edu        ITBWaitResponse,
1335496Ssaidi@eecs.umich.edu        IcacheRetry,
1345496Ssaidi@eecs.umich.edu        IcacheWaitResponse,
1355496Ssaidi@eecs.umich.edu        IcacheWaitSwitch,
1365894Sgblack@eecs.umich.edu        DTBWaitResponse,
1375496Ssaidi@eecs.umich.edu        DcacheRetry,
1385496Ssaidi@eecs.umich.edu        DcacheWaitResponse,
1395496Ssaidi@eecs.umich.edu        DcacheWaitSwitch,
1405496Ssaidi@eecs.umich.edu    };
1415496Ssaidi@eecs.umich.edu
1425496Ssaidi@eecs.umich.edu    Status _status;
1435496Ssaidi@eecs.umich.edu
1445169Ssaidi@eecs.umich.edu  public:
1452SN/A
1462SN/A    Addr dbg_vtophys(Addr addr);
1472SN/A
1482SN/A    bool interval_stats;
1492SN/A
1502SN/A    // current instruction
1514181Sgblack@eecs.umich.edu    TheISA::MachInst inst;
1524181Sgblack@eecs.umich.edu
1532107SN/A    StaticInstPtr curStaticInst;
1543276Sgblack@eecs.umich.edu    StaticInstPtr curMacroStaticInst;
1551469SN/A
1564377Sgblack@eecs.umich.edu    //This is the offset from the current pc that fetch should be performed at
1574377Sgblack@eecs.umich.edu    Addr fetchOffset;
1584377Sgblack@eecs.umich.edu    //This flag says to stay at the current pc. This is useful for
1594377Sgblack@eecs.umich.edu    //instructions which go beyond MachInst boundaries.
1604377Sgblack@eecs.umich.edu    bool stayAtPC;
1614377Sgblack@eecs.umich.edu
1622623SN/A    void checkForInterrupts();
1635894Sgblack@eecs.umich.edu    void setupFetchRequest(Request *req);
1642623SN/A    void preExecute();
1652623SN/A    void postExecute();
1662623SN/A    void advancePC(Fault fault);
167180SN/A
1688737Skoansin.tan@gmail.com    virtual void deallocateContext(ThreadID thread_num);
1698737Skoansin.tan@gmail.com    virtual void haltContext(ThreadID thread_num);
1702SN/A
1712SN/A    // statistics
172334SN/A    virtual void regStats();
173334SN/A    virtual void resetStats();
1742SN/A
1759461Snilay@cs.wisc.edu    virtual void startup();
1769461Snilay@cs.wisc.edu
1772SN/A    // number of simulated instructions
1782SN/A    Counter numInst;
179334SN/A    Counter startNumInst;
1805999Snate@binkert.org    Stats::Scalar numInsts;
1818834Satgutier@umich.edu    Counter numOp;
1828834Satgutier@umich.edu    Counter startNumOp;
1838834Satgutier@umich.edu    Stats::Scalar numOps;
184707SN/A
1854998Sgblack@eecs.umich.edu    void countInst()
1864998Sgblack@eecs.umich.edu    {
1878834Satgutier@umich.edu        if (!curStaticInst->isMicroop() || curStaticInst->isLastMicroop()) {
1888834Satgutier@umich.edu            numInst++;
1898834Satgutier@umich.edu            numInsts++;
1908834Satgutier@umich.edu        }
1918834Satgutier@umich.edu        numOp++;
1928834Satgutier@umich.edu        numOps++;
1938834Satgutier@umich.edu
1947897Shestness@cs.utexas.edu        system->totalNumInsts++;
1954998Sgblack@eecs.umich.edu        thread->funcExeInst++;
1964998Sgblack@eecs.umich.edu    }
1974998Sgblack@eecs.umich.edu
1988834Satgutier@umich.edu    virtual Counter totalInsts() const
199707SN/A    {
200707SN/A        return numInst - startNumInst;
201707SN/A    }
2022SN/A
2038834Satgutier@umich.edu    virtual Counter totalOps() const
2048834Satgutier@umich.edu    {
2058834Satgutier@umich.edu        return numOp - startNumOp;
2068834Satgutier@umich.edu    }
2078834Satgutier@umich.edu
2087897Shestness@cs.utexas.edu    //number of integer alu accesses
2097897Shestness@cs.utexas.edu    Stats::Scalar numIntAluAccesses;
2107897Shestness@cs.utexas.edu
2117897Shestness@cs.utexas.edu    //number of float alu accesses
2127897Shestness@cs.utexas.edu    Stats::Scalar numFpAluAccesses;
2137897Shestness@cs.utexas.edu
2147897Shestness@cs.utexas.edu    //number of function calls/returns
2157897Shestness@cs.utexas.edu    Stats::Scalar numCallsReturns;
2167897Shestness@cs.utexas.edu
2177897Shestness@cs.utexas.edu    //conditional control instructions;
2187897Shestness@cs.utexas.edu    Stats::Scalar numCondCtrlInsts;
2197897Shestness@cs.utexas.edu
2207897Shestness@cs.utexas.edu    //number of int instructions
2217897Shestness@cs.utexas.edu    Stats::Scalar numIntInsts;
2227897Shestness@cs.utexas.edu
2237897Shestness@cs.utexas.edu    //number of float instructions
2247897Shestness@cs.utexas.edu    Stats::Scalar numFpInsts;
2257897Shestness@cs.utexas.edu
2267897Shestness@cs.utexas.edu    //number of integer register file accesses
2277897Shestness@cs.utexas.edu    Stats::Scalar numIntRegReads;
2287897Shestness@cs.utexas.edu    Stats::Scalar numIntRegWrites;
2297897Shestness@cs.utexas.edu
2307897Shestness@cs.utexas.edu    //number of float register file accesses
2317897Shestness@cs.utexas.edu    Stats::Scalar numFpRegReads;
2327897Shestness@cs.utexas.edu    Stats::Scalar numFpRegWrites;
2337897Shestness@cs.utexas.edu
2342SN/A    // number of simulated memory references
2355999Snate@binkert.org    Stats::Scalar numMemRefs;
2367897Shestness@cs.utexas.edu    Stats::Scalar numLoadInsts;
2377897Shestness@cs.utexas.edu    Stats::Scalar numStoreInsts;
2387897Shestness@cs.utexas.edu
2397897Shestness@cs.utexas.edu    // number of idle cycles
2407897Shestness@cs.utexas.edu    Stats::Formula numIdleCycles;
2417897Shestness@cs.utexas.edu
2427897Shestness@cs.utexas.edu    // number of busy cycles
2437897Shestness@cs.utexas.edu    Stats::Formula numBusyCycles;
2442SN/A
245124SN/A    // number of simulated loads
246124SN/A    Counter numLoad;
247334SN/A    Counter startNumLoad;
248124SN/A
2492SN/A    // number of idle cycles
2505999Snate@binkert.org    Stats::Average notIdleFraction;
251729SN/A    Stats::Formula idleFraction;
2522SN/A
2532390SN/A    // number of cycles stalled for I-cache responses
2545999Snate@binkert.org    Stats::Scalar icacheStallCycles;
2552SN/A    Counter lastIcacheStall;
2562SN/A
2572390SN/A    // number of cycles stalled for I-cache retries
2585999Snate@binkert.org    Stats::Scalar icacheRetryCycles;
2592390SN/A    Counter lastIcacheRetry;
2602390SN/A
2612390SN/A    // number of cycles stalled for D-cache responses
2625999Snate@binkert.org    Stats::Scalar dcacheStallCycles;
2632SN/A    Counter lastDcacheStall;
2642SN/A
2652390SN/A    // number of cycles stalled for D-cache retries
2665999Snate@binkert.org    Stats::Scalar dcacheRetryCycles;
2672390SN/A    Counter lastDcacheRetry;
2682390SN/A
2699448SAndreas.Sandberg@ARM.com    void serializeThread(std::ostream &os, ThreadID tid);
2709448SAndreas.Sandberg@ARM.com    void unserializeThread(Checkpoint *cp, const std::string &section,
2719448SAndreas.Sandberg@ARM.com                           ThreadID tid);
2722SN/A
2731371SN/A    // These functions are only used in CPU models that split
2741371SN/A    // effective address computation from the actual memory access.
2752623SN/A    void setEA(Addr EA) { panic("BaseSimpleCPU::setEA() not implemented\n"); }
2765543Ssaidi@eecs.umich.edu    Addr getEA()        { panic("BaseSimpleCPU::getEA() not implemented\n");
2773918Ssaidi@eecs.umich.edu        M5_DUMMY_RETURN}
2781371SN/A
279726SN/A    // The register accessor methods provide the index of the
280726SN/A    // instruction's operand (e.g., 0 or 1), not the architectural
281726SN/A    // register index, to simplify the implementation of register
282726SN/A    // renaming.  We find the architectural register index by indexing
283726SN/A    // into the instruction's own operand index table.  Note that a
284726SN/A    // raw pointer to the StaticInst is provided instead of a
285726SN/A    // ref-counted StaticInstPtr to redice overhead.  This is fine as
286726SN/A    // long as these methods don't copy the pointer into any long-term
287726SN/A    // storage (which is pretty hard to imagine they would have reason
288726SN/A    // to do).
289705SN/A
2903735Sstever@eecs.umich.edu    uint64_t readIntRegOperand(const StaticInst *si, int idx)
291726SN/A    {
2927897Shestness@cs.utexas.edu        numIntRegReads++;
2932683Sktlim@umich.edu        return thread->readIntReg(si->srcRegIdx(idx));
294726SN/A    }
295705SN/A
2963735Sstever@eecs.umich.edu    FloatReg readFloatRegOperand(const StaticInst *si, int idx)
297726SN/A    {
2987897Shestness@cs.utexas.edu        numFpRegReads++;
2999918Ssteve.reinhardt@amd.com        int reg_idx = si->srcRegIdx(idx) - TheISA::FP_Reg_Base;
3002683Sktlim@umich.edu        return thread->readFloatReg(reg_idx);
301726SN/A    }
302705SN/A
3033735Sstever@eecs.umich.edu    FloatRegBits readFloatRegOperandBits(const StaticInst *si, int idx)
3042455SN/A    {
3057897Shestness@cs.utexas.edu        numFpRegReads++;
3069918Ssteve.reinhardt@amd.com        int reg_idx = si->srcRegIdx(idx) - TheISA::FP_Reg_Base;
3072683Sktlim@umich.edu        return thread->readFloatRegBits(reg_idx);
308726SN/A    }
309705SN/A
3103735Sstever@eecs.umich.edu    void setIntRegOperand(const StaticInst *si, int idx, uint64_t val)
311726SN/A    {
3127897Shestness@cs.utexas.edu        numIntRegWrites++;
3132683Sktlim@umich.edu        thread->setIntReg(si->destRegIdx(idx), val);
314726SN/A    }
315705SN/A
3163735Sstever@eecs.umich.edu    void setFloatRegOperand(const StaticInst *si, int idx, FloatReg val)
317726SN/A    {
3187897Shestness@cs.utexas.edu        numFpRegWrites++;
3199918Ssteve.reinhardt@amd.com        int reg_idx = si->destRegIdx(idx) - TheISA::FP_Reg_Base;
3202683Sktlim@umich.edu        thread->setFloatReg(reg_idx, val);
321726SN/A    }
322726SN/A
3233735Sstever@eecs.umich.edu    void setFloatRegOperandBits(const StaticInst *si, int idx,
3243735Sstever@eecs.umich.edu                                FloatRegBits val)
3252455SN/A    {
3267897Shestness@cs.utexas.edu        numFpRegWrites++;
3279918Ssteve.reinhardt@amd.com        int reg_idx = si->destRegIdx(idx) - TheISA::FP_Reg_Base;
3282683Sktlim@umich.edu        thread->setFloatRegBits(reg_idx, val);
329726SN/A    }
330705SN/A
3317597Sminkyu.jeong@arm.com    bool readPredicate() { return thread->readPredicate(); }
3327597Sminkyu.jeong@arm.com    void setPredicate(bool val)
3337600Sminkyu.jeong@arm.com    {
3347600Sminkyu.jeong@arm.com        thread->setPredicate(val);
3357600Sminkyu.jeong@arm.com        if (traceData) {
3367600Sminkyu.jeong@arm.com            traceData->setPredicate(val);
3377600Sminkyu.jeong@arm.com        }
3387600Sminkyu.jeong@arm.com    }
3397720Sgblack@eecs.umich.edu    TheISA::PCState pcState() { return thread->pcState(); }
3407720Sgblack@eecs.umich.edu    void pcState(const TheISA::PCState &val) { thread->pcState(val); }
3417720Sgblack@eecs.umich.edu    Addr instAddr() { return thread->instAddr(); }
3427720Sgblack@eecs.umich.edu    Addr nextInstAddr() { return thread->nextInstAddr(); }
3437720Sgblack@eecs.umich.edu    MicroPC microPC() { return thread->microPC(); }
344705SN/A
3454172Ssaidi@eecs.umich.edu    MiscReg readMiscRegNoEffect(int misc_reg)
3464172Ssaidi@eecs.umich.edu    {
3474172Ssaidi@eecs.umich.edu        return thread->readMiscRegNoEffect(misc_reg);
3484172Ssaidi@eecs.umich.edu    }
3494172Ssaidi@eecs.umich.edu
3502159SN/A    MiscReg readMiscReg(int misc_reg)
3512159SN/A    {
3527897Shestness@cs.utexas.edu        numIntRegReads++;
3532683Sktlim@umich.edu        return thread->readMiscReg(misc_reg);
3542159SN/A    }
355705SN/A
3563468Sgblack@eecs.umich.edu    void setMiscReg(int misc_reg, const MiscReg &val)
3572159SN/A    {
3587897Shestness@cs.utexas.edu        numIntRegWrites++;
3592683Sktlim@umich.edu        return thread->setMiscReg(misc_reg, val);
3602159SN/A    }
3612159SN/A
3624185Ssaidi@eecs.umich.edu    MiscReg readMiscRegOperand(const StaticInst *si, int idx)
3633792Sgblack@eecs.umich.edu    {
3647897Shestness@cs.utexas.edu        numIntRegReads++;
3659918Ssteve.reinhardt@amd.com        int reg_idx = si->srcRegIdx(idx) - TheISA::Misc_Reg_Base;
3663792Sgblack@eecs.umich.edu        return thread->readMiscReg(reg_idx);
3673792Sgblack@eecs.umich.edu    }
3683792Sgblack@eecs.umich.edu
3694185Ssaidi@eecs.umich.edu    void setMiscRegOperand(
3703792Sgblack@eecs.umich.edu            const StaticInst *si, int idx, const MiscReg &val)
3713792Sgblack@eecs.umich.edu    {
3727897Shestness@cs.utexas.edu        numIntRegWrites++;
3739918Ssteve.reinhardt@amd.com        int reg_idx = si->destRegIdx(idx) - TheISA::Misc_Reg_Base;
3744172Ssaidi@eecs.umich.edu        return thread->setMiscReg(reg_idx, val);
3753792Sgblack@eecs.umich.edu    }
3763792Sgblack@eecs.umich.edu
3775358Sgblack@eecs.umich.edu    void demapPage(Addr vaddr, uint64_t asn)
3785358Sgblack@eecs.umich.edu    {
3795358Sgblack@eecs.umich.edu        thread->demapPage(vaddr, asn);
3805358Sgblack@eecs.umich.edu    }
3815358Sgblack@eecs.umich.edu
3825358Sgblack@eecs.umich.edu    void demapInstPage(Addr vaddr, uint64_t asn)
3835358Sgblack@eecs.umich.edu    {
3845358Sgblack@eecs.umich.edu        thread->demapInstPage(vaddr, asn);
3855358Sgblack@eecs.umich.edu    }
3865358Sgblack@eecs.umich.edu
3875358Sgblack@eecs.umich.edu    void demapDataPage(Addr vaddr, uint64_t asn)
3885358Sgblack@eecs.umich.edu    {
3895358Sgblack@eecs.umich.edu        thread->demapDataPage(vaddr, asn);
3905358Sgblack@eecs.umich.edu    }
3915358Sgblack@eecs.umich.edu
3924027Sstever@eecs.umich.edu    unsigned readStCondFailures() {
3934027Sstever@eecs.umich.edu        return thread->readStCondFailures();
3944027Sstever@eecs.umich.edu    }
3954027Sstever@eecs.umich.edu
3964027Sstever@eecs.umich.edu    void setStCondFailures(unsigned sc_failures) {
3974027Sstever@eecs.umich.edu        thread->setStCondFailures(sc_failures);
3984027Sstever@eecs.umich.edu    }
3994027Sstever@eecs.umich.edu
4006221Snate@binkert.org     MiscReg readRegOtherThread(int regIdx, ThreadID tid = InvalidThreadID)
4014661Sksewell@umich.edu     {
4024661Sksewell@umich.edu        panic("Simple CPU models do not support multithreaded "
4034661Sksewell@umich.edu              "register access.\n");
4044661Sksewell@umich.edu     }
4054661Sksewell@umich.edu
4066221Snate@binkert.org     void setRegOtherThread(int regIdx, const MiscReg &val,
4076221Snate@binkert.org                            ThreadID tid = InvalidThreadID)
4084661Sksewell@umich.edu     {
4094661Sksewell@umich.edu        panic("Simple CPU models do not support multithreaded "
4104661Sksewell@umich.edu              "register access.\n");
4114661Sksewell@umich.edu     }
4124661Sksewell@umich.edu
4135250Sksewell@umich.edu    //Fault CacheOp(uint8_t Op, Addr EA);
4145222Sksewell@umich.edu
4155702Ssaidi@eecs.umich.edu    Fault hwrei() { return thread->hwrei(); }
4165702Ssaidi@eecs.umich.edu    bool simPalCheck(int palFunc) { return thread->simPalCheck(palFunc); }
4178557Sgblack@eecs.umich.edu
4188557Sgblack@eecs.umich.edu    void
4198557Sgblack@eecs.umich.edu    syscall(int64_t callnum)
4208557Sgblack@eecs.umich.edu    {
4218779Sgblack@eecs.umich.edu        if (FullSystem)
4228779Sgblack@eecs.umich.edu            panic("Syscall emulation isn't available in FS mode.\n");
4238806Sgblack@eecs.umich.edu
4248557Sgblack@eecs.umich.edu        thread->syscall(callnum);
4258557Sgblack@eecs.umich.edu    }
426705SN/A
4272683Sktlim@umich.edu    bool misspeculating() { return thread->misspeculating(); }
4282680Sktlim@umich.edu    ThreadContext *tcBase() { return tc; }
4292SN/A};
4302SN/A
4312623SN/A#endif // __CPU_SIMPLE_BASE_HH__
432