From 42044645b9e3a60bd77a84de6c356033d6133004 Mon Sep 17 00:00:00 2001 From: Matthew Poremba Date: Thu, 19 Jan 2017 11:59:10 -0500 Subject: ruby: Check MessageBuffer space in garnet NetworkInterface Garnet's NetworkInterface does not consider the size of MessageBuffers when ejecting a Message from the network. Add a size check for the MessageBuffer and only enqueue if space is available. If space is not available, the message if placed in a queue and the credit is held. A callback from the MessageBuffer is implemented to wake the NetworkInterface. If there are messages in the stalled queue, they are processed first, in a FIFO manner and if succesfully ejected, the credit is finally sent back upstream. The maximum size of the stall queue is equal to the number of valid VNETs with MessageBuffers attached. --- src/mem/ruby/network/garnet2.0/NetworkInterface.hh | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/mem/ruby/network/garnet2.0/NetworkInterface.hh') diff --git a/src/mem/ruby/network/garnet2.0/NetworkInterface.hh b/src/mem/ruby/network/garnet2.0/NetworkInterface.hh index f1d1fd505..2dfb2d287 100644 --- a/src/mem/ruby/network/garnet2.0/NetworkInterface.hh +++ b/src/mem/ruby/network/garnet2.0/NetworkInterface.hh @@ -62,6 +62,7 @@ class NetworkInterface : public ClockedObject, public Consumer void addOutPort(NetworkLink *out_link, CreditLink *credit_link, SwitchID router_id); + void dequeueCallback(); void wakeup(); void addNode(std::vector &inNode, std::vector &outNode); @@ -90,6 +91,10 @@ class NetworkInterface : public ClockedObject, public Consumer CreditLink *inCreditLink; CreditLink *outCreditLink; + // Queue for stalled flits + std::deque m_stall_queue; + std::vector m_stall_count; + // Input Flit Buffers // The flit buffers which will serve the Consumer std::vector m_ni_out_vcs; @@ -102,10 +107,15 @@ class NetworkInterface : public ClockedObject, public Consumer // When a vc stays busy for a long time, it indicates a deadlock std::vector vc_busy_counter; + bool checkStallQueue(); bool flitisizeMessage(MsgPtr msg_ptr, int vnet); int calculateVC(int vnet); + void scheduleOutputLink(); void checkReschedule(); + void sendCredit(flit *t_flit, bool is_free); + + void incrementStats(flit *t_flit); }; #endif // __MEM_RUBY_NETWORK_GARNET_NETWORK_INTERFACE_HH__ -- cgit v1.2.3