2c2
< * Copyright (c) 2012-2013, 2015 ARM Limited
---
> * Copyright (c) 2012-2013, 2015-2016 ARM Limited
54,55c54
< #include "mem/packet.hh"
< #include "sim/drain.hh"
---
> #include "mem/cache/queue.hh"
60c59
< class MSHRQueue : public Drainable
---
> class MSHRQueue : public Queue<MSHR>
63,64d61
< /** Local label (for functional print requests) */
< const std::string label;
66d62
< // Parameters
68,80d63
< * The total number of entries in this queue. This number is set as the
< * number of entries requested plus (numReserve - 1). This allows for
< * the same number of effective entries while still maintaining the reserve.
< */
< const int numEntries;
<
< /**
< * The number of entries to hold in reserve. This is needed because copy
< * operations can allocate upto 4 entries at one time.
< */
< const int numReserve;
<
< /**
86,97d68
< /** MSHR storage. */
< std::vector<MSHR> registers;
< /** Holds pointers to all allocated entries. */
< MSHR::List allocatedList;
< /** Holds pointers to entries that haven't been sent to the bus. */
< MSHR::List readyList;
< /** Holds non allocated entries. */
< MSHR::List freeList;
<
< MSHR::Iterator addToReadyList(MSHR *mshr);
<
<
99,105d69
< /** The number of allocated entries. */
< int allocated;
< /** The number of entries that have been forwarded to the bus. */
< int inServiceEntries;
< /** The index of this queue within the cache (MSHR queue vs. write
< * buffer). */
< const int index;
116c80
< int demand_reserve, int index);
---
> int demand_reserve);
119,146d82
< * Find the first MSHR that matches the provided address.
< * @param blk_addr The block address to find.
< * @param is_secure True if the target memory space is secure.
< * @return Pointer to the matching MSHR, null if not found.
< */
< MSHR *findMatch(Addr blk_addr, bool is_secure) const;
<
< /**
< * Find and return all the matching entries in the provided vector.
< * @param blk_addr The block address to find.
< * @param is_secure True if the target memory space is secure.
< * @param matches The vector to return pointers to the matching entries.
< * @return True if any matches are found, false otherwise.
< */
< bool findMatches(Addr blk_addr, bool is_secure,
< std::vector<MSHR*>& matches) const;
<
< /**
< * Find any pending requests that overlap the given request.
< * @param blk_addr Block address.
< * @param is_secure True if the target memory space is secure.
< * @return A pointer to the earliest matching MSHR.
< */
< MSHR *findPending(Addr blk_addr, bool is_secure) const;
<
< bool checkFunctional(PacketPtr pkt, Addr blk_addr);
<
< /**
165,179d100
< * Removes the given MSHR from the queue. This places the MSHR on the
< * free list.
< * @param mshr
< */
< void deallocate(MSHR *mshr);
<
< /**
< * Remove a MSHR from the queue. Returns an iterator into the
< * allocatedList.
< * @param mshr The MSHR to remove.
< * @return An iterator to the next entry in the allocatedList.
< */
< MSHR::Iterator deallocateOne(MSHR *mshr);
<
< /**
218,226d138
< * Returns true if there are no free entries.
< * @return True if this queue is full.
< */
< bool isFull() const
< {
< return (allocated > numEntries - numReserve);
< }
<
< /**
234,252d145
<
< /**
< * Returns the MSHR at the head of the readyList.
< * @return The next request to service.
< */
< MSHR *getNextMSHR() const
< {
< if (readyList.empty() || readyList.front()->readyTime > curTick()) {
< return NULL;
< }
< return readyList.front();
< }
<
< Tick nextMSHRReadyTime() const
< {
< return readyList.empty() ? MaxTick : readyList.front()->readyTime;
< }
<
< DrainState drain() override;