}
m_topology_ptr->createLinks(this);
- // initialize the link's network pointers
- for (vector<NetworkLink_d*>::const_iterator i = m_links.begin();
- i != m_links.end(); ++i) {
- NetworkLink_d* net_link = safe_cast<NetworkLink_d*>(*i);
- net_link->init_net_ptr(this);
- }
-
// FaultModel: declare each router to the fault model
if(isFaultModelEnabled()){
for (vector<Router_d*>::const_iterator i= m_routers.begin();
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();
}
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; }
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:
Cycles m_latency;
int channel_width;
- GarnetNetwork_d *m_net_ptr;
flitBuffer_d *linkBuffer;
Consumer *link_consumer;
flitBuffer_d *link_srcQueue;
}
void
-NetworkLink_d::calculate_power()
+NetworkLink_d::calculate_power(double sim_cycles)
{
OrionConfig* orion_cfg_ptr;
OrionLink* orion_link_ptr;
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 =