diff --git a/src/mem/packet_queue.hh b/src/mem/packet_queue.hh --- a/src/mem/packet_queue.hh +++ b/src/mem/packet_queue.hh @@ -89,6 +89,13 @@ /** Event used to call processSendEvent. */ EventWrapper sendEvent; + /* + * Optionally disable the sanity check + * on the size of the transmitList. The + * sanity check will be enabled by default. + */ + bool disableSanityCheck; + protected: /** Label to use for print request packets label stack. */ @@ -123,8 +130,11 @@ * * @param _em Event manager used for scheduling this queue * @param _label Label to push on the label stack for print request packets + * @param disable_sanity_check Flag used to disable the sanity check + * on the size of the transmitList. The check is enabled by default. */ - PacketQueue(EventManager& _em, const std::string& _label); + PacketQueue(EventManager& _em, const std::string& _label, + bool disable_sanity_check = false); /** * Virtual desctructor since the class may be used as a base class. # Node ID 82d5998cb3bf007aea38fd4f2cc9b2c795bb7f68 # Parent 13d08dd4efc6cdd323abffcff769274b13b302ec diff --git a/src/mem/packet_queue.cc b/src/mem/packet_queue.cc --- a/src/mem/packet_queue.cc +++ b/src/mem/packet_queue.cc @@ -48,9 +48,10 @@ using namespace std; -PacketQueue::PacketQueue(EventManager& _em, const std::string& _label) - : em(_em), sendEvent(this), label(_label), - waitingOnRetry(false) +PacketQueue::PacketQueue(EventManager& _em, const std::string& _label, + bool disable_sanity_check) + : em(_em), sendEvent(this), disableSanityCheck(disable_sanity_check), + label(_label), waitingOnRetry(false) { } @@ -114,7 +115,7 @@ // add a very basic sanity check on the port to ensure the // invisible buffer is not growing beyond reasonable limits - if (transmitList.size() > 100) { + if (!disableSanityCheck && transmitList.size() > 100) { panic("Packet queue %s has grown beyond 100 packets\n", name()); }