From d690ebed4649b6e5837e9ac0772d8e57b56ba482 Mon Sep 17 00:00:00 2001 From: Srikant Bharadwaj Date: Tue, 16 Jul 2019 17:15:57 -0400 Subject: [PATCH] mem-garnet: Separable allocator in Garnet not fair enough. Currently there are independent round robin arbiter at each input port and output port. Every time a VC is selected for output allocation round robin is incremented irrespective of if it is selected by its output port or not. This leads to unfair arbitration at input port and is well known[1]. This patch fixes it to increment only if the output port also selects it. [1] D. U. Becker and W. J. Dally, "Allocator implementations for network-on-chip routers," Proceedings of the Conference on High Performance Computing Networking, Storage and Analysis, Portland, OR, 2009, pp. 1-12 Change-Id: I65963fb8082c51c0e3c6e031a8b87b4f5c3626e1 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/32601 Tested-by: kokoro Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power --- src/mem/ruby/network/garnet2.0/SwitchAllocator.cc | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/mem/ruby/network/garnet2.0/SwitchAllocator.cc b/src/mem/ruby/network/garnet2.0/SwitchAllocator.cc index 324134306..1ed6de1e6 100644 --- a/src/mem/ruby/network/garnet2.0/SwitchAllocator.cc +++ b/src/mem/ruby/network/garnet2.0/SwitchAllocator.cc @@ -130,11 +130,6 @@ SwitchAllocator::arbitrate_inports() m_port_requests[outport][inport] = true; m_vc_winners[outport][inport]= invc; - // Update Round Robin pointer to the next VC - m_round_robin_invc[inport] = invc + 1; - if (m_round_robin_invc[inport] >= m_num_vcs) - m_round_robin_invc[inport] = 0; - break; // got one vc winner for this port } } @@ -248,6 +243,15 @@ SwitchAllocator::arbitrate_outports() if (m_round_robin_inport[outport] >= m_num_inports) m_round_robin_inport[outport] = 0; + // Update Round Robin pointer to the next VC + // We do it here to keep it fair. + // Only the VC which got switch traversal + // is updated. + m_round_robin_invc[inport] = invc + 1; + if (m_round_robin_invc[inport] >= m_num_vcs) + m_round_robin_invc[inport] = 0; + + break; // got a input winner for this outport } -- 2.30.2