summaryrefslogtreecommitdiff
path: root/src/mem/ruby/network/garnet/flexible-pipeline/Router.cc
diff options
context:
space:
mode:
authorTushar Krishna <tushar@csail.mit.edu>2011-03-21 22:51:59 -0400
committerTushar Krishna <tushar@csail.mit.edu>2011-03-21 22:51:59 -0400
commit46cce440be4999cfdedebbf190c83570ba9f1b49 (patch)
tree814477ea1de4ac4fc40d6bfd00764316bb37a45c /src/mem/ruby/network/garnet/flexible-pipeline/Router.cc
parent1b9002eefc39654b18547d7adb77b6fec77d883e (diff)
downloadgem5-46cce440be4999cfdedebbf190c83570ba9f1b49.tar.xz
This patch makes garnet use the info about active and inactive vnets during allocation and power estimations etc
Diffstat (limited to 'src/mem/ruby/network/garnet/flexible-pipeline/Router.cc')
-rw-r--r--src/mem/ruby/network/garnet/flexible-pipeline/Router.cc41
1 files changed, 35 insertions, 6 deletions
diff --git a/src/mem/ruby/network/garnet/flexible-pipeline/Router.cc b/src/mem/ruby/network/garnet/flexible-pipeline/Router.cc
index fef6b00a1..4a0d59973 100644
--- a/src/mem/ruby/network/garnet/flexible-pipeline/Router.cc
+++ b/src/mem/ruby/network/garnet/flexible-pipeline/Router.cc
@@ -156,14 +156,27 @@ Router::vc_arbitrate()
if (inport >= m_in_link.size())
inport = 0;
int invc = m_round_robin_invc[inport];
- m_round_robin_invc[inport]++;
- if (m_round_robin_invc[inport] >= m_num_vcs)
- m_round_robin_invc[inport] = 0;
+ int next_round_robin_invc = invc;
+ do {
+ next_round_robin_invc++;
+
+ if (next_round_robin_invc >= m_num_vcs)
+ next_round_robin_invc = 0;
+
+ } while (!(m_net_ptr->validVirtualNetwork(
+ get_vnet(next_round_robin_invc))));
+
+ m_round_robin_invc[inport] = next_round_robin_invc;
+
for (int vc_iter = 0; vc_iter < m_num_vcs; vc_iter++) {
invc++;
if (invc >= m_num_vcs)
invc = 0;
+
+ if (!(m_net_ptr->validVirtualNetwork(get_vnet(invc))))
+ continue;
+
InVcState *in_vc_state = m_in_vc_state[inport][invc];
if (in_vc_state->isInState(VC_AB_, g_eventQueue_ptr->getTime())) {
@@ -330,9 +343,17 @@ Router::scheduleOutputLinks()
{
for (int port = 0; port < m_out_link.size(); port++) {
int vc_tolookat = m_vc_round_robin[port];
- m_vc_round_robin[port]++;
- if (m_vc_round_robin[port] == m_num_vcs)
- m_vc_round_robin[port] = 0;
+
+ int next_round_robin_vc_tolookat = vc_tolookat;
+ do {
+ next_round_robin_vc_tolookat++;
+
+ if (next_round_robin_vc_tolookat == m_num_vcs)
+ next_round_robin_vc_tolookat = 0;
+ } while (!(m_net_ptr->validVirtualNetwork(
+ get_vnet(next_round_robin_vc_tolookat))));
+
+ m_vc_round_robin[port] = next_round_robin_vc_tolookat;
for (int i = 0; i < m_num_vcs; i++) {
vc_tolookat++;
@@ -358,6 +379,14 @@ Router::scheduleOutputLinks()
}
}
+int
+Router::get_vnet(int vc)
+{
+ int vnet = vc/m_vc_per_vnet;
+ assert(vnet < m_virtual_networks);
+ return vnet;
+}
+
void
Router::checkReschedule()
{