base.hh revision 9920
12SN/A/*
29448SAndreas.Sandberg@ARM.com * Copyright (c) 2011-2012 ARM Limited
39920Syasuko.eckert@amd.com * Copyright (c) 2013 Advanced Micro Devices, Inc.
48733Sgeoffrey.blake@arm.com * All rights reserved
58733Sgeoffrey.blake@arm.com *
68733Sgeoffrey.blake@arm.com * The license below extends only to copyright in the software and shall
78733Sgeoffrey.blake@arm.com * not be construed as granting a license to any other intellectual
88733Sgeoffrey.blake@arm.com * property including but not limited to intellectual property relating
98733Sgeoffrey.blake@arm.com * to a hardware implementation of the functionality of the software
108733Sgeoffrey.blake@arm.com * licensed hereunder.  You may use the software subject to the license
118733Sgeoffrey.blake@arm.com * terms below provided that you ensure that this notice is replicated
128733Sgeoffrey.blake@arm.com * unmodified and in its entirety in all distributions of the software,
138733Sgeoffrey.blake@arm.com * modified or unmodified, in source code or in binary form.
148733Sgeoffrey.blake@arm.com *
151762SN/A * Copyright (c) 2002-2005 The Regents of The University of Michigan
162SN/A * All rights reserved.
172SN/A *
182SN/A * Redistribution and use in source and binary forms, with or without
192SN/A * modification, are permitted provided that the following conditions are
202SN/A * met: redistributions of source code must retain the above copyright
212SN/A * notice, this list of conditions and the following disclaimer;
222SN/A * redistributions in binary form must reproduce the above copyright
232SN/A * notice, this list of conditions and the following disclaimer in the
242SN/A * documentation and/or other materials provided with the distribution;
252SN/A * neither the name of the copyright holders nor the names of its
262SN/A * contributors may be used to endorse or promote products derived from
272SN/A * this software without specific prior written permission.
282SN/A *
292SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
302SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
312SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
322SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
332SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
342SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
352SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
362SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
372SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
382SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
392SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
402665Ssaidi@eecs.umich.edu *
412665Ssaidi@eecs.umich.edu * Authors: Steve Reinhardt
422665Ssaidi@eecs.umich.edu *          Dave Greene
432665Ssaidi@eecs.umich.edu *          Nathan Binkert
442SN/A */
452SN/A
462623SN/A#ifndef __CPU_SIMPLE_BASE_HH__
472623SN/A#define __CPU_SIMPLE_BASE_HH__
482SN/A
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"
538229Snate@binkert.org#include "cpu/pc_event.hh"
542683Sktlim@umich.edu#include "cpu/simple_thread.hh"
551354SN/A#include "cpu/static_inst.hh"
562387SN/A#include "mem/packet.hh"
572387SN/A#include "mem/port.hh"
582387SN/A#include "mem/request.hh"
5956SN/A#include "sim/eventq.hh"
608779Sgblack@eecs.umich.edu#include "sim/full_system.hh"
615348Ssaidi@eecs.umich.edu#include "sim/system.hh"
622SN/A
632SN/A// forward declarations
648779Sgblack@eecs.umich.educlass Checkpoint;
658779Sgblack@eecs.umich.educlass Process;
662SN/Aclass Processor;
678779Sgblack@eecs.umich.educlass ThreadContext;
682SN/A
694182Sgblack@eecs.umich.edunamespace TheISA
704182Sgblack@eecs.umich.edu{
718779Sgblack@eecs.umich.edu    class DTB;
728779Sgblack@eecs.umich.edu    class ITB;
734182Sgblack@eecs.umich.edu}
742SN/A
752SN/Anamespace Trace {
762SN/A    class InstRecord;
772SN/A}
782SN/A
798737Skoansin.tan@gmail.comstruct BaseSimpleCPUParams;
805529Snate@binkert.org
812420SN/A
822623SN/Aclass BaseSimpleCPU : public BaseCPU
832SN/A{
842107SN/A  protected:
852159SN/A    typedef TheISA::MiscReg MiscReg;
862455SN/A    typedef TheISA::FloatReg FloatReg;
872455SN/A    typedef TheISA::FloatRegBits FloatRegBits;
889920Syasuko.eckert@amd.com    typedef TheISA::CCReg CCReg;
892386SN/A
902623SN/A  protected:
912SN/A    Trace::InstRecord *traceData;
921371SN/A
935348Ssaidi@eecs.umich.edu    inline void checkPcEventQueue() {
947720Sgblack@eecs.umich.edu        Addr oldpc, pc = thread->instAddr();
955348Ssaidi@eecs.umich.edu        do {
967720Sgblack@eecs.umich.edu            oldpc = pc;
975348Ssaidi@eecs.umich.edu            system->pcEventQueue.service(tc);
987720Sgblack@eecs.umich.edu            pc = thread->instAddr();
997720Sgblack@eecs.umich.edu        } while (oldpc != pc);
1005348Ssaidi@eecs.umich.edu    }
1015348Ssaidi@eecs.umich.edu
1022SN/A  public:
1035807Snate@binkert.org    void wakeup();
1042SN/A
1052SN/A    void zero_fill_64(Addr addr) {
1062SN/A      static int warned = 0;
1072SN/A      if (!warned) {
1082SN/A        warn ("WH64 is not implemented");
1092SN/A        warned = 1;
1102SN/A      }
1112SN/A    };
1122SN/A
1131400SN/A  public:
1145529Snate@binkert.org    BaseSimpleCPU(BaseSimpleCPUParams *params);
1152623SN/A    virtual ~BaseSimpleCPU();
1162SN/A
1171400SN/A  public:
1182683Sktlim@umich.edu    /** SimpleThread object, provides all the architectural state. */
1192683Sktlim@umich.edu    SimpleThread *thread;
1202190SN/A
1212683Sktlim@umich.edu    /** ThreadContext object, provides an interface for external
1222683Sktlim@umich.edu     * objects to modify this thread's state.
1232683Sktlim@umich.edu     */
1242680Sktlim@umich.edu    ThreadContext *tc;
1258733Sgeoffrey.blake@arm.com
1268733Sgeoffrey.blake@arm.com    CheckerCPU *checker;
1278887Sgeoffrey.blake@arm.com
1285169Ssaidi@eecs.umich.edu  protected:
1295169Ssaidi@eecs.umich.edu
1305496Ssaidi@eecs.umich.edu    enum Status {
1315496Ssaidi@eecs.umich.edu        Idle,
1325496Ssaidi@eecs.umich.edu        Running,
1338276SAli.Saidi@ARM.com        Faulting,
1345894Sgblack@eecs.umich.edu        ITBWaitResponse,
1355496Ssaidi@eecs.umich.edu        IcacheRetry,
1365496Ssaidi@eecs.umich.edu        IcacheWaitResponse,
1375496Ssaidi@eecs.umich.edu        IcacheWaitSwitch,
1385894Sgblack@eecs.umich.edu        DTBWaitResponse,
1395496Ssaidi@eecs.umich.edu        DcacheRetry,
1405496Ssaidi@eecs.umich.edu        DcacheWaitResponse,
1415496Ssaidi@eecs.umich.edu        DcacheWaitSwitch,
1425496Ssaidi@eecs.umich.edu    };
1435496Ssaidi@eecs.umich.edu
1445496Ssaidi@eecs.umich.edu    Status _status;
1455496Ssaidi@eecs.umich.edu
1465169Ssaidi@eecs.umich.edu  public:
1472SN/A
1482SN/A    Addr dbg_vtophys(Addr addr);
1492SN/A
1502SN/A    bool interval_stats;
1512SN/A
1522SN/A    // current instruction
1534181Sgblack@eecs.umich.edu    TheISA::MachInst inst;
1544181Sgblack@eecs.umich.edu
1552107SN/A    StaticInstPtr curStaticInst;
1563276Sgblack@eecs.umich.edu    StaticInstPtr curMacroStaticInst;
1571469SN/A
1584377Sgblack@eecs.umich.edu    //This is the offset from the current pc that fetch should be performed at
1594377Sgblack@eecs.umich.edu    Addr fetchOffset;
1604377Sgblack@eecs.umich.edu    //This flag says to stay at the current pc. This is useful for
1614377Sgblack@eecs.umich.edu    //instructions which go beyond MachInst boundaries.
1624377Sgblack@eecs.umich.edu    bool stayAtPC;
1634377Sgblack@eecs.umich.edu
1642623SN/A    void checkForInterrupts();
1655894Sgblack@eecs.umich.edu    void setupFetchRequest(Request *req);
1662623SN/A    void preExecute();
1672623SN/A    void postExecute();
1682623SN/A    void advancePC(Fault fault);
169180SN/A
1708737Skoansin.tan@gmail.com    virtual void deallocateContext(ThreadID thread_num);
1718737Skoansin.tan@gmail.com    virtual void haltContext(ThreadID thread_num);
1722SN/A
1732SN/A    // statistics
174334SN/A    virtual void regStats();
175334SN/A    virtual void resetStats();
1762SN/A
1779461Snilay@cs.wisc.edu    virtual void startup();
1789461Snilay@cs.wisc.edu
1792SN/A    // number of simulated instructions
1802SN/A    Counter numInst;
181334SN/A    Counter startNumInst;
1825999Snate@binkert.org    Stats::Scalar numInsts;
1838834Satgutier@umich.edu    Counter numOp;
1848834Satgutier@umich.edu    Counter startNumOp;
1858834Satgutier@umich.edu    Stats::Scalar numOps;
186707SN/A
1874998Sgblack@eecs.umich.edu    void countInst()
1884998Sgblack@eecs.umich.edu    {
1898834Satgutier@umich.edu        if (!curStaticInst->isMicroop() || curStaticInst->isLastMicroop()) {
1908834Satgutier@umich.edu            numInst++;
1918834Satgutier@umich.edu            numInsts++;
1928834Satgutier@umich.edu        }
1938834Satgutier@umich.edu        numOp++;
1948834Satgutier@umich.edu        numOps++;
1958834Satgutier@umich.edu
1967897Shestness@cs.utexas.edu        system->totalNumInsts++;
1974998Sgblack@eecs.umich.edu        thread->funcExeInst++;
1984998Sgblack@eecs.umich.edu    }
1994998Sgblack@eecs.umich.edu
2008834Satgutier@umich.edu    virtual Counter totalInsts() const
201707SN/A    {
202707SN/A        return numInst - startNumInst;
203707SN/A    }
2042SN/A
2058834Satgutier@umich.edu    virtual Counter totalOps() const
2068834Satgutier@umich.edu    {
2078834Satgutier@umich.edu        return numOp - startNumOp;
2088834Satgutier@umich.edu    }
2098834Satgutier@umich.edu
2107897Shestness@cs.utexas.edu    //number of integer alu accesses
2117897Shestness@cs.utexas.edu    Stats::Scalar numIntAluAccesses;
2127897Shestness@cs.utexas.edu
2137897Shestness@cs.utexas.edu    //number of float alu accesses
2147897Shestness@cs.utexas.edu    Stats::Scalar numFpAluAccesses;
2157897Shestness@cs.utexas.edu
2167897Shestness@cs.utexas.edu    //number of function calls/returns
2177897Shestness@cs.utexas.edu    Stats::Scalar numCallsReturns;
2187897Shestness@cs.utexas.edu
2197897Shestness@cs.utexas.edu    //conditional control instructions;
2207897Shestness@cs.utexas.edu    Stats::Scalar numCondCtrlInsts;
2217897Shestness@cs.utexas.edu
2227897Shestness@cs.utexas.edu    //number of int instructions
2237897Shestness@cs.utexas.edu    Stats::Scalar numIntInsts;
2247897Shestness@cs.utexas.edu
2257897Shestness@cs.utexas.edu    //number of float instructions
2267897Shestness@cs.utexas.edu    Stats::Scalar numFpInsts;
2277897Shestness@cs.utexas.edu
2287897Shestness@cs.utexas.edu    //number of integer register file accesses
2297897Shestness@cs.utexas.edu    Stats::Scalar numIntRegReads;
2307897Shestness@cs.utexas.edu    Stats::Scalar numIntRegWrites;
2317897Shestness@cs.utexas.edu
2327897Shestness@cs.utexas.edu    //number of float register file accesses
2337897Shestness@cs.utexas.edu    Stats::Scalar numFpRegReads;
2347897Shestness@cs.utexas.edu    Stats::Scalar numFpRegWrites;
2357897Shestness@cs.utexas.edu
2369920Syasuko.eckert@amd.com    //number of condition code register file accesses
2379920Syasuko.eckert@amd.com    Stats::Scalar numCCRegReads;
2389920Syasuko.eckert@amd.com    Stats::Scalar numCCRegWrites;
2399920Syasuko.eckert@amd.com
2402SN/A    // number of simulated memory references
2415999Snate@binkert.org    Stats::Scalar numMemRefs;
2427897Shestness@cs.utexas.edu    Stats::Scalar numLoadInsts;
2437897Shestness@cs.utexas.edu    Stats::Scalar numStoreInsts;
2447897Shestness@cs.utexas.edu
2457897Shestness@cs.utexas.edu    // number of idle cycles
2467897Shestness@cs.utexas.edu    Stats::Formula numIdleCycles;
2477897Shestness@cs.utexas.edu
2487897Shestness@cs.utexas.edu    // number of busy cycles
2497897Shestness@cs.utexas.edu    Stats::Formula numBusyCycles;
2502SN/A
251124SN/A    // number of simulated loads
252124SN/A    Counter numLoad;
253334SN/A    Counter startNumLoad;
254124SN/A
2552SN/A    // number of idle cycles
2565999Snate@binkert.org    Stats::Average notIdleFraction;
257729SN/A    Stats::Formula idleFraction;
2582SN/A
2592390SN/A    // number of cycles stalled for I-cache responses
2605999Snate@binkert.org    Stats::Scalar icacheStallCycles;
2612SN/A    Counter lastIcacheStall;
2622SN/A
2632390SN/A    // number of cycles stalled for I-cache retries
2645999Snate@binkert.org    Stats::Scalar icacheRetryCycles;
2652390SN/A    Counter lastIcacheRetry;
2662390SN/A
2672390SN/A    // number of cycles stalled for D-cache responses
2685999Snate@binkert.org    Stats::Scalar dcacheStallCycles;
2692SN/A    Counter lastDcacheStall;
2702SN/A
2712390SN/A    // number of cycles stalled for D-cache retries
2725999Snate@binkert.org    Stats::Scalar dcacheRetryCycles;
2732390SN/A    Counter lastDcacheRetry;
2742390SN/A
2759448SAndreas.Sandberg@ARM.com    void serializeThread(std::ostream &os, ThreadID tid);
2769448SAndreas.Sandberg@ARM.com    void unserializeThread(Checkpoint *cp, const std::string &section,
2779448SAndreas.Sandberg@ARM.com                           ThreadID tid);
2782SN/A
2791371SN/A    // These functions are only used in CPU models that split
2801371SN/A    // effective address computation from the actual memory access.
2812623SN/A    void setEA(Addr EA) { panic("BaseSimpleCPU::setEA() not implemented\n"); }
2825543Ssaidi@eecs.umich.edu    Addr getEA()        { panic("BaseSimpleCPU::getEA() not implemented\n");
2833918Ssaidi@eecs.umich.edu        M5_DUMMY_RETURN}
2841371SN/A
285726SN/A    // The register accessor methods provide the index of the
286726SN/A    // instruction's operand (e.g., 0 or 1), not the architectural
287726SN/A    // register index, to simplify the implementation of register
288726SN/A    // renaming.  We find the architectural register index by indexing
289726SN/A    // into the instruction's own operand index table.  Note that a
290726SN/A    // raw pointer to the StaticInst is provided instead of a
291726SN/A    // ref-counted StaticInstPtr to redice overhead.  This is fine as
292726SN/A    // long as these methods don't copy the pointer into any long-term
293726SN/A    // storage (which is pretty hard to imagine they would have reason
294726SN/A    // to do).
295705SN/A
2963735Sstever@eecs.umich.edu    uint64_t readIntRegOperand(const StaticInst *si, int idx)
297726SN/A    {
2987897Shestness@cs.utexas.edu        numIntRegReads++;
2992683Sktlim@umich.edu        return thread->readIntReg(si->srcRegIdx(idx));
300726SN/A    }
301705SN/A
3023735Sstever@eecs.umich.edu    FloatReg readFloatRegOperand(const StaticInst *si, int idx)
303726SN/A    {
3047897Shestness@cs.utexas.edu        numFpRegReads++;
3059918Ssteve.reinhardt@amd.com        int reg_idx = si->srcRegIdx(idx) - TheISA::FP_Reg_Base;
3062683Sktlim@umich.edu        return thread->readFloatReg(reg_idx);
307726SN/A    }
308705SN/A
3093735Sstever@eecs.umich.edu    FloatRegBits readFloatRegOperandBits(const StaticInst *si, int idx)
3102455SN/A    {
3117897Shestness@cs.utexas.edu        numFpRegReads++;
3129918Ssteve.reinhardt@amd.com        int reg_idx = si->srcRegIdx(idx) - TheISA::FP_Reg_Base;
3132683Sktlim@umich.edu        return thread->readFloatRegBits(reg_idx);
314726SN/A    }
315705SN/A
3169920Syasuko.eckert@amd.com    CCReg readCCRegOperand(const StaticInst *si, int idx)
3179920Syasuko.eckert@amd.com    {
3189920Syasuko.eckert@amd.com        numCCRegReads++;
3199920Syasuko.eckert@amd.com        int reg_idx = si->srcRegIdx(idx) - TheISA::CC_Reg_Base;
3209920Syasuko.eckert@amd.com        return thread->readCCReg(reg_idx);
3219920Syasuko.eckert@amd.com    }
3229920Syasuko.eckert@amd.com
3233735Sstever@eecs.umich.edu    void setIntRegOperand(const StaticInst *si, int idx, uint64_t val)
324726SN/A    {
3257897Shestness@cs.utexas.edu        numIntRegWrites++;
3262683Sktlim@umich.edu        thread->setIntReg(si->destRegIdx(idx), val);
327726SN/A    }
328705SN/A
3293735Sstever@eecs.umich.edu    void setFloatRegOperand(const StaticInst *si, int idx, FloatReg val)
330726SN/A    {
3317897Shestness@cs.utexas.edu        numFpRegWrites++;
3329918Ssteve.reinhardt@amd.com        int reg_idx = si->destRegIdx(idx) - TheISA::FP_Reg_Base;
3332683Sktlim@umich.edu        thread->setFloatReg(reg_idx, val);
334726SN/A    }
335726SN/A
3363735Sstever@eecs.umich.edu    void setFloatRegOperandBits(const StaticInst *si, int idx,
3373735Sstever@eecs.umich.edu                                FloatRegBits val)
3382455SN/A    {
3397897Shestness@cs.utexas.edu        numFpRegWrites++;
3409918Ssteve.reinhardt@amd.com        int reg_idx = si->destRegIdx(idx) - TheISA::FP_Reg_Base;
3412683Sktlim@umich.edu        thread->setFloatRegBits(reg_idx, val);
342726SN/A    }
343705SN/A
3449920Syasuko.eckert@amd.com    void setCCRegOperand(const StaticInst *si, int idx, CCReg val)
3459920Syasuko.eckert@amd.com    {
3469920Syasuko.eckert@amd.com        numCCRegWrites++;
3479920Syasuko.eckert@amd.com        int reg_idx = si->destRegIdx(idx) - TheISA::CC_Reg_Base;
3489920Syasuko.eckert@amd.com        thread->setCCReg(reg_idx, val);
3499920Syasuko.eckert@amd.com    }
3509920Syasuko.eckert@amd.com
3517597Sminkyu.jeong@arm.com    bool readPredicate() { return thread->readPredicate(); }
3527597Sminkyu.jeong@arm.com    void setPredicate(bool val)
3537600Sminkyu.jeong@arm.com    {
3547600Sminkyu.jeong@arm.com        thread->setPredicate(val);
3557600Sminkyu.jeong@arm.com        if (traceData) {
3567600Sminkyu.jeong@arm.com            traceData->setPredicate(val);
3577600Sminkyu.jeong@arm.com        }
3587600Sminkyu.jeong@arm.com    }
3597720Sgblack@eecs.umich.edu    TheISA::PCState pcState() { return thread->pcState(); }
3607720Sgblack@eecs.umich.edu    void pcState(const TheISA::PCState &val) { thread->pcState(val); }
3617720Sgblack@eecs.umich.edu    Addr instAddr() { return thread->instAddr(); }
3627720Sgblack@eecs.umich.edu    Addr nextInstAddr() { return thread->nextInstAddr(); }
3637720Sgblack@eecs.umich.edu    MicroPC microPC() { return thread->microPC(); }
364705SN/A
3654172Ssaidi@eecs.umich.edu    MiscReg readMiscRegNoEffect(int misc_reg)
3664172Ssaidi@eecs.umich.edu    {
3674172Ssaidi@eecs.umich.edu        return thread->readMiscRegNoEffect(misc_reg);
3684172Ssaidi@eecs.umich.edu    }
3694172Ssaidi@eecs.umich.edu
3702159SN/A    MiscReg readMiscReg(int misc_reg)
3712159SN/A    {
3727897Shestness@cs.utexas.edu        numIntRegReads++;
3732683Sktlim@umich.edu        return thread->readMiscReg(misc_reg);
3742159SN/A    }
375705SN/A
3763468Sgblack@eecs.umich.edu    void setMiscReg(int misc_reg, const MiscReg &val)
3772159SN/A    {
3787897Shestness@cs.utexas.edu        numIntRegWrites++;
3792683Sktlim@umich.edu        return thread->setMiscReg(misc_reg, val);
3802159SN/A    }
3812159SN/A
3824185Ssaidi@eecs.umich.edu    MiscReg readMiscRegOperand(const StaticInst *si, int idx)
3833792Sgblack@eecs.umich.edu    {
3847897Shestness@cs.utexas.edu        numIntRegReads++;
3859918Ssteve.reinhardt@amd.com        int reg_idx = si->srcRegIdx(idx) - TheISA::Misc_Reg_Base;
3863792Sgblack@eecs.umich.edu        return thread->readMiscReg(reg_idx);
3873792Sgblack@eecs.umich.edu    }
3883792Sgblack@eecs.umich.edu
3894185Ssaidi@eecs.umich.edu    void setMiscRegOperand(
3903792Sgblack@eecs.umich.edu            const StaticInst *si, int idx, const MiscReg &val)
3913792Sgblack@eecs.umich.edu    {
3927897Shestness@cs.utexas.edu        numIntRegWrites++;
3939918Ssteve.reinhardt@amd.com        int reg_idx = si->destRegIdx(idx) - TheISA::Misc_Reg_Base;
3944172Ssaidi@eecs.umich.edu        return thread->setMiscReg(reg_idx, val);
3953792Sgblack@eecs.umich.edu    }
3963792Sgblack@eecs.umich.edu
3975358Sgblack@eecs.umich.edu    void demapPage(Addr vaddr, uint64_t asn)
3985358Sgblack@eecs.umich.edu    {
3995358Sgblack@eecs.umich.edu        thread->demapPage(vaddr, asn);
4005358Sgblack@eecs.umich.edu    }
4015358Sgblack@eecs.umich.edu
4025358Sgblack@eecs.umich.edu    void demapInstPage(Addr vaddr, uint64_t asn)
4035358Sgblack@eecs.umich.edu    {
4045358Sgblack@eecs.umich.edu        thread->demapInstPage(vaddr, asn);
4055358Sgblack@eecs.umich.edu    }
4065358Sgblack@eecs.umich.edu
4075358Sgblack@eecs.umich.edu    void demapDataPage(Addr vaddr, uint64_t asn)
4085358Sgblack@eecs.umich.edu    {
4095358Sgblack@eecs.umich.edu        thread->demapDataPage(vaddr, asn);
4105358Sgblack@eecs.umich.edu    }
4115358Sgblack@eecs.umich.edu
4124027Sstever@eecs.umich.edu    unsigned readStCondFailures() {
4134027Sstever@eecs.umich.edu        return thread->readStCondFailures();
4144027Sstever@eecs.umich.edu    }
4154027Sstever@eecs.umich.edu
4164027Sstever@eecs.umich.edu    void setStCondFailures(unsigned sc_failures) {
4174027Sstever@eecs.umich.edu        thread->setStCondFailures(sc_failures);
4184027Sstever@eecs.umich.edu    }
4194027Sstever@eecs.umich.edu
4206221Snate@binkert.org     MiscReg readRegOtherThread(int regIdx, ThreadID tid = InvalidThreadID)
4214661Sksewell@umich.edu     {
4224661Sksewell@umich.edu        panic("Simple CPU models do not support multithreaded "
4234661Sksewell@umich.edu              "register access.\n");
4244661Sksewell@umich.edu     }
4254661Sksewell@umich.edu
4266221Snate@binkert.org     void setRegOtherThread(int regIdx, const MiscReg &val,
4276221Snate@binkert.org                            ThreadID tid = InvalidThreadID)
4284661Sksewell@umich.edu     {
4294661Sksewell@umich.edu        panic("Simple CPU models do not support multithreaded "
4304661Sksewell@umich.edu              "register access.\n");
4314661Sksewell@umich.edu     }
4324661Sksewell@umich.edu
4335250Sksewell@umich.edu    //Fault CacheOp(uint8_t Op, Addr EA);
4345222Sksewell@umich.edu
4355702Ssaidi@eecs.umich.edu    Fault hwrei() { return thread->hwrei(); }
4365702Ssaidi@eecs.umich.edu    bool simPalCheck(int palFunc) { return thread->simPalCheck(palFunc); }
4378557Sgblack@eecs.umich.edu
4388557Sgblack@eecs.umich.edu    void
4398557Sgblack@eecs.umich.edu    syscall(int64_t callnum)
4408557Sgblack@eecs.umich.edu    {
4418779Sgblack@eecs.umich.edu        if (FullSystem)
4428779Sgblack@eecs.umich.edu            panic("Syscall emulation isn't available in FS mode.\n");
4438806Sgblack@eecs.umich.edu
4448557Sgblack@eecs.umich.edu        thread->syscall(callnum);
4458557Sgblack@eecs.umich.edu    }
446705SN/A
4472683Sktlim@umich.edu    bool misspeculating() { return thread->misspeculating(); }
4482680Sktlim@umich.edu    ThreadContext *tcBase() { return tc; }
4492SN/A};
4502SN/A
4512623SN/A#endif // __CPU_SIMPLE_BASE_HH__
452