gem5  v20.1.0.0
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 "cpu/minor/buffers.hh"
49 #include "cpu/minor/cpu.hh"
50 #include "cpu/minor/pipe_data.hh"
51 #include "cpu/minor/trace.hh"
52 
53 namespace Minor
54 {
55 
56 /* Forward declaration */
57 class Execute;
58 
59 class LSQ : public Named
60 {
61  protected:
65 
66  protected:
69  {
70  MemoryRunning, /* Default. Step dcache queues when possible. */
71  MemoryNeedsRetry /* Request rejected, will be asked to retry */
72  };
73 
75  friend std::ostream &operator <<(std::ostream &os,
77 
80  {
81  PartialAddrRangeCoverage, /* Two ranges partly overlap */
82  FullAddrRangeCoverage, /* One range fully covers another */
83  NoAddrRangeCoverage /* Two ranges are disjoint */
84  };
85 
88  {
89  protected:
91  LSQ &lsq;
92 
93  public:
94  DcachePort(std::string name, LSQ &lsq_, MinorCPU &cpu) :
95  MinorCPU::MinorCPUPort(name, cpu), lsq(lsq_)
96  { }
97 
98  protected:
99  bool recvTimingResp(PacketPtr pkt) override
100  { return lsq.recvTimingResp(pkt); }
101 
102  void recvReqRetry() override { lsq.recvReqRetry(); }
103 
104  bool isSnooping() const override { return true; }
105 
106  void recvTimingSnoopReq(PacketPtr pkt) override
107  { return lsq.recvTimingSnoopReq(pkt); }
108 
109  void recvFunctionalSnoop(PacketPtr pkt) override { }
110  };
111 
113 
114  public:
118  class LSQRequest :
119  public BaseTLB::Translation, /* For TLB lookups */
120  public Packet::SenderState /* For packing into a Packet */
121  {
122  public:
125 
128 
131  bool isLoad;
132 
136 
137  /* Requests carry packets on their way to the memory system.
138  * When a Packet returns from the memory system, its
139  * request needs to have its packet updated as this
140  * may have changed in flight */
142 
145 
147  uint64_t *res;
148 
152  bool skipped;
153 
157 
160 
162  {
163  NotIssued, /* Newly created */
164  InTranslation, /* TLB accessed, no reply yet */
165  Translated, /* Finished address translation */
166  Failed, /* The starting start of FailedDataRequests */
167  RequestIssuing, /* Load/store issued to memory in the requests
168  queue */
169  StoreToStoreBuffer, /* Store in transfers on its way to the
170  store buffer */
171  RequestNeedsRetry, /* Retry needed for load */
172  StoreInStoreBuffer, /* Store in the store buffer, before issuing
173  a memory transfer */
174  StoreBufferIssuing, /* Store in store buffer and has been
175  issued */
176  StoreBufferNeedsRetry, /* Retry needed for store */
177  /* All completed states. Includes
178  completed loads, TLB faults and skipped requests whose
179  seqNum's no longer match */
181  };
182 
184 
185  protected:
188 
191  void tryToSuppressFault();
192 
193  void disableMemAccess();
195 
196  public:
197  LSQRequest(LSQ &port_, MinorDynInstPtr inst_, bool isLoad_,
198  PacketDataPtr data_ = NULL, uint64_t *res_ = NULL);
199 
200  virtual ~LSQRequest();
201 
202  public:
204  void makePacket();
205 
207  bool skippedMemAccess() { return skipped; }
208 
211  void setSkipped() { skipped = true; }
212 
216  Addr req1_addr, unsigned int req1_size,
217  Addr req2_addr, unsigned int req2_size);
218 
222 
225  virtual void startAddrTranslation() = 0;
226 
231  virtual PacketPtr getHeadPacket() = 0;
232 
234  virtual void stepToNextPacket() = 0;
235 
237  virtual bool sentAllPackets() = 0;
238 
241  virtual bool hasPacketsInMemSystem() = 0;
242 
245  virtual void retireResponse(PacketPtr packet_) = 0;
246 
248  virtual bool isBarrier();
249 
253 
255  void setState(LSQRequestState new_state);
256 
260  bool isComplete() const;
261 
263  void reportData(std::ostream &os) const;
264  };
265 
267 
268  friend std::ostream & operator <<(std::ostream &os,
270 
271  friend std::ostream & operator <<(std::ostream &os,
273 
274  protected:
277  {
278  protected:
280  void finish(const Fault &fault_, const RequestPtr &request_,
282  { }
283 
284  public:
287 
290  { fatal("No packets in a SpecialDataRequest"); }
291 
293  void stepToNextPacket() { }
294 
296  bool sentAllPackets() { return true; }
297 
299  bool hasPacketsInMemSystem() { return false; }
300 
303  void retireResponse(PacketPtr packet_) { }
304 
305  public:
307  /* Say this is a load, not actually relevant */
308  LSQRequest(port_, inst_, true, NULL, 0)
309  { }
310  };
311 
316  {
317  public:
319  SpecialDataRequest(port_, inst_)
320  { state = Failed; }
321  };
322 
326  {
327  public:
328  bool isBarrier() { return true; }
329 
330  public:
332  SpecialDataRequest(port_, inst_)
333  { state = Complete; }
334  };
335 
338  {
339  protected:
341  void finish(const Fault &fault_, const RequestPtr &request_,
343 
347 
350 
351  public:
353  void startAddrTranslation();
354 
357 
359  void stepToNextPacket() { packetInFlight = true; packetSent = true; }
360 
363 
366  bool sentAllPackets() { return packetSent; }
367 
370  void retireResponse(PacketPtr packet_);
371 
372  public:
374  bool isLoad_, PacketDataPtr data_ = NULL, uint64_t *res_ = NULL) :
375  LSQRequest(port_, inst_, isLoad_, data_, res_),
376  packetInFlight(false),
377  packetSent(false)
378  { }
379  };
380 
382  {
383  protected:
386  protected:
388  unsigned int numFragments;
389 
392 
398 
400  unsigned int numIssuedFragments;
401 
403  unsigned int numRetiredFragments;
404 
408 
411 
412  protected:
414  void finish(const Fault &fault_, const RequestPtr &request_,
416 
417  public:
418  SplitDataRequest(LSQ &port_, MinorDynInstPtr inst_,
419  bool isLoad_, PacketDataPtr data_ = NULL,
420  uint64_t *res_ = NULL);
421 
423 
424  public:
427  void makeFragmentRequests();
428 
431  void makeFragmentPackets();
432 
437  void startAddrTranslation();
438 
441 
443  void stepToNextPacket();
444 
447 
451 
454  void retireResponse(PacketPtr packet_);
455 
458  };
459 
463  class StoreBuffer : public Named
464  {
465  public:
468 
470  const unsigned int numSlots;
471 
473  const unsigned int storeLimitPerCycle;
474 
475  public:
478 
481  unsigned int numUnissuedAccesses;
482 
483  public:
484  StoreBuffer(std::string name_, LSQ &lsq_,
485  unsigned int store_buffer_size,
486  unsigned int store_limit_per_cycle);
487 
488  public:
490  bool canInsert() const;
491 
493  void deleteRequest(LSQRequestPtr request);
494 
496  void insert(LSQRequestPtr request);
497 
504  unsigned int &found_slot);
505 
508  void forwardStoreData(LSQRequestPtr load, unsigned int slot_number);
509 
512  unsigned int numUnissuedStores() { return numUnissuedAccesses; }
513 
517  void countIssuedStore(LSQRequestPtr request);
518 
520  bool isDrained() const { return slots.empty(); }
521 
523  void step();
524 
526  void minorTrace() const;
527  };
528 
529  protected:
534 
535  public:
538 
540  const unsigned int inMemorySystemLimit;
541 
543  const unsigned int lineWidth;
544 
545  public:
549  typedef Queue<LSQRequestPtr,
553 
567 
576 
577  /* The store buffer contains committed cacheable stores on
578  * their way to memory decoupled from subsequence instruction execution.
579  * Before trying to issue a cacheable read from 'requests' to memory,
580  * the store buffer is checked to see if a previous store contains the
581  * needed data (StoreBuffer::canForwardDataToLoad) which can be
582  * forwarded in lieu of a memory access. If there are outstanding
583  * stores in the transfers queue, they must be promoted to the store
584  * buffer (and so be commited) before they can be correctly checked
585  * for forwarding. */
587 
588  protected:
596 
598  unsigned int numAccessesInDTLB;
599 
602  unsigned int numStoresInTransfers;
603 
608 
612 
615 
616  protected:
620  void tryToSendToTransfers(LSQRequestPtr request);
621 
625  bool tryToSend(LSQRequestPtr request);
626 
628  void clearMemBarrier(MinorDynInstPtr inst);
629 
632 
634  bool canSendToMemorySystem();
635 
637  void threadSnoop(LSQRequestPtr request);
638 
639  public:
640  LSQ(std::string name_, std::string dcache_port_name_,
641  MinorCPU &cpu_, Execute &execute_,
642  unsigned int max_accesses_in_memory_system, unsigned int line_width,
643  unsigned int requests_queue_size, unsigned int transfers_queue_size,
644  unsigned int store_buffer_size,
645  unsigned int store_buffer_cycle_store_limit);
646 
647  virtual ~LSQ();
648 
649  public:
657  void step();
658 
661  bool canRequest() { return requests.unreservedRemainingSpace() != 0; }
662 
668 
670  void popResponse(LSQRequestPtr response);
671 
673  bool canPushIntoStoreBuffer() const { return storeBuffer.canInsert(); }
674 
677 
681  bool accessesInFlight() const
682  { return numAccessesIssuedToMemory != 0; }
683 
688 
691  { return lastMemBarrier[thread_id]; }
692 
694  bool isDrained();
695 
698  bool needsToTick();
699 
703  bool committed);
704 
707  Fault pushRequest(MinorDynInstPtr inst, bool isLoad, uint8_t *data,
708  unsigned int size, Addr addr, Request::Flags flags,
709  uint64_t *res, AtomicOpFunctorPtr amo_op,
710  const std::vector<bool>& byte_enable =
712 
716 
718  bool recvTimingResp(PacketPtr pkt);
719  void recvReqRetry();
720  void recvTimingSnoopReq(PacketPtr pkt);
721 
724 
725  void minorTrace() const;
726 };
727 
731 PacketPtr makePacketForRequest(const RequestPtr &request, bool isLoad,
732  Packet::SenderState *sender_state = NULL, PacketDataPtr data = NULL);
733 }
734 
735 #endif /* __CPU_MINOR_NEW_LSQ_HH__ */
pipe_data.hh
Minor::LSQ::BarrierDataRequest::BarrierDataRequest
BarrierDataRequest(LSQ &port_, MinorDynInstPtr inst_)
Definition: lsq.hh:331
Minor::LSQ::getDcachePort
MinorCPU::MinorCPUPort & getDcachePort()
Return the raw-bindable port.
Definition: lsq.hh:723
fatal
#define fatal(...)
This implements a cprintf based fatal() function.
Definition: logging.hh:183
Minor::LSQ::LSQRequest::LSQRequestState
LSQRequestState
Definition: lsq.hh:161
AtomicOpFunctorPtr
std::unique_ptr< AtomicOpFunctor > AtomicOpFunctorPtr
Definition: amo.hh:239
Minor::LSQ::SingleDataRequest::retireResponse
void retireResponse(PacketPtr packet_)
Keep the given packet as the response packet LSQRequest::packet.
Definition: lsq.cc:323
Minor::LSQ::SplitDataRequest::SplitDataRequest
SplitDataRequest(LSQ &port_, MinorDynInstPtr inst_, bool isLoad_, PacketDataPtr data_=NULL, uint64_t *res_=NULL)
Definition: lsq.cc:390
Minor::LSQ::SpecialDataRequest::finish
void finish(const Fault &fault_, const RequestPtr &request_, ThreadContext *tc, BaseTLB::Mode mode)
TLB interace.
Definition: lsq.hh:280
Minor::LSQ::popResponse
void popResponse(LSQRequestPtr response)
Sanity check and pop the head response.
Definition: lsq.cc:1524
Minor::LSQ::LSQRequest::RequestNeedsRetry
@ RequestNeedsRetry
Definition: lsq.hh:171
Minor::LSQ::SplitDataRequest::fragmentRequests
std::vector< RequestPtr > fragmentRequests
Fragment Requests corresponding to the address ranges of each fragment.
Definition: lsq.hh:407
Minor::LSQ::requests
LSQQueue requests
requests contains LSQRequests which have been issued to the TLB by calling ExecContext::readMem/write...
Definition: lsq.hh:566
Minor::LSQ::operator<<
friend std::ostream & operator<<(std::ostream &os, MemoryState state)
Print MemoryState values as shown in the enum definition.
Definition: lsq.cc:1740
X86ISA::os
Bitfield< 17 > os
Definition: misc.hh:803
Minor::LSQ::DcachePort
Exposable data port.
Definition: lsq.hh:87
Minor::LSQ::LSQRequest::RequestIssuing
@ RequestIssuing
Definition: lsq.hh:167
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:346
MinorCPU::MinorCPUPort::cpu
MinorCPU & cpu
The enclosing cpu.
Definition: cpu.hh:102
Minor::LSQ::LSQRequest::StoreBufferNeedsRetry
@ StoreBufferNeedsRetry
Definition: lsq.hh:176
Minor::LSQ::SplitDataRequest::numTranslatedFragments
unsigned int numTranslatedFragments
Number of fragments that have completed address translation, (numTranslatedFragments + numInTranslati...
Definition: lsq.hh:397
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:607
data
const char data[]
Definition: circlebuf.test.cc:42
Minor::LSQ::LSQRequest::res
uint64_t * res
Res from pushRequest.
Definition: lsq.hh:147
Minor::LSQ::MemoryNeedsRetry
@ MemoryNeedsRetry
Definition: lsq.hh:71
Minor::LSQ::recvReqRetry
void recvReqRetry()
Definition: lsq.cc:1359
Minor::LSQ::pushFailedRequest
void pushFailedRequest(MinorDynInstPtr inst)
Push a predicate failed-representing request into the queues just to maintain commit order.
Definition: lsq.cc:1661
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:962
Minor::LSQ::LSQRequest::Failed
@ Failed
Definition: lsq.hh:166
ThreadID
int16_t ThreadID
Thread index/ID type.
Definition: types.hh:227
Minor::LSQ::LSQRequest::LSQRequest
LSQRequest(LSQ &port_, MinorDynInstPtr inst_, bool isLoad_, PacketDataPtr data_=NULL, uint64_t *res_=NULL)
Definition: lsq.cc:56
Minor::LSQ::LSQRequest::skippedMemAccess
bool skippedMemAccess()
Was no memory access attempted for this request?
Definition: lsq.hh:207
Flags< FlagsType >
Minor::LSQ::transfers
LSQQueue transfers
Once issued to memory (or, for stores, just had their state changed to StoreToStoreBuffer) LSQRequest...
Definition: lsq.hh:575
Minor::LSQ::SplitDataRequest::finish
void finish(const Fault &fault_, const RequestPtr &request_, ThreadContext *tc, BaseTLB::Mode mode)
TLB response interface.
Definition: lsq.cc:332
Minor::LSQ::LSQRequest::reportData
void reportData(std::ostream &os) const
MinorTrace report interface.
Definition: lsq.cc:183
Minor::LSQ::numAccessesInDTLB
unsigned int numAccessesInDTLB
Number of requests in the DTLB in the requests queue.
Definition: lsq.hh:598
Minor::LSQ::SplitDataRequest::retireResponse
void retireResponse(PacketPtr packet_)
For loads, paste the response data into the main response packet.
Definition: lsq.cc:627
Minor::LSQ::numAccessesInMemorySystem
unsigned int numAccessesInMemorySystem
Count of the number of mem.
Definition: lsq.hh:595
BaseTLB::Mode
Mode
Definition: tlb.hh:57
Minor::LSQ::FailedDataRequest::FailedDataRequest
FailedDataRequest(LSQ &port_, MinorDynInstPtr inst_)
Definition: lsq.hh:318
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:1691
cpu.hh
Minor::LSQ::LSQRequest::completeDisabledMemAccess
void completeDisabledMemAccess()
Definition: lsq.cc:94
Minor::LSQ::LSQRequest::makePacket
void makePacket()
Make a packet to use with the memory transaction.
Definition: lsq.cc:1724
Minor::LSQ::FullAddrRangeCoverage
@ FullAddrRangeCoverage
Definition: lsq.hh:82
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:681
PacketDataPtr
uint8_t * PacketDataPtr
Definition: packet.hh:67
Minor::LSQ::LSQRequest::isLoad
bool isLoad
Load/store indication used for building packet.
Definition: lsq.hh:131
Minor::LSQ::SplitDataRequest::numIssuedFragments
unsigned int numIssuedFragments
Number of fragments already issued (<= numFragments)
Definition: lsq.hh:400
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:1586
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:1478
Minor::LSQ::cpu
MinorCPU & cpu
My owner(s)
Definition: lsq.hh:63
RequestPtr
std::shared_ptr< Request > RequestPtr
Definition: request.hh:82
std::vector< RequestPtr >
Minor::LSQ::LSQRequest::markDelayed
void markDelayed()
BaseTLB::Translation interface.
Definition: lsq.hh:187
Minor::LSQ::SplitDataRequest::numFragments
unsigned int numFragments
Number of fragments this request is split into.
Definition: lsq.hh:388
Minor::Queue::unreservedRemainingSpace
unsigned int unreservedRemainingSpace() const
Like remainingSpace but does not count reserved spaces.
Definition: buffers.hh:486
Minor::LSQ::LSQRequest::stepToNextPacket
virtual void stepToNextPacket()=0
Step to the next packet for the next call to getHeadPacket.
Minor::LSQ::StoreBuffer::storeLimitPerCycle
const unsigned int storeLimitPerCycle
Maximum number of stores that can be issued per cycle.
Definition: lsq.hh:473
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...
Minor::LSQ::cacheBlockMask
Addr cacheBlockMask
Address Mask for a cache block (e.g.
Definition: lsq.hh:614
Minor::ReportTraitsPtrAdaptor
A similar adaptor but for elements held by pointer ElemType should implement ReportIF.
Definition: buffers.hh:101
Minor::LSQ::SingleDataRequest::startAddrTranslation
void startAddrTranslation()
Send single translation request.
Definition: lsq.cc:298
Minor
Definition: activity.cc:44
Minor::LSQ::SpecialDataRequest::hasPacketsInMemSystem
bool hasPacketsInMemSystem()
Never sends any requests.
Definition: lsq.hh:299
EventFunctionWrapper
Definition: eventq.hh:1101
Minor::LSQ::LSQRequest::isTranslationDelayed
bool isTranslationDelayed
Address translation is delayed due to table walk.
Definition: lsq.hh:159
Minor::LSQ::SplitDataRequest::~SplitDataRequest
~SplitDataRequest()
Definition: lsq.cc:407
Minor::LSQ::execute
Execute & execute
Definition: lsq.hh:64
Minor::LSQ::SplitDataRequest::numInTranslationFragments
unsigned int numInTranslationFragments
Number of fragments in the address translation mechanism.
Definition: lsq.hh:391
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:661
Minor::LSQ::LSQRequest::data
PacketDataPtr data
Dynamically allocated and populated data carried for building write packets.
Definition: lsq.hh:135
Minor::LSQ::SplitDataRequest::numRetiredFragments
unsigned int numRetiredFragments
Number of fragments retired back to this request.
Definition: lsq.hh:403
Minor::LSQ::completeMemBarrierInst
void completeMemBarrierInst(MinorDynInstPtr inst, bool committed)
Complete a barrier instruction.
Definition: lsq.cc:916
Minor::LSQ::LSQRequest::packet
PacketPtr packet
Definition: lsq.hh:141
Minor::LSQ::SplitDataRequest::sentAllPackets
bool sentAllPackets()
Have we stepped past the end of fragmentPackets?
Definition: lsq.hh:449
Minor::LSQ::StoreBuffer::insert
void insert(LSQRequestPtr request)
Insert a request at the back of the queue.
Definition: lsq.cc:744
Minor::LSQ::MemoryRunning
@ MemoryRunning
Definition: lsq.hh:70
Minor::LSQ::DcachePort::recvTimingResp
bool recvTimingResp(PacketPtr pkt) override
Receive a timing response from the peer.
Definition: lsq.hh:99
Minor::LSQ::LSQRequest::sentAllPackets
virtual bool sentAllPackets()=0
Have all packets been sent?
Minor::LSQ::SplitDataRequest::startAddrTranslation
void startAddrTranslation()
Start a loop of do { sendNextFragmentToTranslation ; translateTiming ; finish } while (numTranslatedF...
Definition: lsq.cc:586
ThreadContext
ThreadContext is the external interface to all thread state for anything outside of the CPU.
Definition: thread_context.hh:88
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:807
Minor::LSQ::StoreBuffer::lsq
LSQ & lsq
My owner.
Definition: lsq.hh:467
Minor::LSQ::SingleDataRequest::finish
void finish(const Fault &fault_, const RequestPtr &request_, ThreadContext *tc, BaseTLB::Mode mode)
TLB interace.
Definition: lsq.cc:268
Minor::LSQ::LSQRequest::Translated
@ Translated
Definition: lsq.hh:165
Packet::SenderState
A virtual base opaque structure used to hold state associated with the packet (e.g....
Definition: packet.hh:431
Minor::LSQ::SpecialDataRequest::SpecialDataRequest
SpecialDataRequest(LSQ &port_, MinorDynInstPtr inst_)
Definition: lsq.hh:306
MinorCPU
MinorCPU is an in-order CPU model with four fixed pipeline stages:
Definition: cpu.hh:77
Minor::LSQ::threadSnoop
void threadSnoop(LSQRequestPtr request)
Snoop other threads monitors on memory system accesses.
Definition: lsq.cc:1777
Minor::LSQ::SplitDataRequest::getHeadPacket
PacketPtr getHeadPacket()
Get the head packet as counted by numIssuedFragments.
Definition: lsq.cc:611
Minor::LSQ::LSQRequest::NotIssued
@ NotIssued
Definition: lsq.hh:163
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:417
Minor::Queue
Wrapper for a queue type to act as a pipeline stage input queue.
Definition: buffers.hh:397
Minor::LSQ::StoreBuffer::isDrained
bool isDrained() const
Drained if there is absolutely nothing left in the buffer.
Definition: lsq.hh:520
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:536
Minor::LSQ::SingleDataRequest::getHeadPacket
PacketPtr getHeadPacket()
Get the head packet as counted by numIssuedFragments.
Definition: lsq.hh:356
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:161
Fault
std::shared_ptr< FaultBase > Fault
Definition: types.hh:240
MinorCPU::MinorCPUPort::MinorCPUPort
MinorCPUPort(const std::string &name_, MinorCPU &cpu_)
Definition: cpu.hh:105
Minor::LSQ::PartialAddrRangeCoverage
@ PartialAddrRangeCoverage
Definition: lsq.hh:81
Minor::LSQ::StoreBuffer::numSlots
const unsigned int numSlots
Number of slots, this is a bound on the size of slots.
Definition: lsq.hh:470
Minor::LSQ::recvTimingSnoopReq
void recvTimingSnoopReq(PacketPtr pkt)
Definition: lsq.cc:1757
Minor::LSQ::minorTrace
void minorTrace() const
Definition: lsq.cc:1668
Minor::LSQ::canPushIntoStoreBuffer
bool canPushIntoStoreBuffer() const
Must check this before trying to insert into the store buffer.
Definition: lsq.hh:673
Minor::LSQ::DcachePort::DcachePort
DcachePort(std::string name, LSQ &lsq_, MinorCPU &cpu)
Definition: lsq.hh:94
Minor::LSQ::NoAddrRangeCoverage
@ NoAddrRangeCoverage
Definition: lsq.hh:83
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:512
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:1566
ArmISA::mode
Bitfield< 4, 0 > mode
Definition: miscregs_types.hh:70
Minor::LSQ::SpecialDataRequest::sentAllPackets
bool sentAllPackets()
Has no packets to send.
Definition: lsq.hh:296
Minor::LSQ::SplitDataRequest
Definition: lsq.hh:381
Minor::LSQ::dcachePort
DcachePort dcachePort
Definition: lsq.hh:112
MinorCPU::MinorCPUPort
Provide a non-protected base class for Minor's Ports as derived classes are created by Fetch1 and Exe...
Definition: cpu.hh:98
BaseTLB::Translation
Definition: tlb.hh:59
Minor::LSQ::LSQRequest::disableMemAccess
void disableMemAccess()
Definition: lsq.cc:111
Minor::LSQ::BarrierDataRequest::isBarrier
bool isBarrier()
Is this a request a barrier?
Definition: lsq.hh:328
Minor::LSQ::SplitDataRequest::stepToNextPacket
void stepToNextPacket()
Step on numIssuedFragments.
Definition: lsq.cc:619
Minor::LSQ::StoreBuffer::minorTrace
void minorTrace() const
Report queue contents for MinorTrace.
Definition: lsq.cc:933
Minor::LSQ::LSQRequest::StoreInStoreBuffer
@ StoreInStoreBuffer
Definition: lsq.hh:172
Minor::LSQ::LSQRequest::Complete
@ Complete
Definition: lsq.hh:180
Minor::LSQ::StoreBuffer::numUnissuedAccesses
unsigned int numUnissuedAccesses
Number of occupied slots which have not yet issued a memory access.
Definition: lsq.hh:481
Minor::LSQ::SingleDataRequest::stepToNextPacket
void stepToNextPacket()
Remember that the packet has been sent.
Definition: lsq.hh:359
Minor::LSQ::LSQRequest::skipped
bool skipped
Was skipped.
Definition: lsq.hh:152
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:1177
Minor::LSQ::DcachePort::lsq
LSQ & lsq
My owner.
Definition: lsq.hh:91
InstSeqNum
uint64_t InstSeqNum
Definition: inst_seq.hh:37
Minor::LSQ::StoreBuffer::canInsert
bool canInsert() const
Can a new request be inserted into the queue?
Definition: lsq.cc:723
Minor::LSQ::moveFromRequestsToTransfers
void moveFromRequestsToTransfers(LSQRequestPtr request)
Move a request between queues.
Definition: lsq.cc:1275
Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:142
Minor::LSQ::LSQRequest::InTranslation
@ InTranslation
Definition: lsq.hh:164
Port::name
const std::string name() const
Return port name (for DPRINTF).
Definition: port.hh:106
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:118
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:1405
Minor::LSQ::SplitDataRequest::sendNextFragmentToTranslation
void sendNextFragmentToTranslation()
Part of the address translation loop, see startAddTranslation.
Definition: lsq.cc:704
Minor::LSQ::storeBuffer
StoreBuffer storeBuffer
Definition: lsq.hh:586
Minor::LSQ::LSQRequest::request
RequestPtr request
The underlying request of this LSQRequest.
Definition: lsq.hh:144
Minor::LSQ::StoreBuffer::countIssuedStore
void countIssuedStore(LSQRequestPtr request)
Count a store being issued to memory by decrementing numUnissuedAccesses.
Definition: lsq.cc:837
Minor::LSQ::SpecialDataRequest
Special request types that don't actually issue memory requests.
Definition: lsq.hh:276
Minor::LSQ::LSQRequest::StoreBufferIssuing
@ StoreBufferIssuing
Definition: lsq.hh:174
Minor::LSQ::StoreBuffer
Store buffer.
Definition: lsq.hh:463
Minor::LSQ::LSQRequest::tryToSuppressFault
void tryToSuppressFault()
Instructions may want to suppress translation faults (e.g.
Definition: lsq.cc:75
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:156
Minor::LSQ::SpecialDataRequest::stepToNextPacket
void stepToNextPacket()
Step on numIssuedFragments.
Definition: lsq.hh:293
Minor::LSQ::LSQRequest::getHeadPacket
virtual PacketPtr getHeadPacket()=0
Get the next packet to issue for this request.
Minor::LSQ::DcachePort::recvTimingSnoopReq
void recvTimingSnoopReq(PacketPtr pkt) override
Receive a timing snoop request from the peer.
Definition: lsq.hh:106
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:611
Named
Definition: trace.hh:147
Minor::LSQ::StoreBuffer::canForwardDataToLoad
AddrRangeCoverage canForwardDataToLoad(LSQRequestPtr request, unsigned int &found_slot)
Look for a store which satisfies the given load.
Definition: lsq.cc:766
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:102
Minor::LSQ::numStoresInTransfers
unsigned int numStoresInTransfers
The number of stores in the transfers queue.
Definition: lsq.hh:602
Minor::LSQ::LSQRequest::isComplete
bool isComplete() const
Has this request been completed.
Definition: lsq.cc:175
Minor::LSQ::FailedDataRequest
FailedDataRequest represents requests from instructions that failed their predicates but need to ride...
Definition: lsq.hh:315
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:1712
Minor::LSQ::SingleDataRequest::SingleDataRequest
SingleDataRequest(LSQ &port_, MinorDynInstPtr inst_, bool isLoad_, PacketDataPtr data_=NULL, uint64_t *res_=NULL)
Definition: lsq.hh:373
Minor::LSQ::StoreBuffer::slots
std::deque< LSQRequestPtr > slots
Queue of store requests on their way to memory.
Definition: lsq.hh:477
Minor::LSQ::SingleDataRequest::sentAllPackets
bool sentAllPackets()
packetInFlight can become false again, so need to check packetSent
Definition: lsq.hh:366
Minor::LSQ::LSQRequest::inst
MinorDynInstPtr inst
Instruction which made this request.
Definition: lsq.hh:127
Minor::LSQ::LSQRequest::retireResponse
virtual void retireResponse(PacketPtr packet_)=0
Retire a response packet into the LSQRequest packet possibly completing this transfer.
Minor::LSQ::sendStoreToStoreBuffer
void sendStoreToStoreBuffer(LSQRequestPtr request)
A store has been committed, please move it to the store buffer.
Definition: lsq.cc:1546
Minor::LSQ::StoreBuffer::step
void step()
Try to issue more stores to memory.
Definition: lsq.cc:846
Packet
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Definition: packet.hh:257
Minor::LSQ::LSQRequest::setSkipped
void setSkipped()
Set this request as having been skipped before a memory transfer was attempt.
Definition: lsq.hh:211
std::deque< LSQRequestPtr >
Minor::LSQ::SingleDataRequest::packetSent
bool packetSent
Has the packet been at least sent to the memory system?
Definition: lsq.hh:349
Minor::LSQ::SingleDataRequest
SingleDataRequest is used for requests that don't fragment.
Definition: lsq.hh:337
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:445
addr
ip6_addr_t addr
Definition: inet.hh:423
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:533
Minor::LSQ::getLastMemBarrier
InstSeqNum getLastMemBarrier(ThreadID thread_id) const
Get the execSeqNum of the last issued memory barrier.
Definition: lsq.hh:690
Minor::LSQ::SpecialDataRequest::startAddrTranslation
void startAddrTranslation()
Send single translation request.
Definition: lsq.hh:286
Minor::LSQ::SpecialDataRequest::retireResponse
void retireResponse(PacketPtr packet_)
Keep the given packet as the response packet LSQRequest::packet.
Definition: lsq.hh:303
Minor::LSQ::BarrierDataRequest
Request for doing barrier accounting in the store buffer.
Definition: lsq.hh:325
Minor::LSQ::AddrRangeCoverage
AddrRangeCoverage
Coverage of one address range with another.
Definition: lsq.hh:79
Minor::LSQ::canSendToMemorySystem
bool canSendToMemorySystem()
Can a request be sent to the memory system.
Definition: lsq.cc:1292
Minor::LSQ::~LSQ
virtual ~LSQ()
Definition: lsq.cc:1460
Minor::LSQ::LSQRequest::setState
void setState(LSQRequestState new_state)
Set state and output trace output.
Definition: lsq.cc:167
Minor::NoBubbleTraits
...
Definition: buffers.hh:115
buffers.hh
Minor::LSQ::DcachePort::recvFunctionalSnoop
void recvFunctionalSnoop(PacketPtr pkt) override
Receive a functional snoop request packet from the peer.
Definition: lsq.hh:109
Minor::LSQ::LSQRequestPtr
LSQRequest * LSQRequestPtr
Definition: lsq.hh:266
Minor::LSQ::LSQRequest::startAddrTranslation
virtual void startAddrTranslation()=0
Start the address translation process for this request.
RefCountingPtr< MinorDynInst >
Minor::LSQ
Definition: lsq.hh:59
Minor::LSQ::StoreBuffer::deleteRequest
void deleteRequest(LSQRequestPtr request)
Delete the given request and free the slot it occupied.
Definition: lsq.cc:730
Minor::LSQ::LSQRequest::~LSQRequest
virtual ~LSQRequest()
Definition: lsq.cc:1463
Minor::LSQ::LSQRequest::isBarrier
virtual bool isBarrier()
Is this a request a barrier?
Definition: lsq.cc:155
trace.hh
Minor::LSQ::MemoryState
MemoryState
State of memory access for head access.
Definition: lsq.hh:68
Minor::LSQ::isDrained
bool isDrained()
Is there nothing left in the LSQ.
Definition: lsq.cc:1559
Minor::LSQ::state
MemoryState state
Retry state of last issued memory transfer.
Definition: lsq.hh:537
Minor::LSQ::LSQRequest::StoreToStoreBuffer
@ StoreToStoreBuffer
Definition: lsq.hh:169
Minor::LSQ::LSQRequest::port
LSQ & port
Owning port.
Definition: lsq.hh:124
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:552
Minor::LSQ::SpecialDataRequest::getHeadPacket
PacketPtr getHeadPacket()
Get the head packet as counted by numIssuedFragments.
Definition: lsq.hh:289
Minor::LSQ::SingleDataRequest::hasPacketsInMemSystem
bool hasPacketsInMemSystem()
Has packet been sent.
Definition: lsq.hh:362
Minor::LSQ::LSQRequest::state
LSQRequestState state
Definition: lsq.hh:183
Minor::Execute
Execute stage.
Definition: execute.hh:60
Minor::LSQ::clearMemBarrier
void clearMemBarrier(MinorDynInstPtr inst)
Clear a barrier (if it's the last one marked up in lastMemBarrier)
Definition: lsq.cc:255
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:1489
Minor::LSQ::inMemorySystemLimit
const unsigned int inMemorySystemLimit
Maximum number of in-flight accesses issued to the memory system.
Definition: lsq.hh:540
Minor::LSQ::LSQRequest
Derived SenderState to carry data access info.
Definition: lsq.hh:118
Minor::LSQ::lineWidth
const unsigned int lineWidth
Memory system access width (and snap) in bytes.
Definition: lsq.hh:543
Minor::LSQ::DcachePort::isSnooping
bool isSnooping() const override
Determine if this request port is snooping or not.
Definition: lsq.hh:104
Minor::LSQ::SplitDataRequest::translationEvent
EventFunctionWrapper translationEvent
Event to step between translations.
Definition: lsq.hh:385
Minor::LSQ::recvTimingResp
bool recvTimingResp(PacketPtr pkt)
Memory interface.
Definition: lsq.cc:1299
Minor::LSQ::StoreBuffer::StoreBuffer
StoreBuffer(std::string name_, LSQ &lsq_, unsigned int store_buffer_size, unsigned int store_limit_per_cycle)
Definition: lsq.cc:1679
Minor::LSQ::SplitDataRequest::fragmentPackets
std::vector< Packet * > fragmentPackets
Packets matching fragmentRequests to issue fragments to memory.
Definition: lsq.hh:410

Generated on Wed Sep 30 2020 14:02:08 for gem5 by doxygen 1.8.17