summaryrefslogtreecommitdiff
path: root/src/cpu/testers
diff options
context:
space:
mode:
authorAndreas Hansson <andreas.hansson@arm.com>2016-03-20 06:38:34 -0400
committerAndreas Hansson <andreas.hansson@arm.com>2016-03-20 06:38:34 -0400
commit3ba481496d8a2789ee7e6ff193fbc68cd2008fd2 (patch)
tree4f6d6673aae0aca4eda43043bc343ca8e3ecacf3 /src/cpu/testers
parent4a9dd1feb846e015303196ad5274a829a7c18525 (diff)
downloadgem5-3ba481496d8a2789ee7e6ff193fbc68cd2008fd2.tar.xz
cpu: warn if TrafficGen is suppressing a large numer of packets
Add a basic warning for every 10000 packet that is suppressed to alert the user.
Diffstat (limited to 'src/cpu/testers')
-rw-r--r--src/cpu/testers/traffic_gen/traffic_gen.cc9
-rw-r--r--src/cpu/testers/traffic_gen/traffic_gen.hh2
2 files changed, 10 insertions, 1 deletions
diff --git a/src/cpu/testers/traffic_gen/traffic_gen.cc b/src/cpu/testers/traffic_gen/traffic_gen.cc
index f8eb38d31..a405351ed 100644
--- a/src/cpu/testers/traffic_gen/traffic_gen.cc
+++ b/src/cpu/testers/traffic_gen/traffic_gen.cc
@@ -63,7 +63,8 @@ TrafficGen::TrafficGen(const TrafficGenParams* p)
port(name() + ".port", *this),
retryPkt(NULL),
retryPktTick(0),
- updateEvent(this)
+ updateEvent(this),
+ numSuppressed(0)
{
}
@@ -198,6 +199,12 @@ TrafficGen::update()
} else {
DPRINTF(TrafficGen, "Suppressed packet %s 0x%x\n",
pkt->cmdString(), pkt->getAddr());
+
+ ++numSuppressed;
+ if (numSuppressed % 10000)
+ warn("%s suppressed %d packets with non-memory addresses\n",
+ name(), numSuppressed);
+
delete pkt->req;
delete pkt;
pkt = nullptr;
diff --git a/src/cpu/testers/traffic_gen/traffic_gen.hh b/src/cpu/testers/traffic_gen/traffic_gen.hh
index d57b613f3..914b4ac09 100644
--- a/src/cpu/testers/traffic_gen/traffic_gen.hh
+++ b/src/cpu/testers/traffic_gen/traffic_gen.hh
@@ -177,6 +177,8 @@ class TrafficGen : public MemObject
/** Event for scheduling updates */
EventWrapper<TrafficGen, &TrafficGen::update> updateEvent;
+ uint64_t numSuppressed;
+
/** Count the number of generated packets. */
Stats::Scalar numPackets;