|
gem5 v23.0.0.1
|
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, std::string cache_name) | |
| Create a queue with a given number of entries. | |
| 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. | |
| void | deallocate (MSHR *mshr) override |
| Deallocate a MSHR and its targets. | |
| void | moveToFront (MSHR *mshr) |
| Moves the MSHR to the front of the pending list if it is not in service. | |
| void | delay (MSHR *mshr, Tick delay_ticks) |
| Adds a delay to the provided MSHR and moves MSHRs that will be ready earlier than this entry to the top of the list. | |
| void | markInService (MSHR *mshr, bool pending_modified_resp) |
| Mark the given MSHR as in service. | |
| void | markPending (MSHR *mshr) |
| Mark an in service entry as pending, used to resend a request. | |
| bool | forceDeallocateTarget (MSHR *mshr) |
| Deallocate top target, possibly freeing the MSHR. | |
| bool | havePending () const |
| Returns true if the pending list is not empty. | |
| bool | canPrefetch () const |
| Returns true if sufficient mshrs for prefetch. | |
Public Member Functions inherited from gem5::Queue< MSHR > | |
| Queue (const std::string &_label, int num_entries, int reserve, const std::string &name) | |
| Create a queue with a given number of entries. | |
| bool | isEmpty () const |
| bool | isFull () const |
| int | numInService () const |
| MSHR * | findMatch (Addr blk_addr, bool is_secure, bool ignore_uncacheable=true) const |
| Find the first entry that matches the provided address. | |
| bool | trySatisfyFunctional (PacketPtr pkt) |
| MSHR * | findPending (const QueueEntry *entry) const |
| Find any pending requests that overlap the given request of a different queue. | |
| MSHR * | getNext () const |
| Returns the WriteQueueEntry at the head of the readyList. | |
| Tick | nextReadyTime () const |
| virtual void | deallocate (MSHR *entry) |
| Removes the given entry from the queue. | |
| DrainState | drain () override |
| Draining is the process of clearing out the states of SimObjects.These are the SimObjects that are partially executed or are partially in flight. | |
Public Member Functions inherited from gem5::Drainable | |
| DrainState | drainState () const |
| Return the current drain state of an object. | |
| virtual void | notifyFork () |
| Notify a child process of a fork. | |
Public Member Functions inherited from gem5::Named | |
| Named (const std::string &name_) | |
| virtual | ~Named ()=default |
| virtual std::string | name () const |
Private Attributes | |
| const int | demandReserve |
| The number of entries to reserve for future demand accesses. | |
Additional Inherited Members | |
Protected Member Functions inherited from gem5::Queue< MSHR > | |
| Entry::Iterator | addToReadyList (MSHR *entry) |
Protected Member Functions inherited from gem5::Drainable | |
| Drainable () | |
| virtual | ~Drainable () |
| virtual DrainState | drain ()=0 |
| Draining is the process of clearing out the states of SimObjects.These are the SimObjects that are partially executed or are partially in flight. | |
| virtual void | drainResume () |
| Resume execution after a successful drain. | |
| void | signalDrainDone () const |
| Signal that an object is drained. | |
Protected Attributes inherited from gem5::Queue< MSHR > | |
| const std::string | label |
| Local label (for functional print requests) | |
| const int | numEntries |
| The total number of entries in this queue. | |
| const int | numReserve |
| The number of entries to hold as a temporary overflow space. | |
| std::vector< MSHR > | entries |
| Actual storage. | |
| Entry::List | allocatedList |
| Holds pointers to all allocated entries. | |
| Entry::List | readyList |
| Holds pointers to entries that haven't been sent downstream. | |
| Entry::List | freeList |
| Holds non allocated entries. | |
| int | _numInService |
| The number of entries that are in service. | |
| int | allocated |
| The number of currently allocated entries. | |
A Class for maintaining a list of pending and allocated memory requests.
Definition at line 61 of file mshr_queue.hh.
| gem5::MSHRQueue::MSHRQueue | ( | const std::string & | _label, |
| int | num_entries, | ||
| int | reserve, | ||
| int | demand_reserve, | ||
| std::string | cache_name = "" |
||
| ) |
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 55 of file mshr_queue.cc.
| MSHR * gem5::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 63 of file mshr_queue.cc.
References gem5::Queue< MSHR >::addToReadyList(), gem5::MSHR::allocate(), gem5::Queue< MSHR >::allocated, gem5::Queue< MSHR >::allocatedList, gem5::MSHR::allocIter, DPRINTF, gem5::Queue< MSHR >::freeList, gem5::MSHR::getNumTargets(), gem5::Queue< MSHR >::numEntries, and gem5::MSHR::readyIter.
Referenced by gem5::BaseCache::allocateMissBuffer().
|
inline |
Returns true if sufficient mshrs for prefetch.
Definition at line 158 of file mshr_queue.hh.
References gem5::Queue< MSHR >::allocated, demandReserve, gem5::Queue< MSHR >::numEntries, and gem5::Queue< MSHR >::numReserve.
Referenced by gem5::BaseCache::getNextQueueEntry(), gem5::BaseCache::nextQueueReadyTime(), and gem5::BaseCache::recvTimingResp().
|
overridevirtual |
Deallocate a MSHR and its targets.
Reimplemented from gem5::Queue< MSHR >.
Definition at line 83 of file mshr_queue.cc.
References gem5::Queue< MSHR >::allocatedList, gem5::Queue< Entry >::deallocate(), DPRINTF, gem5::Queue< MSHR >::numEntries, and gem5::MSHR::print().
Referenced by forceDeallocateTarget(), and gem5::BaseCache::recvTimingResp().
Adds a delay to the provided MSHR and moves MSHRs that will be ready earlier than this entry to the top of the list.
| mshr | that needs to be delayed |
| delay_ticks | ticks of the desired delay |
Definition at line 104 of file mshr_queue.cc.
References gem5::MSHR::delay(), gem5::MSHR::readyIter, and gem5::Queue< MSHR >::readyList.
Referenced by gem5::BaseCache::sendMSHRQueuePacket().
| bool gem5::MSHRQueue::forceDeallocateTarget | ( | MSHR * | mshr | ) |
Deallocate top target, possibly freeing the MSHR.
Definition at line 136 of file mshr_queue.cc.
References deallocate(), gem5::MSHR::hasTargets(), gem5::Queue< MSHR >::isFull(), gem5::MSHR::popTarget(), and gem5::MSHR::promoteDeferredTargets().
Referenced by gem5::Cache::sendMSHRQueuePacket().
|
inline |
Returns true if the pending list is not empty.
Definition at line 149 of file mshr_queue.hh.
References gem5::Queue< MSHR >::readyList.
| void gem5::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 115 of file mshr_queue.cc.
References gem5::Queue< MSHR >::_numInService, gem5::MSHR::markInService(), gem5::MSHR::readyIter, and gem5::Queue< MSHR >::readyList.
Referenced by gem5::BaseCache::handleTimingReqHit(), and gem5::BaseCache::markInService().
| void gem5::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 123 of file mshr_queue.cc.
References gem5::Queue< MSHR >::_numInService, gem5::Queue< MSHR >::addToReadyList(), gem5::QueueEntry::inService, and gem5::MSHR::readyIter.
Referenced by gem5::BaseCache::recvTimingResp().
| void gem5::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 94 of file mshr_queue.cc.
References gem5::QueueEntry::inService, gem5::MSHR::readyIter, and gem5::Queue< MSHR >::readyList.
|
private |
The number of entries to reserve for future demand accesses.
Prevent prefetcher from taking all mshr entries
Definition at line 69 of file mshr_queue.hh.
Referenced by canPrefetch().