changeset 5490105626dc in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=5490105626dc
description:
mem: Add sanity check to packet queue size
This patch adds a basic check to ensure that the packet queue does not
grow absurdly large. The queue should only be used to store packets
that were delayed due to blocking from the neighbouring port, and not
for actual storage. Thus, a limit of 100 has been chosen for now
(which is already quite substantial).
diffstat:
src/mem/packet_queue.cc | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diffs (17 lines):
diff -r 8f8c911ab5a7 -r 5490105626dc src/mem/packet_queue.cc
--- a/src/mem/packet_queue.cc Mon Jan 07 13:05:35 2013 -0500
+++ b/src/mem/packet_queue.cc Mon Jan 07 13:05:35 2013 -0500
@@ -113,6 +113,13 @@
// express snoops should never be queued
assert(!pkt->isExpressSnoop());
+ // add a very basic sanity check on the port to ensure the
+ // invisible buffer is not growing beyond reasonable limits
+ if (transmitList.size() > 100) {
+ panic("Packet queue %s has grown beyond 100 packets\n",
+ name());
+ }
+
// nothing on the list, or earlier than current front element,
// schedule an event
if (transmitList.empty() || when < transmitList.front().tick) {
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev