diff options
Diffstat (limited to 'src/mem/ruby/network/garnet/flexible-pipeline')
3 files changed, 14 insertions, 29 deletions
diff --git a/src/mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.cc b/src/mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.cc index 7a304be28..87418b6b1 100644 --- a/src/mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.cc +++ b/src/mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.cc @@ -153,7 +153,6 @@ GarnetNetwork::checkNetworkAllocation(NodeID id, bool ordered, if (ordered) { m_ordered[network_num] = true; } - m_in_use[network_num] = true; } /* diff --git a/src/mem/ruby/network/garnet/flexible-pipeline/Router.cc b/src/mem/ruby/network/garnet/flexible-pipeline/Router.cc index ef985058e..9451439c9 100644 --- a/src/mem/ruby/network/garnet/flexible-pipeline/Router.cc +++ b/src/mem/ruby/network/garnet/flexible-pipeline/Router.cc @@ -157,27 +157,13 @@ Router::vc_arbitrate() if (inport >= m_in_link.size()) inport = 0; int invc = m_round_robin_invc[inport]; - - 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; + m_round_robin_invc[inport] = get_next_round_robin_vc(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_, curCycle())) { @@ -335,17 +321,7 @@ Router::scheduleOutputLinks() { for (int port = 0; port < m_out_link.size(); port++) { int vc_tolookat = m_vc_round_robin[port]; - - 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; + m_vc_round_robin[port] = get_next_round_robin_vc(vc_tolookat); for (int i = 0; i < m_num_vcs; i++) { vc_tolookat++; @@ -374,13 +350,22 @@ Router::scheduleOutputLinks() } int -Router::get_vnet(int vc) +Router::get_vnet(int vc) const { int vnet = vc/m_vc_per_vnet; assert(vnet < m_virtual_networks); return vnet; } +int +Router::get_next_round_robin_vc(int vc) const +{ + vc++; + if (vc == m_num_vcs) + vc = 0; + return vc; +} + void Router::checkReschedule() { diff --git a/src/mem/ruby/network/garnet/flexible-pipeline/Router.hh b/src/mem/ruby/network/garnet/flexible-pipeline/Router.hh index e3f193045..11a860b11 100644 --- a/src/mem/ruby/network/garnet/flexible-pipeline/Router.hh +++ b/src/mem/ruby/network/garnet/flexible-pipeline/Router.hh @@ -65,7 +65,6 @@ class Router : public BasicRouter, public FlexibleConsumer void grant_vc(int out_port, int vc, Cycles grant_time); void release_vc(int out_port, int vc, Cycles release_time); void vc_arbitrate(); - int get_vnet(int vc); void print(std::ostream& out) const; @@ -104,6 +103,8 @@ class Router : public BasicRouter, public FlexibleConsumer void checkReschedule(); void check_arbiter_reschedule(); void scheduleOutputLinks(); + int get_vnet(int vc) const; + int get_next_round_robin_vc(int vc) const; }; #endif // __MEM_RUBY_NETWORK_GARNET_FLEXIBLE_PIPELINE_ROUTER_HH__ |