gem5 [DEVELOP-FOR-25.0]
Loading...
Searching...
No Matches
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
44
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"
55#include "cpu/minor/trace.hh"
56#include "mem/packet.hh"
57
58namespace gem5
59{
60
61namespace minor
62{
63
64/* Forward declaration */
65class Execute;
66
67class 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:
100
101 public:
102 DcachePort(std::string name, LSQ &lsq_, MinorCPU &cpu) :
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:
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
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
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
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:
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
412
416
419
420 protected:
422 void finish(const Fault &fault_, const RequestPtr &request_,
424
425 public:
427 bool isLoad_, PacketDataPtr data_ = NULL,
428 uint64_t *res_ = NULL);
429
431
432 public:
436
439 void makeFragmentPackets();
440
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
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
552
553 public:
556
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
611
616
620
623
624 protected:
629
633 bool tryToSend(LSQRequestPtr request);
634
637
640
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();
729
732
733 void minorTrace() const;
734};
735
739PacketPtr 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__ */
Classes for buffer, queue and FIFO behaviour.
const char data[]
Provide a non-protected base class for Minor's Ports as derived classes are created by Fetch1 and Exe...
Definition cpu.hh:108
MinorCPU & cpu
The enclosing cpu.
Definition cpu.hh:111
MinorCPUPort(const std::string &name_, MinorCPU &cpu_)
Definition cpu.hh:114
MinorCPU is an in-order CPU model with four fixed pipeline stages:
Definition cpu.hh:85
Named(std::string_view name_)
Definition named.hh:57
virtual std::string name() const
Definition named.hh:60
gem5::Flags< FlagsType > Flags
Definition request.hh:102
ThreadContext is the external interface to all thread state for anything outside of the CPU.
Execute stage.
Definition execute.hh:68
BarrierDataRequest(LSQ &port_, MinorDynInstPtr inst_)
Definition lsq.hh:339
bool isBarrier()
Is this a request a barrier?
Definition lsq.hh:336
Exposable data port.
Definition lsq.hh:96
DcachePort(std::string name, LSQ &lsq_, MinorCPU &cpu)
Definition lsq.hh:102
bool recvTimingResp(PacketPtr pkt) override
Receive a timing response from the peer.
Definition lsq.hh:107
bool isSnooping() const override
Determine if this request port is snooping or not.
Definition lsq.hh:112
LSQ & lsq
My owner.
Definition lsq.hh:99
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
void recvTimingSnoopReq(PacketPtr pkt) override
Receive a timing snoop request from the peer.
Definition lsq.hh:114
void recvFunctionalSnoop(PacketPtr pkt) override
Receive a functional snoop request packet from the peer.
Definition lsq.hh:117
FailedDataRequest(LSQ &port_, MinorDynInstPtr inst_)
Definition lsq.hh:326
Derived SenderState to carry data access info.
Definition lsq.hh:129
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
void tryToSuppressFault()
Instructions may want to suppress translation faults (e.g.
Definition lsq.cc:78
bool isTranslationDelayed
Address translation is delayed due to table walk.
Definition lsq.hh:167
LSQ & port
Owning port.
Definition lsq.hh:132
bool needsToBeSentToStoreBuffer()
This request, once processed by the requests/transfers queues, will need to go to the store buffer.
Definition lsq.cc:164
RequestPtr request
The underlying request of this LSQRequest.
Definition lsq.hh:152
bool skipped
Was skipped.
Definition lsq.hh:160
void makePacket()
Make a packet to use with the memory transaction.
Definition lsq.cc:1729
bool isLoad
Load/store indication used for building packet.
Definition lsq.hh:139
void setState(LSQRequestState new_state)
Set state and output trace output.
Definition lsq.cc:170
bool skippedMemAccess()
Was no memory access attempted for this request?
Definition lsq.hh:215
bool issuedToMemory
This in an access other than a normal cacheable load that's visited the memory system.
Definition lsq.hh:164
void setSkipped()
Set this request as having been skipped before a memory transfer was attempt.
Definition lsq.hh:219
virtual bool sentAllPackets()=0
Have all packets been sent?
virtual PacketPtr getHeadPacket()=0
Get the next packet to issue for this request.
PacketDataPtr data
Dynamically allocated and populated data carried for building write packets.
Definition lsq.hh:143
void reportData(std::ostream &os) const
MinorTrace report interface.
Definition lsq.cc:186
virtual bool hasPacketsInMemSystem()=0
True if this request has any issued packets in the memory system and so can't be interrupted until it...
uint64_t * res
Res from pushRequest.
Definition lsq.hh:155
virtual void startAddrTranslation()=0
Start the address translation process for this request.
LSQRequestState state
Definition lsq.hh:191
LSQRequest(LSQ &port_, MinorDynInstPtr inst_, bool isLoad_, PacketDataPtr data_=NULL, uint64_t *res_=NULL)
Definition lsq.cc:59
AddrRangeCoverage containsAddrRangeOf(LSQRequest *other_request)
Does this request's address range fully cover the range of other_request?
virtual void stepToNextPacket()=0
Step to the next packet for the next call to getHeadPacket.
MinorDynInstPtr inst
Instruction which made this request.
Definition lsq.hh:135
virtual bool isBarrier()
Is this a request a barrier?
Definition lsq.cc:158
void completeDisabledMemAccess()
Definition lsq.cc:97
bool isComplete() const
Has this request been completed.
Definition lsq.cc:178
virtual void retireResponse(PacketPtr packet_)=0
Retire a response packet into the LSQRequest packet possibly completing this transfer.
void markDelayed()
BaseMMU::Translation interface.
Definition lsq.hh:195
SingleDataRequest(LSQ &port_, MinorDynInstPtr inst_, bool isLoad_, PacketDataPtr data_=NULL, uint64_t *res_=NULL)
Definition lsq.hh:381
void stepToNextPacket()
Remember that the packet has been sent.
Definition lsq.hh:367
bool hasPacketsInMemSystem()
Has packet been sent.
Definition lsq.hh:370
void startAddrTranslation()
Send single translation request.
Definition lsq.cc:301
void finish(const Fault &fault_, const RequestPtr &request_, ThreadContext *tc, BaseMMU::Mode mode)
TLB interace.
Definition lsq.cc:271
bool sentAllPackets()
packetInFlight can become false again, so need to check packetSent
Definition lsq.hh:374
bool packetSent
Has the packet been at least sent to the memory system?
Definition lsq.hh:357
PacketPtr getHeadPacket()
Get the head packet as counted by numIssuedFragments.
Definition lsq.hh:364
bool packetInFlight
Has my only packet been sent to the memory system but has not yet been responded to.
Definition lsq.hh:354
void retireResponse(PacketPtr packet_)
Keep the given packet as the response packet LSQRequest::packet.
Definition lsq.cc:325
void finish(const Fault &fault_, const RequestPtr &request_, ThreadContext *tc, BaseMMU::Mode mode)
TLB interace.
Definition lsq.hh:288
PacketPtr getHeadPacket()
Get the head packet as counted by numIssuedFragments.
Definition lsq.hh:297
bool sentAllPackets()
Has no packets to send.
Definition lsq.hh:304
SpecialDataRequest(LSQ &port_, MinorDynInstPtr inst_)
Definition lsq.hh:314
void startAddrTranslation()
Send single translation request.
Definition lsq.hh:294
void retireResponse(PacketPtr packet_)
Keep the given packet as the response packet LSQRequest::packet.
Definition lsq.hh:311
bool hasPacketsInMemSystem()
Never sends any requests.
Definition lsq.hh:307
void stepToNextPacket()
Step on numIssuedFragments.
Definition lsq.hh:301
std::vector< Packet * > fragmentPackets
Packets matching fragmentRequests to issue fragments to memory.
Definition lsq.hh:418
void stepToNextPacket()
Step on numIssuedFragments.
Definition lsq.cc:616
unsigned int numTranslatedFragments
Number of fragments that have completed address translation, (numTranslatedFragments + numInTranslati...
Definition lsq.hh:405
EventFunctionWrapper translationEvent
Event to step between translations.
Definition lsq.hh:393
void finish(const Fault &fault_, const RequestPtr &request_, ThreadContext *tc, BaseMMU::Mode mode)
TLB response interface.
Definition lsq.cc:334
unsigned int numFragments
Number of fragments this request is split into.
Definition lsq.hh:396
unsigned int numInTranslationFragments
Number of fragments in the address translation mechanism.
Definition lsq.hh:399
std::vector< RequestPtr > fragmentRequests
Fragment Requests corresponding to the address ranges of each fragment.
Definition lsq.hh:415
void sendNextFragmentToTranslation()
Part of the address translation loop, see startAddTranslation.
Definition lsq.cc:701
unsigned int numIssuedFragments
Number of fragments already issued (<= numFragments)
Definition lsq.hh:408
void retireResponse(PacketPtr packet_)
For loads, paste the response data into the main response packet.
Definition lsq.cc:624
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
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
PacketPtr getHeadPacket()
Get the head packet as counted by numIssuedFragments.
Definition lsq.cc:608
void makeFragmentPackets()
Make the packets to go with the requests so they can be sent to the memory system.
Definition lsq.cc:533
SplitDataRequest(LSQ &port_, MinorDynInstPtr inst_, bool isLoad_, PacketDataPtr data_=NULL, uint64_t *res_=NULL)
Definition lsq.cc:392
void startAddrTranslation()
Start a loop of do { sendNextFragmentToTranslation ; translateTiming ; finish } while (numTranslatedF...
Definition lsq.cc:583
unsigned int numRetiredFragments
Number of fragments retired back to this request.
Definition lsq.hh:411
bool sentAllPackets()
Have we stepped past the end of fragmentPackets?
Definition lsq.hh:457
bool isDrained() const
Drained if there is absolutely nothing left in the buffer.
Definition lsq.hh:528
void step()
Try to issue more stores to memory.
Definition lsq.cc:843
unsigned int numUnissuedAccesses
Number of occupied slots which have not yet issued a memory access.
Definition lsq.hh:489
AddrRangeCoverage canForwardDataToLoad(LSQRequestPtr request, unsigned int &found_slot)
Look for a store which satisfies the given load.
Definition lsq.cc:763
void forwardStoreData(LSQRequestPtr load, unsigned int slot_number)
Fill the given packet with appropriate date from slot slot_number.
Definition lsq.cc:804
const unsigned int storeLimitPerCycle
Maximum number of stores that can be issued per cycle.
Definition lsq.hh:481
void minorTrace() const
Report queue contents for MinorTrace.
Definition lsq.cc:930
StoreBuffer(std::string name_, LSQ &lsq_, unsigned int store_buffer_size, unsigned int store_limit_per_cycle)
Definition lsq.cc:1684
const unsigned int numSlots
Number of slots, this is a bound on the size of slots.
Definition lsq.hh:478
std::deque< LSQRequestPtr > slots
Queue of store requests on their way to memory.
Definition lsq.hh:485
void countIssuedStore(LSQRequestPtr request)
Count a store being issued to memory by decrementing numUnissuedAccesses.
Definition lsq.cc:834
void insert(LSQRequestPtr request)
Insert a request at the back of the queue.
Definition lsq.cc:741
unsigned int numUnissuedStores()
Number of stores in the store buffer which have not been completely issued to the memory system.
Definition lsq.hh:520
bool canInsert() const
Can a new request be inserted into the queue?
Definition lsq.cc:720
void deleteRequest(LSQRequestPtr request)
Delete the given request and free the slot it occupied.
Definition lsq.cc:727
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
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
void recvTimingSnoopReq(PacketPtr pkt)
Definition lsq.cc:1762
void issuedMemBarrierInst(MinorDynInstPtr inst)
A memory barrier instruction has been issued, remember its execSeqNum that we can avoid issuing memor...
Definition lsq.cc:1717
bool tryToSend(LSQRequestPtr request)
Try to send (or resend) a memory request's next/only packet to the memory system.
Definition lsq.cc:1174
void minorTrace() const
Definition lsq.cc:1673
bool canSendToMemorySystem()
Can a request be sent to the memory system.
Definition lsq.cc:1289
MemoryState
State of memory access for head access.
Definition lsq.hh:77
@ MemoryNeedsRetry
Definition lsq.hh:79
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
StoreBuffer storeBuffer
Definition lsq.hh:594
unsigned int numAccessesInDTLB
Number of requests in the DTLB in the requests queue.
Definition lsq.hh:606
void sendStoreToStoreBuffer(LSQRequestPtr request)
A store has been committed, please move it to the store buffer.
Definition lsq.cc:1543
void pushFailedRequest(MinorDynInstPtr inst)
Push a predicate failed-representing request into the queues just to maintain commit order.
Definition lsq.cc:1666
LSQRequestPtr retryRequest
The request (from either requests or the store buffer) which is currently waiting have its memory acc...
Definition lsq.hh:619
void threadSnoop(LSQRequestPtr request)
Snoop other threads monitors on memory system accesses.
Definition lsq.cc:1782
Queue< LSQRequestPtr, ReportTraitsPtrAdaptor< LSQRequestPtr >, NoBubbleTraits< LSQRequestPtr > > LSQQueue
The LSQ consists of three queues: requests, transfers and the store buffer storeBuffer.
Definition lsq.hh:560
void recvReqRetry()
Definition lsq.cc:1356
const Addr lineWidth
Memory system access width (and snap) in bytes.
Definition lsq.hh:551
bool canPushIntoStoreBuffer() const
Must check this before trying to insert into the store buffer.
Definition lsq.hh:681
AddrRangeCoverage
Coverage of one address range with another.
Definition lsq.hh:88
@ PartialAddrRangeCoverage
Definition lsq.hh:89
@ NoAddrRangeCoverage
Definition lsq.hh:91
@ FullAddrRangeCoverage
Definition lsq.hh:90
virtual ~LSQ()
Definition lsq.cc:1457
DcachePort dcachePort
Definition lsq.hh:120
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
bool accessesInFlight() const
Are there any accesses other than normal cached loads in the memory system or having received respons...
Definition lsq.hh:689
unsigned int numAccessesInMemorySystem
Count of the number of mem.
Definition lsq.hh:603
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
LSQRequest * LSQRequestPtr
Definition lsq.hh:274
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
Execute & execute
Definition lsq.hh:72
const unsigned int inMemorySystemLimit
Maximum number of in-flight accesses issued to the memory system.
Definition lsq.hh:548
LSQQueue requests
requests contains LSQRequests which have been issued to the TLB by calling ExecContext::readMem/write...
Definition lsq.hh:574
unsigned int numStoresInTransfers
The number of stores in the transfers queue.
Definition lsq.hh:610
MinorCPU::MinorCPUPort & getDcachePort()
Return the raw-bindable port.
Definition lsq.hh:731
friend std::ostream & operator<<(std::ostream &os, MemoryState state)
Print MemoryState values as shown in the enum definition.
Definition lsq.cc:1745
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
MemoryState state
Retry state of last issued memory transfer.
Definition lsq.hh:545
LSQQueue transfers
Once issued to memory (or, for stores, just had their state changed to StoreToStoreBuffer) LSQRequest...
Definition lsq.hh:583
InstSeqNum getLastMemBarrier(ThreadID thread_id) const
Get the execSeqNum of the last issued memory barrier.
Definition lsq.hh:698
void completeMemBarrierInst(MinorDynInstPtr inst, bool committed)
Complete a barrier instruction.
Definition lsq.cc:913
Addr cacheBlockMask
Address Mask for a cache block (e.g.
Definition lsq.hh:622
void popResponse(LSQRequestPtr response)
Sanity check and pop the head response.
Definition lsq.cc:1521
MinorCPU & cpu
My owner(s)
Definition lsq.hh:71
void moveFromRequestsToTransfers(LSQRequestPtr request)
Move a request between queues.
Definition lsq.cc:1272
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
bool isDrained()
Is there nothing left in the LSQ.
Definition lsq.cc:1556
bool recvTimingResp(PacketPtr pkt)
Memory interface.
Definition lsq.cc:1296
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
void clearMemBarrier(MinorDynInstPtr inst)
Clear a barrier (if it's the last one marked up in lastMemBarrier)
Definition lsq.cc:258
... BubbleTraits are trait classes to add BubbleIF interface functionality to templates which process...
Definition buffers.hh:122
Wrapper for a queue type to act as a pipeline stage input queue.
Definition buffers.hh:404
A similar adaptor but for elements held by pointer ElemType should implement ReportIF.
Definition buffers.hh:108
STL deque class.
Definition stl.hh:44
STL vector class.
Definition stl.hh:37
Top level definition of the Minor in-order CPU model.
This file contains miscellaneous classes and functions for formatting general trace information and a...
std::unique_ptr< AtomicOpFunctor > AtomicOpFunctorPtr
Definition amo.hh:269
#define fatal(...)
This implements a cprintf based fatal() function.
Definition logging.hh:232
Bitfield< 4, 0 > mode
Definition misc_types.hh:74
Bitfield< 17 > os
Definition misc.hh:838
Bitfield< 3 > addr
Definition types.hh:84
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
RefCountingPtr< MinorDynInst > MinorDynInstPtr
MinorDynInsts are currently reference counted.
Definition dyn_inst.hh:71
Copyright (c) 2024 Arm Limited All rights reserved.
Definition binary32.hh:36
std::shared_ptr< FaultBase > Fault
Definition types.hh:249
int16_t ThreadID
Thread index/ID type.
Definition types.hh:235
std::shared_ptr< Request > RequestPtr
Definition request.hh:94
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition types.hh:147
uint8_t * PacketDataPtr
Definition packet.hh:72
Packet * PacketPtr
uint64_t InstSeqNum
Definition inst_seq.hh:40
Declaration of the Packet class.
Contains class definitions for data flowing between pipeline stages in the top-level structure portio...
A virtual base opaque structure used to hold state associated with the packet (e.g....
Definition packet.hh:469

Generated on Mon May 26 2025 09:19:08 for gem5 by doxygen 1.13.2