cpu.hh revision 8887
12315SN/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 *
142332SN/A * Copyright (c) 2006 The Regents of The University of Michigan
152315SN/A * All rights reserved.
162315SN/A *
172315SN/A * Redistribution and use in source and binary forms, with or without
182315SN/A * modification, are permitted provided that the following conditions are
192315SN/A * met: redistributions of source code must retain the above copyright
202315SN/A * notice, this list of conditions and the following disclaimer;
212315SN/A * redistributions in binary form must reproduce the above copyright
222315SN/A * notice, this list of conditions and the following disclaimer in the
232315SN/A * documentation and/or other materials provided with the distribution;
242315SN/A * neither the name of the copyright holders nor the names of its
252315SN/A * contributors may be used to endorse or promote products derived from
262315SN/A * this software without specific prior written permission.
272315SN/A *
282315SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
292315SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
302315SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
312315SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
322315SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
332315SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
342315SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
352315SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
362315SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
372315SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
382315SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
392689Sktlim@umich.edu *
402689Sktlim@umich.edu * Authors: Kevin Lim
412315SN/A */
422315SN/A
432315SN/A#ifndef __CPU_CHECKER_CPU_HH__
442315SN/A#define __CPU_CHECKER_CPU_HH__
452315SN/A
462315SN/A#include <list>
478229Snate@binkert.org#include <map>
482315SN/A#include <queue>
492315SN/A
508733Sgeoffrey.blake@arm.com#include "arch/predecoder.hh"
512669Sktlim@umich.edu#include "arch/types.hh"
522315SN/A#include "base/statistics.hh"
532315SN/A#include "cpu/base.hh"
542315SN/A#include "cpu/base_dyn_inst.hh"
558229Snate@binkert.org#include "cpu/pc_event.hh"
562683Sktlim@umich.edu#include "cpu/simple_thread.hh"
572315SN/A#include "cpu/static_inst.hh"
588733Sgeoffrey.blake@arm.com#include "debug/Checker.hh"
598733Sgeoffrey.blake@arm.com#include "params/CheckerCPU.hh"
602315SN/A#include "sim/eventq.hh"
612315SN/A
622315SN/A// forward declarations
633468Sgblack@eecs.umich.edunamespace TheISA
643468Sgblack@eecs.umich.edu{
656022Sgblack@eecs.umich.edu    class TLB;
663468Sgblack@eecs.umich.edu}
672315SN/A
682315SN/Atemplate <class>
692315SN/Aclass BaseDynInst;
702680Sktlim@umich.educlass ThreadContext;
712669Sktlim@umich.educlass Request;
722315SN/A
732350SN/A/**
742350SN/A * CheckerCPU class.  Dynamically verifies instructions as they are
752350SN/A * completed by making sure that the instruction and its results match
762350SN/A * the independent execution of the benchmark inside the checker.  The
772350SN/A * checker verifies instructions in order, regardless of the order in
782350SN/A * which instructions complete.  There are certain results that can
792350SN/A * not be verified, specifically the result of a store conditional or
802350SN/A * the values of uncached accesses.  In these cases, and with
812350SN/A * instructions marked as "IsUnverifiable", the checker assumes that
822350SN/A * the value from the main CPU's execution is correct and simply
832680Sktlim@umich.edu * copies that value.  It provides a CheckerThreadContext (see
842683Sktlim@umich.edu * checker/thread_context.hh) that provides hooks for updating the
852680Sktlim@umich.edu * Checker's state through any ThreadContext accesses.  This allows the
862350SN/A * checker to be able to correctly verify instructions, even with
872680Sktlim@umich.edu * external accesses to the ThreadContext that change state.
882350SN/A */
892315SN/Aclass CheckerCPU : public BaseCPU
902315SN/A{
912315SN/A  protected:
922315SN/A    typedef TheISA::MachInst MachInst;
932669Sktlim@umich.edu    typedef TheISA::FloatReg FloatReg;
942669Sktlim@umich.edu    typedef TheISA::FloatRegBits FloatRegBits;
952315SN/A    typedef TheISA::MiscReg MiscReg;
968832SAli.Saidi@ARM.com
978832SAli.Saidi@ARM.com    /** id attached to all issued requests */
988832SAli.Saidi@ARM.com    MasterID masterId;
992315SN/A  public:
1002315SN/A    virtual void init();
1012315SN/A
1022315SN/A  public:
1035529Snate@binkert.org    typedef CheckerCPUParams Params;
1045529Snate@binkert.org    const Params *params() const
1058733Sgeoffrey.blake@arm.com    { return reinterpret_cast<const Params *>(_params); }
1062315SN/A    CheckerCPU(Params *p);
1072315SN/A    virtual ~CheckerCPU();
1082315SN/A
1098733Sgeoffrey.blake@arm.com    std::vector<Process*> workload;
1102679Sktlim@umich.edu
1112315SN/A    void setSystem(System *system);
1122315SN/A
1132315SN/A    System *systemPtr;
1142679Sktlim@umich.edu
1158887Sgeoffrey.blake@arm.com    void setIcachePort(CpuPort *icache_port);
1162679Sktlim@umich.edu
1178887Sgeoffrey.blake@arm.com    CpuPort *icachePort;
1182679Sktlim@umich.edu
1198887Sgeoffrey.blake@arm.com    void setDcachePort(CpuPort *dcache_port);
1202679Sktlim@umich.edu
1218887Sgeoffrey.blake@arm.com    CpuPort *dcachePort;
1228887Sgeoffrey.blake@arm.com
1238887Sgeoffrey.blake@arm.com    CpuPort &getDataPort()
1248887Sgeoffrey.blake@arm.com    {
1258887Sgeoffrey.blake@arm.com        panic("Not supported on checker!");
1268887Sgeoffrey.blake@arm.com        return *dcachePort;
1278887Sgeoffrey.blake@arm.com    }
1288887Sgeoffrey.blake@arm.com
1298887Sgeoffrey.blake@arm.com    CpuPort &getInstPort()
1308887Sgeoffrey.blake@arm.com    {
1318887Sgeoffrey.blake@arm.com        panic("Not supported on checker!");
1328887Sgeoffrey.blake@arm.com        return *icachePort;
1338887Sgeoffrey.blake@arm.com    }
1342679Sktlim@umich.edu
1352871Sktlim@umich.edu    virtual Port *getPort(const std::string &name, int idx)
1362871Sktlim@umich.edu    {
1372871Sktlim@umich.edu        panic("Not supported on checker!");
1382871Sktlim@umich.edu        return NULL;
1392871Sktlim@umich.edu    }
1402871Sktlim@umich.edu
1412315SN/A  public:
1422683Sktlim@umich.edu    // Primary thread being run.
1432683Sktlim@umich.edu    SimpleThread *thread;
1442315SN/A
1452680Sktlim@umich.edu    ThreadContext *tc;
1462315SN/A
1476022Sgblack@eecs.umich.edu    TheISA::TLB *itb;
1486022Sgblack@eecs.umich.edu    TheISA::TLB *dtb;
1492315SN/A
1502315SN/A    Addr dbg_vtophys(Addr addr);
1512315SN/A
1522315SN/A    union Result {
1532315SN/A        uint64_t integer;
1542315SN/A        double dbl;
1558733Sgeoffrey.blake@arm.com        void set(uint64_t i) { integer = i; }
1568733Sgeoffrey.blake@arm.com        void set(double d) { dbl = d; }
1578733Sgeoffrey.blake@arm.com        void get(uint64_t& i) { i = integer; }
1588733Sgeoffrey.blake@arm.com        void get(double& d) { d = dbl; }
1592315SN/A    };
1602315SN/A
1618733Sgeoffrey.blake@arm.com    // ISAs like ARM can have multiple destination registers to check,
1628733Sgeoffrey.blake@arm.com    // keep them all in a std::queue
1638733Sgeoffrey.blake@arm.com    std::queue<Result> result;
1642315SN/A
1652315SN/A    // current instruction
1668733Sgeoffrey.blake@arm.com    TheISA::MachInst machInst;
1672315SN/A
1682679Sktlim@umich.edu    // Pointer to the one memory request.
1692679Sktlim@umich.edu    RequestPtr memReq;
1702315SN/A
1712315SN/A    StaticInstPtr curStaticInst;
1728733Sgeoffrey.blake@arm.com    StaticInstPtr curMacroStaticInst;
1732315SN/A
1742315SN/A    // number of simulated instructions
1752315SN/A    Counter numInst;
1762315SN/A    Counter startNumInst;
1772315SN/A
1782315SN/A    std::queue<int> miscRegIdxs;
1792315SN/A
1808733Sgeoffrey.blake@arm.com    TheISA::TLB* getITBPtr() { return itb; }
1818733Sgeoffrey.blake@arm.com    TheISA::TLB* getDTBPtr() { return dtb; }
1828733Sgeoffrey.blake@arm.com
1838887Sgeoffrey.blake@arm.com    virtual Counter totalInsts() const
1848887Sgeoffrey.blake@arm.com    {
1858887Sgeoffrey.blake@arm.com        return 0;
1868887Sgeoffrey.blake@arm.com    }
1878887Sgeoffrey.blake@arm.com
1888887Sgeoffrey.blake@arm.com    virtual Counter totalOps() const
1892315SN/A    {
1902930Sktlim@umich.edu        return 0;
1912315SN/A    }
1922315SN/A
1932315SN/A    // number of simulated loads
1942315SN/A    Counter numLoad;
1952315SN/A    Counter startNumLoad;
1962315SN/A
1972315SN/A    virtual void serialize(std::ostream &os);
1982315SN/A    virtual void unserialize(Checkpoint *cp, const std::string &section);
1992315SN/A
2002315SN/A    // These functions are only used in CPU models that split
2012315SN/A    // effective address computation from the actual memory access.
2022315SN/A    void setEA(Addr EA) { panic("SimpleCPU::setEA() not implemented\n"); }
2035543Ssaidi@eecs.umich.edu    Addr getEA()        { panic("SimpleCPU::getEA() not implemented\n"); }
2042315SN/A
2052315SN/A    // The register accessor methods provide the index of the
2062315SN/A    // instruction's operand (e.g., 0 or 1), not the architectural
2072315SN/A    // register index, to simplify the implementation of register
2082315SN/A    // renaming.  We find the architectural register index by indexing
2092315SN/A    // into the instruction's own operand index table.  Note that a
2102315SN/A    // raw pointer to the StaticInst is provided instead of a
2112315SN/A    // ref-counted StaticInstPtr to redice overhead.  This is fine as
2122315SN/A    // long as these methods don't copy the pointer into any long-term
2132315SN/A    // storage (which is pretty hard to imagine they would have reason
2142315SN/A    // to do).
2152315SN/A
2163735Sstever@eecs.umich.edu    uint64_t readIntRegOperand(const StaticInst *si, int idx)
2172315SN/A    {
2182683Sktlim@umich.edu        return thread->readIntReg(si->srcRegIdx(idx));
2192315SN/A    }
2202315SN/A
2213735Sstever@eecs.umich.edu    FloatReg readFloatRegOperand(const StaticInst *si, int idx)
2222315SN/A    {
2232315SN/A        int reg_idx = si->srcRegIdx(idx) - TheISA::FP_Base_DepTag;
2242683Sktlim@umich.edu        return thread->readFloatReg(reg_idx);
2252315SN/A    }
2262315SN/A
2273735Sstever@eecs.umich.edu    FloatRegBits readFloatRegOperandBits(const StaticInst *si, int idx)
2282669Sktlim@umich.edu    {
2292669Sktlim@umich.edu        int reg_idx = si->srcRegIdx(idx) - TheISA::FP_Base_DepTag;
2302683Sktlim@umich.edu        return thread->readFloatRegBits(reg_idx);
2312315SN/A    }
2322315SN/A
2338733Sgeoffrey.blake@arm.com    template <class T>
2348733Sgeoffrey.blake@arm.com    void setResult(T t)
2358733Sgeoffrey.blake@arm.com    {
2368733Sgeoffrey.blake@arm.com        Result instRes;
2378733Sgeoffrey.blake@arm.com        instRes.set(t);
2388733Sgeoffrey.blake@arm.com        result.push(instRes);
2398733Sgeoffrey.blake@arm.com    }
2408733Sgeoffrey.blake@arm.com
2413735Sstever@eecs.umich.edu    void setIntRegOperand(const StaticInst *si, int idx, uint64_t val)
2422315SN/A    {
2432683Sktlim@umich.edu        thread->setIntReg(si->destRegIdx(idx), val);
2448733Sgeoffrey.blake@arm.com        setResult<uint64_t>(val);
2452315SN/A    }
2462315SN/A
2473735Sstever@eecs.umich.edu    void setFloatRegOperand(const StaticInst *si, int idx, FloatReg val)
2482669Sktlim@umich.edu    {
2492669Sktlim@umich.edu        int reg_idx = si->destRegIdx(idx) - TheISA::FP_Base_DepTag;
2502683Sktlim@umich.edu        thread->setFloatReg(reg_idx, val);
2518733Sgeoffrey.blake@arm.com        setResult<double>(val);
2522315SN/A    }
2532315SN/A
2543735Sstever@eecs.umich.edu    void setFloatRegOperandBits(const StaticInst *si, int idx,
2553735Sstever@eecs.umich.edu                                FloatRegBits val)
2562315SN/A    {
2572315SN/A        int reg_idx = si->destRegIdx(idx) - TheISA::FP_Base_DepTag;
2582683Sktlim@umich.edu        thread->setFloatRegBits(reg_idx, val);
2598733Sgeoffrey.blake@arm.com        setResult<uint64_t>(val);
2602315SN/A    }
2612315SN/A
2628733Sgeoffrey.blake@arm.com    bool readPredicate() { return thread->readPredicate(); }
2638733Sgeoffrey.blake@arm.com    void setPredicate(bool val)
2648733Sgeoffrey.blake@arm.com    {
2658733Sgeoffrey.blake@arm.com        thread->setPredicate(val);
2668733Sgeoffrey.blake@arm.com    }
2672669Sktlim@umich.edu
2688733Sgeoffrey.blake@arm.com    TheISA::PCState pcState() { return thread->pcState(); }
2698733Sgeoffrey.blake@arm.com    void pcState(const TheISA::PCState &val)
2708733Sgeoffrey.blake@arm.com    {
2718733Sgeoffrey.blake@arm.com        DPRINTF(Checker, "Changing PC to %s, old PC %s.\n",
2728733Sgeoffrey.blake@arm.com                         val, thread->pcState());
2738733Sgeoffrey.blake@arm.com        thread->pcState(val);
2748733Sgeoffrey.blake@arm.com    }
2758733Sgeoffrey.blake@arm.com    Addr instAddr() { return thread->instAddr(); }
2768733Sgeoffrey.blake@arm.com    Addr nextInstAddr() { return thread->nextInstAddr(); }
2778733Sgeoffrey.blake@arm.com    MicroPC microPC() { return thread->microPC(); }
2788733Sgeoffrey.blake@arm.com    //////////////////////////////////////////
2792315SN/A
2804172Ssaidi@eecs.umich.edu    MiscReg readMiscRegNoEffect(int misc_reg)
2814172Ssaidi@eecs.umich.edu    {
2824172Ssaidi@eecs.umich.edu        return thread->readMiscRegNoEffect(misc_reg);
2834172Ssaidi@eecs.umich.edu    }
2844172Ssaidi@eecs.umich.edu
2852315SN/A    MiscReg readMiscReg(int misc_reg)
2862315SN/A    {
2872683Sktlim@umich.edu        return thread->readMiscReg(misc_reg);
2882315SN/A    }
2892315SN/A
2904172Ssaidi@eecs.umich.edu    void setMiscRegNoEffect(int misc_reg, const MiscReg &val)
2912315SN/A    {
2924172Ssaidi@eecs.umich.edu        miscRegIdxs.push(misc_reg);
2934172Ssaidi@eecs.umich.edu        return thread->setMiscRegNoEffect(misc_reg, val);
2942315SN/A    }
2952315SN/A
2963468Sgblack@eecs.umich.edu    void setMiscReg(int misc_reg, const MiscReg &val)
2972315SN/A    {
2982315SN/A        miscRegIdxs.push(misc_reg);
2992683Sktlim@umich.edu        return thread->setMiscReg(misc_reg, val);
3002315SN/A    }
3012315SN/A
3028733Sgeoffrey.blake@arm.com    MiscReg readMiscRegOperand(const StaticInst *si, int idx)
3038733Sgeoffrey.blake@arm.com    {
3048733Sgeoffrey.blake@arm.com        int reg_idx = si->srcRegIdx(idx) - TheISA::Ctrl_Base_DepTag;
3058733Sgeoffrey.blake@arm.com        return thread->readMiscReg(reg_idx);
3068733Sgeoffrey.blake@arm.com    }
3078733Sgeoffrey.blake@arm.com
3088733Sgeoffrey.blake@arm.com    void setMiscRegOperand(
3098733Sgeoffrey.blake@arm.com            const StaticInst *si, int idx, const MiscReg &val)
3108733Sgeoffrey.blake@arm.com    {
3118733Sgeoffrey.blake@arm.com        int reg_idx = si->destRegIdx(idx) - TheISA::Ctrl_Base_DepTag;
3128733Sgeoffrey.blake@arm.com        return thread->setMiscReg(reg_idx, val);
3138733Sgeoffrey.blake@arm.com    }
3148733Sgeoffrey.blake@arm.com    /////////////////////////////////////////
3158733Sgeoffrey.blake@arm.com
3168733Sgeoffrey.blake@arm.com    void recordPCChange(const TheISA::PCState &val)
3178733Sgeoffrey.blake@arm.com    {
3188733Sgeoffrey.blake@arm.com       changedPC = true;
3198733Sgeoffrey.blake@arm.com       newPCState = val;
3208733Sgeoffrey.blake@arm.com    }
3212315SN/A
3225358Sgblack@eecs.umich.edu    void demapPage(Addr vaddr, uint64_t asn)
3235358Sgblack@eecs.umich.edu    {
3245358Sgblack@eecs.umich.edu        this->itb->demapPage(vaddr, asn);
3255358Sgblack@eecs.umich.edu        this->dtb->demapPage(vaddr, asn);
3265358Sgblack@eecs.umich.edu    }
3275358Sgblack@eecs.umich.edu
3285358Sgblack@eecs.umich.edu    void demapInstPage(Addr vaddr, uint64_t asn)
3295358Sgblack@eecs.umich.edu    {
3305358Sgblack@eecs.umich.edu        this->itb->demapPage(vaddr, asn);
3315358Sgblack@eecs.umich.edu    }
3325358Sgblack@eecs.umich.edu
3335358Sgblack@eecs.umich.edu    void demapDataPage(Addr vaddr, uint64_t asn)
3345358Sgblack@eecs.umich.edu    {
3355358Sgblack@eecs.umich.edu        this->dtb->demapPage(vaddr, asn);
3365358Sgblack@eecs.umich.edu    }
3375358Sgblack@eecs.umich.edu
3388733Sgeoffrey.blake@arm.com    Fault readMem(Addr addr, uint8_t *data, unsigned size, unsigned flags);
3398733Sgeoffrey.blake@arm.com    Fault writeMem(uint8_t *data, unsigned size,
3408733Sgeoffrey.blake@arm.com                   Addr addr, unsigned flags, uint64_t *res);
3418733Sgeoffrey.blake@arm.com
3428733Sgeoffrey.blake@arm.com    void setStCondFailures(unsigned sc_failures)
3438733Sgeoffrey.blake@arm.com    {}
3448733Sgeoffrey.blake@arm.com    /////////////////////////////////////////////////////
3458733Sgeoffrey.blake@arm.com
3465702Ssaidi@eecs.umich.edu    Fault hwrei() { return thread->hwrei(); }
3475702Ssaidi@eecs.umich.edu    bool simPalCheck(int palFunc) { return thread->simPalCheck(palFunc); }
3488733Sgeoffrey.blake@arm.com    void wakeup() { }
3492315SN/A    // Assume that the normal CPU's call to syscall was successful.
3502332SN/A    // The checker's state would have already been updated by the syscall.
3512669Sktlim@umich.edu    void syscall(uint64_t callnum) { }
3522315SN/A
3532315SN/A    void handleError()
3542315SN/A    {
3552315SN/A        if (exitOnError)
3562732Sktlim@umich.edu            dumpAndExit();
3572315SN/A    }
3582732Sktlim@umich.edu
3598733Sgeoffrey.blake@arm.com    bool checkFlags(Request *unverified_req, Addr vAddr,
3608733Sgeoffrey.blake@arm.com                    Addr pAddr, int flags);
3612315SN/A
3622732Sktlim@umich.edu    void dumpAndExit();
3632732Sktlim@umich.edu
3642680Sktlim@umich.edu    ThreadContext *tcBase() { return tc; }
3652683Sktlim@umich.edu    SimpleThread *threadBase() { return thread; }
3662315SN/A
3672315SN/A    Result unverifiedResult;
3682669Sktlim@umich.edu    Request *unverifiedReq;
3692679Sktlim@umich.edu    uint8_t *unverifiedMemData;
3702315SN/A
3712315SN/A    bool changedPC;
3722315SN/A    bool willChangePC;
3738733Sgeoffrey.blake@arm.com    TheISA::PCState newPCState;
3742315SN/A    bool changedNextPC;
3752315SN/A    bool exitOnError;
3762354SN/A    bool updateOnError;
3772732Sktlim@umich.edu    bool warnOnlyOnLoadError;
3782315SN/A
3792315SN/A    InstSeqNum youngestSN;
3802315SN/A};
3812315SN/A
3822350SN/A/**
3832350SN/A * Templated Checker class.  This Checker class is templated on the
3842350SN/A * DynInstPtr of the instruction type that will be verified.  Proper
3852350SN/A * template instantiations of the Checker must be placed at the bottom
3862350SN/A * of checker/cpu.cc.
3872350SN/A */
3888733Sgeoffrey.blake@arm.comtemplate <class Impl>
3892315SN/Aclass Checker : public CheckerCPU
3902315SN/A{
3918733Sgeoffrey.blake@arm.com  private:
3928733Sgeoffrey.blake@arm.com    typedef typename Impl::DynInstPtr DynInstPtr;
3938733Sgeoffrey.blake@arm.com
3942315SN/A  public:
3952315SN/A    Checker(Params *p)
3968733Sgeoffrey.blake@arm.com        : CheckerCPU(p), updateThisCycle(false), unverifiedInst(NULL),
3978733Sgeoffrey.blake@arm.com          predecoder(NULL)
3982315SN/A    { }
3992315SN/A
4002840Sktlim@umich.edu    void switchOut();
4012315SN/A    void takeOverFrom(BaseCPU *oldCPU);
4022315SN/A
4038733Sgeoffrey.blake@arm.com    void advancePC(Fault fault);
4048733Sgeoffrey.blake@arm.com
4052732Sktlim@umich.edu    void verify(DynInstPtr &inst);
4062315SN/A
4072315SN/A    void validateInst(DynInstPtr &inst);
4082315SN/A    void validateExecution(DynInstPtr &inst);
4092315SN/A    void validateState();
4102315SN/A
4118733Sgeoffrey.blake@arm.com    void copyResult(DynInstPtr &inst, uint64_t mismatch_val, int start_idx);
4128733Sgeoffrey.blake@arm.com    void handlePendingInt();
4132732Sktlim@umich.edu
4142732Sktlim@umich.edu  private:
4152732Sktlim@umich.edu    void handleError(DynInstPtr &inst)
4162732Sktlim@umich.edu    {
4172360SN/A        if (exitOnError) {
4182732Sktlim@umich.edu            dumpAndExit(inst);
4192360SN/A        } else if (updateOnError) {
4202354SN/A            updateThisCycle = true;
4212360SN/A        }
4222732Sktlim@umich.edu    }
4232732Sktlim@umich.edu
4242732Sktlim@umich.edu    void dumpAndExit(DynInstPtr &inst);
4252732Sktlim@umich.edu
4262354SN/A    bool updateThisCycle;
4272354SN/A
4282354SN/A    DynInstPtr unverifiedInst;
4298733Sgeoffrey.blake@arm.com    TheISA::Predecoder predecoder;
4302354SN/A
4312315SN/A    std::list<DynInstPtr> instList;
4322315SN/A    typedef typename std::list<DynInstPtr>::iterator InstListIt;
4332315SN/A    void dumpInsts();
4342315SN/A};
4352315SN/A
4362315SN/A#endif // __CPU_CHECKER_CPU_HH__
437