execute.hh revision 10259
110259SAndrew.Bardsley@arm.com/*
210259SAndrew.Bardsley@arm.com * Copyright (c) 2013-2014 ARM Limited
310259SAndrew.Bardsley@arm.com * All rights reserved
410259SAndrew.Bardsley@arm.com *
510259SAndrew.Bardsley@arm.com * The license below extends only to copyright in the software and shall
610259SAndrew.Bardsley@arm.com * not be construed as granting a license to any other intellectual
710259SAndrew.Bardsley@arm.com * property including but not limited to intellectual property relating
810259SAndrew.Bardsley@arm.com * to a hardware implementation of the functionality of the software
910259SAndrew.Bardsley@arm.com * licensed hereunder.  You may use the software subject to the license
1010259SAndrew.Bardsley@arm.com * terms below provided that you ensure that this notice is replicated
1110259SAndrew.Bardsley@arm.com * unmodified and in its entirety in all distributions of the software,
1210259SAndrew.Bardsley@arm.com * modified or unmodified, in source code or in binary form.
1310259SAndrew.Bardsley@arm.com *
1410259SAndrew.Bardsley@arm.com * Redistribution and use in source and binary forms, with or without
1510259SAndrew.Bardsley@arm.com * modification, are permitted provided that the following conditions are
1610259SAndrew.Bardsley@arm.com * met: redistributions of source code must retain the above copyright
1710259SAndrew.Bardsley@arm.com * notice, this list of conditions and the following disclaimer;
1810259SAndrew.Bardsley@arm.com * redistributions in binary form must reproduce the above copyright
1910259SAndrew.Bardsley@arm.com * notice, this list of conditions and the following disclaimer in the
2010259SAndrew.Bardsley@arm.com * documentation and/or other materials provided with the distribution;
2110259SAndrew.Bardsley@arm.com * neither the name of the copyright holders nor the names of its
2210259SAndrew.Bardsley@arm.com * contributors may be used to endorse or promote products derived from
2310259SAndrew.Bardsley@arm.com * this software without specific prior written permission.
2410259SAndrew.Bardsley@arm.com *
2510259SAndrew.Bardsley@arm.com * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
2610259SAndrew.Bardsley@arm.com * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
2710259SAndrew.Bardsley@arm.com * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
2810259SAndrew.Bardsley@arm.com * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
2910259SAndrew.Bardsley@arm.com * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
3010259SAndrew.Bardsley@arm.com * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
3110259SAndrew.Bardsley@arm.com * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
3210259SAndrew.Bardsley@arm.com * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
3310259SAndrew.Bardsley@arm.com * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3410259SAndrew.Bardsley@arm.com * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
3510259SAndrew.Bardsley@arm.com * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3610259SAndrew.Bardsley@arm.com *
3710259SAndrew.Bardsley@arm.com * Authors: Andrew Bardsley
3810259SAndrew.Bardsley@arm.com */
3910259SAndrew.Bardsley@arm.com
4010259SAndrew.Bardsley@arm.com/**
4110259SAndrew.Bardsley@arm.com * @file
4210259SAndrew.Bardsley@arm.com *
4310259SAndrew.Bardsley@arm.com *  All the fun of executing instructions from Decode and sending branch/new
4410259SAndrew.Bardsley@arm.com *  instruction stream info. to Fetch1.
4510259SAndrew.Bardsley@arm.com */
4610259SAndrew.Bardsley@arm.com
4710259SAndrew.Bardsley@arm.com#ifndef __CPU_MINOR_EXECUTE_HH__
4810259SAndrew.Bardsley@arm.com#define __CPU_MINOR_EXECUTE_HH__
4910259SAndrew.Bardsley@arm.com
5010259SAndrew.Bardsley@arm.com#include "cpu/minor/buffers.hh"
5110259SAndrew.Bardsley@arm.com#include "cpu/minor/cpu.hh"
5210259SAndrew.Bardsley@arm.com#include "cpu/minor/func_unit.hh"
5310259SAndrew.Bardsley@arm.com#include "cpu/minor/lsq.hh"
5410259SAndrew.Bardsley@arm.com#include "cpu/minor/pipe_data.hh"
5510259SAndrew.Bardsley@arm.com#include "cpu/minor/scoreboard.hh"
5610259SAndrew.Bardsley@arm.com
5710259SAndrew.Bardsley@arm.comnamespace Minor
5810259SAndrew.Bardsley@arm.com{
5910259SAndrew.Bardsley@arm.com
6010259SAndrew.Bardsley@arm.com/** Execute stage.  Everything apart from fetching and decoding instructions.
6110259SAndrew.Bardsley@arm.com *  The LSQ lives here too. */
6210259SAndrew.Bardsley@arm.comclass Execute : public Named
6310259SAndrew.Bardsley@arm.com{
6410259SAndrew.Bardsley@arm.com  protected:
6510259SAndrew.Bardsley@arm.com    /** Input port carrying instructions from Decode */
6610259SAndrew.Bardsley@arm.com    Latch<ForwardInstData>::Output inp;
6710259SAndrew.Bardsley@arm.com
6810259SAndrew.Bardsley@arm.com    /** Input port carrying stream changes to Fetch1 */
6910259SAndrew.Bardsley@arm.com    Latch<BranchData>::Input out;
7010259SAndrew.Bardsley@arm.com
7110259SAndrew.Bardsley@arm.com    /** Pointer back to the containing CPU */
7210259SAndrew.Bardsley@arm.com    MinorCPU &cpu;
7310259SAndrew.Bardsley@arm.com
7410259SAndrew.Bardsley@arm.com    /** Number of instructions that can be issued per cycle */
7510259SAndrew.Bardsley@arm.com    unsigned int issueLimit;
7610259SAndrew.Bardsley@arm.com
7710259SAndrew.Bardsley@arm.com    /** Number of memory ops that can be issued per cycle */
7810259SAndrew.Bardsley@arm.com    unsigned int memoryIssueLimit;
7910259SAndrew.Bardsley@arm.com
8010259SAndrew.Bardsley@arm.com    /** Number of instructions that can be committed per cycle */
8110259SAndrew.Bardsley@arm.com    unsigned int commitLimit;
8210259SAndrew.Bardsley@arm.com
8310259SAndrew.Bardsley@arm.com    /** Number of memory instructions that can be committed per cycle */
8410259SAndrew.Bardsley@arm.com    unsigned int memoryCommitLimit;
8510259SAndrew.Bardsley@arm.com
8610259SAndrew.Bardsley@arm.com    /** If true, more than one input line can be processed each cycle if
8710259SAndrew.Bardsley@arm.com     *  there is room to execute more instructions than taken from the first
8810259SAndrew.Bardsley@arm.com     *  line */
8910259SAndrew.Bardsley@arm.com    bool processMoreThanOneInput;
9010259SAndrew.Bardsley@arm.com
9110259SAndrew.Bardsley@arm.com    /** Descriptions of the functional units we want to generate */
9210259SAndrew.Bardsley@arm.com    MinorFUPool &fuDescriptions;
9310259SAndrew.Bardsley@arm.com
9410259SAndrew.Bardsley@arm.com    /** Number of functional units to produce */
9510259SAndrew.Bardsley@arm.com    unsigned int numFuncUnits;
9610259SAndrew.Bardsley@arm.com
9710259SAndrew.Bardsley@arm.com    /** Longest latency of any FU, useful for setting up the activity
9810259SAndrew.Bardsley@arm.com     *  recoder */
9910259SAndrew.Bardsley@arm.com    Cycles longestFuLatency;
10010259SAndrew.Bardsley@arm.com
10110259SAndrew.Bardsley@arm.com    /** Modify instruction trace times on commit */
10210259SAndrew.Bardsley@arm.com    bool setTraceTimeOnCommit;
10310259SAndrew.Bardsley@arm.com
10410259SAndrew.Bardsley@arm.com    /** Modify instruction trace times on issue */
10510259SAndrew.Bardsley@arm.com    bool setTraceTimeOnIssue;
10610259SAndrew.Bardsley@arm.com
10710259SAndrew.Bardsley@arm.com    /** Allow mem refs to leave their FUs before reaching the head
10810259SAndrew.Bardsley@arm.com     *  of the in flight insts queue if their dependencies are met */
10910259SAndrew.Bardsley@arm.com    bool allowEarlyMemIssue;
11010259SAndrew.Bardsley@arm.com
11110259SAndrew.Bardsley@arm.com    /** The FU index of the non-existent costless FU for instructions
11210259SAndrew.Bardsley@arm.com     *  which pass the MinorDynInst::isNoCostInst test */
11310259SAndrew.Bardsley@arm.com    unsigned int noCostFUIndex;
11410259SAndrew.Bardsley@arm.com
11510259SAndrew.Bardsley@arm.com    /** Dcache port to pass on to the CPU.  Execute owns this */
11610259SAndrew.Bardsley@arm.com    LSQ lsq;
11710259SAndrew.Bardsley@arm.com
11810259SAndrew.Bardsley@arm.com    /** Scoreboard of instruction dependencies */
11910259SAndrew.Bardsley@arm.com    Scoreboard scoreboard;
12010259SAndrew.Bardsley@arm.com
12110259SAndrew.Bardsley@arm.com    /** The execution functional units */
12210259SAndrew.Bardsley@arm.com    std::vector<FUPipeline *> funcUnits;
12310259SAndrew.Bardsley@arm.com
12410259SAndrew.Bardsley@arm.com  public: /* Public for Pipeline to be able to pass it to Decode */
12510259SAndrew.Bardsley@arm.com    InputBuffer<ForwardInstData> inputBuffer;
12610259SAndrew.Bardsley@arm.com
12710259SAndrew.Bardsley@arm.com  protected:
12810259SAndrew.Bardsley@arm.com    /** Stage cycle-by-cycle state */
12910259SAndrew.Bardsley@arm.com
13010259SAndrew.Bardsley@arm.com    /** State that drain passes through (in order).  On a drain request,
13110259SAndrew.Bardsley@arm.com     *  Execute transitions into either DrainCurrentInst (if between
13210259SAndrew.Bardsley@arm.com     *  microops) or DrainHaltFetch.
13310259SAndrew.Bardsley@arm.com     *
13410259SAndrew.Bardsley@arm.com     *  Note that Execute doesn't actually have *  a 'Drained' state, only
13510259SAndrew.Bardsley@arm.com     *  an indication that it's currently draining and isDrained that can't
13610259SAndrew.Bardsley@arm.com     *  tell if there are insts still in the pipeline leading up to
13710259SAndrew.Bardsley@arm.com     *  Execute */
13810259SAndrew.Bardsley@arm.com    enum DrainState
13910259SAndrew.Bardsley@arm.com    {
14010259SAndrew.Bardsley@arm.com        NotDraining, /* Not draining, possibly running */
14110259SAndrew.Bardsley@arm.com        DrainCurrentInst, /* Draining to end of inst/macroop */
14210259SAndrew.Bardsley@arm.com        DrainHaltFetch, /* Halting Fetch after completing current inst */
14310259SAndrew.Bardsley@arm.com        DrainAllInsts /* Discarding all remaining insts */
14410259SAndrew.Bardsley@arm.com    };
14510259SAndrew.Bardsley@arm.com
14610259SAndrew.Bardsley@arm.com    /** In-order instructions either in FUs or the LSQ */
14710259SAndrew.Bardsley@arm.com    Queue<QueuedInst, ReportTraitsAdaptor<QueuedInst> > *inFlightInsts;
14810259SAndrew.Bardsley@arm.com
14910259SAndrew.Bardsley@arm.com    /** Memory ref instructions still in the FUs */
15010259SAndrew.Bardsley@arm.com    Queue<QueuedInst, ReportTraitsAdaptor<QueuedInst> > *inFUMemInsts;
15110259SAndrew.Bardsley@arm.com
15210259SAndrew.Bardsley@arm.com    /** Index that we've completed upto in getInput data.  We can say we're
15310259SAndrew.Bardsley@arm.com     *  popInput when this equals getInput()->width() */
15410259SAndrew.Bardsley@arm.com    unsigned int inputIndex;
15510259SAndrew.Bardsley@arm.com
15610259SAndrew.Bardsley@arm.com    /** The last commit was the end of a full instruction so an interrupt
15710259SAndrew.Bardsley@arm.com     *  can safely happen */
15810259SAndrew.Bardsley@arm.com    bool lastCommitWasEndOfMacroop;
15910259SAndrew.Bardsley@arm.com
16010259SAndrew.Bardsley@arm.com    /** Structure for reporting insts currently being processed/retired
16110259SAndrew.Bardsley@arm.com     *  for MinorTrace */
16210259SAndrew.Bardsley@arm.com    ForwardInstData instsBeingCommitted;
16310259SAndrew.Bardsley@arm.com
16410259SAndrew.Bardsley@arm.com    /** Source of sequence number for instuction streams.  Increment this and
16510259SAndrew.Bardsley@arm.com     *  pass to fetch whenever an instruction stream needs to be changed.
16610259SAndrew.Bardsley@arm.com     *  For any more complicated behaviour (e.g. speculation) there'll need
16710259SAndrew.Bardsley@arm.com     *  to be another plan. THREAD, need one for each thread */
16810259SAndrew.Bardsley@arm.com    InstSeqNum streamSeqNum;
16910259SAndrew.Bardsley@arm.com
17010259SAndrew.Bardsley@arm.com    /** A prediction number for use where one isn't available from an
17110259SAndrew.Bardsley@arm.com     *  instruction.  This is harvested from committed instructions.
17210259SAndrew.Bardsley@arm.com     *  This isn't really needed as the streamSeqNum will change on
17310259SAndrew.Bardsley@arm.com     *  a branch, but it minimises disruption in stream identification */
17410259SAndrew.Bardsley@arm.com    InstSeqNum lastPredictionSeqNum;
17510259SAndrew.Bardsley@arm.com
17610259SAndrew.Bardsley@arm.com    /** State progression for draining NotDraining -> ... -> DrainAllInsts */
17710259SAndrew.Bardsley@arm.com    DrainState drainState;
17810259SAndrew.Bardsley@arm.com
17910259SAndrew.Bardsley@arm.com  protected:
18010259SAndrew.Bardsley@arm.com    friend std::ostream &operator <<(std::ostream &os, DrainState state);
18110259SAndrew.Bardsley@arm.com
18210259SAndrew.Bardsley@arm.com    /** Get a piece of data to work on from the inputBuffer, or 0 if there
18310259SAndrew.Bardsley@arm.com     *  is no data. */
18410259SAndrew.Bardsley@arm.com    const ForwardInstData *getInput();
18510259SAndrew.Bardsley@arm.com
18610259SAndrew.Bardsley@arm.com    /** Pop an element off the input buffer, if there are any */
18710259SAndrew.Bardsley@arm.com    void popInput();
18810259SAndrew.Bardsley@arm.com
18910259SAndrew.Bardsley@arm.com    /** Generate Branch data based (into branch) on an observed (or not)
19010259SAndrew.Bardsley@arm.com     *  change in PC while executing an instruction.
19110259SAndrew.Bardsley@arm.com     *  Also handles branch prediction information within the inst. */
19210259SAndrew.Bardsley@arm.com    void tryToBranch(MinorDynInstPtr inst, Fault fault, BranchData &branch);
19310259SAndrew.Bardsley@arm.com
19410259SAndrew.Bardsley@arm.com    /** Actually create a branch to communicate to Fetch1/Fetch2 and,
19510259SAndrew.Bardsley@arm.com     *  if that is a stream-changing branch update the streamSeqNum */
19610259SAndrew.Bardsley@arm.com    void updateBranchData(BranchData::Reason reason,
19710259SAndrew.Bardsley@arm.com        MinorDynInstPtr inst, const TheISA::PCState &target,
19810259SAndrew.Bardsley@arm.com        BranchData &branch);
19910259SAndrew.Bardsley@arm.com
20010259SAndrew.Bardsley@arm.com    /** Handle extracting mem ref responses from the memory queues and
20110259SAndrew.Bardsley@arm.com     *  completing the associated instructions.
20210259SAndrew.Bardsley@arm.com     *  Fault is an output and will contain any fault caused (and already
20310259SAndrew.Bardsley@arm.com     *  invoked by the function)
20410259SAndrew.Bardsley@arm.com     *  Sets branch to any branch generated by the instruction. */
20510259SAndrew.Bardsley@arm.com    void handleMemResponse(MinorDynInstPtr inst,
20610259SAndrew.Bardsley@arm.com        LSQ::LSQRequestPtr response, BranchData &branch,
20710259SAndrew.Bardsley@arm.com        Fault &fault);
20810259SAndrew.Bardsley@arm.com
20910259SAndrew.Bardsley@arm.com    /** Execute a memory reference instruction.  This calls initiateAcc on
21010259SAndrew.Bardsley@arm.com     *  the instruction which will then call writeMem or readMem to issue a
21110259SAndrew.Bardsley@arm.com     *  memory access to the LSQ.
21210259SAndrew.Bardsley@arm.com     *  Returns true if the instruction was executed rather than stalled
21310259SAndrew.Bardsley@arm.com     *  because of a lack of LSQ resources and false otherwise.
21410259SAndrew.Bardsley@arm.com     *  branch is set to any branch raised by the instruction.
21510259SAndrew.Bardsley@arm.com     *  failed_predicate is set to false if the instruction passed its
21610259SAndrew.Bardsley@arm.com     *  predicate and so will access memory or true if the instruction
21710259SAndrew.Bardsley@arm.com     *  *failed* its predicate and is now complete.
21810259SAndrew.Bardsley@arm.com     *  fault is set if any non-NoFault fault is raised.
21910259SAndrew.Bardsley@arm.com     *  Any faults raised are actually invoke-d by this function. */
22010259SAndrew.Bardsley@arm.com    bool executeMemRefInst(MinorDynInstPtr inst, BranchData &branch,
22110259SAndrew.Bardsley@arm.com        bool &failed_predicate, Fault &fault);
22210259SAndrew.Bardsley@arm.com
22310259SAndrew.Bardsley@arm.com    /** Has an interrupt been raised */
22410259SAndrew.Bardsley@arm.com    bool isInterrupted(ThreadID thread_id) const;
22510259SAndrew.Bardsley@arm.com
22610259SAndrew.Bardsley@arm.com    /** Are we between instructions?  Can we be interrupted? */
22710259SAndrew.Bardsley@arm.com    bool isInbetweenInsts() const;
22810259SAndrew.Bardsley@arm.com
22910259SAndrew.Bardsley@arm.com    /** Act on an interrupt.  Returns true if an interrupt was actually
23010259SAndrew.Bardsley@arm.com     *  signalled and invoked */
23110259SAndrew.Bardsley@arm.com    bool takeInterrupt(ThreadID thread_id, BranchData &branch);
23210259SAndrew.Bardsley@arm.com
23310259SAndrew.Bardsley@arm.com    /** Try and issue instructions from the inputBuffer */
23410259SAndrew.Bardsley@arm.com    unsigned int issue(bool only_issue_microops);
23510259SAndrew.Bardsley@arm.com
23610259SAndrew.Bardsley@arm.com    /** Try to act on PC-related events.  Returns true if any were
23710259SAndrew.Bardsley@arm.com     *  executed */
23810259SAndrew.Bardsley@arm.com    bool tryPCEvents();
23910259SAndrew.Bardsley@arm.com
24010259SAndrew.Bardsley@arm.com    /** Do the stats handling and instruction count and PC event events
24110259SAndrew.Bardsley@arm.com     *  related to the new instruction/op counts */
24210259SAndrew.Bardsley@arm.com    void doInstCommitAccounting(MinorDynInstPtr inst);
24310259SAndrew.Bardsley@arm.com
24410259SAndrew.Bardsley@arm.com    /** Commit a single instruction.  Returns true if the instruction being
24510259SAndrew.Bardsley@arm.com     *  examined was completed (fully executed, discarded, or initiated a
24610259SAndrew.Bardsley@arm.com     *  memory access), false if there is still some processing to do.
24710259SAndrew.Bardsley@arm.com     *  fu_index is the index of the functional unit this instruction is
24810259SAndrew.Bardsley@arm.com     *  being executed in into for funcUnits
24910259SAndrew.Bardsley@arm.com     *  If early_memory_issue is true then this is an early execution
25010259SAndrew.Bardsley@arm.com     *  of a mem ref and so faults will not be processed.
25110259SAndrew.Bardsley@arm.com     *  If the return value is true:
25210259SAndrew.Bardsley@arm.com     *      fault is set if a fault happened,
25310259SAndrew.Bardsley@arm.com     *      branch is set to indicate any branch that occurs
25410259SAndrew.Bardsley@arm.com     *      committed is set to true if this instruction is committed
25510259SAndrew.Bardsley@arm.com     *          (and so needs to be traced and accounted for)
25610259SAndrew.Bardsley@arm.com     *      completed_mem_issue is set if the instruction was a
25710259SAndrew.Bardsley@arm.com     *          memory access that was issued */
25810259SAndrew.Bardsley@arm.com    bool commitInst(MinorDynInstPtr inst, bool early_memory_issue,
25910259SAndrew.Bardsley@arm.com        BranchData &branch, Fault &fault, bool &committed,
26010259SAndrew.Bardsley@arm.com        bool &completed_mem_issue);
26110259SAndrew.Bardsley@arm.com
26210259SAndrew.Bardsley@arm.com    /** Try and commit instructions from the ends of the functional unit
26310259SAndrew.Bardsley@arm.com     *  pipelines.
26410259SAndrew.Bardsley@arm.com     *  If only_commit_microops is true then only commit upto the
26510259SAndrew.Bardsley@arm.com     *  end of the currect full instruction.
26610259SAndrew.Bardsley@arm.com     *  If discard is true then discard all instructions rather than
26710259SAndrew.Bardsley@arm.com     *  committing.
26810259SAndrew.Bardsley@arm.com     *  branch is set to any branch raised during commit. */
26910259SAndrew.Bardsley@arm.com    void commit(bool only_commit_microops, bool discard, BranchData &branch);
27010259SAndrew.Bardsley@arm.com
27110259SAndrew.Bardsley@arm.com    /** Set the drain state (with useful debugging messages) */
27210259SAndrew.Bardsley@arm.com    void setDrainState(DrainState state);
27310259SAndrew.Bardsley@arm.com
27410259SAndrew.Bardsley@arm.com  public:
27510259SAndrew.Bardsley@arm.com    Execute(const std::string &name_,
27610259SAndrew.Bardsley@arm.com        MinorCPU &cpu_,
27710259SAndrew.Bardsley@arm.com        MinorCPUParams &params,
27810259SAndrew.Bardsley@arm.com        Latch<ForwardInstData>::Output inp_,
27910259SAndrew.Bardsley@arm.com        Latch<BranchData>::Input out_);
28010259SAndrew.Bardsley@arm.com
28110259SAndrew.Bardsley@arm.com    ~Execute();
28210259SAndrew.Bardsley@arm.com
28310259SAndrew.Bardsley@arm.com  public:
28410259SAndrew.Bardsley@arm.com
28510259SAndrew.Bardsley@arm.com    /** Cause Execute to issue an UnpredictedBranch (or WakeupFetch if
28610259SAndrew.Bardsley@arm.com     *  that was passed as the reason) to Fetch1 to wake the
28710259SAndrew.Bardsley@arm.com     *  system up (using the PC from the thread context). */
28810259SAndrew.Bardsley@arm.com    void wakeupFetch(BranchData::Reason reason =
28910259SAndrew.Bardsley@arm.com        BranchData::UnpredictedBranch);
29010259SAndrew.Bardsley@arm.com
29110259SAndrew.Bardsley@arm.com    /** Returns the DcachePort owned by this Execute to pass upwards */
29210259SAndrew.Bardsley@arm.com    MinorCPU::MinorCPUPort &getDcachePort();
29310259SAndrew.Bardsley@arm.com
29410259SAndrew.Bardsley@arm.com    /** To allow ExecContext to find the LSQ */
29510259SAndrew.Bardsley@arm.com    LSQ &getLSQ() { return lsq; }
29610259SAndrew.Bardsley@arm.com
29710259SAndrew.Bardsley@arm.com    /** Does the given instruction have the right stream sequence number
29810259SAndrew.Bardsley@arm.com     *  to be committed? */
29910259SAndrew.Bardsley@arm.com    bool instIsRightStream(MinorDynInstPtr inst);
30010259SAndrew.Bardsley@arm.com
30110259SAndrew.Bardsley@arm.com    /** Returns true if the given instruction is at the head of the
30210259SAndrew.Bardsley@arm.com     *  inFlightInsts instruction queue */
30310259SAndrew.Bardsley@arm.com    bool instIsHeadInst(MinorDynInstPtr inst);
30410259SAndrew.Bardsley@arm.com
30510259SAndrew.Bardsley@arm.com    /** Pass on input/buffer data to the output if you can */
30610259SAndrew.Bardsley@arm.com    void evaluate();
30710259SAndrew.Bardsley@arm.com
30810259SAndrew.Bardsley@arm.com    void minorTrace() const;
30910259SAndrew.Bardsley@arm.com
31010259SAndrew.Bardsley@arm.com    /** After thread suspension, has Execute been drained of in-flight
31110259SAndrew.Bardsley@arm.com     *  instructions and memory accesses. */
31210259SAndrew.Bardsley@arm.com    bool isDrained();
31310259SAndrew.Bardsley@arm.com
31410259SAndrew.Bardsley@arm.com    /** Like the drain interface on SimObject */
31510259SAndrew.Bardsley@arm.com    unsigned int drain();
31610259SAndrew.Bardsley@arm.com    void drainResume();
31710259SAndrew.Bardsley@arm.com};
31810259SAndrew.Bardsley@arm.com
31910259SAndrew.Bardsley@arm.com}
32010259SAndrew.Bardsley@arm.com
32110259SAndrew.Bardsley@arm.com#endif /* __CPU_MINOR_EXECUTE_HH__ */
322