lsq_unit.hh revision 12355
14120Sgblack@eecs.umich.edu/*
24120Sgblack@eecs.umich.edu * Copyright (c) 2012-2014,2017 ARM Limited
34120Sgblack@eecs.umich.edu * All rights reserved
44120Sgblack@eecs.umich.edu *
54120Sgblack@eecs.umich.edu * The license below extends only to copyright in the software and shall
64120Sgblack@eecs.umich.edu * not be construed as granting a license to any other intellectual
74120Sgblack@eecs.umich.edu * property including but not limited to intellectual property relating
84120Sgblack@eecs.umich.edu * to a hardware implementation of the functionality of the software
94120Sgblack@eecs.umich.edu * licensed hereunder.  You may use the software subject to the license
104120Sgblack@eecs.umich.edu * terms below provided that you ensure that this notice is replicated
114120Sgblack@eecs.umich.edu * unmodified and in its entirety in all distributions of the software,
124120Sgblack@eecs.umich.edu * modified or unmodified, in source code or in binary form.
134120Sgblack@eecs.umich.edu *
144120Sgblack@eecs.umich.edu * Copyright (c) 2004-2006 The Regents of The University of Michigan
154120Sgblack@eecs.umich.edu * Copyright (c) 2013 Advanced Micro Devices, Inc.
164120Sgblack@eecs.umich.edu * All rights reserved.
174120Sgblack@eecs.umich.edu *
184120Sgblack@eecs.umich.edu * Redistribution and use in source and binary forms, with or without
194120Sgblack@eecs.umich.edu * modification, are permitted provided that the following conditions are
204120Sgblack@eecs.umich.edu * met: redistributions of source code must retain the above copyright
214120Sgblack@eecs.umich.edu * notice, this list of conditions and the following disclaimer;
224120Sgblack@eecs.umich.edu * redistributions in binary form must reproduce the above copyright
234120Sgblack@eecs.umich.edu * notice, this list of conditions and the following disclaimer in the
244120Sgblack@eecs.umich.edu * documentation and/or other materials provided with the distribution;
254120Sgblack@eecs.umich.edu * neither the name of the copyright holders nor the names of its
264120Sgblack@eecs.umich.edu * contributors may be used to endorse or promote products derived from
274120Sgblack@eecs.umich.edu * this software without specific prior written permission.
284120Sgblack@eecs.umich.edu *
294120Sgblack@eecs.umich.edu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
304120Sgblack@eecs.umich.edu * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
314120Sgblack@eecs.umich.edu * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
324120Sgblack@eecs.umich.edu * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
334120Sgblack@eecs.umich.edu * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
344120Sgblack@eecs.umich.edu * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
354120Sgblack@eecs.umich.edu * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
364120Sgblack@eecs.umich.edu * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
374120Sgblack@eecs.umich.edu * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
384120Sgblack@eecs.umich.edu * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
394120Sgblack@eecs.umich.edu * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
404120Sgblack@eecs.umich.edu *
414120Sgblack@eecs.umich.edu * Authors: Kevin Lim
424120Sgblack@eecs.umich.edu *          Korey Sewell
434120Sgblack@eecs.umich.edu */
444120Sgblack@eecs.umich.edu
454120Sgblack@eecs.umich.edu#ifndef __CPU_O3_LSQ_UNIT_HH__
464120Sgblack@eecs.umich.edu#define __CPU_O3_LSQ_UNIT_HH__
474120Sgblack@eecs.umich.edu
484120Sgblack@eecs.umich.edu#include <algorithm>
494120Sgblack@eecs.umich.edu#include <cstring>
504120Sgblack@eecs.umich.edu#include <map>
514120Sgblack@eecs.umich.edu#include <queue>
524120Sgblack@eecs.umich.edu
534120Sgblack@eecs.umich.edu#include "arch/generic/debugfaults.hh"
544120Sgblack@eecs.umich.edu#include "arch/isa_traits.hh"
554120Sgblack@eecs.umich.edu#include "arch/locked_mem.hh"
564120Sgblack@eecs.umich.edu#include "arch/mmapped_ipr.hh"
574120Sgblack@eecs.umich.edu#include "config/the_isa.hh"
584120Sgblack@eecs.umich.edu#include "cpu/inst_seq.hh"
594120Sgblack@eecs.umich.edu#include "cpu/timebuf.hh"
604120Sgblack@eecs.umich.edu#include "debug/LSQUnit.hh"
614139Sgblack@eecs.umich.edu#include "mem/packet.hh"
624135Sgblack@eecs.umich.edu#include "mem/port.hh"
634120Sgblack@eecs.umich.edu
644120Sgblack@eecs.umich.edustruct DerivO3CPUParams;
654120Sgblack@eecs.umich.edu
665114Sgblack@eecs.umich.edu/**
675114Sgblack@eecs.umich.edu * Class that implements the actual LQ and SQ for each specific
684135Sgblack@eecs.umich.edu * thread.  Both are circular queues; load entries are freed upon
694365Sgblack@eecs.umich.edu * committing, while store entries are freed once they writeback. The
705114Sgblack@eecs.umich.edu * LSQUnit tracks if there are memory ordering violations, and also
715114Sgblack@eecs.umich.edu * detects partial load to store forwarding cases (a store only has
725114Sgblack@eecs.umich.edu * part of a load's data) that requires the load to wait until the
735114Sgblack@eecs.umich.edu * store writes back. In the former case it holds onto the instruction
745114Sgblack@eecs.umich.edu * until the dependence unit looks at it, and in the latter it stalls
755114Sgblack@eecs.umich.edu * the LSQ until the store writes back. At that point the load is
765114Sgblack@eecs.umich.edu * replayed.
775114Sgblack@eecs.umich.edu */
784729Sgblack@eecs.umich.edutemplate <class Impl>
794365Sgblack@eecs.umich.educlass LSQUnit {
805114Sgblack@eecs.umich.edu  public:
814365Sgblack@eecs.umich.edu    typedef typename Impl::O3CPU O3CPU;
824365Sgblack@eecs.umich.edu    typedef typename Impl::DynInstPtr DynInstPtr;
835114Sgblack@eecs.umich.edu    typedef typename Impl::CPUPol::IEW IEW;
845114Sgblack@eecs.umich.edu    typedef typename Impl::CPUPol::LSQ LSQ;
855114Sgblack@eecs.umich.edu    typedef typename Impl::CPUPol::IssueStruct IssueStruct;
865114Sgblack@eecs.umich.edu
875114Sgblack@eecs.umich.edu  public:
885114Sgblack@eecs.umich.edu    /** Constructs an LSQ unit. init() must be called prior to use. */
895114Sgblack@eecs.umich.edu    LSQUnit();
905114Sgblack@eecs.umich.edu
915114Sgblack@eecs.umich.edu    /** Initializes the LSQ unit with the specified number of entries. */
925114Sgblack@eecs.umich.edu    void init(O3CPU *cpu_ptr, IEW *iew_ptr, DerivO3CPUParams *params,
935114Sgblack@eecs.umich.edu            LSQ *lsq_ptr, unsigned maxLQEntries, unsigned maxSQEntries,
945114Sgblack@eecs.umich.edu            unsigned id);
955114Sgblack@eecs.umich.edu
965114Sgblack@eecs.umich.edu    /** Returns the name of the LSQ unit. */
975114Sgblack@eecs.umich.edu    std::string name() const;
985114Sgblack@eecs.umich.edu
995114Sgblack@eecs.umich.edu    /** Registers statistics. */
1005114Sgblack@eecs.umich.edu    void regStats();
1015114Sgblack@eecs.umich.edu
1025114Sgblack@eecs.umich.edu    /** Sets the pointer to the dcache port. */
1035114Sgblack@eecs.umich.edu    void setDcachePort(MasterPort *dcache_port);
1045114Sgblack@eecs.umich.edu
1055114Sgblack@eecs.umich.edu    /** Perform sanity checks after a drain. */
1065114Sgblack@eecs.umich.edu    void drainSanityCheck() const;
1075114Sgblack@eecs.umich.edu
1085114Sgblack@eecs.umich.edu    /** Takes over from another CPU's thread. */
1095114Sgblack@eecs.umich.edu    void takeOverFrom();
1105114Sgblack@eecs.umich.edu
1115114Sgblack@eecs.umich.edu    /** Ticks the LSQ unit, which in this case only resets the number of
1125114Sgblack@eecs.umich.edu     * used cache ports.
1135114Sgblack@eecs.umich.edu     * @todo: Move the number of used ports up to the LSQ level so it can
1145124Sgblack@eecs.umich.edu     * be shared by all LSQ units.
1155114Sgblack@eecs.umich.edu     */
1165114Sgblack@eecs.umich.edu    void tick() { usedStorePorts = 0; }
1175114Sgblack@eecs.umich.edu
1185114Sgblack@eecs.umich.edu    /** Inserts an instruction. */
1195114Sgblack@eecs.umich.edu    void insert(DynInstPtr &inst);
1205114Sgblack@eecs.umich.edu    /** Inserts a load instruction. */
1215114Sgblack@eecs.umich.edu    void insertLoad(DynInstPtr &load_inst);
1225114Sgblack@eecs.umich.edu    /** Inserts a store instruction. */
1235114Sgblack@eecs.umich.edu    void insertStore(DynInstPtr &store_inst);
1245114Sgblack@eecs.umich.edu
1255114Sgblack@eecs.umich.edu    /** Check for ordering violations in the LSQ. For a store squash if we
1265114Sgblack@eecs.umich.edu     * ever find a conflicting load. For a load, only squash if we
1275124Sgblack@eecs.umich.edu     * an external snoop invalidate has been seen for that load address
1285114Sgblack@eecs.umich.edu     * @param load_idx index to start checking at
1295114Sgblack@eecs.umich.edu     * @param inst the instruction to check
1305114Sgblack@eecs.umich.edu     */
1315114Sgblack@eecs.umich.edu    Fault checkViolations(int load_idx, DynInstPtr &inst);
1325114Sgblack@eecs.umich.edu
1335114Sgblack@eecs.umich.edu    /** Check if an incoming invalidate hits in the lsq on a load
1345114Sgblack@eecs.umich.edu     * that might have issued out of order wrt another load beacuse
1355114Sgblack@eecs.umich.edu     * of the intermediate invalidate.
1365114Sgblack@eecs.umich.edu     */
1375114Sgblack@eecs.umich.edu    void checkSnoop(PacketPtr pkt);
1385114Sgblack@eecs.umich.edu
1395114Sgblack@eecs.umich.edu    /** Executes a load instruction. */
1405124Sgblack@eecs.umich.edu    Fault executeLoad(DynInstPtr &inst);
1415114Sgblack@eecs.umich.edu
1424135Sgblack@eecs.umich.edu    Fault executeLoad(int lq_idx) { panic("Not implemented"); return NoFault; }
1434150Sgblack@eecs.umich.edu    /** Executes a store instruction. */
1444365Sgblack@eecs.umich.edu    Fault executeStore(DynInstPtr &inst);
1454365Sgblack@eecs.umich.edu
1464365Sgblack@eecs.umich.edu    /** Commits the head load. */
1474729Sgblack@eecs.umich.edu    void commitLoad();
1484365Sgblack@eecs.umich.edu    /** Commits loads older than a specific sequence number. */
1494365Sgblack@eecs.umich.edu    void commitLoads(InstSeqNum &youngest_inst);
1504365Sgblack@eecs.umich.edu
1514365Sgblack@eecs.umich.edu    /** Commits stores older than a specific sequence number. */
1524365Sgblack@eecs.umich.edu    void commitStores(InstSeqNum &youngest_inst);
1534365Sgblack@eecs.umich.edu
1544365Sgblack@eecs.umich.edu    /** Writes back stores. */
1554365Sgblack@eecs.umich.edu    void writebackStores();
1564365Sgblack@eecs.umich.edu
1574365Sgblack@eecs.umich.edu    /** Completes the data access that has been returned from the
1584150Sgblack@eecs.umich.edu     * memory system. */
1594150Sgblack@eecs.umich.edu    void completeDataAccess(PacketPtr pkt);
1604150Sgblack@eecs.umich.edu
1614150Sgblack@eecs.umich.edu    /** Clears all the entries in the LQ. */
1625114Sgblack@eecs.umich.edu    void clearLQ();
1635114Sgblack@eecs.umich.edu
1645114Sgblack@eecs.umich.edu    /** Clears all the entries in the SQ. */
1655114Sgblack@eecs.umich.edu    void clearSQ();
1665114Sgblack@eecs.umich.edu
1675114Sgblack@eecs.umich.edu    /** Resizes the LQ to a given size. */
1685114Sgblack@eecs.umich.edu    void resizeLQ(unsigned size);
1695114Sgblack@eecs.umich.edu
1705114Sgblack@eecs.umich.edu    /** Resizes the SQ to a given size. */
1715114Sgblack@eecs.umich.edu    void resizeSQ(unsigned size);
1725114Sgblack@eecs.umich.edu
1735114Sgblack@eecs.umich.edu    /** Squashes all instructions younger than a specific sequence number. */
1745114Sgblack@eecs.umich.edu    void squash(const InstSeqNum &squashed_num);
1755114Sgblack@eecs.umich.edu
1765114Sgblack@eecs.umich.edu    /** Returns if there is a memory ordering violation. Value is reset upon
1775114Sgblack@eecs.umich.edu     * call to getMemDepViolator().
1785114Sgblack@eecs.umich.edu     */
1795114Sgblack@eecs.umich.edu    bool violation() { return memDepViolator; }
1805114Sgblack@eecs.umich.edu
1815114Sgblack@eecs.umich.edu    /** Returns the memory ordering violator. */
1825114Sgblack@eecs.umich.edu    DynInstPtr getMemDepViolator();
1835114Sgblack@eecs.umich.edu
1845114Sgblack@eecs.umich.edu    /** Returns the number of free LQ entries. */
1855114Sgblack@eecs.umich.edu    unsigned numFreeLoadEntries();
1865114Sgblack@eecs.umich.edu
1875114Sgblack@eecs.umich.edu    /** Returns the number of free SQ entries. */
1885114Sgblack@eecs.umich.edu    unsigned numFreeStoreEntries();
1895114Sgblack@eecs.umich.edu
1905114Sgblack@eecs.umich.edu    /** Returns the number of loads in the LQ. */
1915114Sgblack@eecs.umich.edu    int numLoads() { return loads; }
1925114Sgblack@eecs.umich.edu
1935114Sgblack@eecs.umich.edu    /** Returns the number of stores in the SQ. */
1945114Sgblack@eecs.umich.edu    int numStores() { return stores; }
1955114Sgblack@eecs.umich.edu
1965114Sgblack@eecs.umich.edu    /** Returns if either the LQ or SQ is full. */
1975114Sgblack@eecs.umich.edu    bool isFull() { return lqFull() || sqFull(); }
1985114Sgblack@eecs.umich.edu
1995114Sgblack@eecs.umich.edu    /** Returns if both the LQ and SQ are empty. */
2005114Sgblack@eecs.umich.edu    bool isEmpty() const { return lqEmpty() && sqEmpty(); }
2015114Sgblack@eecs.umich.edu
2025114Sgblack@eecs.umich.edu    /** Returns if the LQ is full. */
2035114Sgblack@eecs.umich.edu    bool lqFull() { return loads >= (LQEntries - 1); }
2045114Sgblack@eecs.umich.edu
2055114Sgblack@eecs.umich.edu    /** Returns if the SQ is full. */
2065114Sgblack@eecs.umich.edu    bool sqFull() { return stores >= (SQEntries - 1); }
2075114Sgblack@eecs.umich.edu
2085114Sgblack@eecs.umich.edu    /** Returns if the LQ is empty. */
2095114Sgblack@eecs.umich.edu    bool lqEmpty() const { return loads == 0; }
2105114Sgblack@eecs.umich.edu
2115114Sgblack@eecs.umich.edu    /** Returns if the SQ is empty. */
2125114Sgblack@eecs.umich.edu    bool sqEmpty() const { return stores == 0; }
2135114Sgblack@eecs.umich.edu
2145114Sgblack@eecs.umich.edu    /** Returns the number of instructions in the LSQ. */
2155114Sgblack@eecs.umich.edu    unsigned getCount() { return loads + stores; }
2165114Sgblack@eecs.umich.edu
2175114Sgblack@eecs.umich.edu    /** Returns if there are any stores to writeback. */
2185114Sgblack@eecs.umich.edu    bool hasStoresToWB() { return storesToWB; }
2195114Sgblack@eecs.umich.edu
2205114Sgblack@eecs.umich.edu    /** Returns the number of stores to writeback. */
2215114Sgblack@eecs.umich.edu    int numStoresToWB() { return storesToWB; }
2225114Sgblack@eecs.umich.edu
2235114Sgblack@eecs.umich.edu    /** Returns if the LSQ unit will writeback on this cycle. */
2245114Sgblack@eecs.umich.edu    bool willWB() { return storeQueue[storeWBIdx].canWB &&
2255114Sgblack@eecs.umich.edu                        !storeQueue[storeWBIdx].completed &&
2265114Sgblack@eecs.umich.edu                        !isStoreBlocked; }
2275114Sgblack@eecs.umich.edu
2285114Sgblack@eecs.umich.edu    /** Handles doing the retry. */
2295114Sgblack@eecs.umich.edu    void recvRetry();
2305114Sgblack@eecs.umich.edu
2315114Sgblack@eecs.umich.edu  private:
2325114Sgblack@eecs.umich.edu    /** Reset the LSQ state */
2335114Sgblack@eecs.umich.edu    void resetState();
2345114Sgblack@eecs.umich.edu
2355114Sgblack@eecs.umich.edu    /** Writes back the instruction, sending it to IEW. */
2365114Sgblack@eecs.umich.edu    void writeback(DynInstPtr &inst, PacketPtr pkt);
2375114Sgblack@eecs.umich.edu
2385114Sgblack@eecs.umich.edu    /** Writes back a store that couldn't be completed the previous cycle. */
2395114Sgblack@eecs.umich.edu    void writebackPendingStore();
2405114Sgblack@eecs.umich.edu
2415114Sgblack@eecs.umich.edu    /** Handles completing the send of a store to memory. */
2425114Sgblack@eecs.umich.edu    void storePostSend(PacketPtr pkt);
2435114Sgblack@eecs.umich.edu
2445114Sgblack@eecs.umich.edu    /** Completes the store at the specified index. */
2455114Sgblack@eecs.umich.edu    void completeStore(int store_idx);
2465114Sgblack@eecs.umich.edu
2475114Sgblack@eecs.umich.edu    /** Attempts to send a store to the cache. */
2485114Sgblack@eecs.umich.edu    bool sendStore(PacketPtr data_pkt);
2495114Sgblack@eecs.umich.edu
2505114Sgblack@eecs.umich.edu    /** Increments the given store index (circular queue). */
2515114Sgblack@eecs.umich.edu    inline void incrStIdx(int &store_idx) const;
2525114Sgblack@eecs.umich.edu    /** Decrements the given store index (circular queue). */
2535114Sgblack@eecs.umich.edu    inline void decrStIdx(int &store_idx) const;
2545114Sgblack@eecs.umich.edu    /** Increments the given load index (circular queue). */
2555114Sgblack@eecs.umich.edu    inline void incrLdIdx(int &load_idx) const;
2565114Sgblack@eecs.umich.edu    /** Decrements the given load index (circular queue). */
2575114Sgblack@eecs.umich.edu    inline void decrLdIdx(int &load_idx) const;
2585114Sgblack@eecs.umich.edu
2595114Sgblack@eecs.umich.edu  public:
2605114Sgblack@eecs.umich.edu    /** Debugging function to dump instructions in the LSQ. */
2615114Sgblack@eecs.umich.edu    void dumpInsts() const;
2625114Sgblack@eecs.umich.edu
2635114Sgblack@eecs.umich.edu  private:
2645114Sgblack@eecs.umich.edu    /** Pointer to the CPU. */
2655114Sgblack@eecs.umich.edu    O3CPU *cpu;
2665114Sgblack@eecs.umich.edu
2675114Sgblack@eecs.umich.edu    /** Pointer to the IEW stage. */
2685114Sgblack@eecs.umich.edu    IEW *iewStage;
2695114Sgblack@eecs.umich.edu
2705114Sgblack@eecs.umich.edu    /** Pointer to the LSQ. */
2715114Sgblack@eecs.umich.edu    LSQ *lsq;
2725114Sgblack@eecs.umich.edu
2735114Sgblack@eecs.umich.edu    /** Pointer to the dcache port.  Used only for sending. */
2745114Sgblack@eecs.umich.edu    MasterPort *dcachePort;
2755114Sgblack@eecs.umich.edu
2765114Sgblack@eecs.umich.edu    /** Derived class to hold any sender state the LSQ needs. */
2775114Sgblack@eecs.umich.edu    class LSQSenderState : public Packet::SenderState
2785114Sgblack@eecs.umich.edu    {
2795114Sgblack@eecs.umich.edu      public:
2805114Sgblack@eecs.umich.edu        /** Default constructor. */
2815114Sgblack@eecs.umich.edu        LSQSenderState()
2825114Sgblack@eecs.umich.edu            : mainPkt(NULL), pendingPacket(NULL), idx(0), outstanding(1),
2835114Sgblack@eecs.umich.edu              isLoad(false), noWB(false), isSplit(false),
2845114Sgblack@eecs.umich.edu              pktToSend(false), cacheBlocked(false)
2855114Sgblack@eecs.umich.edu          { }
2865114Sgblack@eecs.umich.edu
2875114Sgblack@eecs.umich.edu        /** Instruction who initiated the access to memory. */
2885114Sgblack@eecs.umich.edu        DynInstPtr inst;
2895114Sgblack@eecs.umich.edu        /** The main packet from a split load, used during writeback. */
2905114Sgblack@eecs.umich.edu        PacketPtr mainPkt;
2915114Sgblack@eecs.umich.edu        /** A second packet from a split store that needs sending. */
2925114Sgblack@eecs.umich.edu        PacketPtr pendingPacket;
2935114Sgblack@eecs.umich.edu        /** The LQ/SQ index of the instruction. */
2945114Sgblack@eecs.umich.edu        uint8_t idx;
2955114Sgblack@eecs.umich.edu        /** Number of outstanding packets to complete. */
2965114Sgblack@eecs.umich.edu        uint8_t outstanding;
2975114Sgblack@eecs.umich.edu        /** Whether or not it is a load. */
2985114Sgblack@eecs.umich.edu        bool isLoad;
2995114Sgblack@eecs.umich.edu        /** Whether or not the instruction will need to writeback. */
3005114Sgblack@eecs.umich.edu        bool noWB;
3015114Sgblack@eecs.umich.edu        /** Whether or not this access is split in two. */
3025114Sgblack@eecs.umich.edu        bool isSplit;
3035114Sgblack@eecs.umich.edu        /** Whether or not there is a packet that needs sending. */
3045114Sgblack@eecs.umich.edu        bool pktToSend;
3055114Sgblack@eecs.umich.edu        /** Whether or not the second packet of this split load was blocked */
3065114Sgblack@eecs.umich.edu        bool cacheBlocked;
3075114Sgblack@eecs.umich.edu
3085114Sgblack@eecs.umich.edu        /** Completes a packet and returns whether the access is finished. */
3095114Sgblack@eecs.umich.edu        inline bool complete() { return --outstanding == 0; }
3105114Sgblack@eecs.umich.edu    };
3115114Sgblack@eecs.umich.edu
3125114Sgblack@eecs.umich.edu    /** Writeback event, specifically for when stores forward data to loads. */
3135114Sgblack@eecs.umich.edu    class WritebackEvent : public Event {
3145114Sgblack@eecs.umich.edu      public:
3155114Sgblack@eecs.umich.edu        /** Constructs a writeback event. */
3165114Sgblack@eecs.umich.edu        WritebackEvent(DynInstPtr &_inst, PacketPtr pkt, LSQUnit *lsq_ptr);
3175114Sgblack@eecs.umich.edu
3185114Sgblack@eecs.umich.edu        /** Processes the writeback event. */
3195114Sgblack@eecs.umich.edu        void process();
3205114Sgblack@eecs.umich.edu
3215114Sgblack@eecs.umich.edu        /** Returns the description of this event. */
3225114Sgblack@eecs.umich.edu        const char *description() const;
3235114Sgblack@eecs.umich.edu
3245114Sgblack@eecs.umich.edu      private:
3255114Sgblack@eecs.umich.edu        /** Instruction whose results are being written back. */
3265114Sgblack@eecs.umich.edu        DynInstPtr inst;
3275114Sgblack@eecs.umich.edu
3285114Sgblack@eecs.umich.edu        /** The packet that would have been sent to memory. */
3295114Sgblack@eecs.umich.edu        PacketPtr pkt;
3305114Sgblack@eecs.umich.edu
3315114Sgblack@eecs.umich.edu        /** The pointer to the LSQ unit that issued the store. */
3325114Sgblack@eecs.umich.edu        LSQUnit<Impl> *lsqPtr;
3335114Sgblack@eecs.umich.edu    };
3345114Sgblack@eecs.umich.edu
3355114Sgblack@eecs.umich.edu  public:
3365114Sgblack@eecs.umich.edu    struct SQEntry {
3375114Sgblack@eecs.umich.edu        /** Constructs an empty store queue entry. */
3385114Sgblack@eecs.umich.edu        SQEntry()
3395114Sgblack@eecs.umich.edu            : inst(NULL), req(NULL), size(0),
3405114Sgblack@eecs.umich.edu              canWB(0), committed(0), completed(0)
3415114Sgblack@eecs.umich.edu        {
3425114Sgblack@eecs.umich.edu            std::memset(data, 0, sizeof(data));
3435114Sgblack@eecs.umich.edu        }
3445114Sgblack@eecs.umich.edu
3455114Sgblack@eecs.umich.edu        ~SQEntry()
3465114Sgblack@eecs.umich.edu        {
3475114Sgblack@eecs.umich.edu            inst = NULL;
3485114Sgblack@eecs.umich.edu        }
3495114Sgblack@eecs.umich.edu
3505114Sgblack@eecs.umich.edu        /** Constructs a store queue entry for a given instruction. */
3515114Sgblack@eecs.umich.edu        SQEntry(DynInstPtr &_inst)
3525114Sgblack@eecs.umich.edu            : inst(_inst), req(NULL), sreqLow(NULL), sreqHigh(NULL), size(0),
3535114Sgblack@eecs.umich.edu              isSplit(0), canWB(0), committed(0), completed(0), isAllZeros(0)
3545114Sgblack@eecs.umich.edu        {
3555114Sgblack@eecs.umich.edu            std::memset(data, 0, sizeof(data));
3565114Sgblack@eecs.umich.edu        }
3575114Sgblack@eecs.umich.edu        /** The store data. */
3585114Sgblack@eecs.umich.edu        char data[16];
3595114Sgblack@eecs.umich.edu        /** The store instruction. */
3605114Sgblack@eecs.umich.edu        DynInstPtr inst;
3615114Sgblack@eecs.umich.edu        /** The request for the store. */
3625114Sgblack@eecs.umich.edu        RequestPtr req;
3635114Sgblack@eecs.umich.edu        /** The split requests for the store. */
3645114Sgblack@eecs.umich.edu        RequestPtr sreqLow;
3655114Sgblack@eecs.umich.edu        RequestPtr sreqHigh;
3665124Sgblack@eecs.umich.edu        /** The size of the store. */
3675124Sgblack@eecs.umich.edu        uint8_t size;
3685124Sgblack@eecs.umich.edu        /** Whether or not the store is split into two requests. */
3695124Sgblack@eecs.umich.edu        bool isSplit;
3705124Sgblack@eecs.umich.edu        /** Whether or not the store can writeback. */
3715124Sgblack@eecs.umich.edu        bool canWB;
3725124Sgblack@eecs.umich.edu        /** Whether or not the store is committed. */
3735124Sgblack@eecs.umich.edu        bool committed;
3745114Sgblack@eecs.umich.edu        /** Whether or not the store is completed. */
3755114Sgblack@eecs.umich.edu        bool completed;
3765114Sgblack@eecs.umich.edu        /** Does this request write all zeros and thus doesn't
3775124Sgblack@eecs.umich.edu         * have any data attached to it. Used for cache block zero
3785114Sgblack@eecs.umich.edu         * style instructs (ARM DC ZVA; ALPHA WH64)
3795124Sgblack@eecs.umich.edu         */
3805124Sgblack@eecs.umich.edu        bool isAllZeros;
3815124Sgblack@eecs.umich.edu    };
3825124Sgblack@eecs.umich.edu
3835114Sgblack@eecs.umich.edu  private:
3845114Sgblack@eecs.umich.edu    /** The LSQUnit thread id. */
3855114Sgblack@eecs.umich.edu    ThreadID lsqID;
3865114Sgblack@eecs.umich.edu
3875124Sgblack@eecs.umich.edu    /** The store queue. */
3885124Sgblack@eecs.umich.edu    std::vector<SQEntry> storeQueue;
3895124Sgblack@eecs.umich.edu
3905124Sgblack@eecs.umich.edu    /** The load queue. */
3915124Sgblack@eecs.umich.edu    std::vector<DynInstPtr> loadQueue;
3925124Sgblack@eecs.umich.edu
3935124Sgblack@eecs.umich.edu    /** The number of LQ entries, plus a sentinel entry (circular queue).
3945124Sgblack@eecs.umich.edu     *  @todo: Consider having var that records the true number of LQ entries.
3955114Sgblack@eecs.umich.edu     */
3965114Sgblack@eecs.umich.edu    unsigned LQEntries;
3975114Sgblack@eecs.umich.edu    /** The number of SQ entries, plus a sentinel entry (circular queue).
3985124Sgblack@eecs.umich.edu     *  @todo: Consider having var that records the true number of SQ entries.
3995114Sgblack@eecs.umich.edu     */
4005124Sgblack@eecs.umich.edu    unsigned SQEntries;
4015124Sgblack@eecs.umich.edu
4025124Sgblack@eecs.umich.edu    /** The number of places to shift addresses in the LSQ before checking
4035124Sgblack@eecs.umich.edu     * for dependency violations
4045114Sgblack@eecs.umich.edu     */
4054120Sgblack@eecs.umich.edu    unsigned depCheckShift;
4064120Sgblack@eecs.umich.edu
4074120Sgblack@eecs.umich.edu    /** Should loads be checked for dependency issues */
408    bool checkLoads;
409
410    /** The number of load instructions in the LQ. */
411    int loads;
412    /** The number of store instructions in the SQ. */
413    int stores;
414    /** The number of store instructions in the SQ waiting to writeback. */
415    int storesToWB;
416
417    /** The index of the head instruction in the LQ. */
418    int loadHead;
419    /** The index of the tail instruction in the LQ. */
420    int loadTail;
421
422    /** The index of the head instruction in the SQ. */
423    int storeHead;
424    /** The index of the first instruction that may be ready to be
425     * written back, and has not yet been written back.
426     */
427    int storeWBIdx;
428    /** The index of the tail instruction in the SQ. */
429    int storeTail;
430
431    /// @todo Consider moving to a more advanced model with write vs read ports
432    /** The number of cache ports available each cycle (stores only). */
433    int cacheStorePorts;
434
435    /** The number of used cache ports in this cycle by stores. */
436    int usedStorePorts;
437
438    //list<InstSeqNum> mshrSeqNums;
439
440    /** Address Mask for a cache block (e.g. ~(cache_block_size-1)) */
441    Addr cacheBlockMask;
442
443    /** Wire to read information from the issue stage time queue. */
444    typename TimeBuffer<IssueStruct>::wire fromIssue;
445
446    /** Whether or not the LSQ is stalled. */
447    bool stalled;
448    /** The store that causes the stall due to partial store to load
449     * forwarding.
450     */
451    InstSeqNum stallingStoreIsn;
452    /** The index of the above store. */
453    int stallingLoadIdx;
454
455    /** The packet that needs to be retried. */
456    PacketPtr retryPkt;
457
458    /** Whehter or not a store is blocked due to the memory system. */
459    bool isStoreBlocked;
460
461    /** Whether or not a store is in flight. */
462    bool storeInFlight;
463
464    /** The oldest load that caused a memory ordering violation. */
465    DynInstPtr memDepViolator;
466
467    /** Whether or not there is a packet that couldn't be sent because of
468     * a lack of cache ports. */
469    bool hasPendingPkt;
470
471    /** The packet that is pending free cache ports. */
472    PacketPtr pendingPkt;
473
474    /** Flag for memory model. */
475    bool needsTSO;
476
477    // Will also need how many read/write ports the Dcache has.  Or keep track
478    // of that in stage that is one level up, and only call executeLoad/Store
479    // the appropriate number of times.
480    /** Total number of loads forwaded from LSQ stores. */
481    Stats::Scalar lsqForwLoads;
482
483    /** Total number of loads ignored due to invalid addresses. */
484    Stats::Scalar invAddrLoads;
485
486    /** Total number of squashed loads. */
487    Stats::Scalar lsqSquashedLoads;
488
489    /** Total number of responses from the memory system that are
490     * ignored due to the instruction already being squashed. */
491    Stats::Scalar lsqIgnoredResponses;
492
493    /** Tota number of memory ordering violations. */
494    Stats::Scalar lsqMemOrderViolation;
495
496    /** Total number of squashed stores. */
497    Stats::Scalar lsqSquashedStores;
498
499    /** Total number of software prefetches ignored due to invalid addresses. */
500    Stats::Scalar invAddrSwpfs;
501
502    /** Ready loads blocked due to partial store-forwarding. */
503    Stats::Scalar lsqBlockedLoads;
504
505    /** Number of loads that were rescheduled. */
506    Stats::Scalar lsqRescheduledLoads;
507
508    /** Number of times the LSQ is blocked due to the cache. */
509    Stats::Scalar lsqCacheBlocked;
510
511  public:
512    /** Executes the load at the given index. */
513    Fault read(Request *req, Request *sreqLow, Request *sreqHigh,
514               int load_idx);
515
516    /** Executes the store at the given index. */
517    Fault write(Request *req, Request *sreqLow, Request *sreqHigh,
518                uint8_t *data, int store_idx);
519
520    /** Returns the index of the head load instruction. */
521    int getLoadHead() { return loadHead; }
522    /** Returns the sequence number of the head load instruction. */
523    InstSeqNum getLoadHeadSeqNum()
524    {
525        if (loadQueue[loadHead]) {
526            return loadQueue[loadHead]->seqNum;
527        } else {
528            return 0;
529        }
530
531    }
532
533    /** Returns the index of the head store instruction. */
534    int getStoreHead() { return storeHead; }
535    /** Returns the sequence number of the head store instruction. */
536    InstSeqNum getStoreHeadSeqNum()
537    {
538        if (storeQueue[storeHead].inst) {
539            return storeQueue[storeHead].inst->seqNum;
540        } else {
541            return 0;
542        }
543
544    }
545
546    /** Returns whether or not the LSQ unit is stalled. */
547    bool isStalled()  { return stalled; }
548};
549
550template <class Impl>
551Fault
552LSQUnit<Impl>::read(Request *req, Request *sreqLow, Request *sreqHigh,
553                    int load_idx)
554{
555    DynInstPtr load_inst = loadQueue[load_idx];
556
557    assert(load_inst);
558
559    assert(!load_inst->isExecuted());
560
561    // Make sure this isn't a strictly ordered load
562    // A bit of a hackish way to get strictly ordered accesses to work
563    // only if they're at the head of the LSQ and are ready to commit
564    // (at the head of the ROB too).
565    if (req->isStrictlyOrdered() &&
566        (load_idx != loadHead || !load_inst->isAtCommit())) {
567        iewStage->rescheduleMemInst(load_inst);
568        ++lsqRescheduledLoads;
569        DPRINTF(LSQUnit, "Strictly ordered load [sn:%lli] PC %s\n",
570                load_inst->seqNum, load_inst->pcState());
571
572        // Must delete request now that it wasn't handed off to
573        // memory.  This is quite ugly.  @todo: Figure out the proper
574        // place to really handle request deletes.
575        delete req;
576        if (TheISA::HasUnalignedMemAcc && sreqLow) {
577            delete sreqLow;
578            delete sreqHigh;
579        }
580        return std::make_shared<GenericISA::M5PanicFault>(
581            "Strictly ordered load [sn:%llx] PC %s\n",
582            load_inst->seqNum, load_inst->pcState());
583    }
584
585    // Check the SQ for any previous stores that might lead to forwarding
586    int store_idx = load_inst->sqIdx;
587
588    int store_size = 0;
589
590    DPRINTF(LSQUnit, "Read called, load idx: %i, store idx: %i, "
591            "storeHead: %i addr: %#x%s\n",
592            load_idx, store_idx, storeHead, req->getPaddr(),
593            sreqLow ? " split" : "");
594
595    if (req->isLLSC()) {
596        assert(!sreqLow);
597        // Disable recording the result temporarily.  Writing to misc
598        // regs normally updates the result, but this is not the
599        // desired behavior when handling store conditionals.
600        load_inst->recordResult(false);
601        TheISA::handleLockedRead(load_inst.get(), req);
602        load_inst->recordResult(true);
603    }
604
605    if (req->isMmappedIpr()) {
606        assert(!load_inst->memData);
607        load_inst->memData = new uint8_t[64];
608
609        ThreadContext *thread = cpu->tcBase(lsqID);
610        Cycles delay(0);
611        PacketPtr data_pkt = new Packet(req, MemCmd::ReadReq);
612
613        data_pkt->dataStatic(load_inst->memData);
614        if (!TheISA::HasUnalignedMemAcc || !sreqLow) {
615            delay = TheISA::handleIprRead(thread, data_pkt);
616        } else {
617            assert(sreqLow->isMmappedIpr() && sreqHigh->isMmappedIpr());
618            PacketPtr fst_data_pkt = new Packet(sreqLow, MemCmd::ReadReq);
619            PacketPtr snd_data_pkt = new Packet(sreqHigh, MemCmd::ReadReq);
620
621            fst_data_pkt->dataStatic(load_inst->memData);
622            snd_data_pkt->dataStatic(load_inst->memData + sreqLow->getSize());
623
624            delay = TheISA::handleIprRead(thread, fst_data_pkt);
625            Cycles delay2 = TheISA::handleIprRead(thread, snd_data_pkt);
626            if (delay2 > delay)
627                delay = delay2;
628
629            delete sreqLow;
630            delete sreqHigh;
631            delete fst_data_pkt;
632            delete snd_data_pkt;
633        }
634        WritebackEvent *wb = new WritebackEvent(load_inst, data_pkt, this);
635        cpu->schedule(wb, cpu->clockEdge(delay));
636        return NoFault;
637    }
638
639    while (store_idx != -1) {
640        // End once we've reached the top of the LSQ
641        if (store_idx == storeWBIdx) {
642            break;
643        }
644
645        // Move the index to one younger
646        if (--store_idx < 0)
647            store_idx += SQEntries;
648
649        assert(storeQueue[store_idx].inst);
650
651        store_size = storeQueue[store_idx].size;
652
653        if (!store_size || storeQueue[store_idx].inst->strictlyOrdered() ||
654            (storeQueue[store_idx].req &&
655             storeQueue[store_idx].req->isCacheMaintenance())) {
656            // Cache maintenance instructions go down via the store
657            // path but they carry no data and they shouldn't be
658            // considered for forwarding
659            continue;
660        }
661
662        assert(storeQueue[store_idx].inst->effAddrValid());
663
664        // Check if the store data is within the lower and upper bounds of
665        // addresses that the request needs.
666        bool store_has_lower_limit =
667            req->getVaddr() >= storeQueue[store_idx].inst->effAddr;
668        bool store_has_upper_limit =
669            (req->getVaddr() + req->getSize()) <=
670            (storeQueue[store_idx].inst->effAddr + store_size);
671        bool lower_load_has_store_part =
672            req->getVaddr() < (storeQueue[store_idx].inst->effAddr +
673                           store_size);
674        bool upper_load_has_store_part =
675            (req->getVaddr() + req->getSize()) >
676            storeQueue[store_idx].inst->effAddr;
677
678        // If the store's data has all of the data needed and the load isn't
679        // LLSC, we can forward.
680        if (store_has_lower_limit && store_has_upper_limit && !req->isLLSC()) {
681            // Get shift amount for offset into the store's data.
682            int shift_amt = req->getVaddr() - storeQueue[store_idx].inst->effAddr;
683
684            // Allocate memory if this is the first time a load is issued.
685            if (!load_inst->memData) {
686                load_inst->memData = new uint8_t[req->getSize()];
687            }
688            if (storeQueue[store_idx].isAllZeros)
689                memset(load_inst->memData, 0, req->getSize());
690            else
691                memcpy(load_inst->memData,
692                    storeQueue[store_idx].data + shift_amt, req->getSize());
693
694            DPRINTF(LSQUnit, "Forwarding from store idx %i to load to "
695                    "addr %#x\n", store_idx, req->getVaddr());
696
697            PacketPtr data_pkt = new Packet(req, MemCmd::ReadReq);
698            data_pkt->dataStatic(load_inst->memData);
699
700            WritebackEvent *wb = new WritebackEvent(load_inst, data_pkt, this);
701
702            // We'll say this has a 1 cycle load-store forwarding latency
703            // for now.
704            // @todo: Need to make this a parameter.
705            cpu->schedule(wb, curTick());
706
707            // Don't need to do anything special for split loads.
708            if (TheISA::HasUnalignedMemAcc && sreqLow) {
709                delete sreqLow;
710                delete sreqHigh;
711            }
712
713            ++lsqForwLoads;
714            return NoFault;
715        } else if (
716                (!req->isLLSC() &&
717                 ((store_has_lower_limit && lower_load_has_store_part) ||
718                  (store_has_upper_limit && upper_load_has_store_part) ||
719                  (lower_load_has_store_part && upper_load_has_store_part))) ||
720                (req->isLLSC() &&
721                 ((store_has_lower_limit || upper_load_has_store_part) &&
722                  (store_has_upper_limit || lower_load_has_store_part)))) {
723            // This is the partial store-load forwarding case where a store
724            // has only part of the load's data and the load isn't LLSC or
725            // the load is LLSC and the store has all or part of the load's
726            // data
727
728            // If it's already been written back, then don't worry about
729            // stalling on it.
730            if (storeQueue[store_idx].completed) {
731                panic("Should not check one of these");
732                continue;
733            }
734
735            // Must stall load and force it to retry, so long as it's the oldest
736            // load that needs to do so.
737            if (!stalled ||
738                (stalled &&
739                 load_inst->seqNum <
740                 loadQueue[stallingLoadIdx]->seqNum)) {
741                stalled = true;
742                stallingStoreIsn = storeQueue[store_idx].inst->seqNum;
743                stallingLoadIdx = load_idx;
744            }
745
746            // Tell IQ/mem dep unit that this instruction will need to be
747            // rescheduled eventually
748            iewStage->rescheduleMemInst(load_inst);
749            load_inst->clearIssued();
750            ++lsqRescheduledLoads;
751
752            // Do not generate a writeback event as this instruction is not
753            // complete.
754            DPRINTF(LSQUnit, "Load-store forwarding mis-match. "
755                    "Store idx %i to load addr %#x\n",
756                    store_idx, req->getVaddr());
757
758            // Must delete request now that it wasn't handed off to
759            // memory.  This is quite ugly.  @todo: Figure out the
760            // proper place to really handle request deletes.
761            delete req;
762            if (TheISA::HasUnalignedMemAcc && sreqLow) {
763                delete sreqLow;
764                delete sreqHigh;
765            }
766
767            return NoFault;
768        }
769    }
770
771    // If there's no forwarding case, then go access memory
772    DPRINTF(LSQUnit, "Doing memory access for inst [sn:%lli] PC %s\n",
773            load_inst->seqNum, load_inst->pcState());
774
775    // Allocate memory if this is the first time a load is issued.
776    if (!load_inst->memData) {
777        load_inst->memData = new uint8_t[req->getSize()];
778    }
779
780    // if we the cache is not blocked, do cache access
781    bool completedFirst = false;
782    PacketPtr data_pkt = Packet::createRead(req);
783    PacketPtr fst_data_pkt = NULL;
784    PacketPtr snd_data_pkt = NULL;
785
786    data_pkt->dataStatic(load_inst->memData);
787
788    LSQSenderState *state = new LSQSenderState;
789    state->isLoad = true;
790    state->idx = load_idx;
791    state->inst = load_inst;
792    data_pkt->senderState = state;
793
794    if (!TheISA::HasUnalignedMemAcc || !sreqLow) {
795        // Point the first packet at the main data packet.
796        fst_data_pkt = data_pkt;
797    } else {
798        // Create the split packets.
799        fst_data_pkt = Packet::createRead(sreqLow);
800        snd_data_pkt = Packet::createRead(sreqHigh);
801
802        fst_data_pkt->dataStatic(load_inst->memData);
803        snd_data_pkt->dataStatic(load_inst->memData + sreqLow->getSize());
804
805        fst_data_pkt->senderState = state;
806        snd_data_pkt->senderState = state;
807
808        state->isSplit = true;
809        state->outstanding = 2;
810        state->mainPkt = data_pkt;
811    }
812
813    // For now, load throughput is constrained by the number of
814    // load FUs only, and loads do not consume a cache port (only
815    // stores do).
816    // @todo We should account for cache port contention
817    // and arbitrate between loads and stores.
818    bool successful_load = true;
819    if (!dcachePort->sendTimingReq(fst_data_pkt)) {
820        successful_load = false;
821    } else if (TheISA::HasUnalignedMemAcc && sreqLow) {
822        completedFirst = true;
823
824        // The first packet was sent without problems, so send this one
825        // too. If there is a problem with this packet then the whole
826        // load will be squashed, so indicate this to the state object.
827        // The first packet will return in completeDataAccess and be
828        // handled there.
829        // @todo We should also account for cache port contention
830        // here.
831        if (!dcachePort->sendTimingReq(snd_data_pkt)) {
832            // The main packet will be deleted in completeDataAccess.
833            state->complete();
834            // Signify to 1st half that the 2nd half was blocked via state
835            state->cacheBlocked = true;
836            successful_load = false;
837        }
838    }
839
840    // If the cache was blocked, or has become blocked due to the access,
841    // handle it.
842    if (!successful_load) {
843        if (!sreqLow) {
844            // Packet wasn't split, just delete main packet info
845            delete state;
846            delete req;
847            delete data_pkt;
848        }
849
850        if (TheISA::HasUnalignedMemAcc && sreqLow) {
851            if (!completedFirst) {
852                // Split packet, but first failed.  Delete all state.
853                delete state;
854                delete req;
855                delete data_pkt;
856                delete fst_data_pkt;
857                delete snd_data_pkt;
858                delete sreqLow;
859                delete sreqHigh;
860                sreqLow = NULL;
861                sreqHigh = NULL;
862            } else {
863                // Can't delete main packet data or state because first packet
864                // was sent to the memory system
865                delete data_pkt;
866                delete req;
867                delete sreqHigh;
868                delete snd_data_pkt;
869                sreqHigh = NULL;
870            }
871        }
872
873        ++lsqCacheBlocked;
874
875        iewStage->blockMemInst(load_inst);
876
877        // No fault occurred, even though the interface is blocked.
878        return NoFault;
879    }
880
881    return NoFault;
882}
883
884template <class Impl>
885Fault
886LSQUnit<Impl>::write(Request *req, Request *sreqLow, Request *sreqHigh,
887                     uint8_t *data, int store_idx)
888{
889    assert(storeQueue[store_idx].inst);
890
891    DPRINTF(LSQUnit, "Doing write to store idx %i, addr %#x"
892            " | storeHead:%i [sn:%i]\n",
893            store_idx, req->getPaddr(), storeHead,
894            storeQueue[store_idx].inst->seqNum);
895
896    storeQueue[store_idx].req = req;
897    storeQueue[store_idx].sreqLow = sreqLow;
898    storeQueue[store_idx].sreqHigh = sreqHigh;
899    unsigned size = req->getSize();
900    storeQueue[store_idx].size = size;
901    bool store_no_data = req->getFlags() & Request::STORE_NO_DATA;
902    storeQueue[store_idx].isAllZeros = store_no_data;
903    assert(size <= sizeof(storeQueue[store_idx].data) || store_no_data);
904
905    // Split stores can only occur in ISAs with unaligned memory accesses.  If
906    // a store request has been split, sreqLow and sreqHigh will be non-null.
907    if (TheISA::HasUnalignedMemAcc && sreqLow) {
908        storeQueue[store_idx].isSplit = true;
909    }
910
911    if (!(req->getFlags() & Request::CACHE_BLOCK_ZERO) && \
912        !req->isCacheMaintenance())
913        memcpy(storeQueue[store_idx].data, data, size);
914
915    // This function only writes the data to the store queue, so no fault
916    // can happen here.
917    return NoFault;
918}
919
920#endif // __CPU_O3_LSQ_UNIT_HH__
921