gem5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
lsq.hh
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013-2014 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  * Authors: Andrew Bardsley
38  */
39 
47 #ifndef __CPU_MINOR_NEW_LSQ_HH__
48 #define __CPU_MINOR_NEW_LSQ_HH__
49 
50 #include "cpu/minor/buffers.hh"
51 #include "cpu/minor/cpu.hh"
52 #include "cpu/minor/pipe_data.hh"
53 #include "cpu/minor/trace.hh"
54 
55 namespace Minor
56 {
57 
58 /* Forward declaration */
59 class Execute;
60 
61 class LSQ : public Named
62 {
63  protected:
67 
68  protected:
71  {
72  MemoryRunning, /* Default. Step dcache queues when possible. */
73  MemoryNeedsRetry /* Request rejected, will be asked to retry */
74  };
75 
77  friend std::ostream &operator <<(std::ostream &os,
79 
82  {
83  PartialAddrRangeCoverage, /* Two ranges partly overlap */
84  FullAddrRangeCoverage, /* One range fully covers another */
85  NoAddrRangeCoverage /* Two ranges are disjoint */
86  };
87 
90  {
91  protected:
93  LSQ &lsq;
94 
95  public:
96  DcachePort(std::string name, LSQ &lsq_, MinorCPU &cpu) :
97  MinorCPU::MinorCPUPort(name, cpu), lsq(lsq_)
98  { }
99 
100  protected:
101  bool recvTimingResp(PacketPtr pkt) override
102  { return lsq.recvTimingResp(pkt); }
103 
104  void recvReqRetry() override { lsq.recvReqRetry(); }
105 
106  bool isSnooping() const override { return true; }
107 
108  void recvTimingSnoopReq(PacketPtr pkt) override
109  { return lsq.recvTimingSnoopReq(pkt); }
110 
111  void recvFunctionalSnoop(PacketPtr pkt) override { }
112  };
113 
115 
116  public:
120  class LSQRequest :
121  public BaseTLB::Translation, /* For TLB lookups */
122  public Packet::SenderState /* For packing into a Packet */
123  {
124  public:
127 
130 
133  bool isLoad;
134 
138 
139  /* Requests carry packets on their way to the memory system.
140  * When a Packet returns from the memory system, its
141  * request needs to have its packet updated as this
142  * may have changed in flight */
144 
147 
150 
152  uint64_t *res;
153 
157  bool skipped;
158 
162 
164  {
165  NotIssued, /* Newly created */
166  InTranslation, /* TLB accessed, no reply yet */
167  Translated, /* Finished address translation */
168  Failed, /* The starting start of FailedDataRequests */
169  RequestIssuing, /* Load/store issued to memory in the requests
170  queue */
171  StoreToStoreBuffer, /* Store in transfers on its way to the
172  store buffer */
173  RequestNeedsRetry, /* Retry needed for load */
174  StoreInStoreBuffer, /* Store in the store buffer, before issuing
175  a memory transfer */
176  StoreBufferIssuing, /* Store in store buffer and has been
177  issued */
178  StoreBufferNeedsRetry, /* Retry needed for store */
179  /* All completed states. Includes
180  completed loads, TLB faults and skipped requests whose
181  seqNum's no longer match */
183  };
184 
186 
187  protected:
189  void markDelayed() { }
190 
191  public:
192  LSQRequest(LSQ &port_, MinorDynInstPtr inst_, bool isLoad_,
193  PacketDataPtr data_ = NULL, uint64_t *res_ = NULL);
194 
195  virtual ~LSQRequest();
196 
197  public:
199  void makePacket();
200 
202  bool skippedMemAccess() { return skipped; }
203 
206  void setSkipped() { skipped = true; }
207 
211  Addr req1_addr, unsigned int req1_size,
212  Addr req2_addr, unsigned int req2_size);
213 
217 
220  virtual void startAddrTranslation() = 0;
221 
226  virtual PacketPtr getHeadPacket() = 0;
227 
229  virtual void stepToNextPacket() = 0;
230 
232  virtual bool sentAllPackets() = 0;
233 
236  virtual bool hasPacketsInMemSystem() = 0;
237 
240  virtual void retireResponse(PacketPtr packet_) = 0;
241 
243  virtual bool isBarrier();
244 
248 
250  void setState(LSQRequestState new_state);
251 
255  bool isComplete() const;
256 
258  void reportData(std::ostream &os) const;
259  };
260 
262 
263  friend std::ostream & operator <<(std::ostream &os,
265 
266  friend std::ostream & operator <<(std::ostream &os,
268 
269  protected:
272  {
273  protected:
275  void finish(const Fault &fault_, RequestPtr request_,
277  { }
278 
279  public:
282 
285  { fatal("No packets in a SpecialDataRequest"); }
286 
288  void stepToNextPacket() { }
289 
291  bool sentAllPackets() { return true; }
292 
294  bool hasPacketsInMemSystem() { return false; }
295 
298  void retireResponse(PacketPtr packet_) { }
299 
300  public:
302  /* Say this is a load, not actually relevant */
303  LSQRequest(port_, inst_, true, NULL, 0)
304  { }
305  };
306 
311  {
312  public:
314  SpecialDataRequest(port_, inst_)
315  { state = Failed; }
316  };
317 
321  {
322  public:
323  bool isBarrier() { return true; }
324 
325  public:
327  SpecialDataRequest(port_, inst_)
328  { state = Complete; }
329  };
330 
333  {
334  protected:
336  void finish(const Fault &fault_, RequestPtr request_,
338 
342 
345 
346  public:
348  void startAddrTranslation();
349 
352 
354  void stepToNextPacket() { packetInFlight = true; packetSent = true; }
355 
358 
361  bool sentAllPackets() { return packetSent; }
362 
365  void retireResponse(PacketPtr packet_);
366 
367  public:
369  bool isLoad_, PacketDataPtr data_ = NULL, uint64_t *res_ = NULL) :
370  LSQRequest(port_, inst_, isLoad_, data_, res_),
371  packetInFlight(false),
372  packetSent(false)
373  { }
374  };
375 
377  {
378  protected:
380  class TranslationEvent : public Event
381  {
382  protected:
384 
385  public:
387  : owner(owner_) { }
388 
389  void process()
391  };
392 
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_, 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 
458 
461  void retireResponse(PacketPtr packet_);
462 
465  };
466 
470  class StoreBuffer : public Named
471  {
472  public:
475 
477  const unsigned int numSlots;
478 
480  const unsigned int storeLimitPerCycle;
481 
482  public:
485 
488  unsigned int numUnissuedAccesses;
489 
490  public:
491  StoreBuffer(std::string name_, LSQ &lsq_,
492  unsigned int store_buffer_size,
493  unsigned int store_limit_per_cycle);
494 
495  public:
497  bool canInsert() const;
498 
500  void deleteRequest(LSQRequestPtr request);
501 
503  void insert(LSQRequestPtr request);
504 
511  unsigned int &found_slot);
512 
515  void forwardStoreData(LSQRequestPtr load, unsigned int slot_number);
516 
519  unsigned int numUnissuedStores() { return numUnissuedAccesses; }
520 
524  void countIssuedStore(LSQRequestPtr request);
525 
527  bool isDrained() const { return slots.empty(); }
528 
530  void step();
531 
533  void minorTrace() const;
534  };
535 
536  protected:
541 
542  public:
545 
547  const unsigned int inMemorySystemLimit;
548 
550  const unsigned int lineWidth;
551 
552  public:
556  typedef Queue<LSQRequestPtr,
560 
574 
583 
584  /* The store buffer contains committed cacheable stores on
585  * their way to memory decoupled from subsequence instruction execution.
586  * Before trying to issue a cacheable read from 'requests' to memory,
587  * the store buffer is checked to see if a previous store contains the
588  * needed data (StoreBuffer::canForwardDataToLoad) which can be
589  * forwarded in lieu of a memory access. If there are outstanding
590  * stores in the transfers queue, they must be promoted to the store
591  * buffer (and so be commited) before they can be correctly checked
592  * for forwarding. */
594 
595  protected:
603 
605  unsigned int numAccessesInDTLB;
606 
609  unsigned int numStoresInTransfers;
610 
615 
619 
622 
623  protected:
627  void tryToSendToTransfers(LSQRequestPtr request);
628 
632  bool tryToSend(LSQRequestPtr request);
633 
635  void clearMemBarrier(MinorDynInstPtr inst);
636 
639 
641  bool canSendToMemorySystem();
642 
644  void threadSnoop(LSQRequestPtr request);
645 
646  public:
647  LSQ(std::string name_, std::string dcache_port_name_,
648  MinorCPU &cpu_, Execute &execute_,
649  unsigned int max_accesses_in_memory_system, unsigned int line_width,
650  unsigned int requests_queue_size, unsigned int transfers_queue_size,
651  unsigned int store_buffer_size,
652  unsigned int store_buffer_cycle_store_limit);
653 
654  virtual ~LSQ();
655 
656  public:
664  void step();
665 
668  bool canRequest() { return requests.unreservedRemainingSpace() != 0; }
669 
675 
677  void popResponse(LSQRequestPtr response);
678 
680  bool canPushIntoStoreBuffer() const { return storeBuffer.canInsert(); }
681 
684 
688  bool accessesInFlight() const
689  { return numAccessesIssuedToMemory != 0; }
690 
695 
698  { return lastMemBarrier[thread_id]; }
699 
701  bool isDrained();
702 
705  bool needsToTick();
706 
710  bool committed);
711 
714  void pushRequest(MinorDynInstPtr inst, bool isLoad, uint8_t *data,
715  unsigned int size, Addr addr, Request::Flags flags,
716  uint64_t *res);
717 
721 
723  bool recvTimingResp(PacketPtr pkt);
724  void recvReqRetry();
725  void recvTimingSnoopReq(PacketPtr pkt);
726 
729 
730  void minorTrace() const;
731 };
732 
736 PacketPtr makePacketForRequest(Request &request, bool isLoad,
737  Packet::SenderState *sender_state = NULL, PacketDataPtr data = NULL);
738 }
739 
740 #endif /* __CPU_MINOR_NEW_LSQ_HH__ */
MemoryState
State of memory access for head access.
Definition: lsq.hh:70
SpecialDataRequest(LSQ &port_, MinorDynInstPtr inst_)
Definition: lsq.hh:301
DcachePort dcachePort
Definition: lsq.hh:114
void makeFragmentPackets()
Make the packets to go with the requests so they can be sent to the memory system.
Definition: lsq.cc:445
MinorCPU & cpu
The enclosing cpu.
Definition: cpu.hh:104
virtual bool sentAllPackets()=0
Have all packets been sent?
void setState(LSQRequestState new_state)
Set state and output trace output.
Definition: lsq.cc:130
MinorDynInstPtr inst
Instruction which made this request.
Definition: lsq.hh:129
void stepToNextPacket()
Remember that the packet has been sent.
Definition: lsq.hh:354
SingleDataRequest is used for requests that don't fragment.
Definition: lsq.hh:332
const unsigned int numSlots
Number of slots, this is a bound on the size of slots.
Definition: lsq.hh:477
unsigned int numAccessesIssuedToMemory
The number of accesses which have been issued to the memory system but have not been committed/discar...
Definition: lsq.hh:614
Execute stage.
Definition: execute.hh:62
LSQQueue transfers
Once issued to memory (or, for stores, just had their state changed to StoreToStoreBuffer) LSQRequest...
Definition: lsq.hh:582
Top level definition of the Minor in-order CPU model.
PacketDataPtr data
Dynamically allocated and populated data carried for building write packets.
Definition: lsq.hh:137
Contains class definitions for data flowing between pipeline stages in the top-level structure portio...
void makeFragmentRequests()
Make all the Requests for this transfer's fragments so that those requests can be sent for address tr...
Definition: lsq.cc:353
StoreBuffer(std::string name_, LSQ &lsq_, unsigned int store_buffer_size, unsigned int store_limit_per_cycle)
Definition: lsq.cc:1543
TranslationEvent(SplitDataRequest &owner_)
Definition: lsq.hh:386
LSQQueue requests
requests contains LSQRequests which have been issued to the TLB by calling ExecContext::readMem/write...
Definition: lsq.hh:573
friend std::ostream & operator<<(std::ostream &os, MemoryState state)
Print MemoryState values as shown in the enum definition.
Definition: lsq.cc:1605
void finish(const Fault &fault_, RequestPtr request_, ThreadContext *tc, BaseTLB::Mode mode)
TLB interace.
Definition: lsq.cc:231
std::vector< Packet * > fragmentPackets
Packets matching fragmentRequests to issue fragments to memory.
Definition: lsq.hh:418
void step()
Try to issue more stores to memory.
Definition: lsq.cc:745
TranslationEvent translationEvent
Definition: lsq.hh:393
const std::string name() const
Return port name (for DPRINTF).
Definition: port.hh:99
unsigned int numIssuedFragments
Number of fragments already issued (<= numFragments)
Definition: lsq.hh:408
void popResponse(LSQRequestPtr response)
Sanity check and pop the head response.
Definition: lsq.cc:1412
void issuedMemBarrierInst(MinorDynInstPtr inst)
A memory barrier instruction has been issued, remember its execSeqNum that we can avoid issuing memor...
Definition: lsq.cc:1573
unsigned int numUnissuedAccesses
Number of occupied slots which have not yet issued a memory access.
Definition: lsq.hh:488
void makePacket()
Make a packet to use with the memory transaction.
Definition: lsq.cc:1585
void finish(const Fault &fault_, RequestPtr request_, ThreadContext *tc, BaseTLB::Mode mode)
TLB response interface.
Definition: lsq.cc:278
void pushFailedRequest(MinorDynInstPtr inst)
Push a predicate failed-representing request into the queues just to maintain commit order...
Definition: lsq.cc:1525
std::deque< LSQRequestPtr > slots
Queue of store requests on their way to memory.
Definition: lsq.hh:484
unsigned int numStoresInTransfers
The number of stores in the transfers queue.
Definition: lsq.hh:609
uint8_t * PacketDataPtr
Definition: packet.hh:70
Fault fault
Fault generated performing this request.
Definition: lsq.hh:149
const unsigned int storeLimitPerCycle
Maximum number of stores that can be issued per cycle.
Definition: lsq.hh:480
ip6_addr_t addr
Definition: inet.hh:335
PacketPtr makePacketForRequest(Request &request, bool isLoad, Packet::SenderState *sender_state, PacketDataPtr data)
Make a suitable packet for the given request.
Definition: lsq.cc:1555
void stepToNextPacket()
Step on numIssuedFragments.
Definition: lsq.hh:288
virtual bool isBarrier()
Is this a request a barrier?
Definition: lsq.cc:118
SingleDataRequest(LSQ &port_, MinorDynInstPtr inst_, bool isLoad_, PacketDataPtr data_=NULL, uint64_t *res_=NULL)
Definition: lsq.hh:368
void minorTrace() const
Report queue contents for MinorTrace.
Definition: lsq.cc:832
Exposable data port.
Definition: lsq.hh:89
Special request types that don't actually issue memory requests.
Definition: lsq.hh:271
PacketPtr getHeadPacket()
Get the head packet as counted by numIssuedFragments.
Definition: lsq.cc:514
void retireResponse(PacketPtr packet_)
For loads, paste the response data into the main response packet.
Definition: lsq.cc:530
bool accessesInFlight() const
Are there any accesses other than normal cached loads in the memory system or having received respons...
Definition: lsq.hh:688
void retireResponse(PacketPtr packet_)
Keep the given packet as the response packet LSQRequest::packet.
Definition: lsq.hh:298
unsigned int numFragments
Number of fragments this request is split into.
Definition: lsq.hh:396
void finish(const Fault &fault_, RequestPtr request_, ThreadContext *tc, BaseTLB::Mode mode)
TLB interace.
Definition: lsq.hh:275
MinorCPUPort(const std::string &name_, MinorCPU &cpu_)
Definition: cpu.hh:107
void startAddrTranslation()
Send single translation request.
Definition: lsq.hh:281
Bitfield< 4, 0 > mode
Definition: miscregs.hh:1385
unsigned int numAccessesInMemorySystem
Count of the number of mem.
Definition: lsq.hh:602
unsigned int unreservedRemainingSpace() const
Like remainingSpace but does not count reserved spaces.
Definition: buffers.hh:484
void reportData(std::ostream &os) const
MinorTrace report interface.
Definition: lsq.cc:146
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:1377
void sendNextFragmentToTranslation()
Part of the address translation loop, see startAddTranslation.
Definition: lsq.cc:607
BarrierDataRequest(LSQ &port_, MinorDynInstPtr inst_)
Definition: lsq.hh:326
Wrapper for a queue type to act as a pipeline stage input queue.
Definition: buffers.hh:393
bool isBarrier()
Is this a request a barrier?
Definition: lsq.hh:323
ThreadContext is the external interface to all thread state for anything outside of the CPU...
This file contains miscellaneous classes and functions for formatting general trace information and a...
FailedDataRequest(LSQ &port_, MinorDynInstPtr inst_)
Definition: lsq.hh:313
Bitfield< 17 > os
Definition: misc.hh:804
bool sentAllPackets()
packetInFlight can become false again, so need to check packetSent
Definition: lsq.hh:361
Derived SenderState to carry data access info.
Definition: lsq.hh:120
LSQRequestState state
Definition: lsq.hh:185
bool canInsert() const
Can a new request be inserted into the queue?
Definition: lsq.cc:626
bool isSnooping() const override
Determine if this master port is snooping or not.
Definition: lsq.hh:106
const char data[]
Definition: circlebuf.cc:43
Provide a non-protected base class for Minor's Ports as derived classes are created by Fetch1 and Exe...
Definition: cpu.hh:100
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:89
std::vector< InstSeqNum > lastMemBarrier
Most recent execSeqNum of a memory barrier instruction or 0 if there are no in-flight barriers...
Definition: lsq.hh:540
Definition: trace.hh:140
std::vector< Request * > fragmentRequests
Fragment Requests corresponding to the address ranges of each fragment.
Definition: lsq.hh:415
void pushRequest(MinorDynInstPtr inst, bool isLoad, uint8_t *data, unsigned int size, Addr addr, Request::Flags flags, uint64_t *res)
Single interface for readMem/writeMem to issue requests into the LSQ.
Definition: lsq.cc:1474
bool canRequest()
Is their space in the request queue to be able to push a request by issuing an isMemRef instruction...
Definition: lsq.hh:668
Request for doing barrier accounting in the store buffer.
Definition: lsq.hh:320
void completeMemBarrierInst(MinorDynInstPtr inst, bool committed)
Complete a barrier instruction.
Definition: lsq.cc:815
Request request
The underlying request of this LSQRequest.
Definition: lsq.hh:146
A similar adaptor but for elements held by pointer ElemType should implement ReportIF.
Definition: buffers.hh:103
MemoryState state
Retry state of last issued memory transfer.
Definition: lsq.hh:544
virtual ~LSQRequest()
Definition: lsq.cc:1351
bool skippedMemAccess()
Was no memory access attempted for this request?
Definition: lsq.hh:202
unsigned int numRetiredFragments
Number of fragments retired back to this request.
Definition: lsq.hh:411
PacketPtr getHeadPacket()
Get the head packet as counted by numIssuedFragments.
Definition: lsq.hh:351
StoreBuffer storeBuffer
Definition: lsq.hh:593
void startAddrTranslation()
Start a loop of do { sendNextFragmentToTranslation ; translateTiming ; finish } while (numTranslatedF...
Definition: lsq.cc:493
PacketPtr getHeadPacket()
Get the head packet as counted by numIssuedFragments.
Definition: lsq.hh:284
bool issuedToMemory
This in an access other than a normal cacheable load that's visited the memory system.
Definition: lsq.hh:161
virtual void retireResponse(PacketPtr packet_)=0
Retire a response packet into the LSQRequest packet possibly completing this transfer.
bool tryToSend(LSQRequestPtr request)
Try to send (or resend) a memory request's next/only packet to the memory system. ...
Definition: lsq.cc:1058
bool isLoad
Load/store indication used for building packet.
Definition: lsq.hh:133
bool hasPacketsInMemSystem()
Has packet been sent.
Definition: lsq.hh:357
LSQ & lsq
My owner.
Definition: lsq.hh:93
#define fatal(...)
Definition: misc.hh:163
virtual void stepToNextPacket()=0
Step to the next packet for the next call to getHeadPacket.
MinorCPU::MinorCPUPort & getDcachePort()
Return the raw-bindable port.
Definition: lsq.hh:728
bool canSendToMemorySystem()
Can a request be sent to the memory system.
Definition: lsq.cc:1176
uint64_t InstSeqNum
Definition: inst_seq.hh:40
virtual void startAddrTranslation()=0
Start the address translation process for this request.
bool isDrained() const
Drained if there is absolutely nothing left in the buffer.
Definition: lsq.hh:527
FailedDataRequest represents requests from instructions that failed their predicates but need to ride...
Definition: lsq.hh:310
LSQRequest * LSQRequestPtr
Definition: lsq.hh:261
AddrRangeCoverage canForwardDataToLoad(LSQRequestPtr request, unsigned int &found_slot)
Look for a store which satisfies the given load.
Definition: lsq.cc:669
bool packetSent
Has the packet been at least sent to the memory system?
Definition: lsq.hh:344
unsigned int numInTranslationFragments
Number of fragments in the address translation mechanism.
Definition: lsq.hh:399
Classes for buffer, queue and FIFO behaviour.
bool needsToBeSentToStoreBuffer()
This request, once processed by the requests/transfers queues, will need to go to the store buffer...
Definition: lsq.cc:124
void clearMemBarrier(MinorDynInstPtr inst)
Clear a barrier (if it's the last one marked up in lastMemBarrier)
Definition: lsq.cc:218
InstSeqNum getLastMemBarrier(ThreadID thread_id) const
Get the execSeqNum of the last issued memory barrier.
Definition: lsq.hh:697
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:142
MinorCPU & cpu
My owner(s)
Definition: lsq.hh:65
bool sentAllPackets()
Have we stepped past the end of fragmentPackets?
Definition: lsq.hh:457
bool canPushIntoStoreBuffer() const
Must check this before trying to insert into the store buffer.
Definition: lsq.hh:680
bool isDrained()
Is there nothing left in the LSQ.
Definition: lsq.cc:1447
A Packet is used to encapsulate a transfer between two objects in the memory system (e...
Definition: packet.hh:245
unsigned int numUnissuedStores()
Number of stores in the store buffer which have not been completely issued to the memory system...
Definition: lsq.hh:519
bool recvTimingResp(PacketPtr pkt) override
Receive a timing response from the slave port.
Definition: lsq.hh:101
void tryToSendToTransfers(LSQRequestPtr request)
Try and issue a memory access for a translated request at the head of the requests queue...
Definition: lsq.cc:861
A virtual base opaque structure used to hold state associated with the packet (e.g., an MSHR), specific to a MemObject that sees the packet.
Definition: packet.hh:377
LSQRequest(LSQ &port_, MinorDynInstPtr inst_, bool isLoad_, PacketDataPtr data_=NULL, uint64_t *res_=NULL)
Definition: lsq.cc:72
AddrRangeCoverage
Coverage of one address range with another.
Definition: lsq.hh:81
void recvReqRetry() override
Called by the slave port if sendTimingReq was called on this master port (causing recvTimingReq to be...
Definition: lsq.hh:104
void markDelayed()
BaseTLB::Translation interface.
Definition: lsq.hh:189
void step()
Step checks the queues to see if their are issuable transfers which were not otherwise picked up by t...
Definition: lsq.cc:1366
unsigned int numAccessesInDTLB
Number of requests in the DTLB in the requests queue.
Definition: lsq.hh:605
Mode
Definition: tlb.hh:61
int16_t ThreadID
Thread index/ID type.
Definition: types.hh:171
void sendStoreToStoreBuffer(LSQRequestPtr request)
A store has been committed, please move it to the store buffer.
Definition: lsq.cc:1434
LSQRequestPtr retryRequest
The request (from either requests or the store buffer) which is currently waiting have its memory acc...
Definition: lsq.hh:618
bool recvTimingResp(PacketPtr pkt)
Memory interface.
Definition: lsq.cc:1183
uint64_t * res
Res from pushRequest.
Definition: lsq.hh:152
DcachePort(std::string name, LSQ &lsq_, MinorCPU &cpu)
Definition: lsq.hh:96
int size()
Definition: pagetable.hh:146
virtual ~LSQ()
Definition: lsq.cc:1348
Event to step between translations.
Definition: lsq.hh:380
void insert(LSQRequestPtr request)
Insert a request at the back of the queue.
Definition: lsq.cc:647
bool skipped
Was skipped.
Definition: lsq.hh:157
LSQ & port
Owning port.
Definition: lsq.hh:126
Definition: eventq.hh:185
void minorTrace() const
Definition: lsq.cc:1532
void recvTimingSnoopReq(PacketPtr pkt) override
Receive a timing snoop request from the slave port.
Definition: lsq.hh:108
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
Addr cacheBlockMask
Address Mask for a cache block (e.g.
Definition: lsq.hh:621
PacketPtr packet
Definition: lsq.hh:143
bool hasPacketsInMemSystem()
Never sends any requests.
Definition: lsq.hh:294
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:1293
Store buffer.
Definition: lsq.hh:470
virtual PacketPtr getHeadPacket()=0
Get the next packet to issue for this request.
void recvReqRetry()
Definition: lsq.cc:1246
bool packetInFlight
Has my only packet been sent to the memory system but has not yet been responded to.
Definition: lsq.hh:341
LSQ & lsq
My owner.
Definition: lsq.hh:474
const unsigned int inMemorySystemLimit
Maximum number of in-flight accesses issued to the memory system.
Definition: lsq.hh:547
const unsigned int lineWidth
Memory system access width (and snap) in bytes.
Definition: lsq.hh:550
MinorCPU is an in-order CPU model with four fixed pipeline stages:
Definition: cpu.hh:79
void recvFunctionalSnoop(PacketPtr pkt) override
Receive a functional snoop request packet from the slave port.
Definition: lsq.hh:111
bool isComplete() const
Has this request been completed.
Definition: lsq.cc:138
void threadSnoop(LSQRequestPtr request)
Snoop other threads monitors on memory system accesses.
Definition: lsq.cc:1642
void setSkipped()
Set this request as having been skipped before a memory transfer was attempt.
Definition: lsq.hh:206
void stepToNextPacket()
Step on numIssuedFragments.
Definition: lsq.cc:522
std::shared_ptr< FaultBase > Fault
Definition: types.hh:184
void retireResponse(PacketPtr packet_)
Keep the given packet as the response packet LSQRequest::packet.
Definition: lsq.cc:269
Queue< LSQRequestPtr, ReportTraitsPtrAdaptor< LSQRequestPtr >, NoBubbleTraits< LSQRequestPtr > > LSQQueue
The LSQ consists of three queues: requests, transfers and the store buffer storeBuffer.
Definition: lsq.hh:559
void startAddrTranslation()
Send single translation request.
Definition: lsq.cc:251
void deleteRequest(LSQRequestPtr request)
Delete the given request and free the slot it occupied.
Definition: lsq.cc:633
void recvTimingSnoopReq(PacketPtr pkt)
Definition: lsq.cc:1622
void countIssuedStore(LSQRequestPtr request)
Count a store being issued to memory by decrementing numUnissuedAccesses.
Definition: lsq.cc:736
Execute & execute
Definition: lsq.hh:66
bool sentAllPackets()
Has no packets to send.
Definition: lsq.hh:291
void moveFromRequestsToTransfers(LSQRequestPtr request)
Move a request between queues.
Definition: lsq.cc:1159
void forwardStoreData(LSQRequestPtr load, unsigned int slot_number)
Fill the given packet with appropriate date from slot slot_number.
Definition: lsq.cc:706
SplitDataRequest(LSQ &port_, MinorDynInstPtr inst_, bool isLoad_, PacketDataPtr data_=NULL, uint64_t *res_=NULL)
Definition: lsq.cc:321
virtual bool hasPacketsInMemSystem()=0
True if this request has any issued packets in the memory system and so can't be interrupted until it...
bool needsToTick()
May need to be ticked next cycle as one of the queues contains an actionable transfers or address tra...
Definition: lsq.cc:1454
unsigned int numTranslatedFragments
Number of fragments that have completed address translation, (numTranslatedFragments + numInTranslati...
Definition: lsq.hh:405

Generated on Fri Jun 9 2017 13:03:42 for gem5 by doxygen 1.8.6