ruby: Replace Time with Cycles in SequencerMessage
[gem5.git] / src / mem / packet_queue.cc
index eb94cc3970e5048727b65cdf54ae3215742b6a1b..e60e77453b4c1e99292eb18af308d9e797cd6c2b 100644 (file)
@@ -41,6 +41,7 @@
  *          Andreas Hansson
  */
 
+#include "base/trace.hh"
 #include "debug/Drain.hh"
 #include "debug/PacketQueue.hh"
 #include "mem/packet_queue.hh"
@@ -112,6 +113,13 @@ PacketQueue::schedSendTiming(PacketPtr pkt, Tick when, bool send_as_snoop)
     // 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) {