Giacomo Travaglini has uploaded this change for review. ( https://gem5-review.googlesource.com/11849

Change subject: cpu: Turn BaseTrafficGen numSuppressed into a stat
......................................................................

cpu: Turn BaseTrafficGen numSuppressed into a stat

This is changing numSuppressed from being a warn only variable into
a Stat so that it is visible at the end of simulation.

Change-Id: I934782e796c898bfc0e773cc88c597a68e403272
---
M src/cpu/testers/traffic_gen/base.cc
M src/cpu/testers/traffic_gen/base.hh
2 files changed, 8 insertions(+), 4 deletions(-)



diff --git a/src/cpu/testers/traffic_gen/base.cc b/src/cpu/testers/traffic_gen/base.cc
index fe25778..140e133 100644
--- a/src/cpu/testers/traffic_gen/base.cc
+++ b/src/cpu/testers/traffic_gen/base.cc
@@ -78,7 +78,6 @@
       retryPkt(NULL),
       retryPktTick(0),
       updateEvent([this]{ update(); }, name()),
-      numSuppressed(0),
       masterID(system->getMasterId(this))
 {
 }
@@ -180,9 +179,9 @@
                     pkt->cmdString(), pkt->getAddr());

             ++numSuppressed;
-            if (numSuppressed % 10000)
+            if (!(static_cast<int>(numSuppressed.value()) % 10000))
warn("%s suppressed %d packets with non-memory addresses\n",
-                     name(), numSuppressed);
+                     name(), numSuppressed.value());

             delete pkt;
             pkt = nullptr;
@@ -308,6 +307,10 @@
         .name(name() + ".numPackets")
         .desc("Number of packets generated");

+    numSuppressed
+        .name(name() + ".numSuppressed")
+        .desc("Number of suppressed packets to non-memory space");
+
     numRetries
         .name(name() + ".numRetries")
         .desc("Number of retries");
diff --git a/src/cpu/testers/traffic_gen/base.hh b/src/cpu/testers/traffic_gen/base.hh
index 080bd78..fe4229f 100644
--- a/src/cpu/testers/traffic_gen/base.hh
+++ b/src/cpu/testers/traffic_gen/base.hh
@@ -163,7 +163,8 @@
     /** Event for scheduling updates */
     EventFunctionWrapper updateEvent;

-    uint64_t numSuppressed;
+    /** Count the number of dropped requests. */
+    Stats::Scalar numSuppressed;

   private: // Stats
     /** Count the number of generated packets. */

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

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: I934782e796c898bfc0e773cc88c597a68e403272
Gerrit-Change-Number: 11849
Gerrit-PatchSet: 1
Gerrit-Owner: Giacomo Travaglini <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to