iew.hh revision 5529
11689SN/A/*
22326SN/A * Copyright (c) 2004-2006 The Regents of The University of Michigan
31689SN/A * All rights reserved.
41689SN/A *
51689SN/A * Redistribution and use in source and binary forms, with or without
61689SN/A * modification, are permitted provided that the following conditions are
71689SN/A * met: redistributions of source code must retain the above copyright
81689SN/A * notice, this list of conditions and the following disclaimer;
91689SN/A * redistributions in binary form must reproduce the above copyright
101689SN/A * notice, this list of conditions and the following disclaimer in the
111689SN/A * documentation and/or other materials provided with the distribution;
121689SN/A * neither the name of the copyright holders nor the names of its
131689SN/A * contributors may be used to endorse or promote products derived from
141689SN/A * this software without specific prior written permission.
151689SN/A *
161689SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
171689SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
181689SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
191689SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
201689SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
211689SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
221689SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
231689SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
241689SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
251689SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
261689SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
272665Ssaidi@eecs.umich.edu *
282665Ssaidi@eecs.umich.edu * Authors: Kevin Lim
291689SN/A */
301689SN/A
312292SN/A#ifndef __CPU_O3_IEW_HH__
322292SN/A#define __CPU_O3_IEW_HH__
331060SN/A
342926Sktlim@umich.edu#include "config/full_system.hh"
352926Sktlim@umich.edu
361060SN/A#include <queue>
371060SN/A
381461SN/A#include "base/statistics.hh"
391060SN/A#include "base/timebuf.hh"
401717SN/A#include "cpu/o3/comm.hh"
412292SN/A#include "cpu/o3/scoreboard.hh"
422292SN/A#include "cpu/o3/lsq.hh"
431060SN/A
445529Snate@binkert.orgclass DerivO3CPUParams;
452292SN/Aclass FUPool;
462292SN/A
472292SN/A/**
482326SN/A * DefaultIEW handles both single threaded and SMT IEW
492326SN/A * (issue/execute/writeback).  It handles the dispatching of
502326SN/A * instructions to the LSQ/IQ as part of the issue stage, and has the
512326SN/A * IQ try to issue instructions each cycle. The execute latency is
522326SN/A * actually tied into the issue latency to allow the IQ to be able to
532292SN/A * do back-to-back scheduling without having to speculatively schedule
542326SN/A * instructions. This happens by having the IQ have access to the
552326SN/A * functional units, and the IQ gets the execution latencies from the
562326SN/A * FUs when it issues instructions. Instructions reach the execute
572326SN/A * stage on the last cycle of their execution, which is when the IQ
582326SN/A * knows to wake up any dependent instructions, allowing back to back
592326SN/A * scheduling. The execute portion of IEW separates memory
602326SN/A * instructions from non-memory instructions, either telling the LSQ
612326SN/A * to execute the instruction, or executing the instruction directly.
622326SN/A * The writeback portion of IEW completes the instructions by waking
632326SN/A * up any dependents, and marking the register ready on the
642326SN/A * scoreboard.
652292SN/A */
661681SN/Atemplate<class Impl>
672292SN/Aclass DefaultIEW
681060SN/A{
691060SN/A  private:
701060SN/A    //Typedefs from Impl
711061SN/A    typedef typename Impl::CPUPol CPUPol;
721061SN/A    typedef typename Impl::DynInstPtr DynInstPtr;
732733Sktlim@umich.edu    typedef typename Impl::O3CPU O3CPU;
741060SN/A
751681SN/A    typedef typename CPUPol::IQ IQ;
761061SN/A    typedef typename CPUPol::RenameMap RenameMap;
772292SN/A    typedef typename CPUPol::LSQ LSQ;
781060SN/A
791061SN/A    typedef typename CPUPol::TimeStruct TimeStruct;
801061SN/A    typedef typename CPUPol::IEWStruct IEWStruct;
811061SN/A    typedef typename CPUPol::RenameStruct RenameStruct;
821061SN/A    typedef typename CPUPol::IssueStruct IssueStruct;
831060SN/A
842733Sktlim@umich.edu    friend class Impl::O3CPU;
852292SN/A    friend class CPUPol::IQ;
862292SN/A
871060SN/A  public:
882292SN/A    /** Overall IEW stage status. Used to determine if the CPU can
892292SN/A     * deschedule itself due to a lack of activity.
902292SN/A     */
911060SN/A    enum Status {
922292SN/A        Active,
932292SN/A        Inactive
942292SN/A    };
952292SN/A
962292SN/A    /** Status for Issue, Execute, and Writeback stages. */
972292SN/A    enum StageStatus {
981060SN/A        Running,
991060SN/A        Blocked,
1001060SN/A        Idle,
1012292SN/A        StartSquash,
1021060SN/A        Squashing,
1031060SN/A        Unblocking
1041060SN/A    };
1051060SN/A
1061060SN/A  private:
1072292SN/A    /** Overall stage status. */
1081060SN/A    Status _status;
1092292SN/A    /** Dispatch status. */
1102292SN/A    StageStatus dispatchStatus[Impl::MaxThreads];
1112292SN/A    /** Execute status. */
1122292SN/A    StageStatus exeStatus;
1132292SN/A    /** Writeback status. */
1142292SN/A    StageStatus wbStatus;
1151060SN/A
1161060SN/A  public:
1172292SN/A    /** Constructs a DefaultIEW with the given parameters. */
1185529Snate@binkert.org    DefaultIEW(O3CPU *_cpu, DerivO3CPUParams *params);
1191060SN/A
1202292SN/A    /** Returns the name of the DefaultIEW stage. */
1212292SN/A    std::string name() const;
1221062SN/A
1232292SN/A    /** Registers statistics. */
1242632Sstever@eecs.umich.edu    void regStats();
1252632Sstever@eecs.umich.edu
1262292SN/A    /** Initializes stage; sends back the number of free IQ and LSQ entries. */
1272292SN/A    void initStage();
1282292SN/A
1292871Sktlim@umich.edu    /** Returns the dcache port. */
1302871Sktlim@umich.edu    Port *getDcachePort() { return ldstQueue.getDcachePort(); }
1312871Sktlim@umich.edu
1322292SN/A    /** Sets main time buffer used for backwards communication. */
1332632Sstever@eecs.umich.edu    void setTimeBuffer(TimeBuffer<TimeStruct> *tb_ptr);
1342632Sstever@eecs.umich.edu
1352292SN/A    /** Sets time buffer for getting instructions coming from rename. */
1362632Sstever@eecs.umich.edu    void setRenameQueue(TimeBuffer<RenameStruct> *rq_ptr);
1372632Sstever@eecs.umich.edu
1382292SN/A    /** Sets time buffer to pass on instructions to commit. */
1392632Sstever@eecs.umich.edu    void setIEWQueue(TimeBuffer<IEWStruct> *iq_ptr);
1402632Sstever@eecs.umich.edu
1412292SN/A    /** Sets pointer to list of active threads. */
1422292SN/A    void setActiveThreads(std::list<unsigned> *at_ptr);
1432632Sstever@eecs.umich.edu
1442292SN/A    /** Sets pointer to the scoreboard. */
1452292SN/A    void setScoreboard(Scoreboard *sb_ptr);
1462632Sstever@eecs.umich.edu
1472843Sktlim@umich.edu    /** Drains IEW stage. */
1482863Sktlim@umich.edu    bool drain();
1492843Sktlim@umich.edu
1502843Sktlim@umich.edu    /** Resumes execution after a drain. */
1512843Sktlim@umich.edu    void resume();
1522632Sstever@eecs.umich.edu
1532348SN/A    /** Completes switch out of IEW stage. */
1542843Sktlim@umich.edu    void switchOut();
1552632Sstever@eecs.umich.edu
1562348SN/A    /** Takes over from another CPU's thread. */
1572307SN/A    void takeOverFrom();
1582632Sstever@eecs.umich.edu
1592348SN/A    /** Returns if IEW is switched out. */
1602307SN/A    bool isSwitchedOut() { return switchedOut; }
1612632Sstever@eecs.umich.edu
1622292SN/A    /** Squashes instructions in IEW for a specific thread. */
1632292SN/A    void squash(unsigned tid);
1642107SN/A
1652292SN/A    /** Wakes all dependents of a completed instruction. */
1662632Sstever@eecs.umich.edu    void wakeDependents(DynInstPtr &inst);
1672632Sstever@eecs.umich.edu
1682292SN/A    /** Tells memory dependence unit that a memory instruction needs to be
1692292SN/A     * rescheduled. It will re-execute once replayMemInst() is called.
1702292SN/A     */
1712292SN/A    void rescheduleMemInst(DynInstPtr &inst);
1722292SN/A
1732292SN/A    /** Re-executes all rescheduled memory instructions. */
1742292SN/A    void replayMemInst(DynInstPtr &inst);
1752292SN/A
1762292SN/A    /** Sends an instruction to commit through the time buffer. */
1772632Sstever@eecs.umich.edu    void instToCommit(DynInstPtr &inst);
1782632Sstever@eecs.umich.edu
1792292SN/A    /** Inserts unused instructions of a thread into the skid buffer. */
1802292SN/A    void skidInsert(unsigned tid);
1812292SN/A
1822292SN/A    /** Returns the max of the number of entries in all of the skid buffers. */
1832292SN/A    int skidCount();
1842292SN/A
1852292SN/A    /** Returns if all of the skid buffers are empty. */
1862292SN/A    bool skidsEmpty();
1872292SN/A
1882292SN/A    /** Updates overall IEW status based on all of the stages' statuses. */
1892292SN/A    void updateStatus();
1902292SN/A
1912292SN/A    /** Resets entries of the IQ and the LSQ. */
1922292SN/A    void resetEntries();
1932292SN/A
1942292SN/A    /** Tells the CPU to wakeup if it has descheduled itself due to no
1952292SN/A     * activity. Used mainly by the LdWritebackEvent.
1962292SN/A     */
1972292SN/A    void wakeCPU();
1982292SN/A
1992292SN/A    /** Reports to the CPU that there is activity this cycle. */
2002292SN/A    void activityThisCycle();
2012292SN/A
2022292SN/A    /** Tells CPU that the IEW stage is active and running. */
2032292SN/A    inline void activateStage();
2042292SN/A
2052292SN/A    /** Tells CPU that the IEW stage is inactive and idle. */
2062292SN/A    inline void deactivateStage();
2072292SN/A
2082292SN/A    /** Returns if the LSQ has any stores to writeback. */
2092292SN/A    bool hasStoresToWB() { return ldstQueue.hasStoresToWB(); }
2102292SN/A
2112820Sktlim@umich.edu    void incrWb(InstSeqNum &sn)
2122820Sktlim@umich.edu    {
2132820Sktlim@umich.edu        if (++wbOutstanding == wbMax)
2142820Sktlim@umich.edu            ableToIssue = false;
2152820Sktlim@umich.edu        DPRINTF(IEW, "wbOutstanding: %i\n", wbOutstanding);
2162353SN/A        assert(wbOutstanding <= wbMax);
2172926Sktlim@umich.edu#ifdef DEBUG
2182820Sktlim@umich.edu        wbList.insert(sn);
2192820Sktlim@umich.edu#endif
2202820Sktlim@umich.edu    }
2212820Sktlim@umich.edu
2222820Sktlim@umich.edu    void decrWb(InstSeqNum &sn)
2232820Sktlim@umich.edu    {
2242820Sktlim@umich.edu        if (wbOutstanding-- == wbMax)
2252820Sktlim@umich.edu            ableToIssue = true;
2262820Sktlim@umich.edu        DPRINTF(IEW, "wbOutstanding: %i\n", wbOutstanding);
2272353SN/A        assert(wbOutstanding >= 0);
2282926Sktlim@umich.edu#ifdef DEBUG
2292820Sktlim@umich.edu        assert(wbList.find(sn) != wbList.end());
2302820Sktlim@umich.edu        wbList.erase(sn);
2312820Sktlim@umich.edu#endif
2322820Sktlim@umich.edu    }
2332820Sktlim@umich.edu
2342926Sktlim@umich.edu#ifdef DEBUG
2352820Sktlim@umich.edu    std::set<InstSeqNum> wbList;
2362820Sktlim@umich.edu
2372820Sktlim@umich.edu    void dumpWb()
2382820Sktlim@umich.edu    {
2392820Sktlim@umich.edu        std::set<InstSeqNum>::iterator wb_it = wbList.begin();
2402820Sktlim@umich.edu        while (wb_it != wbList.end()) {
2412820Sktlim@umich.edu            cprintf("[sn:%lli]\n",
2422820Sktlim@umich.edu                    (*wb_it));
2432820Sktlim@umich.edu            wb_it++;
2442820Sktlim@umich.edu        }
2452820Sktlim@umich.edu    }
2462820Sktlim@umich.edu#endif
2472820Sktlim@umich.edu
2482820Sktlim@umich.edu    bool canIssue() { return ableToIssue; }
2492820Sktlim@umich.edu
2502820Sktlim@umich.edu    bool ableToIssue;
2512820Sktlim@umich.edu
2522632Sstever@eecs.umich.edu  private:
2532292SN/A    /** Sends commit proper information for a squash due to a branch
2542292SN/A     * mispredict.
2552292SN/A     */
2562292SN/A    void squashDueToBranch(DynInstPtr &inst, unsigned thread_id);
2572632Sstever@eecs.umich.edu
2582292SN/A    /** Sends commit proper information for a squash due to a memory order
2592292SN/A     * violation.
2602292SN/A     */
2612292SN/A    void squashDueToMemOrder(DynInstPtr &inst, unsigned thread_id);
2622292SN/A
2632292SN/A    /** Sends commit proper information for a squash due to memory becoming
2642292SN/A     * blocked (younger issued instructions must be retried).
2652292SN/A     */
2662292SN/A    void squashDueToMemBlocked(DynInstPtr &inst, unsigned thread_id);
2672292SN/A
2682292SN/A    /** Sets Dispatch to blocked, and signals back to other stages to block. */
2692292SN/A    void block(unsigned thread_id);
2702292SN/A
2712292SN/A    /** Unblocks Dispatch if the skid buffer is empty, and signals back to
2722292SN/A     * other stages to unblock.
2732292SN/A     */
2742292SN/A    void unblock(unsigned thread_id);
2752292SN/A
2762292SN/A    /** Determines proper actions to take given Dispatch's status. */
2772292SN/A    void dispatch(unsigned tid);
2782292SN/A
2792292SN/A    /** Dispatches instructions to IQ and LSQ. */
2802292SN/A    void dispatchInsts(unsigned tid);
2812292SN/A
2822292SN/A    /** Executes instructions. In the case of memory operations, it informs the
2832292SN/A     * LSQ to execute the instructions. Also handles any redirects that occur
2842292SN/A     * due to the executed instructions.
2852292SN/A     */
2862632Sstever@eecs.umich.edu    void executeInsts();
2872632Sstever@eecs.umich.edu
2882292SN/A    /** Writebacks instructions. In our model, the instruction's execute()
2892292SN/A     * function atomically reads registers, executes, and writes registers.
2902292SN/A     * Thus this writeback only wakes up dependent instructions, and informs
2912292SN/A     * the scoreboard of registers becoming ready.
2922292SN/A     */
2932292SN/A    void writebackInsts();
2942292SN/A
2952292SN/A    /** Returns the number of valid, non-squashed instructions coming from
2962292SN/A     * rename to dispatch.
2972292SN/A     */
2982292SN/A    unsigned validInstsFromRename();
2992292SN/A
3002292SN/A    /** Reads the stall signals. */
3012292SN/A    void readStallSignals(unsigned tid);
3022292SN/A
3032292SN/A    /** Checks if any of the stall conditions are currently true. */
3042292SN/A    bool checkStall(unsigned tid);
3052292SN/A
3062292SN/A    /** Processes inputs and changes state accordingly. */
3072292SN/A    void checkSignalsAndUpdate(unsigned tid);
3082292SN/A
3092702Sktlim@umich.edu    /** Removes instructions from rename from a thread's instruction list. */
3102702Sktlim@umich.edu    void emptyRenameInsts(unsigned tid);
3112702Sktlim@umich.edu
3122292SN/A    /** Sorts instructions coming from rename into lists separated by thread. */
3132292SN/A    void sortInsts();
3141060SN/A
3151060SN/A  public:
3162292SN/A    /** Ticks IEW stage, causing Dispatch, the IQ, the LSQ, Execute, and
3172292SN/A     * Writeback to run for one cycle.
3182292SN/A     */
3192632Sstever@eecs.umich.edu    void tick();
3201060SN/A
3211060SN/A  private:
3222348SN/A    /** Updates execution stats based on the instruction. */
3232301SN/A    void updateExeInstStats(DynInstPtr &inst);
3241062SN/A
3252292SN/A    /** Pointer to main time buffer used for backwards communication. */
3262632Sstever@eecs.umich.edu    TimeBuffer<TimeStruct> *timeBuffer;
3271062SN/A
3282292SN/A    /** Wire to write information heading to previous stages. */
3292292SN/A    typename TimeBuffer<TimeStruct>::wire toFetch;
3301060SN/A
3311060SN/A    /** Wire to get commit's output from backwards time buffer. */
3321060SN/A    typename TimeBuffer<TimeStruct>::wire fromCommit;
3331060SN/A
3341060SN/A    /** Wire to write information heading to previous stages. */
3351060SN/A    typename TimeBuffer<TimeStruct>::wire toRename;
3361060SN/A
3371060SN/A    /** Rename instruction queue interface. */
3381060SN/A    TimeBuffer<RenameStruct> *renameQueue;
3391060SN/A
3401060SN/A    /** Wire to get rename's output from rename queue. */
3411060SN/A    typename TimeBuffer<RenameStruct>::wire fromRename;
3421060SN/A
3431060SN/A    /** Issue stage queue. */
3441060SN/A    TimeBuffer<IssueStruct> issueToExecQueue;
3451060SN/A
3461060SN/A    /** Wire to read information from the issue stage time queue. */
3471060SN/A    typename TimeBuffer<IssueStruct>::wire fromIssue;
3481060SN/A
3491060SN/A    /**
3501060SN/A     * IEW stage time buffer.  Holds ROB indices of instructions that
3511060SN/A     * can be marked as completed.
3521060SN/A     */
3531060SN/A    TimeBuffer<IEWStruct> *iewQueue;
3541060SN/A
3551060SN/A    /** Wire to write infromation heading to commit. */
3561060SN/A    typename TimeBuffer<IEWStruct>::wire toCommit;
3571060SN/A
3582292SN/A    /** Queue of all instructions coming from rename this cycle. */
3592292SN/A    std::queue<DynInstPtr> insts[Impl::MaxThreads];
3602292SN/A
3611060SN/A    /** Skid buffer between rename and IEW. */
3622292SN/A    std::queue<DynInstPtr> skidBuffer[Impl::MaxThreads];
3631060SN/A
3642292SN/A    /** Scoreboard pointer. */
3652292SN/A    Scoreboard* scoreboard;
3662292SN/A
3671681SN/A  private:
3682292SN/A    /** CPU pointer. */
3692733Sktlim@umich.edu    O3CPU *cpu;
3701060SN/A
3712292SN/A    /** Records if IEW has written to the time buffer this cycle, so that the
3722292SN/A     * CPU can deschedule itself if there is no activity.
3732292SN/A     */
3742292SN/A    bool wroteToTimeBuffer;
3752292SN/A
3762292SN/A    /** Source of possible stalls. */
3772292SN/A    struct Stalls {
3782292SN/A        bool commit;
3792292SN/A    };
3802292SN/A
3812292SN/A    /** Stages that are telling IEW to stall. */
3822292SN/A    Stalls stalls[Impl::MaxThreads];
3832292SN/A
3842292SN/A    /** Debug function to print instructions that are issued this cycle. */
3852292SN/A    void printAvailableInsts();
3862292SN/A
3872292SN/A  public:
3884329Sktlim@umich.edu    /** Instruction queue. */
3894329Sktlim@umich.edu    IQ instQueue;
3904329Sktlim@umich.edu
3914329Sktlim@umich.edu    /** Load / store queue. */
3924329Sktlim@umich.edu    LSQ ldstQueue;
3934329Sktlim@umich.edu
3944329Sktlim@umich.edu    /** Pointer to the functional unit pool. */
3954329Sktlim@umich.edu    FUPool *fuPool;
3962292SN/A    /** Records if the LSQ needs to be updated on the next cycle, so that
3972292SN/A     * IEW knows if there will be activity on the next cycle.
3982292SN/A     */
3992292SN/A    bool updateLSQNextCycle;
4002292SN/A
4011060SN/A  private:
4022292SN/A    /** Records if there is a fetch redirect on this cycle for each thread. */
4032292SN/A    bool fetchRedirect[Impl::MaxThreads];
4042292SN/A
4052292SN/A    /** Records if the queues have been changed (inserted or issued insts),
4062292SN/A     * so that IEW knows to broadcast the updated amount of free entries.
4072292SN/A     */
4082292SN/A    bool updatedQueues;
4092292SN/A
4101060SN/A    /** Commit to IEW delay, in ticks. */
4111060SN/A    unsigned commitToIEWDelay;
4121060SN/A
4131060SN/A    /** Rename to IEW delay, in ticks. */
4141060SN/A    unsigned renameToIEWDelay;
4151060SN/A
4161060SN/A    /**
4171060SN/A     * Issue to execute delay, in ticks.  What this actually represents is
4181060SN/A     * the amount of time it takes for an instruction to wake up, be
4191060SN/A     * scheduled, and sent to a FU for execution.
4201060SN/A     */
4211060SN/A    unsigned issueToExecuteDelay;
4221060SN/A
4232820Sktlim@umich.edu    /** Width of dispatch, in instructions. */
4242820Sktlim@umich.edu    unsigned dispatchWidth;
4251060SN/A
4261060SN/A    /** Width of issue, in instructions. */
4271060SN/A    unsigned issueWidth;
4281060SN/A
4292292SN/A    /** Index into queue of instructions being written back. */
4302292SN/A    unsigned wbNumInst;
4312292SN/A
4322292SN/A    /** Cycle number within the queue of instructions being written back.
4332292SN/A     * Used in case there are too many instructions writing back at the current
4342292SN/A     * cycle and writesbacks need to be scheduled for the future. See comments
4352292SN/A     * in instToCommit().
4361060SN/A     */
4372292SN/A    unsigned wbCycle;
4381060SN/A
4392820Sktlim@umich.edu    /** Number of instructions in flight that will writeback. */
4403125Sktlim@umich.edu
4413125Sktlim@umich.edu    /** Number of instructions in flight that will writeback. */
4422353SN/A    int wbOutstanding;
4432820Sktlim@umich.edu
4442820Sktlim@umich.edu    /** Writeback width. */
4452820Sktlim@umich.edu    unsigned wbWidth;
4462820Sktlim@umich.edu
4472820Sktlim@umich.edu    /** Writeback width * writeback depth, where writeback depth is
4482820Sktlim@umich.edu     * the number of cycles of writing back instructions that can be
4492820Sktlim@umich.edu     * buffered. */
4502820Sktlim@umich.edu    unsigned wbMax;
4512820Sktlim@umich.edu
4522292SN/A    /** Number of active threads. */
4532292SN/A    unsigned numThreads;
4542292SN/A
4552292SN/A    /** Pointer to list of active threads. */
4562292SN/A    std::list<unsigned> *activeThreads;
4572292SN/A
4582292SN/A    /** Maximum size of the skid buffer. */
4592292SN/A    unsigned skidBufferMax;
4602292SN/A
4612348SN/A    /** Is this stage switched out. */
4622307SN/A    bool switchedOut;
4632307SN/A
4642292SN/A    /** Stat for total number of idle cycles. */
4651062SN/A    Stats::Scalar<> iewIdleCycles;
4662292SN/A    /** Stat for total number of squashing cycles. */
4671062SN/A    Stats::Scalar<> iewSquashCycles;
4682292SN/A    /** Stat for total number of blocking cycles. */
4691062SN/A    Stats::Scalar<> iewBlockCycles;
4702292SN/A    /** Stat for total number of unblocking cycles. */
4711062SN/A    Stats::Scalar<> iewUnblockCycles;
4722292SN/A    /** Stat for total number of instructions dispatched. */
4731062SN/A    Stats::Scalar<> iewDispatchedInsts;
4742292SN/A    /** Stat for total number of squashed instructions dispatch skips. */
4751062SN/A    Stats::Scalar<> iewDispSquashedInsts;
4762292SN/A    /** Stat for total number of dispatched load instructions. */
4771062SN/A    Stats::Scalar<> iewDispLoadInsts;
4782292SN/A    /** Stat for total number of dispatched store instructions. */
4791062SN/A    Stats::Scalar<> iewDispStoreInsts;
4802292SN/A    /** Stat for total number of dispatched non speculative instructions. */
4811062SN/A    Stats::Scalar<> iewDispNonSpecInsts;
4822292SN/A    /** Stat for number of times the IQ becomes full. */
4831062SN/A    Stats::Scalar<> iewIQFullEvents;
4842292SN/A    /** Stat for number of times the LSQ becomes full. */
4852292SN/A    Stats::Scalar<> iewLSQFullEvents;
4862292SN/A    /** Stat for total number of memory ordering violation events. */
4871062SN/A    Stats::Scalar<> memOrderViolationEvents;
4882292SN/A    /** Stat for total number of incorrect predicted taken branches. */
4891062SN/A    Stats::Scalar<> predictedTakenIncorrect;
4902292SN/A    /** Stat for total number of incorrect predicted not taken branches. */
4912292SN/A    Stats::Scalar<> predictedNotTakenIncorrect;
4922292SN/A    /** Stat for total number of mispredicted branches detected at execute. */
4932292SN/A    Stats::Formula branchMispredicts;
4942301SN/A
4952727Sktlim@umich.edu    /** Stat for total number of executed instructions. */
4962727Sktlim@umich.edu    Stats::Scalar<> iewExecutedInsts;
4972727Sktlim@umich.edu    /** Stat for total number of executed load instructions. */
4982727Sktlim@umich.edu    Stats::Vector<> iewExecLoadInsts;
4992353SN/A    /** Stat for total number of executed store instructions. */
5002353SN/A//    Stats::Scalar<> iewExecStoreInsts;
5012727Sktlim@umich.edu    /** Stat for total number of squashed instructions skipped at execute. */
5022727Sktlim@umich.edu    Stats::Scalar<> iewExecSquashedInsts;
5032348SN/A    /** Number of executed software prefetches. */
5042727Sktlim@umich.edu    Stats::Vector<> iewExecutedSwp;
5052348SN/A    /** Number of executed nops. */
5062727Sktlim@umich.edu    Stats::Vector<> iewExecutedNop;
5072348SN/A    /** Number of executed meomory references. */
5082727Sktlim@umich.edu    Stats::Vector<> iewExecutedRefs;
5092348SN/A    /** Number of executed branches. */
5102727Sktlim@umich.edu    Stats::Vector<> iewExecutedBranches;
5112348SN/A    /** Number of executed store instructions. */
5122301SN/A    Stats::Formula iewExecStoreInsts;
5132727Sktlim@umich.edu    /** Number of instructions executed per cycle. */
5142727Sktlim@umich.edu    Stats::Formula iewExecRate;
5152727Sktlim@umich.edu
5162348SN/A    /** Number of instructions sent to commit. */
5172301SN/A    Stats::Vector<> iewInstsToCommit;
5182348SN/A    /** Number of instructions that writeback. */
5192326SN/A    Stats::Vector<> writebackCount;
5202348SN/A    /** Number of instructions that wake consumers. */
5212326SN/A    Stats::Vector<> producerInst;
5222348SN/A    /** Number of instructions that wake up from producers. */
5232326SN/A    Stats::Vector<> consumerInst;
5242348SN/A    /** Number of instructions that were delayed in writing back due
5252348SN/A     * to resource contention.
5262348SN/A     */
5272326SN/A    Stats::Vector<> wbPenalized;
5282348SN/A    /** Number of instructions per cycle written back. */
5292326SN/A    Stats::Formula wbRate;
5302348SN/A    /** Average number of woken instructions per writeback. */
5312326SN/A    Stats::Formula wbFanout;
5322348SN/A    /** Number of instructions per cycle delayed in writing back . */
5332326SN/A    Stats::Formula wbPenalizedRate;
5341060SN/A};
5351060SN/A
5362292SN/A#endif // __CPU_O3_IEW_HH__
537