mem-cache: Add MSHR debuging information
Add debug statment in MSHR and MSHRQueue class to track the number of free MSHR each time a new one is allocated/deallocated. Also track the allocation/deallocation of each MSHR target. Change-Id: I2533e7660da1cde3052425f8db8852e59d463b42 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/47041 Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br> Maintainer: Daniel Carvalho <odanrc@yahoo.com.br> Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
15
src/mem/cache/mshr_queue.cc
vendored
15
src/mem/cache/mshr_queue.cc
vendored
@@ -46,6 +46,7 @@
|
||||
|
||||
#include <cassert>
|
||||
|
||||
#include "debug/MSHR.hh"
|
||||
#include "mem/cache/mshr.hh"
|
||||
|
||||
MSHRQueue::MSHRQueue(const std::string &_label,
|
||||
@@ -64,6 +65,9 @@ MSHRQueue::allocate(Addr blk_addr, unsigned blk_size, PacketPtr pkt,
|
||||
assert(mshr->getNumTargets() == 0);
|
||||
freeList.pop_front();
|
||||
|
||||
DPRINTF(MSHR, "Allocating new MSHR. Number in use will be %lu/%lu\n",
|
||||
allocatedList.size() + 1, numEntries);
|
||||
|
||||
mshr->allocate(blk_addr, blk_size, pkt, when_ready, order, alloc_on_fill);
|
||||
mshr->allocIter = allocatedList.insert(allocatedList.end(), mshr);
|
||||
mshr->readyIter = addToReadyList(mshr);
|
||||
@@ -72,6 +76,17 @@ MSHRQueue::allocate(Addr blk_addr, unsigned blk_size, PacketPtr pkt,
|
||||
return mshr;
|
||||
}
|
||||
|
||||
void
|
||||
MSHRQueue::deallocate(MSHR* mshr)
|
||||
{
|
||||
|
||||
DPRINTF(MSHR, "Deallocating all targets: %s", mshr->print());
|
||||
Queue<MSHR>::deallocate(mshr);
|
||||
DPRINTF(MSHR, "MSHR deallocated. Number in use: %lu/%lu\n",
|
||||
allocatedList.size(), numEntries);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
MSHRQueue::moveToFront(MSHR *mshr)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user