base.hh revision 8834
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"
518733Sgeoffrey.blake@arm.com#include "config/use_checker.hh"
521717SN/A#include "cpu/base.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
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
698779Sgblack@eecs.umich.educlass Checkpoint;
708779Sgblack@eecs.umich.educlass MemObject;
718779Sgblack@eecs.umich.educlass Process;
722SN/Aclass Processor;
738779Sgblack@eecs.umich.educlass ThreadContext;
742SN/A
754182Sgblack@eecs.umich.edunamespace TheISA
764182Sgblack@eecs.umich.edu{
778779Sgblack@eecs.umich.edu    class DTB;
788779Sgblack@eecs.umich.edu    class ITB;
794182Sgblack@eecs.umich.edu    class Predecoder;
804182Sgblack@eecs.umich.edu}
812SN/A
822SN/Anamespace Trace {
832SN/A    class InstRecord;
842SN/A}
852SN/A
868737Skoansin.tan@gmail.comstruct BaseSimpleCPUParams;
875529Snate@binkert.org
882420SN/A
892623SN/Aclass BaseSimpleCPU : public BaseCPU
902SN/A{
912107SN/A  protected:
922159SN/A    typedef TheISA::MiscReg MiscReg;
932455SN/A    typedef TheISA::FloatReg FloatReg;
942455SN/A    typedef TheISA::FloatRegBits FloatRegBits;
952386SN/A
962623SN/A  protected:
972SN/A    Trace::InstRecord *traceData;
981371SN/A
995348Ssaidi@eecs.umich.edu    inline void checkPcEventQueue() {
1007720Sgblack@eecs.umich.edu        Addr oldpc, pc = thread->instAddr();
1015348Ssaidi@eecs.umich.edu        do {
1027720Sgblack@eecs.umich.edu            oldpc = pc;
1035348Ssaidi@eecs.umich.edu            system->pcEventQueue.service(tc);
1047720Sgblack@eecs.umich.edu            pc = thread->instAddr();
1057720Sgblack@eecs.umich.edu        } while (oldpc != pc);
1065348Ssaidi@eecs.umich.edu    }
1075348Ssaidi@eecs.umich.edu
1082SN/A  public:
1095807Snate@binkert.org    void wakeup();
1102SN/A
1112SN/A    void zero_fill_64(Addr addr) {
1122SN/A      static int warned = 0;
1132SN/A      if (!warned) {
1142SN/A        warn ("WH64 is not implemented");
1152SN/A        warned = 1;
1162SN/A      }
1172SN/A    };
1182SN/A
1191400SN/A  public:
1205529Snate@binkert.org    BaseSimpleCPU(BaseSimpleCPUParams *params);
1212623SN/A    virtual ~BaseSimpleCPU();
1222SN/A
1231400SN/A  public:
1242683Sktlim@umich.edu    /** SimpleThread object, provides all the architectural state. */
1252683Sktlim@umich.edu    SimpleThread *thread;
1262190SN/A
1272683Sktlim@umich.edu    /** ThreadContext object, provides an interface for external
1282683Sktlim@umich.edu     * objects to modify this thread's state.
1292683Sktlim@umich.edu     */
1302680Sktlim@umich.edu    ThreadContext *tc;
1318733Sgeoffrey.blake@arm.com
1328733Sgeoffrey.blake@arm.com#if USE_CHECKER
1338733Sgeoffrey.blake@arm.com    CheckerCPU *checker;
1348733Sgeoffrey.blake@arm.com#endif
1355169Ssaidi@eecs.umich.edu  protected:
1365169Ssaidi@eecs.umich.edu
1375496Ssaidi@eecs.umich.edu    enum Status {
1385496Ssaidi@eecs.umich.edu        Idle,
1395496Ssaidi@eecs.umich.edu        Running,
1408276SAli.Saidi@ARM.com        Faulting,
1415894Sgblack@eecs.umich.edu        ITBWaitResponse,
1425496Ssaidi@eecs.umich.edu        IcacheRetry,
1435496Ssaidi@eecs.umich.edu        IcacheWaitResponse,
1445496Ssaidi@eecs.umich.edu        IcacheWaitSwitch,
1455894Sgblack@eecs.umich.edu        DTBWaitResponse,
1465496Ssaidi@eecs.umich.edu        DcacheRetry,
1475496Ssaidi@eecs.umich.edu        DcacheWaitResponse,
1485496Ssaidi@eecs.umich.edu        DcacheWaitSwitch,
1495496Ssaidi@eecs.umich.edu        SwitchedOut
1505496Ssaidi@eecs.umich.edu    };
1515496Ssaidi@eecs.umich.edu
1525496Ssaidi@eecs.umich.edu    Status _status;
1535496Ssaidi@eecs.umich.edu
1545169Ssaidi@eecs.umich.edu  public:
1552SN/A
1562SN/A    Addr dbg_vtophys(Addr addr);
1572SN/A
1582SN/A    bool interval_stats;
1592SN/A
1602SN/A    // current instruction
1614181Sgblack@eecs.umich.edu    TheISA::MachInst inst;
1624181Sgblack@eecs.umich.edu
1634182Sgblack@eecs.umich.edu    // The predecoder
1644182Sgblack@eecs.umich.edu    TheISA::Predecoder predecoder;
1652SN/A
1662107SN/A    StaticInstPtr curStaticInst;
1673276Sgblack@eecs.umich.edu    StaticInstPtr curMacroStaticInst;
1681469SN/A
1694377Sgblack@eecs.umich.edu    //This is the offset from the current pc that fetch should be performed at
1704377Sgblack@eecs.umich.edu    Addr fetchOffset;
1714377Sgblack@eecs.umich.edu    //This flag says to stay at the current pc. This is useful for
1724377Sgblack@eecs.umich.edu    //instructions which go beyond MachInst boundaries.
1734377Sgblack@eecs.umich.edu    bool stayAtPC;
1744377Sgblack@eecs.umich.edu
1752623SN/A    void checkForInterrupts();
1765894Sgblack@eecs.umich.edu    void setupFetchRequest(Request *req);
1772623SN/A    void preExecute();
1782623SN/A    void postExecute();
1792623SN/A    void advancePC(Fault fault);
180180SN/A
1818737Skoansin.tan@gmail.com    virtual void deallocateContext(ThreadID thread_num);
1828737Skoansin.tan@gmail.com    virtual void haltContext(ThreadID thread_num);
1832SN/A
1842SN/A    // statistics
185334SN/A    virtual void regStats();
186334SN/A    virtual void resetStats();
1872SN/A
1882SN/A    // number of simulated instructions
1892SN/A    Counter numInst;
190334SN/A    Counter startNumInst;
1915999Snate@binkert.org    Stats::Scalar numInsts;
1928834Satgutier@umich.edu    Counter numOp;
1938834Satgutier@umich.edu    Counter startNumOp;
1948834Satgutier@umich.edu    Stats::Scalar numOps;
195707SN/A
1964998Sgblack@eecs.umich.edu    void countInst()
1974998Sgblack@eecs.umich.edu    {
1988834Satgutier@umich.edu        if (!curStaticInst->isMicroop() || curStaticInst->isLastMicroop()) {
1998834Satgutier@umich.edu            numInst++;
2008834Satgutier@umich.edu            numInsts++;
2018834Satgutier@umich.edu        }
2028834Satgutier@umich.edu        numOp++;
2038834Satgutier@umich.edu        numOps++;
2048834Satgutier@umich.edu
2057897Shestness@cs.utexas.edu        system->totalNumInsts++;
2064998Sgblack@eecs.umich.edu        thread->funcExeInst++;
2074998Sgblack@eecs.umich.edu    }
2084998Sgblack@eecs.umich.edu
2098834Satgutier@umich.edu    virtual Counter totalInsts() const
210707SN/A    {
211707SN/A        return numInst - startNumInst;
212707SN/A    }
2132SN/A
2148834Satgutier@umich.edu    virtual Counter totalOps() const
2158834Satgutier@umich.edu    {
2168834Satgutier@umich.edu        return numOp - startNumOp;
2178834Satgutier@umich.edu    }
2188834Satgutier@umich.edu
2197897Shestness@cs.utexas.edu    //number of integer alu accesses
2207897Shestness@cs.utexas.edu    Stats::Scalar numIntAluAccesses;
2217897Shestness@cs.utexas.edu
2227897Shestness@cs.utexas.edu    //number of float alu accesses
2237897Shestness@cs.utexas.edu    Stats::Scalar numFpAluAccesses;
2247897Shestness@cs.utexas.edu
2257897Shestness@cs.utexas.edu    //number of function calls/returns
2267897Shestness@cs.utexas.edu    Stats::Scalar numCallsReturns;
2277897Shestness@cs.utexas.edu
2287897Shestness@cs.utexas.edu    //conditional control instructions;
2297897Shestness@cs.utexas.edu    Stats::Scalar numCondCtrlInsts;
2307897Shestness@cs.utexas.edu
2317897Shestness@cs.utexas.edu    //number of int instructions
2327897Shestness@cs.utexas.edu    Stats::Scalar numIntInsts;
2337897Shestness@cs.utexas.edu
2347897Shestness@cs.utexas.edu    //number of float instructions
2357897Shestness@cs.utexas.edu    Stats::Scalar numFpInsts;
2367897Shestness@cs.utexas.edu
2377897Shestness@cs.utexas.edu    //number of integer register file accesses
2387897Shestness@cs.utexas.edu    Stats::Scalar numIntRegReads;
2397897Shestness@cs.utexas.edu    Stats::Scalar numIntRegWrites;
2407897Shestness@cs.utexas.edu
2417897Shestness@cs.utexas.edu    //number of float register file accesses
2427897Shestness@cs.utexas.edu    Stats::Scalar numFpRegReads;
2437897Shestness@cs.utexas.edu    Stats::Scalar numFpRegWrites;
2447897Shestness@cs.utexas.edu
2452SN/A    // number of simulated memory references
2465999Snate@binkert.org    Stats::Scalar numMemRefs;
2477897Shestness@cs.utexas.edu    Stats::Scalar numLoadInsts;
2487897Shestness@cs.utexas.edu    Stats::Scalar numStoreInsts;
2497897Shestness@cs.utexas.edu
2507897Shestness@cs.utexas.edu    // number of idle cycles
2517897Shestness@cs.utexas.edu    Stats::Formula numIdleCycles;
2527897Shestness@cs.utexas.edu
2537897Shestness@cs.utexas.edu    // number of busy cycles
2547897Shestness@cs.utexas.edu    Stats::Formula numBusyCycles;
2552SN/A
256124SN/A    // number of simulated loads
257124SN/A    Counter numLoad;
258334SN/A    Counter startNumLoad;
259124SN/A
2602SN/A    // number of idle cycles
2615999Snate@binkert.org    Stats::Average notIdleFraction;
262729SN/A    Stats::Formula idleFraction;
2632SN/A
2642390SN/A    // number of cycles stalled for I-cache responses
2655999Snate@binkert.org    Stats::Scalar icacheStallCycles;
2662SN/A    Counter lastIcacheStall;
2672SN/A
2682390SN/A    // number of cycles stalled for I-cache retries
2695999Snate@binkert.org    Stats::Scalar icacheRetryCycles;
2702390SN/A    Counter lastIcacheRetry;
2712390SN/A
2722390SN/A    // number of cycles stalled for D-cache responses
2735999Snate@binkert.org    Stats::Scalar dcacheStallCycles;
2742SN/A    Counter lastDcacheStall;
2752SN/A
2762390SN/A    // number of cycles stalled for D-cache retries
2775999Snate@binkert.org    Stats::Scalar dcacheRetryCycles;
2782390SN/A    Counter lastDcacheRetry;
2792390SN/A
280217SN/A    virtual void serialize(std::ostream &os);
281237SN/A    virtual void unserialize(Checkpoint *cp, const std::string &section);
2822SN/A
2831371SN/A    // These functions are only used in CPU models that split
2841371SN/A    // effective address computation from the actual memory access.
2852623SN/A    void setEA(Addr EA) { panic("BaseSimpleCPU::setEA() not implemented\n"); }
2865543Ssaidi@eecs.umich.edu    Addr getEA()        { panic("BaseSimpleCPU::getEA() not implemented\n");
2873918Ssaidi@eecs.umich.edu        M5_DUMMY_RETURN}
2881371SN/A
289726SN/A    // The register accessor methods provide the index of the
290726SN/A    // instruction's operand (e.g., 0 or 1), not the architectural
291726SN/A    // register index, to simplify the implementation of register
292726SN/A    // renaming.  We find the architectural register index by indexing
293726SN/A    // into the instruction's own operand index table.  Note that a
294726SN/A    // raw pointer to the StaticInst is provided instead of a
295726SN/A    // ref-counted StaticInstPtr to redice overhead.  This is fine as
296726SN/A    // long as these methods don't copy the pointer into any long-term
297726SN/A    // storage (which is pretty hard to imagine they would have reason
298726SN/A    // to do).
299705SN/A
3003735Sstever@eecs.umich.edu    uint64_t readIntRegOperand(const StaticInst *si, int idx)
301726SN/A    {
3027897Shestness@cs.utexas.edu        numIntRegReads++;
3032683Sktlim@umich.edu        return thread->readIntReg(si->srcRegIdx(idx));
304726SN/A    }
305705SN/A
3063735Sstever@eecs.umich.edu    FloatReg readFloatRegOperand(const StaticInst *si, int idx)
307726SN/A    {
3087897Shestness@cs.utexas.edu        numFpRegReads++;
309726SN/A        int reg_idx = si->srcRegIdx(idx) - TheISA::FP_Base_DepTag;
3102683Sktlim@umich.edu        return thread->readFloatReg(reg_idx);
311726SN/A    }
312705SN/A
3133735Sstever@eecs.umich.edu    FloatRegBits readFloatRegOperandBits(const StaticInst *si, int idx)
3142455SN/A    {
3157897Shestness@cs.utexas.edu        numFpRegReads++;
3162455SN/A        int reg_idx = si->srcRegIdx(idx) - TheISA::FP_Base_DepTag;
3172683Sktlim@umich.edu        return thread->readFloatRegBits(reg_idx);
318726SN/A    }
319705SN/A
3203735Sstever@eecs.umich.edu    void setIntRegOperand(const StaticInst *si, int idx, uint64_t val)
321726SN/A    {
3227897Shestness@cs.utexas.edu        numIntRegWrites++;
3232683Sktlim@umich.edu        thread->setIntReg(si->destRegIdx(idx), val);
324726SN/A    }
325705SN/A
3263735Sstever@eecs.umich.edu    void setFloatRegOperand(const StaticInst *si, int idx, FloatReg val)
327726SN/A    {
3287897Shestness@cs.utexas.edu        numFpRegWrites++;
329726SN/A        int reg_idx = si->destRegIdx(idx) - TheISA::FP_Base_DepTag;
3302683Sktlim@umich.edu        thread->setFloatReg(reg_idx, val);
331726SN/A    }
332726SN/A
3333735Sstever@eecs.umich.edu    void setFloatRegOperandBits(const StaticInst *si, int idx,
3343735Sstever@eecs.umich.edu                                FloatRegBits val)
3352455SN/A    {
3367897Shestness@cs.utexas.edu        numFpRegWrites++;
3372455SN/A        int reg_idx = si->destRegIdx(idx) - TheISA::FP_Base_DepTag;
3382683Sktlim@umich.edu        thread->setFloatRegBits(reg_idx, val);
339726SN/A    }
340705SN/A
3417597Sminkyu.jeong@arm.com    bool readPredicate() { return thread->readPredicate(); }
3427597Sminkyu.jeong@arm.com    void setPredicate(bool val)
3437600Sminkyu.jeong@arm.com    {
3447600Sminkyu.jeong@arm.com        thread->setPredicate(val);
3457600Sminkyu.jeong@arm.com        if (traceData) {
3467600Sminkyu.jeong@arm.com            traceData->setPredicate(val);
3477600Sminkyu.jeong@arm.com        }
3487600Sminkyu.jeong@arm.com    }
3497720Sgblack@eecs.umich.edu    TheISA::PCState pcState() { return thread->pcState(); }
3507720Sgblack@eecs.umich.edu    void pcState(const TheISA::PCState &val) { thread->pcState(val); }
3517720Sgblack@eecs.umich.edu    Addr instAddr() { return thread->instAddr(); }
3527720Sgblack@eecs.umich.edu    Addr nextInstAddr() { return thread->nextInstAddr(); }
3537720Sgblack@eecs.umich.edu    MicroPC microPC() { return thread->microPC(); }
354705SN/A
3554172Ssaidi@eecs.umich.edu    MiscReg readMiscRegNoEffect(int misc_reg)
3564172Ssaidi@eecs.umich.edu    {
3574172Ssaidi@eecs.umich.edu        return thread->readMiscRegNoEffect(misc_reg);
3584172Ssaidi@eecs.umich.edu    }
3594172Ssaidi@eecs.umich.edu
3602159SN/A    MiscReg readMiscReg(int misc_reg)
3612159SN/A    {
3627897Shestness@cs.utexas.edu        numIntRegReads++;
3632683Sktlim@umich.edu        return thread->readMiscReg(misc_reg);
3642159SN/A    }
365705SN/A
3663468Sgblack@eecs.umich.edu    void setMiscReg(int misc_reg, const MiscReg &val)
3672159SN/A    {
3687897Shestness@cs.utexas.edu        numIntRegWrites++;
3692683Sktlim@umich.edu        return thread->setMiscReg(misc_reg, val);
3702159SN/A    }
3712159SN/A
3724185Ssaidi@eecs.umich.edu    MiscReg readMiscRegOperand(const StaticInst *si, int idx)
3733792Sgblack@eecs.umich.edu    {
3747897Shestness@cs.utexas.edu        numIntRegReads++;
3753792Sgblack@eecs.umich.edu        int reg_idx = si->srcRegIdx(idx) - TheISA::Ctrl_Base_DepTag;
3763792Sgblack@eecs.umich.edu        return thread->readMiscReg(reg_idx);
3773792Sgblack@eecs.umich.edu    }
3783792Sgblack@eecs.umich.edu
3794185Ssaidi@eecs.umich.edu    void setMiscRegOperand(
3803792Sgblack@eecs.umich.edu            const StaticInst *si, int idx, const MiscReg &val)
3813792Sgblack@eecs.umich.edu    {
3827897Shestness@cs.utexas.edu        numIntRegWrites++;
3833792Sgblack@eecs.umich.edu        int reg_idx = si->destRegIdx(idx) - TheISA::Ctrl_Base_DepTag;
3844172Ssaidi@eecs.umich.edu        return thread->setMiscReg(reg_idx, val);
3853792Sgblack@eecs.umich.edu    }
3863792Sgblack@eecs.umich.edu
3875358Sgblack@eecs.umich.edu    void demapPage(Addr vaddr, uint64_t asn)
3885358Sgblack@eecs.umich.edu    {
3895358Sgblack@eecs.umich.edu        thread->demapPage(vaddr, asn);
3905358Sgblack@eecs.umich.edu    }
3915358Sgblack@eecs.umich.edu
3925358Sgblack@eecs.umich.edu    void demapInstPage(Addr vaddr, uint64_t asn)
3935358Sgblack@eecs.umich.edu    {
3945358Sgblack@eecs.umich.edu        thread->demapInstPage(vaddr, asn);
3955358Sgblack@eecs.umich.edu    }
3965358Sgblack@eecs.umich.edu
3975358Sgblack@eecs.umich.edu    void demapDataPage(Addr vaddr, uint64_t asn)
3985358Sgblack@eecs.umich.edu    {
3995358Sgblack@eecs.umich.edu        thread->demapDataPage(vaddr, asn);
4005358Sgblack@eecs.umich.edu    }
4015358Sgblack@eecs.umich.edu
4024027Sstever@eecs.umich.edu    unsigned readStCondFailures() {
4034027Sstever@eecs.umich.edu        return thread->readStCondFailures();
4044027Sstever@eecs.umich.edu    }
4054027Sstever@eecs.umich.edu
4064027Sstever@eecs.umich.edu    void setStCondFailures(unsigned sc_failures) {
4074027Sstever@eecs.umich.edu        thread->setStCondFailures(sc_failures);
4084027Sstever@eecs.umich.edu    }
4094027Sstever@eecs.umich.edu
4106221Snate@binkert.org     MiscReg readRegOtherThread(int regIdx, ThreadID tid = InvalidThreadID)
4114661Sksewell@umich.edu     {
4124661Sksewell@umich.edu        panic("Simple CPU models do not support multithreaded "
4134661Sksewell@umich.edu              "register access.\n");
4144661Sksewell@umich.edu     }
4154661Sksewell@umich.edu
4166221Snate@binkert.org     void setRegOtherThread(int regIdx, const MiscReg &val,
4176221Snate@binkert.org                            ThreadID tid = InvalidThreadID)
4184661Sksewell@umich.edu     {
4194661Sksewell@umich.edu        panic("Simple CPU models do not support multithreaded "
4204661Sksewell@umich.edu              "register access.\n");
4214661Sksewell@umich.edu     }
4224661Sksewell@umich.edu
4235250Sksewell@umich.edu    //Fault CacheOp(uint8_t Op, Addr EA);
4245222Sksewell@umich.edu
4255702Ssaidi@eecs.umich.edu    Fault hwrei() { return thread->hwrei(); }
4265702Ssaidi@eecs.umich.edu    bool simPalCheck(int palFunc) { return thread->simPalCheck(palFunc); }
4278557Sgblack@eecs.umich.edu
4288557Sgblack@eecs.umich.edu    void
4298557Sgblack@eecs.umich.edu    syscall(int64_t callnum)
4308557Sgblack@eecs.umich.edu    {
4318779Sgblack@eecs.umich.edu        if (FullSystem)
4328779Sgblack@eecs.umich.edu            panic("Syscall emulation isn't available in FS mode.\n");
4338806Sgblack@eecs.umich.edu
4348557Sgblack@eecs.umich.edu        thread->syscall(callnum);
4358557Sgblack@eecs.umich.edu    }
436705SN/A
4372683Sktlim@umich.edu    bool misspeculating() { return thread->misspeculating(); }
4382680Sktlim@umich.edu    ThreadContext *tcBase() { return tc; }
4392SN/A};
4402SN/A
4412623SN/A#endif // __CPU_SIMPLE_BASE_HH__
442