Srikant Bharadwaj has submitted this change and it was merged. (
https://gem5-review.googlesource.com/c/public/gem5/+/16688 )
Change subject: ruby: Fix garnet's round robin arbitration for vc selection
......................................................................
ruby: Fix garnet's round robin arbitration for vc selection
Garnet utilizes round robin policy to select a VC for
transmission ar Network Interface and Routers. The current logic
for round robin is only fair if all the virtual networks are active
at a given router. If the router or network interface is not
receiving traffic in from any vnet then the priority is always taken
up by the next vnet in numerically (or loops back to 0).
This fix changes the way we perform round robin arbitration. When
a VC is selected in a cycle, the round robin pointer is set to the VC
next to it and is iterated from there on. If any VC does not have a
flit in a given cycle, it will lose its turn until the next round.
At maximum traffic this will model round robin correctly even if
a certain VNET is not active at that unit.
Change-Id: I9bf805221054f9f25bee14b57ff521f4ce4ca980
Reviewed-on: https://gem5-review.googlesource.com/c/16688
Reviewed-by: Jieming Yin <[email protected]>
Maintainer: Jason Lowe-Power <[email protected]>
---
M src/mem/ruby/network/garnet2.0/NetworkInterface.cc
M src/mem/ruby/network/garnet2.0/SwitchAllocator.cc
2 files changed, 6 insertions(+), 7 deletions(-)
Approvals:
Jieming Yin: Looks good to me, approved
Jason Lowe-Power: Looks good to me, approved
diff --git a/src/mem/ruby/network/garnet2.0/NetworkInterface.cc
b/src/mem/ruby/network/garnet2.0/NetworkInterface.cc
index b3d89ca..4e69270 100644
--- a/src/mem/ruby/network/garnet2.0/NetworkInterface.cc
+++ b/src/mem/ruby/network/garnet2.0/NetworkInterface.cc
@@ -437,9 +437,6 @@
NetworkInterface::scheduleOutputLink()
{
int vc = m_vc_round_robin;
- m_vc_round_robin++;
- if (m_vc_round_robin == m_num_vcs)
- m_vc_round_robin = 0;
for (int i = 0; i < m_num_vcs; i++) {
vc++;
@@ -470,6 +467,8 @@
if (!is_candidate_vc)
continue;
+ m_vc_round_robin = vc;
+
m_out_vc_state[vc]->decrement_credit();
// Just removing the flit
flit *t_flit = m_ni_out_vcs[vc]->getTopFlit();
diff --git a/src/mem/ruby/network/garnet2.0/SwitchAllocator.cc
b/src/mem/ruby/network/garnet2.0/SwitchAllocator.cc
index 836f071..1e9d0e6 100644
--- a/src/mem/ruby/network/garnet2.0/SwitchAllocator.cc
+++ b/src/mem/ruby/network/garnet2.0/SwitchAllocator.cc
@@ -136,8 +136,8 @@
m_port_requests[outport][inport] = true;
m_vc_winners[outport][inport]= invc;
- // Update Round Robin pointer
- m_round_robin_invc[inport]++;
+ // 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;
@@ -252,7 +252,7 @@
m_port_requests[outport][inport] = false;
// Update Round Robin pointer
- m_round_robin_inport[outport]++;
+ m_round_robin_inport[outport] = inport + 1;
if (m_round_robin_inport[outport] >= m_num_inports)
m_round_robin_inport[outport] = 0;
@@ -393,4 +393,4 @@
{
m_input_arbiter_activity = 0;
m_output_arbiter_activity = 0;
-}
\ No newline at end of file
+}
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/16688
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: I9bf805221054f9f25bee14b57ff521f4ce4ca980
Gerrit-Change-Number: 16688
Gerrit-PatchSet: 5
Gerrit-Owner: Srikant Bharadwaj <[email protected]>
Gerrit-Reviewer: Anthony Gutierrez <[email protected]>
Gerrit-Reviewer: Gabe Black <[email protected]>
Gerrit-Reviewer: Jason Lowe-Power <[email protected]>
Gerrit-Reviewer: Jieming Yin <[email protected]>
Gerrit-Reviewer: Srikant Bharadwaj <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev