diff options
author | Matthew Poremba <matthew.poremba@amd.com> | 2017-01-19 11:59:10 -0500 |
---|---|---|
committer | Matthew Poremba <matthew.poremba@amd.com> | 2017-01-19 11:59:10 -0500 |
commit | 42044645b9e3a60bd77a84de6c356033d6133004 (patch) | |
tree | 0afd45ce0d71b4dc8cefe21f3ec188cb21a9774e /src/mem/ruby/network/garnet2.0/NetworkInterface.hh | |
parent | a4b546c3a139aeb33f087422637ac06fc4477d11 (diff) | |
download | gem5-42044645b9e3a60bd77a84de6c356033d6133004.tar.xz |
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.
Diffstat (limited to 'src/mem/ruby/network/garnet2.0/NetworkInterface.hh')
-rw-r--r-- | src/mem/ruby/network/garnet2.0/NetworkInterface.hh | 10 |
1 files changed, 10 insertions, 0 deletions
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<MessageBuffer *> &inNode, std::vector<MessageBuffer *> &outNode); @@ -90,6 +91,10 @@ class NetworkInterface : public ClockedObject, public Consumer CreditLink *inCreditLink; CreditLink *outCreditLink; + // Queue for stalled flits + std::deque<flit *> m_stall_queue; + std::vector<int> m_stall_count; + // Input Flit Buffers // The flit buffers which will serve the Consumer std::vector<flitBuffer *> 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<int> 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__ |