summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichiel W. van Tol <Michiel.VanTol@arm.com>2018-07-24 15:28:34 +0100
committerGiacomo Travaglini <giacomo.travaglini@arm.com>2018-08-24 13:23:40 +0000
commit2b3168021cb0ceed8e90045435181bb82eed0c12 (patch)
treed88d7c87e70a15d46798316e53d12e10ff42c16f
parent50a57c0376c02c912a978c4443dd58caebe0f173 (diff)
downloadgem5-2b3168021cb0ceed8e90045435181bb82eed0c12.tar.xz
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 Reviewed-on: https://gem5-review.googlesource.com/11849 Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
-rw-r--r--src/cpu/testers/traffic_gen/base.cc9
-rw-r--r--src/cpu/testers/traffic_gen/base.hh3
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 41d005220..6778e417b 100644
--- a/src/cpu/testers/traffic_gen/base.cc
+++ b/src/cpu/testers/traffic_gen/base.cc
@@ -78,7 +78,6 @@ BaseTrafficGen::BaseTrafficGen(const BaseTrafficGenParams* p)
retryPkt(NULL),
retryPktTick(0),
updateEvent([this]{ update(); }, name()),
- numSuppressed(0),
masterID(system->getMasterId(this))
{
}
@@ -186,9 +185,9 @@ BaseTrafficGen::update()
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;
@@ -314,6 +313,10 @@ BaseTrafficGen::regStats()
.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 080bd7847..fe4229f23 100644
--- a/src/cpu/testers/traffic_gen/base.hh
+++ b/src/cpu/testers/traffic_gen/base.hh
@@ -163,7 +163,8 @@ class BaseTrafficGen : public MemObject
/** 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. */