gem5  [DEVELOP-FOR-23.0]
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
lsq.hh
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013-2014, 2018 ARM Limited
3  * All rights reserved
4  *
5  * The license below extends only to copyright in the software and shall
6  * not be construed as granting a license to any other intellectual
7  * property including but not limited to intellectual property relating
8  * to a hardware implementation of the functionality of the software
9  * licensed hereunder. You may use the software subject to the license
10  * terms below provided that you ensure that this notice is replicated
11  * unmodified and in its entirety in all distributions of the software,
12  * modified or unmodified, in source code or in binary form.
13  *
14  * Redistribution and use in source and binary forms, with or without
15  * modification, are permitted provided that the following conditions are
16  * met: redistributions of source code must retain the above copyright
17  * notice, this list of conditions and the following disclaimer;
18  * redistributions in binary form must reproduce the above copyright
19  * notice, this list of conditions and the following disclaimer in the
20  * documentation and/or other materials provided with the distribution;
21  * neither the name of the copyright holders nor the names of its
22  * contributors may be used to endorse or promote products derived from
23  * this software without specific prior written permission.
24  *
25  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
26  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
27  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
28  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
29  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
30  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
31  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
32  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
33  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
34  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
35  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36  */
37 
45 #ifndef __CPU_MINOR_NEW_LSQ_HH__
46 #define __CPU_MINOR_NEW_LSQ_HH__
47 
48 #include <string>
49 #include <vector>
50 
51 #include "base/named.hh"
52 #include "cpu/minor/buffers.hh"
53 #include "cpu/minor/cpu.hh"
54 #include "cpu/minor/pipe_data.hh"
55 #include "cpu/minor/trace.hh"
56 #include "mem/packet.hh"
57 
58 namespace gem5
59 {
60 
61 namespace minor
62 {
63 
64 /* Forward declaration */
65 class Execute;
66 
67 class LSQ : public Named
68 {
69  protected:
73 
74  protected:
77  {
78  MemoryRunning, /* Default. Step dcache queues when possible. */
79  MemoryNeedsRetry /* Request rejected, will be asked to retry */
80  };
81 
83  friend std::ostream &operator <<(std::ostream &os,
85 
88  {
89  PartialAddrRangeCoverage, /* Two ranges partly overlap */
90  FullAddrRangeCoverage, /* One range fully covers another */
91  NoAddrRangeCoverage /* Two ranges are disjoint */
92  };
93 
96  {
97  protected:
99  LSQ &lsq;
100 
101  public:
102  DcachePort(std::string name, LSQ &lsq_, MinorCPU &cpu) :
103  MinorCPU::MinorCPUPort(name, cpu), lsq(lsq_)
104  { }
105 
106  protected:
107  bool recvTimingResp(PacketPtr pkt) override
108  { return lsq.recvTimingResp(pkt); }
109 
110  void recvReqRetry() override { lsq.recvReqRetry(); }
111 
112  bool isSnooping() const override { return true; }
113 
114  void recvTimingSnoopReq(PacketPtr pkt) override
115  { return lsq.recvTimingSnoopReq(pkt); }
116 
117  void recvFunctionalSnoop(PacketPtr pkt) override { }
118  };
119 
121 
122  public:
126  class LSQRequest :
127  public BaseMMU::Translation, /* For TLB lookups */
128  public Packet::SenderState /* For packing into a Packet */
129  {
130  public:
133 
136 
139  bool isLoad;
140 
144 
145  /* Requests carry packets on their way to the memory system.
146  * When a Packet returns from the memory system, its
147  * request needs to have its packet updated as this
148  * may have changed in flight */
150 
153 
155  uint64_t *res;
156 
160  bool skipped;
161 
165 
168 
170  {
171  NotIssued, /* Newly created */
172  InTranslation, /* TLB accessed, no reply yet */
173  Translated, /* Finished address translation */
174  Failed, /* The starting start of FailedDataRequests */
175  RequestIssuing, /* Load/store issued to memory in the requests
176  queue */
177  StoreToStoreBuffer, /* Store in transfers on its way to the
178  store buffer */
179  RequestNeedsRetry, /* Retry needed for load */
180  StoreInStoreBuffer, /* Store in the store buffer, before issuing
181  a memory transfer */
182  StoreBufferIssuing, /* Store in store buffer and has been
183  issued */
184  StoreBufferNeedsRetry, /* Retry needed for store */
185  /* All completed states. Includes
186  completed loads, TLB faults and skipped requests whose
187  seqNum's no longer match */
189  };
190 
192 
193  protected:
196 
199  void tryToSuppressFault();
200 
201  void disableMemAccess();
203 
204  public:
205  LSQRequest(LSQ &port_, MinorDynInstPtr inst_, bool isLoad_,
206  PacketDataPtr data_ = NULL, uint64_t *res_ = NULL);
207 
208  virtual ~LSQRequest();
209 
210  public:
212  void makePacket();
213 
215  bool skippedMemAccess() { return skipped; }
216 
219  void setSkipped() { skipped = true; }
220 
224  Addr req1_addr, unsigned int req1_size,
225  Addr req2_addr, unsigned int req2_size);
226 
230 
233  virtual void startAddrTranslation() = 0;
234 
239  virtual PacketPtr getHeadPacket() = 0;
240 
242  virtual void stepToNextPacket() = 0;
243 
245  virtual bool sentAllPackets() = 0;
246 
249  virtual bool hasPacketsInMemSystem() = 0;
250 
253  virtual void retireResponse(PacketPtr packet_) = 0;
254 
256  virtual bool isBarrier();
257 
261 
263  void setState(LSQRequestState new_state);
264 
268  bool isComplete() const;
269 
271  void reportData(std::ostream &os) const;
272  };
273 
275 
276  friend std::ostream & operator <<(std::ostream &os,
278 
279  friend std::ostream & operator <<(std::ostream &os,
281 
282  protected:
285  {
286  protected:
288  void finish(const Fault &fault_, const RequestPtr &request_,
290  { }
291 
292  public:
295 
298  { fatal("No packets in a SpecialDataRequest"); }
299 
301  void stepToNextPacket() { }
302 
304  bool sentAllPackets() { return true; }
305 
307  bool hasPacketsInMemSystem() { return false; }
308 
311  void retireResponse(PacketPtr packet_) { }
312 
313  public:
315  /* Say this is a load, not actually relevant */
316  LSQRequest(port_, inst_, true, NULL, 0)
317  { }
318  };
319 
324  {
325  public:
327  SpecialDataRequest(port_, inst_)
328  { state = Failed; }
329  };
330 
334  {
335  public:
336  bool isBarrier() { return true; }
337 
338  public:
340  SpecialDataRequest(port_, inst_)
341  { state = Complete; }
342  };
343 
346  {
347  protected:
349  void finish(const Fault &fault_, const RequestPtr &request_,
351 
355 
358 
359  public:
361  void startAddrTranslation();
362 
365 
367  void stepToNextPacket() { packetInFlight = true; packetSent = true; }
368 
371 
374  bool sentAllPackets() { return packetSent; }
375 
378  void retireResponse(PacketPtr packet_);
379 
380  public:
382  bool isLoad_, PacketDataPtr data_ = NULL, uint64_t *res_ = NULL) :
383  LSQRequest(port_, inst_, isLoad_, data_, res_),
384  packetInFlight(false),
385  packetSent(false)
386  { }
387  };
388 
390  {
391  protected:
394  protected:
396  unsigned int numFragments;
397 
400 
406 
408  unsigned int numIssuedFragments;
409 
411  unsigned int numRetiredFragments;
412 
416 
419 
420  protected:
422  void finish(const Fault &fault_, const RequestPtr &request_,
424 
425  public:
426  SplitDataRequest(LSQ &port_, MinorDynInstPtr inst_,
427  bool isLoad_, PacketDataPtr data_ = NULL,
428  uint64_t *res_ = NULL);
429 
431 
432  public:
435  void makeFragmentRequests();
436 
439  void makeFragmentPackets();
440 
445  void startAddrTranslation();
446 
449 
451  void stepToNextPacket();
452 
455 
459 
462  void retireResponse(PacketPtr packet_);
463 
466  };
467 
471  class StoreBuffer : public Named
472  {
473  public:
476 
478  const unsigned int numSlots;
479 
481  const unsigned int storeLimitPerCycle;
482 
483  public:
486 
489  unsigned int numUnissuedAccesses;
490 
491  public:
492  StoreBuffer(std::string name_, LSQ &lsq_,
493  unsigned int store_buffer_size,
494  unsigned int store_limit_per_cycle);
495 
496  public:
498  bool canInsert() const;
499 
501  void deleteRequest(LSQRequestPtr request);
502 
504  void insert(LSQRequestPtr request);
505 
512  unsigned int &found_slot);
513 
516  void forwardStoreData(LSQRequestPtr load, unsigned int slot_number);
517 
520  unsigned int numUnissuedStores() { return numUnissuedAccesses; }
521 
525  void countIssuedStore(LSQRequestPtr request);
526 
528  bool isDrained() const { return slots.empty(); }
529 
531  void step();
532 
534  void minorTrace() const;
535  };
536 
537  protected:
542 
543  public:
546 
548  const unsigned int inMemorySystemLimit;
549 
551  const unsigned int lineWidth;
552 
553  public:
557  typedef Queue<LSQRequestPtr,
561 
575 
584 
585  /* The store buffer contains committed cacheable stores on
586  * their way to memory decoupled from subsequence instruction execution.
587  * Before trying to issue a cacheable read from 'requests' to memory,
588  * the store buffer is checked to see if a previous store contains the
589  * needed data (StoreBuffer::canForwardDataToLoad) which can be
590  * forwarded in lieu of a memory access. If there are outstanding
591  * stores in the transfers queue, they must be promoted to the store
592  * buffer (and so be commited) before they can be correctly checked
593  * for forwarding. */
595 
596  protected:
604 
606  unsigned int numAccessesInDTLB;
607 
610  unsigned int numStoresInTransfers;
611 
616 
620 
623 
624  protected:
628  void tryToSendToTransfers(LSQRequestPtr request);
629 
633  bool tryToSend(LSQRequestPtr request);
634 
636  void clearMemBarrier(MinorDynInstPtr inst);
637 
640 
642  bool canSendToMemorySystem();
643 
645  void threadSnoop(LSQRequestPtr request);
646 
647  public:
648  LSQ(std::string name_, std::string dcache_port_name_,
649  MinorCPU &cpu_, Execute &execute_,
650  unsigned int max_accesses_in_memory_system, unsigned int line_width,
651  unsigned int requests_queue_size, unsigned int transfers_queue_size,
652  unsigned int store_buffer_size,
653  unsigned int store_buffer_cycle_store_limit);
654 
655  virtual ~LSQ();
656 
657  public:
665  void step();
666 
669  bool canRequest() { return requests.unreservedRemainingSpace() != 0; }
670 
676 
678  void popResponse(LSQRequestPtr response);
679 
681  bool canPushIntoStoreBuffer() const { return storeBuffer.canInsert(); }
682 
685 
689  bool accessesInFlight() const
690  { return numAccessesIssuedToMemory != 0; }
691 
696 
699  { return lastMemBarrier[thread_id]; }
700 
702  bool isDrained();
703 
706  bool needsToTick();
707 
711  bool committed);
712 
715  Fault pushRequest(MinorDynInstPtr inst, bool isLoad, uint8_t *data,
716  unsigned int size, Addr addr, Request::Flags flags,
717  uint64_t *res, AtomicOpFunctorPtr amo_op,
718  const std::vector<bool>& byte_enable =
720 
724 
726  bool recvTimingResp(PacketPtr pkt);
727  void recvReqRetry();
728  void recvTimingSnoopReq(PacketPtr pkt);
729 
732 
733  void minorTrace() const;
734 };
735 
739 PacketPtr makePacketForRequest(const RequestPtr &request, bool isLoad,
740  Packet::SenderState *sender_state = NULL, PacketDataPtr data = NULL);
741 
742 } // namespace minor
743 } // namespace gem5
744 
745 #endif /* __CPU_MINOR_NEW_LSQ_HH__ */
gem5::minor::LSQ
Definition: lsq.hh:67
gem5::minor::LSQ::LSQRequest::sentAllPackets
virtual bool sentAllPackets()=0
Have all packets been sent?
pipe_data.hh
fatal
#define fatal(...)
This implements a cprintf based fatal() function.
Definition: logging.hh:200
gem5::minor::LSQ::requests
LSQQueue requests
requests contains LSQRequests which have been issued to the TLB by calling ExecContext::readMem/write...
Definition: lsq.hh:574
gem5::minor::LSQ::LSQRequest::retireResponse
virtual void retireResponse(PacketPtr packet_)=0
Retire a response packet into the LSQRequest packet possibly completing this transfer.
gem5::minor::LSQ::LSQRequest::tryToSuppressFault
void tryToSuppressFault()
Instructions may want to suppress translation faults (e.g.
Definition: lsq.cc:78
gem5::minor::LSQ::SpecialDataRequest::getHeadPacket
PacketPtr getHeadPacket()
Get the head packet as counted by numIssuedFragments.
Definition: lsq.hh:297
gem5::minor::LSQ::LSQRequest::StoreToStoreBuffer
@ StoreToStoreBuffer
Definition: lsq.hh:177
gem5::minor::LSQ::SingleDataRequest::sentAllPackets
bool sentAllPackets()
packetInFlight can become false again, so need to check packetSent
Definition: lsq.hh:374
gem5::minor::LSQ::MemoryNeedsRetry
@ MemoryNeedsRetry
Definition: lsq.hh:79
gem5::MinorCPU::MinorCPUPort::MinorCPUPort
MinorCPUPort(const std::string &name_, MinorCPU &cpu_)
Definition: cpu.hh:112
gem5::minor::LSQ::StoreBuffer::StoreBuffer
StoreBuffer(std::string name_, LSQ &lsq_, unsigned int store_buffer_size, unsigned int store_limit_per_cycle)
Definition: lsq.cc:1684
gem5::minor::ReportTraitsPtrAdaptor
A similar adaptor but for elements held by pointer ElemType should implement ReportIF.
Definition: buffers.hh:107
gem5::minor::LSQ::DcachePort::DcachePort
DcachePort(std::string name, LSQ &lsq_, MinorCPU &cpu)
Definition: lsq.hh:102
gem5::Port::name
const std::string name() const
Return port name (for DPRINTF).
Definition: port.hh:111
gem5::minor::LSQ::LSQRequest::request
RequestPtr request
The underlying request of this LSQRequest.
Definition: lsq.hh:152
gem5::minor::LSQ::issuedMemBarrierInst
void issuedMemBarrierInst(MinorDynInstPtr inst)
A memory barrier instruction has been issued, remember its execSeqNum that we can avoid issuing memor...
Definition: lsq.cc:1717
data
const char data[]
Definition: circlebuf.test.cc:48
gem5::minor::LSQ::SplitDataRequest::retireResponse
void retireResponse(PacketPtr packet_)
For loads, paste the response data into the main response packet.
Definition: lsq.cc:624
gem5::minor::LSQ::LSQRequest::isLoad
bool isLoad
Load/store indication used for building packet.
Definition: lsq.hh:139
gem5::minor::LSQ::AddrRangeCoverage
AddrRangeCoverage
Coverage of one address range with another.
Definition: lsq.hh:87
gem5::minor::LSQ::LSQRequest::RequestIssuing
@ RequestIssuing
Definition: lsq.hh:175
gem5::minor::LSQ::StoreBuffer::storeLimitPerCycle
const unsigned int storeLimitPerCycle
Maximum number of stores that can be issued per cycle.
Definition: lsq.hh:481
gem5::minor::LSQ::LSQRequest::makePacket
void makePacket()
Make a packet to use with the memory transaction.
Definition: lsq.cc:1729
gem5::minor::LSQ::LSQRequestPtr
LSQRequest * LSQRequestPtr
Definition: lsq.hh:274
gem5::minor::LSQ::threadSnoop
void threadSnoop(LSQRequestPtr request)
Snoop other threads monitors on memory system accesses.
Definition: lsq.cc:1782
gem5::minor::LSQ::LSQRequest::LSQRequestState
LSQRequestState
Definition: lsq.hh:169
gem5::minor::LSQ::PartialAddrRangeCoverage
@ PartialAddrRangeCoverage
Definition: lsq.hh:89
gem5::minor::LSQ::LSQRequest::packet
PacketPtr packet
Definition: lsq.hh:149
gem5::minor::LSQ::state
MemoryState state
Retry state of last issued memory transfer.
Definition: lsq.hh:545
gem5::minor::LSQ::LSQRequest::setSkipped
void setSkipped()
Set this request as having been skipped before a memory transfer was attempt.
Definition: lsq.hh:219
gem5::MinorCPU::MinorCPUPort
Provide a non-protected base class for Minor's Ports as derived classes are created by Fetch1 and Exe...
Definition: cpu.hh:105
gem5::minor::LSQ::StoreBuffer::numUnissuedAccesses
unsigned int numUnissuedAccesses
Number of occupied slots which have not yet issued a memory access.
Definition: lsq.hh:489
gem5::BaseMMU::Mode
Mode
Definition: mmu.hh:56
gem5::minor::LSQ::SplitDataRequest::sendNextFragmentToTranslation
void sendNextFragmentToTranslation()
Part of the address translation loop, see startAddTranslation.
Definition: lsq.cc:701
gem5::minor::LSQ::NoAddrRangeCoverage
@ NoAddrRangeCoverage
Definition: lsq.hh:91
gem5::minor::LSQ::BarrierDataRequest::BarrierDataRequest
BarrierDataRequest(LSQ &port_, MinorDynInstPtr inst_)
Definition: lsq.hh:339
gem5::minor::LSQ::DcachePort
Exposable data port.
Definition: lsq.hh:95
named.hh
gem5::minor::LSQ::StoreBuffer::forwardStoreData
void forwardStoreData(LSQRequestPtr load, unsigned int slot_number)
Fill the given packet with appropriate date from slot slot_number.
Definition: lsq.cc:804
gem5::minor::LSQ::StoreBuffer::numUnissuedStores
unsigned int numUnissuedStores()
Number of stores in the store buffer which have not been completely issued to the memory system.
Definition: lsq.hh:520
gem5::minor::LSQ::LSQRequest::issuedToMemory
bool issuedToMemory
This in an access other than a normal cacheable load that's visited the memory system.
Definition: lsq.hh:164
gem5::minor::LSQ::SpecialDataRequest::finish
void finish(const Fault &fault_, const RequestPtr &request_, ThreadContext *tc, BaseMMU::Mode mode)
TLB interace.
Definition: lsq.hh:288
gem5::minor::LSQ::LSQRequest::needsToBeSentToStoreBuffer
bool needsToBeSentToStoreBuffer()
This request, once processed by the requests/transfers queues, will need to go to the store buffer.
Definition: lsq.cc:164
gem5::minor::Queue
Wrapper for a queue type to act as a pipeline stage input queue.
Definition: buffers.hh:403
gem5::minor::LSQ::FailedDataRequest
FailedDataRequest represents requests from instructions that failed their predicates but need to ride...
Definition: lsq.hh:323
gem5::MinorCPU::MinorCPUPort::cpu
MinorCPU & cpu
The enclosing cpu.
Definition: cpu.hh:109
cpu.hh
minor
gem5::minor::LSQ::DcachePort::recvTimingSnoopReq
void recvTimingSnoopReq(PacketPtr pkt) override
Receive a timing snoop request from the peer.
Definition: lsq.hh:114
gem5::MinorCPU
MinorCPU is an in-order CPU model with four fixed pipeline stages:
Definition: cpu.hh:84
gem5::minor::LSQ::MemoryState
MemoryState
State of memory access for head access.
Definition: lsq.hh:76
gem5::minor::LSQ::SplitDataRequest::finish
void finish(const Fault &fault_, const RequestPtr &request_, ThreadContext *tc, BaseMMU::Mode mode)
TLB response interface.
Definition: lsq.cc:334
gem5::minor::LSQ::cacheBlockMask
Addr cacheBlockMask
Address Mask for a cache block (e.g.
Definition: lsq.hh:622
gem5::minor::LSQ::numAccessesInDTLB
unsigned int numAccessesInDTLB
Number of requests in the DTLB in the requests queue.
Definition: lsq.hh:606
gem5::minor::LSQ::LSQRequest::markDelayed
void markDelayed()
BaseMMU::Translation interface.
Definition: lsq.hh:195
gem5::minor::LSQ::step
void step()
Step checks the queues to see if their are issuable transfers which were not otherwise picked up by t...
Definition: lsq.cc:1475
std::vector< RequestPtr >
gem5::minor::LSQ::SpecialDataRequest::stepToNextPacket
void stepToNextPacket()
Step on numIssuedFragments.
Definition: lsq.hh:301
gem5::minor::LSQ::needsToTick
bool needsToTick()
May need to be ticked next cycle as one of the queues contains an actionable transfers or address tra...
Definition: lsq.cc:1563
gem5::minor::LSQ::lineWidth
const unsigned int lineWidth
Memory system access width (and snap) in bytes.
Definition: lsq.hh:551
gem5::minor::LSQ::pushFailedRequest
void pushFailedRequest(MinorDynInstPtr inst)
Push a predicate failed-representing request into the queues just to maintain commit order.
Definition: lsq.cc:1666
gem5::PacketDataPtr
uint8_t * PacketDataPtr
Definition: packet.hh:72
gem5::minor::LSQ::LSQRequest::Complete
@ Complete
Definition: lsq.hh:188
gem5::minor::LSQ::lastMemBarrier
std::vector< InstSeqNum > lastMemBarrier
Most recent execSeqNum of a memory barrier instruction or 0 if there are no in-flight barriers.
Definition: lsq.hh:541
gem5::minor::LSQ::BarrierDataRequest
Request for doing barrier accounting in the store buffer.
Definition: lsq.hh:333
gem5::minor::LSQ::SplitDataRequest::makeFragmentRequests
void makeFragmentRequests()
Make all the Requests for this transfer's fragments so that those requests can be sent for address tr...
Definition: lsq.cc:419
gem5::minor::LSQ::LSQQueue
Queue< LSQRequestPtr, ReportTraitsPtrAdaptor< LSQRequestPtr >, NoBubbleTraits< LSQRequestPtr > > LSQQueue
The LSQ consists of three queues: requests, transfers and the store buffer storeBuffer.
Definition: lsq.hh:560
gem5::minor::LSQ::BarrierDataRequest::isBarrier
bool isBarrier()
Is this a request a barrier?
Definition: lsq.hh:336
gem5::minor::LSQ::SplitDataRequest::sentAllPackets
bool sentAllPackets()
Have we stepped past the end of fragmentPackets?
Definition: lsq.hh:457
gem5::minor::LSQ::SpecialDataRequest::SpecialDataRequest
SpecialDataRequest(LSQ &port_, MinorDynInstPtr inst_)
Definition: lsq.hh:314
gem5::minor::LSQ::SingleDataRequest::finish
void finish(const Fault &fault_, const RequestPtr &request_, ThreadContext *tc, BaseMMU::Mode mode)
TLB interace.
Definition: lsq.cc:271
gem5::minor::LSQ::SingleDataRequest::startAddrTranslation
void startAddrTranslation()
Send single translation request.
Definition: lsq.cc:301
gem5::minor::LSQ::LSQRequest::Translated
@ Translated
Definition: lsq.hh:173
gem5::minor::LSQ::LSQRequest::skippedMemAccess
bool skippedMemAccess()
Was no memory access attempted for this request?
Definition: lsq.hh:215
gem5::RefCountingPtr< MinorDynInst >
gem5::minor::LSQ::LSQRequest::containsAddrRangeOf
static AddrRangeCoverage containsAddrRangeOf(Addr req1_addr, unsigned int req1_size, Addr req2_addr, unsigned int req2_size)
Does address range req1 (req1_addr to req1_addr + req1_size - 1) fully cover, partially cover or not ...
Definition: lsq.cc:121
packet.hh
gem5::minor::LSQ::SplitDataRequest::numIssuedFragments
unsigned int numIssuedFragments
Number of fragments already issued (<= numFragments)
Definition: lsq.hh:408
gem5::minor::LSQ::LSQRequest::~LSQRequest
virtual ~LSQRequest()
Definition: lsq.cc:1460
gem5::minor::LSQ::LSQRequest
Derived SenderState to carry data access info.
Definition: lsq.hh:126
gem5::minor::LSQ::SpecialDataRequest::sentAllPackets
bool sentAllPackets()
Has no packets to send.
Definition: lsq.hh:304
gem5::Named
Interface for things with names.
Definition: named.hh:38
gem5::minor::LSQ::isDrained
bool isDrained()
Is there nothing left in the LSQ.
Definition: lsq.cc:1556
gem5::minor::LSQ::SplitDataRequest::hasPacketsInMemSystem
bool hasPacketsInMemSystem()
True if this request has any issued packets in the memory system and so can't be interrupted until it...
Definition: lsq.hh:453
gem5::minor::LSQ::SplitDataRequest::numInTranslationFragments
unsigned int numInTranslationFragments
Number of fragments in the address translation mechanism.
Definition: lsq.hh:399
gem5::minor::LSQ::LSQRequest::data
PacketDataPtr data
Dynamically allocated and populated data carried for building write packets.
Definition: lsq.hh:143
gem5::minor::LSQ::~LSQ
virtual ~LSQ()
Definition: lsq.cc:1457
gem5::minor::LSQ::StoreBuffer::canForwardDataToLoad
AddrRangeCoverage canForwardDataToLoad(LSQRequestPtr request, unsigned int &found_slot)
Look for a store which satisfies the given load.
Definition: lsq.cc:763
gem5::Flags< FlagsType >
gem5::minor::LSQ::SingleDataRequest::stepToNextPacket
void stepToNextPacket()
Remember that the packet has been sent.
Definition: lsq.hh:367
gem5::minor::LSQ::execute
Execute & execute
Definition: lsq.hh:72
gem5::minor::LSQ::minorTrace
void minorTrace() const
Definition: lsq.cc:1673
gem5::minor::LSQ::clearMemBarrier
void clearMemBarrier(MinorDynInstPtr inst)
Clear a barrier (if it's the last one marked up in lastMemBarrier)
Definition: lsq.cc:258
gem5::minor::LSQ::SpecialDataRequest::hasPacketsInMemSystem
bool hasPacketsInMemSystem()
Never sends any requests.
Definition: lsq.hh:307
gem5::minor::LSQ::StoreBuffer::insert
void insert(LSQRequestPtr request)
Insert a request at the back of the queue.
Definition: lsq.cc:741
gem5::minor::LSQ::LSQRequest::Failed
@ Failed
Definition: lsq.hh:174
gem5::ThreadContext
ThreadContext is the external interface to all thread state for anything outside of the CPU.
Definition: thread_context.hh:88
gem5::minor::LSQ::LSQRequest::disableMemAccess
void disableMemAccess()
Definition: lsq.cc:114
gem5::Fault
std::shared_ptr< FaultBase > Fault
Definition: types.hh:248
gem5::minor::LSQ::SpecialDataRequest::retireResponse
void retireResponse(PacketPtr packet_)
Keep the given packet as the response packet LSQRequest::packet.
Definition: lsq.hh:311
gem5::minor::LSQ::getDcachePort
MinorCPU::MinorCPUPort & getDcachePort()
Return the raw-bindable port.
Definition: lsq.hh:731
gem5::minor::LSQ::SingleDataRequest::hasPacketsInMemSystem
bool hasPacketsInMemSystem()
Has packet been sent.
Definition: lsq.hh:370
gem5::minor::LSQ::getLastMemBarrier
InstSeqNum getLastMemBarrier(ThreadID thread_id) const
Get the execSeqNum of the last issued memory barrier.
Definition: lsq.hh:698
gem5::minor::LSQ::StoreBuffer::isDrained
bool isDrained() const
Drained if there is absolutely nothing left in the buffer.
Definition: lsq.hh:528
gem5::minor::LSQ::StoreBuffer
Store buffer.
Definition: lsq.hh:471
gem5::Packet
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Definition: packet.hh:294
gem5::minor::LSQ::SplitDataRequest::numFragments
unsigned int numFragments
Number of fragments this request is split into.
Definition: lsq.hh:396
gem5::minor::LSQ::LSQRequest::inst
MinorDynInstPtr inst
Instruction which made this request.
Definition: lsq.hh:135
gem5::minor::LSQ::SpecialDataRequest
Special request types that don't actually issue memory requests.
Definition: lsq.hh:284
gem5::minor::LSQ::LSQRequest::stepToNextPacket
virtual void stepToNextPacket()=0
Step to the next packet for the next call to getHeadPacket.
gem5::minor::LSQ::LSQRequest::StoreBufferIssuing
@ StoreBufferIssuing
Definition: lsq.hh:182
gem5::minor::LSQ::canRequest
bool canRequest()
Is their space in the request queue to be able to push a request by issuing an isMemRef instruction.
Definition: lsq.hh:669
gem5::minor::LSQ::DcachePort::isSnooping
bool isSnooping() const override
Determine if this request port is snooping or not.
Definition: lsq.hh:112
gem5::minor::LSQ::SplitDataRequest::getHeadPacket
PacketPtr getHeadPacket()
Get the head packet as counted by numIssuedFragments.
Definition: lsq.cc:608
gem5::minor::LSQ::LSQ
LSQ(std::string name_, std::string dcache_port_name_, MinorCPU &cpu_, Execute &execute_, unsigned int max_accesses_in_memory_system, unsigned int line_width, unsigned int requests_queue_size, unsigned int transfers_queue_size, unsigned int store_buffer_size, unsigned int store_buffer_cycle_store_limit)
Definition: lsq.cc:1402
gem5::minor::LSQ::StoreBuffer::step
void step()
Try to issue more stores to memory.
Definition: lsq.cc:843
gem5::RequestPtr
std::shared_ptr< Request > RequestPtr
Definition: request.hh:92
gem5::minor::LSQ::LSQRequest::setState
void setState(LSQRequestState new_state)
Set state and output trace output.
Definition: lsq.cc:170
gem5::minor::LSQ::recvReqRetry
void recvReqRetry()
Definition: lsq.cc:1356
gem5::minor::LSQ::storeBuffer
StoreBuffer storeBuffer
Definition: lsq.hh:594
gem5::minor::LSQ::StoreBuffer::countIssuedStore
void countIssuedStore(LSQRequestPtr request)
Count a store being issued to memory by decrementing numUnissuedAccesses.
Definition: lsq.cc:834
gem5::minor::LSQ::LSQRequest::getHeadPacket
virtual PacketPtr getHeadPacket()=0
Get the next packet to issue for this request.
gem5::minor::LSQ::DcachePort::recvReqRetry
void recvReqRetry() override
Called by the peer if sendTimingReq was called on this peer (causing recvTimingReq to be called on th...
Definition: lsq.hh:110
gem5::minor::LSQ::completeMemBarrierInst
void completeMemBarrierInst(MinorDynInstPtr inst, bool committed)
Complete a barrier instruction.
Definition: lsq.cc:913
gem5::minor::LSQ::SplitDataRequest::SplitDataRequest
SplitDataRequest(LSQ &port_, MinorDynInstPtr inst_, bool isLoad_, PacketDataPtr data_=NULL, uint64_t *res_=NULL)
Definition: lsq.cc:392
gem5::minor::LSQ::tryToSend
bool tryToSend(LSQRequestPtr request)
Try to send (or resend) a memory request's next/only packet to the memory system.
Definition: lsq.cc:1174
gem5::minor::makePacketForRequest
PacketPtr makePacketForRequest(const RequestPtr &request, bool isLoad, Packet::SenderState *sender_state, PacketDataPtr data)
Make a suitable packet for the given request.
Definition: lsq.cc:1696
gem5::minor::LSQ::popResponse
void popResponse(LSQRequestPtr response)
Sanity check and pop the head response.
Definition: lsq.cc:1521
gem5::minor::LSQ::FailedDataRequest::FailedDataRequest
FailedDataRequest(LSQ &port_, MinorDynInstPtr inst_)
Definition: lsq.hh:326
gem5::minor::LSQ::SplitDataRequest::fragmentPackets
std::vector< Packet * > fragmentPackets
Packets matching fragmentRequests to issue fragments to memory.
Definition: lsq.hh:418
gem5::minor::LSQ::LSQRequest::RequestNeedsRetry
@ RequestNeedsRetry
Definition: lsq.hh:179
flags
uint8_t flags
Definition: helpers.cc:66
gem5::minor::Queue::unreservedRemainingSpace
unsigned int unreservedRemainingSpace() const
Like remainingSpace but does not count reserved spaces.
Definition: buffers.hh:492
gem5::minor::LSQ::SingleDataRequest::packetSent
bool packetSent
Has the packet been at least sent to the memory system?
Definition: lsq.hh:357
gem5::Packet::SenderState
A virtual base opaque structure used to hold state associated with the packet (e.g....
Definition: packet.hh:468
gem5::minor::LSQ::SplitDataRequest::translationEvent
EventFunctionWrapper translationEvent
Event to step between translations.
Definition: lsq.hh:393
gem5::minor::LSQ::tryToSendToTransfers
void tryToSendToTransfers(LSQRequestPtr request)
Try and issue a memory access for a translated request at the head of the requests queue.
Definition: lsq.cc:959
gem5::minor::LSQ::SplitDataRequest::makeFragmentPackets
void makeFragmentPackets()
Make the packets to go with the requests so they can be sent to the memory system.
Definition: lsq.cc:533
gem5::Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:147
gem5::minor::LSQ::LSQRequest::res
uint64_t * res
Res from pushRequest.
Definition: lsq.hh:155
gem5::minor::LSQ::moveFromRequestsToTransfers
void moveFromRequestsToTransfers(LSQRequestPtr request)
Move a request between queues.
Definition: lsq.cc:1272
gem5::minor::LSQ::SplitDataRequest::fragmentRequests
std::vector< RequestPtr > fragmentRequests
Fragment Requests corresponding to the address ranges of each fragment.
Definition: lsq.hh:415
gem5::minor::LSQ::DcachePort::recvTimingResp
bool recvTimingResp(PacketPtr pkt) override
Receive a timing response from the peer.
Definition: lsq.hh:107
gem5::minor::LSQ::StoreBuffer::slots
std::deque< LSQRequestPtr > slots
Queue of store requests on their way to memory.
Definition: lsq.hh:485
gem5::minor::LSQ::LSQRequest::InTranslation
@ InTranslation
Definition: lsq.hh:172
gem5::minor::LSQ::numAccessesInMemorySystem
unsigned int numAccessesInMemorySystem
Count of the number of mem.
Definition: lsq.hh:603
gem5::minor::LSQ::canSendToMemorySystem
bool canSendToMemorySystem()
Can a request be sent to the memory system.
Definition: lsq.cc:1289
gem5::minor::LSQ::SplitDataRequest::~SplitDataRequest
~SplitDataRequest()
Definition: lsq.cc:409
gem5::minor::LSQ::SplitDataRequest::stepToNextPacket
void stepToNextPacket()
Step on numIssuedFragments.
Definition: lsq.cc:616
gem5::minor::LSQ::LSQRequest::StoreBufferNeedsRetry
@ StoreBufferNeedsRetry
Definition: lsq.hh:184
gem5::minor::LSQ::SingleDataRequest::getHeadPacket
PacketPtr getHeadPacket()
Get the head packet as counted by numIssuedFragments.
Definition: lsq.hh:364
gem5::EventFunctionWrapper
Definition: eventq.hh:1136
gem5::minor::LSQ::inMemorySystemLimit
const unsigned int inMemorySystemLimit
Maximum number of in-flight accesses issued to the memory system.
Definition: lsq.hh:548
gem5::BaseMMU::Translation
Definition: mmu.hh:58
gem5::minor::LSQ::LSQRequest::startAddrTranslation
virtual void startAddrTranslation()=0
Start the address translation process for this request.
gem5::minor::LSQ::StoreBuffer::canInsert
bool canInsert() const
Can a new request be inserted into the queue?
Definition: lsq.cc:720
gem5::minor::LSQ::dcachePort
DcachePort dcachePort
Definition: lsq.hh:120
gem5::minor::LSQ::LSQRequest::skipped
bool skipped
Was skipped.
Definition: lsq.hh:160
gem5::minor::LSQ::LSQRequest::state
LSQRequestState state
Definition: lsq.hh:191
gem5::X86ISA::os
Bitfield< 17 > os
Definition: misc.hh:810
gem5::minor::LSQ::accessesInFlight
bool accessesInFlight() const
Are there any accesses other than normal cached loads in the memory system or having received respons...
Definition: lsq.hh:689
gem5::minor::LSQ::numAccessesIssuedToMemory
unsigned int numAccessesIssuedToMemory
The number of accesses which have been issued to the memory system but have not been committed/discar...
Definition: lsq.hh:615
gem5::minor::LSQ::LSQRequest::completeDisabledMemAccess
void completeDisabledMemAccess()
Definition: lsq.cc:97
gem5::minor::LSQ::recvTimingSnoopReq
void recvTimingSnoopReq(PacketPtr pkt)
Definition: lsq.cc:1762
gem5::minor::LSQ::operator<<
friend std::ostream & operator<<(std::ostream &os, MemoryState state)
Print MemoryState values as shown in the enum definition.
Definition: lsq.cc:1745
std::deque< LSQRequestPtr >
gem5::minor::Execute
Execute stage.
Definition: execute.hh:67
gem5::minor::LSQ::LSQRequest::isTranslationDelayed
bool isTranslationDelayed
Address translation is delayed due to table walk.
Definition: lsq.hh:167
gem5::minor::LSQ::StoreBuffer::minorTrace
void minorTrace() const
Report queue contents for MinorTrace.
Definition: lsq.cc:930
gem5::minor::LSQ::SplitDataRequest::numRetiredFragments
unsigned int numRetiredFragments
Number of fragments retired back to this request.
Definition: lsq.hh:411
gem5::minor::LSQ::DcachePort::recvFunctionalSnoop
void recvFunctionalSnoop(PacketPtr pkt) override
Receive a functional snoop request packet from the peer.
Definition: lsq.hh:117
gem5::minor::LSQ::SingleDataRequest
SingleDataRequest is used for requests that don't fragment.
Definition: lsq.hh:345
gem5::minor::LSQ::LSQRequest::port
LSQ & port
Owning port.
Definition: lsq.hh:132
gem5::minor::LSQ::MemoryRunning
@ MemoryRunning
Definition: lsq.hh:78
gem5::minor::LSQ::LSQRequest::LSQRequest
LSQRequest(LSQ &port_, MinorDynInstPtr inst_, bool isLoad_, PacketDataPtr data_=NULL, uint64_t *res_=NULL)
Definition: lsq.cc:59
gem5::minor::NoBubbleTraits
...
Definition: buffers.hh:121
gem5::minor::LSQ::LSQRequest::isBarrier
virtual bool isBarrier()
Is this a request a barrier?
Definition: lsq.cc:158
gem5::minor::LSQ::transfers
LSQQueue transfers
Once issued to memory (or, for stores, just had their state changed to StoreToStoreBuffer) LSQRequest...
Definition: lsq.hh:583
gem5::minor::LSQ::LSQRequest::NotIssued
@ NotIssued
Definition: lsq.hh:171
gem5::minor::LSQ::SplitDataRequest
Definition: lsq.hh:389
gem5::minor::LSQ::retryRequest
LSQRequestPtr retryRequest
The request (from either requests or the store buffer) which is currently waiting have its memory acc...
Definition: lsq.hh:619
gem5::InstSeqNum
uint64_t InstSeqNum
Definition: inst_seq.hh:40
buffers.hh
gem5::minor::LSQ::SplitDataRequest::startAddrTranslation
void startAddrTranslation()
Start a loop of do { sendNextFragmentToTranslation ; translateTiming ; finish } while (numTranslatedF...
Definition: lsq.cc:583
gem5::minor::LSQ::numStoresInTransfers
unsigned int numStoresInTransfers
The number of stores in the transfers queue.
Definition: lsq.hh:610
gem5::minor::LSQ::StoreBuffer::deleteRequest
void deleteRequest(LSQRequestPtr request)
Delete the given request and free the slot it occupied.
Definition: lsq.cc:727
gem5::minor::LSQ::SingleDataRequest::retireResponse
void retireResponse(PacketPtr packet_)
Keep the given packet as the response packet LSQRequest::packet.
Definition: lsq.cc:325
gem5::minor::LSQ::recvTimingResp
bool recvTimingResp(PacketPtr pkt)
Memory interface.
Definition: lsq.cc:1296
gem5::minor::LSQ::cpu
MinorCPU & cpu
My owner(s)
Definition: lsq.hh:71
trace.hh
gem5::minor::LSQ::pushRequest
Fault pushRequest(MinorDynInstPtr inst, bool isLoad, uint8_t *data, unsigned int size, Addr addr, Request::Flags flags, uint64_t *res, AtomicOpFunctorPtr amo_op, const std::vector< bool > &byte_enable=std::vector< bool >())
Single interface for readMem/writeMem/amoMem to issue requests into the LSQ.
Definition: lsq.cc:1583
gem5::AtomicOpFunctorPtr
std::unique_ptr< AtomicOpFunctor > AtomicOpFunctorPtr
Definition: amo.hh:269
gem5::minor::LSQ::SplitDataRequest::numTranslatedFragments
unsigned int numTranslatedFragments
Number of fragments that have completed address translation, (numTranslatedFragments + numInTranslati...
Definition: lsq.hh:405
gem5
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Definition: gpu_translation_state.hh:37
gem5::minor::LSQ::LSQRequest::reportData
void reportData(std::ostream &os) const
MinorTrace report interface.
Definition: lsq.cc:186
gem5::minor::LSQ::LSQRequest::hasPacketsInMemSystem
virtual bool hasPacketsInMemSystem()=0
True if this request has any issued packets in the memory system and so can't be interrupted until it...
gem5::minor::LSQ::LSQRequest::isComplete
bool isComplete() const
Has this request been completed.
Definition: lsq.cc:178
gem5::minor::LSQ::sendStoreToStoreBuffer
void sendStoreToStoreBuffer(LSQRequestPtr request)
A store has been committed, please move it to the store buffer.
Definition: lsq.cc:1543
gem5::minor::LSQ::findResponse
LSQRequestPtr findResponse(MinorDynInstPtr inst)
Returns a response if it's at the head of the transfers queue and it's either complete or can be sent...
Definition: lsq.cc:1486
gem5::minor::LSQ::canPushIntoStoreBuffer
bool canPushIntoStoreBuffer() const
Must check this before trying to insert into the store buffer.
Definition: lsq.hh:681
gem5::minor::LSQ::FullAddrRangeCoverage
@ FullAddrRangeCoverage
Definition: lsq.hh:90
gem5::minor::LSQ::SingleDataRequest::packetInFlight
bool packetInFlight
Has my only packet been sent to the memory system but has not yet been responded to.
Definition: lsq.hh:354
gem5::minor::LSQ::StoreBuffer::lsq
LSQ & lsq
My owner.
Definition: lsq.hh:475
gem5::minor::LSQ::SpecialDataRequest::startAddrTranslation
void startAddrTranslation()
Send single translation request.
Definition: lsq.hh:294
gem5::minor::LSQ::StoreBuffer::numSlots
const unsigned int numSlots
Number of slots, this is a bound on the size of slots.
Definition: lsq.hh:478
gem5::minor::LSQ::LSQRequest::StoreInStoreBuffer
@ StoreInStoreBuffer
Definition: lsq.hh:180
gem5::ThreadID
int16_t ThreadID
Thread index/ID type.
Definition: types.hh:235
gem5::ArmISA::mode
Bitfield< 4, 0 > mode
Definition: misc_types.hh:74
gem5::X86ISA::addr
Bitfield< 3 > addr
Definition: types.hh:84
gem5::minor::LSQ::DcachePort::lsq
LSQ & lsq
My owner.
Definition: lsq.hh:99
gem5::minor::LSQ::SingleDataRequest::SingleDataRequest
SingleDataRequest(LSQ &port_, MinorDynInstPtr inst_, bool isLoad_, PacketDataPtr data_=NULL, uint64_t *res_=NULL)
Definition: lsq.hh:381

Generated on Sun Jul 30 2023 01:56:52 for gem5 by doxygen 1.8.17