summaryrefslogtreecommitdiff
path: root/src/mem/ruby/network/garnet
diff options
context:
space:
mode:
authorTushar Krishna <tushar@csail.mit.edu>2011-05-31 02:55:14 -0400
committerTushar Krishna <tushar@csail.mit.edu>2011-05-31 02:55:14 -0400
commit36899dc197c17a87077c59604e00482b6f63a2a8 (patch)
treef3649419649a990e135904c259713adb157b053f /src/mem/ruby/network/garnet
parent8dcbe8adb537dafcadbb97ff87605936fe42b2b7 (diff)
downloadgem5-36899dc197c17a87077c59604e00482b6f63a2a8.tar.xz
garnet: added network ptr to links to be used by orion
Diffstat (limited to 'src/mem/ruby/network/garnet')
-rw-r--r--src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.cc7
-rw-r--r--src/mem/ruby/network/garnet/fixed-pipeline/NetworkLink_d.hh7
2 files changed, 13 insertions, 1 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 7ba2e561a..1fa4abbac 100644
--- a/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.cc
+++ b/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.cc
@@ -90,6 +90,13 @@ GarnetNetwork_d::init()
}
// false because this isn't a reconfiguration
m_topology_ptr->createLinks(this, false);
+
+ // initialize the link's network pointers
+ for (vector<NetworkLink_d*>::const_iterator i = m_link_ptr_vector.begin();
+ i != m_link_ptr_vector.end(); ++i) {
+ NetworkLink_d* net_link = safe_cast<NetworkLink_d*>(*i);
+ net_link->init_net_ptr(this);
+ }
}
GarnetNetwork_d::~GarnetNetwork_d()
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 5da006c4d..61dfe5c52 100644
--- a/src/mem/ruby/network/garnet/fixed-pipeline/NetworkLink_d.hh
+++ b/src/mem/ruby/network/garnet/fixed-pipeline/NetworkLink_d.hh
@@ -65,12 +65,17 @@ class NetworkLink_d : public SimObject, public Consumer
inline bool isReady() { return linkBuffer->isReady(); }
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;
+ }
protected:
int m_id;
int m_latency;
-
int channel_width;
+
+ GarnetNetwork_d *m_net_ptr;
flitBuffer_d *linkBuffer;
Consumer *link_consumer;
flitBuffer_d *link_srcQueue;