gem5
|
A Class for maintaining a list of pending and allocated memory requests. More...
#include <mshr_queue.hh>
Public Member Functions | |
MSHRQueue (const std::string &_label, int num_entries, int reserve, int demand_reserve) | |
Create a queue with a given number of entries. More... | |
MSHR * | allocate (Addr blk_addr, unsigned blk_size, PacketPtr pkt, Tick when_ready, Counter order, bool alloc_on_fill) |
Allocates a new MSHR for the request and size. More... | |
void | moveToFront (MSHR *mshr) |
Moves the MSHR to the front of the pending list if it is not in service. More... | |
void | markInService (MSHR *mshr, bool pending_modified_resp) |
Mark the given MSHR as in service. More... | |
void | markPending (MSHR *mshr) |
Mark an in service entry as pending, used to resend a request. More... | |
bool | forceDeallocateTarget (MSHR *mshr) |
Deallocate top target, possibly freeing the MSHR. More... | |
bool | havePending () const |
Returns true if the pending list is not empty. More... | |
bool | canPrefetch () const |
Returns true if sufficient mshrs for prefetch. More... | |
Public Member Functions inherited from Queue< MSHR > | |
Queue (const std::string &_label, int num_entries, int reserve) | |
Create a queue with a given number of entries. More... | |
bool | isEmpty () const |
bool | isFull () const |
int | numInService () const |
MSHR * | findMatch (Addr blk_addr, bool is_secure) const |
Find the first WriteQueueEntry that matches the provided address. More... | |
bool | checkFunctional (PacketPtr pkt, Addr blk_addr) |
MSHR * | findPending (Addr blk_addr, bool is_secure) const |
Find any pending requests that overlap the given request. More... | |
MSHR * | getNext () const |
Returns the WriteQueueEntry at the head of the readyList. More... | |
Tick | nextReadyTime () const |
void | deallocate (MSHR *entry) |
Removes the given entry from the queue. More... | |
DrainState | drain () override |
Notify an object that it needs to drain its state. More... | |
Public Member Functions inherited from Drainable | |
DrainState | drainState () const |
Return the current drain state of an object. More... | |
virtual void | notifyFork () |
Notify a child process of a fork. More... | |
Private Attributes | |
const int | demandReserve |
The number of entries to reserve for future demand accesses. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from Queue< MSHR > | |
MSHR::Iterator | addToReadyList (MSHR *entry) |
Protected Member Functions inherited from Drainable | |
Drainable () | |
virtual | ~Drainable () |
virtual void | drainResume () |
Resume execution after a successful drain. More... | |
void | signalDrainDone () const |
Signal that an object is drained. More... | |
Protected Attributes inherited from Queue< MSHR > | |
const std::string | label |
Local label (for functional print requests) More... | |
const int | numEntries |
The total number of entries in this queue. More... | |
const int | numReserve |
The number of entries to hold as a temporary overflow space. More... | |
std::vector< MSHR > | entries |
Actual storage. More... | |
MSHR::List | allocatedList |
Holds pointers to all allocated entries. More... | |
MSHR::List | readyList |
Holds pointers to entries that haven't been sent downstream. More... | |
MSHR::List | freeList |
Holds non allocated entries. More... | |
int | _numInService |
The number of entries that are in service. More... | |
int | allocated |
The number of currently allocated entries. More... | |
A Class for maintaining a list of pending and allocated memory requests.
Definition at line 59 of file mshr_queue.hh.
MSHRQueue::MSHRQueue | ( | const std::string & | _label, |
int | num_entries, | ||
int | reserve, | ||
int | demand_reserve | ||
) |
Create a queue with a given number of entries.
num_entrys | The number of entries in this queue. |
reserve | The minimum number of entries needed to satisfy any access. |
demand_reserve | The minimum number of entries needed to satisfy demand accesses. |
Definition at line 52 of file mshr_queue.cc.
MSHR * MSHRQueue::allocate | ( | Addr | blk_addr, |
unsigned | blk_size, | ||
PacketPtr | pkt, | ||
Tick | when_ready, | ||
Counter | order, | ||
bool | alloc_on_fill | ||
) |
Allocates a new MSHR for the request and size.
This places the request as the first target in the MSHR.
blk_addr | The address of the block. |
blk_size | The number of bytes to request. |
pkt | The original miss. |
when_ready | When should the MSHR be ready to act upon. |
order | The logical order of this MSHR |
alloc_on_fill | Should the cache allocate a block on fill |
Definition at line 59 of file mshr_queue.cc.
References Queue< MSHR >::addToReadyList(), Queue< MSHR >::allocated, Queue< MSHR >::allocatedList, and Queue< MSHR >::freeList.
Referenced by BaseCache::allocateMissBuffer().
|
inline |
Returns true if sufficient mshrs for prefetch.
Definition at line 142 of file mshr_queue.hh.
References Queue< MSHR >::allocated, demandReserve, Queue< MSHR >::numEntries, and Queue< MSHR >::numReserve.
Referenced by Cache::getNextQueueEntry(), Cache::nextQueueReadyTime(), and Cache::recvTimingResp().
bool MSHRQueue::forceDeallocateTarget | ( | MSHR * | mshr | ) |
Deallocate top target, possibly freeing the MSHR.
Definition at line 107 of file mshr_queue.cc.
References Queue< MSHR >::deallocate(), MSHR::hasTargets(), Queue< MSHR >::isFull(), MSHR::popTarget(), and MSHR::promoteDeferredTargets().
Referenced by Cache::sendMSHRQueuePacket().
|
inline |
Returns true if the pending list is not empty.
Definition at line 133 of file mshr_queue.hh.
References Queue< MSHR >::readyList.
void MSHRQueue::markInService | ( | MSHR * | mshr, |
bool | pending_modified_resp | ||
) |
Mark the given MSHR as in service.
This removes the MSHR from the readyList or deallocates the MSHR if it does not expect a response.
mshr | The MSHR to mark in service. |
pending_modified_resp | Whether we expect a modified response from another cache |
Definition at line 86 of file mshr_queue.cc.
References Queue< MSHR >::_numInService, MSHR::markInService(), MSHR::readyIter, and Queue< MSHR >::readyList.
Referenced by BaseCache::markInService().
void MSHRQueue::markPending | ( | MSHR * | mshr | ) |
Mark an in service entry as pending, used to resend a request.
mshr | The MSHR to resend. |
@ todo might want to add rerequests to front of pending list for performance.
Definition at line 94 of file mshr_queue.cc.
References Queue< MSHR >::_numInService, Queue< MSHR >::addToReadyList(), QueueEntry::inService, and MSHR::readyIter.
Referenced by Cache::recvTimingResp().
void MSHRQueue::moveToFront | ( | MSHR * | mshr | ) |
Moves the MSHR to the front of the pending list if it is not in service.
mshr | The entry to move. |
Definition at line 76 of file mshr_queue.cc.
References QueueEntry::inService, MSHR::readyIter, and Queue< MSHR >::readyList.
|
private |
The number of entries to reserve for future demand accesses.
Prevent prefetcher from taking all mshr entries
Definition at line 67 of file mshr_queue.hh.
Referenced by canPrefetch().