diff -r 3c62e3b7f658 -r b989f6228833 src/mem/packet_queue.hh --- a/src/mem/packet_queue.hh Fri Mar 15 16:28:08 2013 -0500 +++ b/src/mem/packet_queue.hh Sun Mar 17 19:52:43 2013 -0500 @@ -84,6 +84,9 @@ * serviced yet. */ DeferredPacketList transmitList; + /** Maximum packet buffer depth. Used for sanity checking */ + unsigned maxQueueDepth; + /** The manager which is used for the event queue */ EventManager& em; @@ -178,6 +181,13 @@ */ virtual const std::string name() const = 0; + /** + * Set maximum depth of the packet queue. Default is 100 packets. + * + * @param Maximum number of packets this queue can hold + */ + void setMaxDepth(unsigned max_depth) { maxQueueDepth = max_depth; } + /** Check the list of buffered packets against the supplied * functional request. */ bool checkFunctional(PacketPtr pkt); diff -r 3c62e3b7f658 -r b989f6228833 src/mem/packet_queue.cc --- a/src/mem/packet_queue.cc Fri Mar 15 16:28:08 2013 -0500 +++ b/src/mem/packet_queue.cc Sun Mar 17 19:52:43 2013 -0500 @@ -49,8 +49,8 @@ using namespace std; PacketQueue::PacketQueue(EventManager& _em, const std::string& _label) - : em(_em), sendEvent(this), drainManager(NULL), label(_label), - waitingOnRetry(false) + : maxQueueDepth(100), em(_em), sendEvent(this), drainManager(NULL), + label(_label), waitingOnRetry(false) { } @@ -115,9 +115,10 @@ // 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()); + if (transmitList.size() > maxQueueDepth) { + panic("Packet queue %s has grown beyond %u packets. " + "To extend this limit, call setMaxDepth(max_depth)\n", + name(), maxQueueDepth); } // nothing on the list, or earlier than current front element,