iew.hh revision 11246
11689SN/A/*
210333Smitch.hayenga@arm.com * Copyright (c) 2010-2012, 2014 ARM Limited
37782Sminkyu.jeong@arm.com * All rights reserved
47782Sminkyu.jeong@arm.com *
57782Sminkyu.jeong@arm.com * The license below extends only to copyright in the software and shall
67782Sminkyu.jeong@arm.com * not be construed as granting a license to any other intellectual
77782Sminkyu.jeong@arm.com * property including but not limited to intellectual property relating
87782Sminkyu.jeong@arm.com * to a hardware implementation of the functionality of the software
97782Sminkyu.jeong@arm.com * licensed hereunder.  You may use the software subject to the license
107782Sminkyu.jeong@arm.com * terms below provided that you ensure that this notice is replicated
117782Sminkyu.jeong@arm.com * unmodified and in its entirety in all distributions of the software,
127782Sminkyu.jeong@arm.com * modified or unmodified, in source code or in binary form.
137782Sminkyu.jeong@arm.com *
142326SN/A * Copyright (c) 2004-2006 The Regents of The University of Michigan
151689SN/A * All rights reserved.
161689SN/A *
171689SN/A * Redistribution and use in source and binary forms, with or without
181689SN/A * modification, are permitted provided that the following conditions are
191689SN/A * met: redistributions of source code must retain the above copyright
201689SN/A * notice, this list of conditions and the following disclaimer;
211689SN/A * redistributions in binary form must reproduce the above copyright
221689SN/A * notice, this list of conditions and the following disclaimer in the
231689SN/A * documentation and/or other materials provided with the distribution;
241689SN/A * neither the name of the copyright holders nor the names of its
251689SN/A * contributors may be used to endorse or promote products derived from
261689SN/A * this software without specific prior written permission.
271689SN/A *
281689SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
291689SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
301689SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
311689SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
321689SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
331689SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
341689SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
351689SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
361689SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
371689SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
381689SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
392665Ssaidi@eecs.umich.edu *
402665Ssaidi@eecs.umich.edu * Authors: Kevin Lim
411689SN/A */
421689SN/A
432292SN/A#ifndef __CPU_O3_IEW_HH__
442292SN/A#define __CPU_O3_IEW_HH__
451060SN/A
461060SN/A#include <queue>
478230Snate@binkert.org#include <set>
481060SN/A
491461SN/A#include "base/statistics.hh"
501717SN/A#include "cpu/o3/comm.hh"
518229Snate@binkert.org#include "cpu/o3/lsq.hh"
522292SN/A#include "cpu/o3/scoreboard.hh"
538229Snate@binkert.org#include "cpu/timebuf.hh"
548232Snate@binkert.org#include "debug/IEW.hh"
5510023Smatt.horsnell@ARM.com#include "sim/probe/probe.hh"
561060SN/A
578737Skoansin.tan@gmail.comstruct DerivO3CPUParams;
582292SN/Aclass FUPool;
592292SN/A
602292SN/A/**
612326SN/A * DefaultIEW handles both single threaded and SMT IEW
622326SN/A * (issue/execute/writeback).  It handles the dispatching of
632326SN/A * instructions to the LSQ/IQ as part of the issue stage, and has the
642326SN/A * IQ try to issue instructions each cycle. The execute latency is
652326SN/A * actually tied into the issue latency to allow the IQ to be able to
662292SN/A * do back-to-back scheduling without having to speculatively schedule
672326SN/A * instructions. This happens by having the IQ have access to the
682326SN/A * functional units, and the IQ gets the execution latencies from the
692326SN/A * FUs when it issues instructions. Instructions reach the execute
702326SN/A * stage on the last cycle of their execution, which is when the IQ
712326SN/A * knows to wake up any dependent instructions, allowing back to back
722326SN/A * scheduling. The execute portion of IEW separates memory
732326SN/A * instructions from non-memory instructions, either telling the LSQ
742326SN/A * to execute the instruction, or executing the instruction directly.
752326SN/A * The writeback portion of IEW completes the instructions by waking
762326SN/A * up any dependents, and marking the register ready on the
772326SN/A * scoreboard.
782292SN/A */
791681SN/Atemplate<class Impl>
802292SN/Aclass DefaultIEW
811060SN/A{
821060SN/A  private:
831060SN/A    //Typedefs from Impl
841061SN/A    typedef typename Impl::CPUPol CPUPol;
851061SN/A    typedef typename Impl::DynInstPtr DynInstPtr;
862733Sktlim@umich.edu    typedef typename Impl::O3CPU O3CPU;
871060SN/A
881681SN/A    typedef typename CPUPol::IQ IQ;
891061SN/A    typedef typename CPUPol::RenameMap RenameMap;
902292SN/A    typedef typename CPUPol::LSQ LSQ;
911060SN/A
921061SN/A    typedef typename CPUPol::TimeStruct TimeStruct;
931061SN/A    typedef typename CPUPol::IEWStruct IEWStruct;
941061SN/A    typedef typename CPUPol::RenameStruct RenameStruct;
951061SN/A    typedef typename CPUPol::IssueStruct IssueStruct;
961060SN/A
971060SN/A  public:
982292SN/A    /** Overall IEW stage status. Used to determine if the CPU can
992292SN/A     * deschedule itself due to a lack of activity.
1002292SN/A     */
1011060SN/A    enum Status {
1022292SN/A        Active,
1032292SN/A        Inactive
1042292SN/A    };
1052292SN/A
1062292SN/A    /** Status for Issue, Execute, and Writeback stages. */
1072292SN/A    enum StageStatus {
1081060SN/A        Running,
1091060SN/A        Blocked,
1101060SN/A        Idle,
1112292SN/A        StartSquash,
1121060SN/A        Squashing,
1131060SN/A        Unblocking
1141060SN/A    };
1151060SN/A
1161060SN/A  private:
1172292SN/A    /** Overall stage status. */
1181060SN/A    Status _status;
1192292SN/A    /** Dispatch status. */
1202292SN/A    StageStatus dispatchStatus[Impl::MaxThreads];
1212292SN/A    /** Execute status. */
1222292SN/A    StageStatus exeStatus;
1232292SN/A    /** Writeback status. */
1242292SN/A    StageStatus wbStatus;
1251060SN/A
12610023Smatt.horsnell@ARM.com    /** Probe points. */
12710023Smatt.horsnell@ARM.com    ProbePointArg<DynInstPtr> *ppMispredict;
12810023Smatt.horsnell@ARM.com    ProbePointArg<DynInstPtr> *ppDispatch;
12911246Sradhika.jagtap@ARM.com    /** To probe when instruction execution begins. */
13011246Sradhika.jagtap@ARM.com    ProbePointArg<DynInstPtr> *ppExecute;
13111246Sradhika.jagtap@ARM.com    /** To probe when instruction execution is complete. */
13211246Sradhika.jagtap@ARM.com    ProbePointArg<DynInstPtr> *ppToCommit;
13310023Smatt.horsnell@ARM.com
1341060SN/A  public:
1352292SN/A    /** Constructs a DefaultIEW with the given parameters. */
1365529Snate@binkert.org    DefaultIEW(O3CPU *_cpu, DerivO3CPUParams *params);
1371060SN/A
1382292SN/A    /** Returns the name of the DefaultIEW stage. */
1392292SN/A    std::string name() const;
1401062SN/A
1412292SN/A    /** Registers statistics. */
1422632Sstever@eecs.umich.edu    void regStats();
1432632Sstever@eecs.umich.edu
14410023Smatt.horsnell@ARM.com    /** Registers probes. */
14510023Smatt.horsnell@ARM.com    void regProbePoints();
14610023Smatt.horsnell@ARM.com
1472292SN/A    /** Initializes stage; sends back the number of free IQ and LSQ entries. */
1489427SAndreas.Sandberg@ARM.com    void startupStage();
1492292SN/A
1502292SN/A    /** Sets main time buffer used for backwards communication. */
1512632Sstever@eecs.umich.edu    void setTimeBuffer(TimeBuffer<TimeStruct> *tb_ptr);
1522632Sstever@eecs.umich.edu
1532292SN/A    /** Sets time buffer for getting instructions coming from rename. */
1542632Sstever@eecs.umich.edu    void setRenameQueue(TimeBuffer<RenameStruct> *rq_ptr);
1552632Sstever@eecs.umich.edu
1562292SN/A    /** Sets time buffer to pass on instructions to commit. */
1572632Sstever@eecs.umich.edu    void setIEWQueue(TimeBuffer<IEWStruct> *iq_ptr);
1582632Sstever@eecs.umich.edu
1592292SN/A    /** Sets pointer to list of active threads. */
1606221Snate@binkert.org    void setActiveThreads(std::list<ThreadID> *at_ptr);
1612632Sstever@eecs.umich.edu
1622292SN/A    /** Sets pointer to the scoreboard. */
1632292SN/A    void setScoreboard(Scoreboard *sb_ptr);
1642632Sstever@eecs.umich.edu
1659444SAndreas.Sandberg@ARM.com    /** Perform sanity checks after a drain. */
1669444SAndreas.Sandberg@ARM.com    void drainSanityCheck() const;
1672843Sktlim@umich.edu
1689444SAndreas.Sandberg@ARM.com    /** Has the stage drained? */
1699444SAndreas.Sandberg@ARM.com    bool isDrained() const;
1702632Sstever@eecs.umich.edu
1712348SN/A    /** Takes over from another CPU's thread. */
1722307SN/A    void takeOverFrom();
1732632Sstever@eecs.umich.edu
1742292SN/A    /** Squashes instructions in IEW for a specific thread. */
1756221Snate@binkert.org    void squash(ThreadID tid);
1762107SN/A
1772292SN/A    /** Wakes all dependents of a completed instruction. */
1782632Sstever@eecs.umich.edu    void wakeDependents(DynInstPtr &inst);
1792632Sstever@eecs.umich.edu
1802292SN/A    /** Tells memory dependence unit that a memory instruction needs to be
1812292SN/A     * rescheduled. It will re-execute once replayMemInst() is called.
1822292SN/A     */
1832292SN/A    void rescheduleMemInst(DynInstPtr &inst);
1842292SN/A
1852292SN/A    /** Re-executes all rescheduled memory instructions. */
1862292SN/A    void replayMemInst(DynInstPtr &inst);
1872292SN/A
18810333Smitch.hayenga@arm.com    /** Moves memory instruction onto the list of cache blocked instructions */
18910333Smitch.hayenga@arm.com    void blockMemInst(DynInstPtr &inst);
19010333Smitch.hayenga@arm.com
19110333Smitch.hayenga@arm.com    /** Notifies that the cache has become unblocked */
19210333Smitch.hayenga@arm.com    void cacheUnblocked();
19310333Smitch.hayenga@arm.com
1942292SN/A    /** Sends an instruction to commit through the time buffer. */
1952632Sstever@eecs.umich.edu    void instToCommit(DynInstPtr &inst);
1962632Sstever@eecs.umich.edu
1972292SN/A    /** Inserts unused instructions of a thread into the skid buffer. */
1986221Snate@binkert.org    void skidInsert(ThreadID tid);
1992292SN/A
2002292SN/A    /** Returns the max of the number of entries in all of the skid buffers. */
2012292SN/A    int skidCount();
2022292SN/A
2032292SN/A    /** Returns if all of the skid buffers are empty. */
2042292SN/A    bool skidsEmpty();
2052292SN/A
2062292SN/A    /** Updates overall IEW status based on all of the stages' statuses. */
2072292SN/A    void updateStatus();
2082292SN/A
2092292SN/A    /** Resets entries of the IQ and the LSQ. */
2102292SN/A    void resetEntries();
2112292SN/A
2122292SN/A    /** Tells the CPU to wakeup if it has descheduled itself due to no
2132292SN/A     * activity. Used mainly by the LdWritebackEvent.
2142292SN/A     */
2152292SN/A    void wakeCPU();
2162292SN/A
2172292SN/A    /** Reports to the CPU that there is activity this cycle. */
2182292SN/A    void activityThisCycle();
2192292SN/A
2202292SN/A    /** Tells CPU that the IEW stage is active and running. */
2212292SN/A    inline void activateStage();
2222292SN/A
2232292SN/A    /** Tells CPU that the IEW stage is inactive and idle. */
2242292SN/A    inline void deactivateStage();
2252292SN/A
2262292SN/A    /** Returns if the LSQ has any stores to writeback. */
2272292SN/A    bool hasStoresToWB() { return ldstQueue.hasStoresToWB(); }
2282292SN/A
2295557Sktlim@umich.edu    /** Returns if the LSQ has any stores to writeback. */
2306221Snate@binkert.org    bool hasStoresToWB(ThreadID tid) { return ldstQueue.hasStoresToWB(tid); }
2315557Sktlim@umich.edu
2327598Sminkyu.jeong@arm.com    /** Check misprediction  */
2337598Sminkyu.jeong@arm.com    void checkMisprediction(DynInstPtr &inst);
2347598Sminkyu.jeong@arm.com
2352632Sstever@eecs.umich.edu  private:
2362292SN/A    /** Sends commit proper information for a squash due to a branch
2372292SN/A     * mispredict.
2382292SN/A     */
2396221Snate@binkert.org    void squashDueToBranch(DynInstPtr &inst, ThreadID tid);
2402632Sstever@eecs.umich.edu
2412292SN/A    /** Sends commit proper information for a squash due to a memory order
2422292SN/A     * violation.
2432292SN/A     */
2446221Snate@binkert.org    void squashDueToMemOrder(DynInstPtr &inst, ThreadID tid);
2452292SN/A
2462292SN/A    /** Sets Dispatch to blocked, and signals back to other stages to block. */
2476221Snate@binkert.org    void block(ThreadID tid);
2482292SN/A
2492292SN/A    /** Unblocks Dispatch if the skid buffer is empty, and signals back to
2502292SN/A     * other stages to unblock.
2512292SN/A     */
2526221Snate@binkert.org    void unblock(ThreadID tid);
2532292SN/A
2542292SN/A    /** Determines proper actions to take given Dispatch's status. */
2556221Snate@binkert.org    void dispatch(ThreadID tid);
2562292SN/A
2572292SN/A    /** Dispatches instructions to IQ and LSQ. */
2586221Snate@binkert.org    void dispatchInsts(ThreadID tid);
2592292SN/A
2602292SN/A    /** Executes instructions. In the case of memory operations, it informs the
2612292SN/A     * LSQ to execute the instructions. Also handles any redirects that occur
2622292SN/A     * due to the executed instructions.
2632292SN/A     */
2642632Sstever@eecs.umich.edu    void executeInsts();
2652632Sstever@eecs.umich.edu
2662292SN/A    /** Writebacks instructions. In our model, the instruction's execute()
2672292SN/A     * function atomically reads registers, executes, and writes registers.
2682292SN/A     * Thus this writeback only wakes up dependent instructions, and informs
2692292SN/A     * the scoreboard of registers becoming ready.
2702292SN/A     */
2712292SN/A    void writebackInsts();
2722292SN/A
2732292SN/A    /** Returns the number of valid, non-squashed instructions coming from
2742292SN/A     * rename to dispatch.
2752292SN/A     */
2762292SN/A    unsigned validInstsFromRename();
2772292SN/A
2782292SN/A    /** Checks if any of the stall conditions are currently true. */
2796221Snate@binkert.org    bool checkStall(ThreadID tid);
2802292SN/A
2812292SN/A    /** Processes inputs and changes state accordingly. */
2826221Snate@binkert.org    void checkSignalsAndUpdate(ThreadID tid);
2832292SN/A
2842702Sktlim@umich.edu    /** Removes instructions from rename from a thread's instruction list. */
2856221Snate@binkert.org    void emptyRenameInsts(ThreadID tid);
2862702Sktlim@umich.edu
2872292SN/A    /** Sorts instructions coming from rename into lists separated by thread. */
2882292SN/A    void sortInsts();
2891060SN/A
2901060SN/A  public:
2912292SN/A    /** Ticks IEW stage, causing Dispatch, the IQ, the LSQ, Execute, and
2922292SN/A     * Writeback to run for one cycle.
2932292SN/A     */
2942632Sstever@eecs.umich.edu    void tick();
2951060SN/A
2961060SN/A  private:
2972348SN/A    /** Updates execution stats based on the instruction. */
2982301SN/A    void updateExeInstStats(DynInstPtr &inst);
2991062SN/A
3002292SN/A    /** Pointer to main time buffer used for backwards communication. */
3012632Sstever@eecs.umich.edu    TimeBuffer<TimeStruct> *timeBuffer;
3021062SN/A
3032292SN/A    /** Wire to write information heading to previous stages. */
3042292SN/A    typename TimeBuffer<TimeStruct>::wire toFetch;
3051060SN/A
3061060SN/A    /** Wire to get commit's output from backwards time buffer. */
3071060SN/A    typename TimeBuffer<TimeStruct>::wire fromCommit;
3081060SN/A
3091060SN/A    /** Wire to write information heading to previous stages. */
3101060SN/A    typename TimeBuffer<TimeStruct>::wire toRename;
3111060SN/A
3121060SN/A    /** Rename instruction queue interface. */
3131060SN/A    TimeBuffer<RenameStruct> *renameQueue;
3141060SN/A
3151060SN/A    /** Wire to get rename's output from rename queue. */
3161060SN/A    typename TimeBuffer<RenameStruct>::wire fromRename;
3171060SN/A
3181060SN/A    /** Issue stage queue. */
3191060SN/A    TimeBuffer<IssueStruct> issueToExecQueue;
3201060SN/A
3211060SN/A    /** Wire to read information from the issue stage time queue. */
3221060SN/A    typename TimeBuffer<IssueStruct>::wire fromIssue;
3231060SN/A
3241060SN/A    /**
3251060SN/A     * IEW stage time buffer.  Holds ROB indices of instructions that
3261060SN/A     * can be marked as completed.
3271060SN/A     */
3281060SN/A    TimeBuffer<IEWStruct> *iewQueue;
3291060SN/A
3301060SN/A    /** Wire to write infromation heading to commit. */
3311060SN/A    typename TimeBuffer<IEWStruct>::wire toCommit;
3321060SN/A
3332292SN/A    /** Queue of all instructions coming from rename this cycle. */
3342292SN/A    std::queue<DynInstPtr> insts[Impl::MaxThreads];
3352292SN/A
3361060SN/A    /** Skid buffer between rename and IEW. */
3372292SN/A    std::queue<DynInstPtr> skidBuffer[Impl::MaxThreads];
3381060SN/A
3392292SN/A    /** Scoreboard pointer. */
3402292SN/A    Scoreboard* scoreboard;
3412292SN/A
3421681SN/A  private:
3432292SN/A    /** CPU pointer. */
3442733Sktlim@umich.edu    O3CPU *cpu;
3451060SN/A
3462292SN/A    /** Records if IEW has written to the time buffer this cycle, so that the
3472292SN/A     * CPU can deschedule itself if there is no activity.
3482292SN/A     */
3492292SN/A    bool wroteToTimeBuffer;
3502292SN/A
3512292SN/A    /** Debug function to print instructions that are issued this cycle. */
3522292SN/A    void printAvailableInsts();
3532292SN/A
3542292SN/A  public:
3554329Sktlim@umich.edu    /** Instruction queue. */
3564329Sktlim@umich.edu    IQ instQueue;
3574329Sktlim@umich.edu
3584329Sktlim@umich.edu    /** Load / store queue. */
3594329Sktlim@umich.edu    LSQ ldstQueue;
3604329Sktlim@umich.edu
3614329Sktlim@umich.edu    /** Pointer to the functional unit pool. */
3624329Sktlim@umich.edu    FUPool *fuPool;
3632292SN/A    /** Records if the LSQ needs to be updated on the next cycle, so that
3642292SN/A     * IEW knows if there will be activity on the next cycle.
3652292SN/A     */
3662292SN/A    bool updateLSQNextCycle;
3672292SN/A
3681060SN/A  private:
3692292SN/A    /** Records if there is a fetch redirect on this cycle for each thread. */
3702292SN/A    bool fetchRedirect[Impl::MaxThreads];
3712292SN/A
3722292SN/A    /** Records if the queues have been changed (inserted or issued insts),
3732292SN/A     * so that IEW knows to broadcast the updated amount of free entries.
3742292SN/A     */
3752292SN/A    bool updatedQueues;
3762292SN/A
3779184Sandreas.hansson@arm.com    /** Commit to IEW delay. */
3789184Sandreas.hansson@arm.com    Cycles commitToIEWDelay;
3791060SN/A
3809184Sandreas.hansson@arm.com    /** Rename to IEW delay. */
3819184Sandreas.hansson@arm.com    Cycles renameToIEWDelay;
3821060SN/A
3831060SN/A    /**
3849184Sandreas.hansson@arm.com     * Issue to execute delay. What this actually represents is
3851060SN/A     * the amount of time it takes for an instruction to wake up, be
3861060SN/A     * scheduled, and sent to a FU for execution.
3871060SN/A     */
3889184Sandreas.hansson@arm.com    Cycles issueToExecuteDelay;
3891060SN/A
3902820Sktlim@umich.edu    /** Width of dispatch, in instructions. */
3912820Sktlim@umich.edu    unsigned dispatchWidth;
3921060SN/A
3931060SN/A    /** Width of issue, in instructions. */
3941060SN/A    unsigned issueWidth;
3951060SN/A
3962292SN/A    /** Index into queue of instructions being written back. */
3972292SN/A    unsigned wbNumInst;
3982292SN/A
3992292SN/A    /** Cycle number within the queue of instructions being written back.
4002292SN/A     * Used in case there are too many instructions writing back at the current
4012292SN/A     * cycle and writesbacks need to be scheduled for the future. See comments
4022292SN/A     * in instToCommit().
4031060SN/A     */
4042292SN/A    unsigned wbCycle;
4051060SN/A
4062820Sktlim@umich.edu    /** Writeback width. */
4072820Sktlim@umich.edu    unsigned wbWidth;
4082820Sktlim@umich.edu
4092292SN/A    /** Number of active threads. */
4106221Snate@binkert.org    ThreadID numThreads;
4112292SN/A
4122292SN/A    /** Pointer to list of active threads. */
4136221Snate@binkert.org    std::list<ThreadID> *activeThreads;
4142292SN/A
4152292SN/A    /** Maximum size of the skid buffer. */
4162292SN/A    unsigned skidBufferMax;
4172292SN/A
4182292SN/A    /** Stat for total number of idle cycles. */
4195999Snate@binkert.org    Stats::Scalar iewIdleCycles;
4202292SN/A    /** Stat for total number of squashing cycles. */
4215999Snate@binkert.org    Stats::Scalar iewSquashCycles;
4222292SN/A    /** Stat for total number of blocking cycles. */
4235999Snate@binkert.org    Stats::Scalar iewBlockCycles;
4242292SN/A    /** Stat for total number of unblocking cycles. */
4255999Snate@binkert.org    Stats::Scalar iewUnblockCycles;
4262292SN/A    /** Stat for total number of instructions dispatched. */
4275999Snate@binkert.org    Stats::Scalar iewDispatchedInsts;
4282292SN/A    /** Stat for total number of squashed instructions dispatch skips. */
4295999Snate@binkert.org    Stats::Scalar iewDispSquashedInsts;
4302292SN/A    /** Stat for total number of dispatched load instructions. */
4315999Snate@binkert.org    Stats::Scalar iewDispLoadInsts;
4322292SN/A    /** Stat for total number of dispatched store instructions. */
4335999Snate@binkert.org    Stats::Scalar iewDispStoreInsts;
4342292SN/A    /** Stat for total number of dispatched non speculative instructions. */
4355999Snate@binkert.org    Stats::Scalar iewDispNonSpecInsts;
4362292SN/A    /** Stat for number of times the IQ becomes full. */
4375999Snate@binkert.org    Stats::Scalar iewIQFullEvents;
4382292SN/A    /** Stat for number of times the LSQ becomes full. */
4395999Snate@binkert.org    Stats::Scalar iewLSQFullEvents;
4402292SN/A    /** Stat for total number of memory ordering violation events. */
4415999Snate@binkert.org    Stats::Scalar memOrderViolationEvents;
4422292SN/A    /** Stat for total number of incorrect predicted taken branches. */
4435999Snate@binkert.org    Stats::Scalar predictedTakenIncorrect;
4442292SN/A    /** Stat for total number of incorrect predicted not taken branches. */
4455999Snate@binkert.org    Stats::Scalar predictedNotTakenIncorrect;
4462292SN/A    /** Stat for total number of mispredicted branches detected at execute. */
4472292SN/A    Stats::Formula branchMispredicts;
4482301SN/A
4492727Sktlim@umich.edu    /** Stat for total number of executed instructions. */
4505999Snate@binkert.org    Stats::Scalar iewExecutedInsts;
4512727Sktlim@umich.edu    /** Stat for total number of executed load instructions. */
4525999Snate@binkert.org    Stats::Vector iewExecLoadInsts;
4532353SN/A    /** Stat for total number of executed store instructions. */
4545999Snate@binkert.org//    Stats::Scalar iewExecStoreInsts;
4552727Sktlim@umich.edu    /** Stat for total number of squashed instructions skipped at execute. */
4565999Snate@binkert.org    Stats::Scalar iewExecSquashedInsts;
4572348SN/A    /** Number of executed software prefetches. */
4585999Snate@binkert.org    Stats::Vector iewExecutedSwp;
4592348SN/A    /** Number of executed nops. */
4605999Snate@binkert.org    Stats::Vector iewExecutedNop;
4612348SN/A    /** Number of executed meomory references. */
4625999Snate@binkert.org    Stats::Vector iewExecutedRefs;
4632348SN/A    /** Number of executed branches. */
4645999Snate@binkert.org    Stats::Vector iewExecutedBranches;
4652348SN/A    /** Number of executed store instructions. */
4662301SN/A    Stats::Formula iewExecStoreInsts;
4672727Sktlim@umich.edu    /** Number of instructions executed per cycle. */
4682727Sktlim@umich.edu    Stats::Formula iewExecRate;
4692727Sktlim@umich.edu
4702348SN/A    /** Number of instructions sent to commit. */
4715999Snate@binkert.org    Stats::Vector iewInstsToCommit;
4722348SN/A    /** Number of instructions that writeback. */
4735999Snate@binkert.org    Stats::Vector writebackCount;
4742348SN/A    /** Number of instructions that wake consumers. */
4755999Snate@binkert.org    Stats::Vector producerInst;
4762348SN/A    /** Number of instructions that wake up from producers. */
4775999Snate@binkert.org    Stats::Vector consumerInst;
4782348SN/A    /** Number of instructions per cycle written back. */
4792326SN/A    Stats::Formula wbRate;
4802348SN/A    /** Average number of woken instructions per writeback. */
4812326SN/A    Stats::Formula wbFanout;
4821060SN/A};
4831060SN/A
4842292SN/A#endif // __CPU_O3_IEW_HH__
485