Nathanael Premillieu has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/47199 )

Change subject: mem: print prefetch queues in Queued prefetcher
......................................................................

mem: print prefetch queues in Queued prefetcher

Added to track the content of the prefetch queues in the debug output

Change-Id: I49d0f4f643ec0dbd7af3087b6267d454cfccddba
---
M src/mem/cache/prefetch/queued.cc
M src/mem/cache/prefetch/queued.hh
2 files changed, 39 insertions(+), 0 deletions(-)



diff --git a/src/mem/cache/prefetch/queued.cc b/src/mem/cache/prefetch/queued.cc
index db3ba2f..2d4d060 100644
--- a/src/mem/cache/prefetch/queued.cc
+++ b/src/mem/cache/prefetch/queued.cc
@@ -113,6 +113,38 @@
     }
 }

+void
+Queued::printQueue(const std::list<DeferredPacket>  &queue)
+{
+    if (&queue == &pfq) {
+        printPFQueue();
+    } else {
+        assert(&queue == &pfqMissingTranslation);
+        printPFTranslationQueue();
+    }
+}
+
+void
+Queued::printPFQueue()
+{
+    int pos = 0;
+    for (const_iterator it = pfq.cbegin(); it != pfq.cend(); it++, pos++) {
+        DPRINTF(HWPrefetch, "PFQ[%d]: Prefetch Req Addr: %#x prio: %3d\n",
+                pos, it->pkt->getAddr(), it->priority);
+    }
+}
+
+void
+Queued::printPFTranslationQueue()
+{
+    int pos = 0;
+    for (const_iterator it = pfqMissingTranslation.cbegin();
+         it != pfqMissingTranslation.cend(); it++, pos++) {
+ DPRINTF(HWPrefetch, "PFTransQ[%d]: Prefetch Req Addr: %#x prio: %3d\n",
+                pos, it->pkt->getAddr(), it->priority);
+    }
+}
+
 size_t
 Queued::getMaxPermittedPrefetches(size_t total) const
 {
@@ -485,6 +517,8 @@
             it++;
         queue.insert(it, dpp);
     }
+
+    printQueue(queue);
 }

 } // namespace prefetch
diff --git a/src/mem/cache/prefetch/queued.hh b/src/mem/cache/prefetch/queued.hh
index 07b6940..4e14df4 100644
--- a/src/mem/cache/prefetch/queued.hh
+++ b/src/mem/cache/prefetch/queued.hh
@@ -200,6 +200,8 @@
         return pfq.empty() ? MaxTick : pfq.front().tick;
     }

+    void printQueue(const std::list<DeferredPacket>  &queue);
+
   private:

     /**
@@ -250,6 +252,9 @@

     RequestPtr createPrefetchRequest(Addr addr, PrefetchInfo const &pfi,
                                         PacketPtr pkt);
+
+    void printPFQueue();
+    void printPFTranslationQueue();
 };

 } // namespace prefetch

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/47199
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I49d0f4f643ec0dbd7af3087b6267d454cfccddba
Gerrit-Change-Number: 47199
Gerrit-PatchSet: 1
Gerrit-Owner: Nathanael Premillieu <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to