From bd8f954526bc33ab2b57fbc91f2caa82b2115db8 Mon Sep 17 00:00:00 2001 From: Nilay Vaish Date: Fri, 21 Feb 2014 08:02:04 -0600 Subject: [PATCH] ruby: network: garnet: fixed: removes net_ptr from links --- .../network/garnet/fixed-pipeline/GarnetNetwork_d.cc | 10 ++-------- .../network/garnet/fixed-pipeline/NetworkLink_d.hh | 4 +--- src/mem/ruby/network/orion/NetworkPower.cc | 4 +--- 3 files changed, 4 insertions(+), 14 deletions(-) diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.cc b/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.cc index 8db57267e..831c0b2fe 100644 --- a/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.cc +++ b/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.cc @@ -90,13 +90,6 @@ GarnetNetwork_d::init() } m_topology_ptr->createLinks(this); - // initialize the link's network pointers - for (vector::const_iterator i = m_links.begin(); - i != m_links.end(); ++i) { - NetworkLink_d* net_link = safe_cast(*i); - net_link->init_net_ptr(this); - } - // FaultModel: declare each router to the fault model if(isFaultModelEnabled()){ for (vector::const_iterator i= m_routers.begin(); @@ -285,8 +278,9 @@ GarnetNetwork_d::collateLinkStats() void GarnetNetwork_d::collatePowerStats() { + double sim_cycles = (double)(curCycle() - g_ruby_start); for (int i = 0; i < m_links.size(); i++) { - m_links[i]->calculate_power(); + m_links[i]->calculate_power(sim_cycles); m_dynamic_link_power += m_links[i]->get_dynamic_power(); m_static_link_power += m_links[i]->get_static_power(); } diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/NetworkLink_d.hh b/src/mem/ruby/network/garnet/fixed-pipeline/NetworkLink_d.hh index fcdd28b67..6d1396023 100644 --- a/src/mem/ruby/network/garnet/fixed-pipeline/NetworkLink_d.hh +++ b/src/mem/ruby/network/garnet/fixed-pipeline/NetworkLink_d.hh @@ -56,7 +56,7 @@ class NetworkLink_d : public ClockedObject, public Consumer int get_id(){return m_id;} void wakeup(); - void calculate_power(); + void calculate_power(double); double get_dynamic_power() const { return m_power_dyn; } double get_static_power()const { return m_power_sta; } @@ -69,7 +69,6 @@ class NetworkLink_d : public ClockedObject, public Consumer inline flit_d* peekLink() { return linkBuffer->peekTopFlit(); } inline flit_d* consumeLink() { return linkBuffer->getTopFlit(); } - void init_net_ptr(GarnetNetwork_d* net_ptr) { m_net_ptr = net_ptr; } uint32_t functionalWrite(Packet *); private: @@ -77,7 +76,6 @@ class NetworkLink_d : public ClockedObject, public Consumer Cycles m_latency; int channel_width; - GarnetNetwork_d *m_net_ptr; flitBuffer_d *linkBuffer; Consumer *link_consumer; flitBuffer_d *link_srcQueue; diff --git a/src/mem/ruby/network/orion/NetworkPower.cc b/src/mem/ruby/network/orion/NetworkPower.cc index f4a471986..cb2841f04 100644 --- a/src/mem/ruby/network/orion/NetworkPower.cc +++ b/src/mem/ruby/network/orion/NetworkPower.cc @@ -211,7 +211,7 @@ Router_d::calculate_power() } void -NetworkLink_d::calculate_power() +NetworkLink_d::calculate_power(double sim_cycles) { OrionConfig* orion_cfg_ptr; OrionLink* orion_link_ptr; @@ -232,8 +232,6 @@ NetworkLink_d::calculate_power() channel_width_bits, orion_cfg_ptr); - double sim_cycles = (double)(m_net_ptr->curCycle() - g_ruby_start); - // Dynamic Power // Assume half the bits flipped on every link activity double link_dynamic_energy = -- 2.30.2