summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTushar Krishna <tushar@csail.mit.edu>2011-05-18 03:04:14 -0400
committerTushar Krishna <tushar@csail.mit.edu>2011-05-18 03:04:14 -0400
commit26eaba4cb5a5933c17abe9efca8590610f1e36b4 (patch)
treee1edaf1ac8e04594b2d56c378834f1d47ae6cbfa /src
parent44e599a1a4843db07cb77cfedc136e8e994016cf (diff)
downloadgem5-26eaba4cb5a5933c17abe9efca8590610f1e36b4.tar.xz
garnet: rename and rearrange config parameters.
Renamed (message) class to vnet for consistency with rest of ruby. Moved some parameters specific to fixed/flexible garnet networks into their corresponding py files.
Diffstat (limited to 'src')
-rw-r--r--src/mem/ruby/network/garnet/BaseGarnetNetwork.cc5
-rw-r--r--src/mem/ruby/network/garnet/BaseGarnetNetwork.hh10
-rw-r--r--src/mem/ruby/network/garnet/BaseGarnetNetwork.py5
-rw-r--r--src/mem/ruby/network/garnet/fixed-pipeline/GarnetLink_d.py4
-rw-r--r--src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.cc13
-rw-r--r--src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.hh10
-rw-r--r--src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.py3
-rw-r--r--src/mem/ruby/network/garnet/fixed-pipeline/GarnetRouter_d.py4
-rw-r--r--src/mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.cc2
-rw-r--r--src/mem/ruby/network/garnet/fixed-pipeline/NetworkLink_d.cc4
-rw-r--r--src/mem/ruby/network/garnet/fixed-pipeline/Router_d.cc2
-rw-r--r--src/mem/ruby/network/garnet/flexible-pipeline/GarnetLink.py4
-rw-r--r--src/mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.cc11
-rw-r--r--src/mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.hh2
-rw-r--r--src/mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.py2
-rw-r--r--src/mem/ruby/network/garnet/flexible-pipeline/GarnetRouter.py4
-rw-r--r--src/mem/ruby/network/garnet/flexible-pipeline/NetworkInterface.cc2
-rw-r--r--src/mem/ruby/network/garnet/flexible-pipeline/NetworkLink.cc2
-rw-r--r--src/mem/ruby/network/garnet/flexible-pipeline/Router.cc2
19 files changed, 46 insertions, 45 deletions
diff --git a/src/mem/ruby/network/garnet/BaseGarnetNetwork.cc b/src/mem/ruby/network/garnet/BaseGarnetNetwork.cc
index 2e3cc8b24..e3eb73b0a 100644
--- a/src/mem/ruby/network/garnet/BaseGarnetNetwork.cc
+++ b/src/mem/ruby/network/garnet/BaseGarnetNetwork.cc
@@ -37,10 +37,7 @@ BaseGarnetNetwork::BaseGarnetNetwork(const Params *p)
: Network(p)
{
m_ni_flit_size = p->ni_flit_size;
- m_number_of_pipe_stages = p->number_of_pipe_stages;
- m_vcs_per_class = p->vcs_per_class;
- m_buffers_per_data_vc = p->buffers_per_data_vc;
- m_buffers_per_ctrl_vc = p->buffers_per_ctrl_vc;
+ m_vcs_per_vnet = p->vcs_per_vnet;
m_ruby_start = 0;
m_flits_received = 0;
diff --git a/src/mem/ruby/network/garnet/BaseGarnetNetwork.hh b/src/mem/ruby/network/garnet/BaseGarnetNetwork.hh
index 8e3115eb5..95d4c5f5c 100644
--- a/src/mem/ruby/network/garnet/BaseGarnetNetwork.hh
+++ b/src/mem/ruby/network/garnet/BaseGarnetNetwork.hh
@@ -49,17 +49,11 @@ class BaseGarnetNetwork : public Network
void init();
int getNiFlitSize() {return m_ni_flit_size; }
- int getNumPipeStages() {return m_number_of_pipe_stages; }
- int getVCsPerClass() {return m_vcs_per_class; }
- int getBuffersPerDataVC() {return m_buffers_per_data_vc; }
- int getBuffersPerCtrlVC() {return m_buffers_per_ctrl_vc; }
+ int getVCsPerVnet() {return m_vcs_per_vnet; }
protected:
int m_ni_flit_size;
- int m_number_of_pipe_stages;
- int m_vcs_per_class;
- int m_buffers_per_data_vc;
- int m_buffers_per_ctrl_vc;
+ int m_vcs_per_vnet;
int m_flits_received;
int m_flits_injected;
diff --git a/src/mem/ruby/network/garnet/BaseGarnetNetwork.py b/src/mem/ruby/network/garnet/BaseGarnetNetwork.py
index d2366ed1a..8073131f4 100644
--- a/src/mem/ruby/network/garnet/BaseGarnetNetwork.py
+++ b/src/mem/ruby/network/garnet/BaseGarnetNetwork.py
@@ -35,7 +35,4 @@ class BaseGarnetNetwork(RubyNetwork):
type = 'BaseGarnetNetwork'
abstract = True
ni_flit_size = Param.Int(16, "network interface flit size in bytes")
- number_of_pipe_stages = Param.Int(4, "router pipeline stages");
- vcs_per_class = Param.Int(4, "virtual channels per message class");
- buffers_per_data_vc = Param.Int(4, "buffers per data virtual channel");
- buffers_per_ctrl_vc = Param.Int(1, "buffers per ctrl virtual channel");
+ vcs_per_vnet = Param.Int(4, "virtual channels per virtual network");
diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/GarnetLink_d.py b/src/mem/ruby/network/garnet/fixed-pipeline/GarnetLink_d.py
index 363ff2e44..1fb7e0b7b 100644
--- a/src/mem/ruby/network/garnet/fixed-pipeline/GarnetLink_d.py
+++ b/src/mem/ruby/network/garnet/fixed-pipeline/GarnetLink_d.py
@@ -37,8 +37,8 @@ class NetworkLink_d(SimObject):
type = 'NetworkLink_d'
link_id = Param.Int(Parent.link_id, "link id")
link_latency = Param.Int(Parent.latency, "link latency")
- vcs_per_class = Param.Int(Parent.vcs_per_class,
- "virtual channels per message class")
+ vcs_per_vnet = Param.Int(Parent.vcs_per_vnet,
+ "virtual channels per virtual network")
virt_nets = Param.Int(Parent.number_of_virtual_networks,
"number of virtual networks")
channel_width = Param.Int(Parent.bandwidth_factor,
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 c8b9fbea7..17dba251d 100644
--- a/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.cc
+++ b/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.cc
@@ -49,6 +49,9 @@ using m5::stl_helpers::deletePointers;
GarnetNetwork_d::GarnetNetwork_d(const Params *p)
: BaseGarnetNetwork(p)
{
+ m_buffers_per_data_vc = p->buffers_per_data_vc;
+ m_buffers_per_ctrl_vc = p->buffers_per_ctrl_vc;
+
// record the routers
for (vector<BasicRouter*>::const_iterator i =
m_topology_ptr->params()->routers.begin();
@@ -254,9 +257,9 @@ GarnetNetwork_d::printStats(ostream& out) const
{
double average_link_utilization = 0;
vector<double> average_vc_load;
- average_vc_load.resize(m_virtual_networks*m_vcs_per_class);
+ average_vc_load.resize(m_virtual_networks*m_vcs_per_vnet);
- for (int i = 0; i < m_virtual_networks*m_vcs_per_class; i++)
+ for (int i = 0; i < m_virtual_networks*m_vcs_per_vnet; i++)
{
average_vc_load[i] = 0;
}
@@ -272,7 +275,7 @@ GarnetNetwork_d::printStats(ostream& out) const
vector<int> vc_load = m_link_ptr_vector[i]->getVcLoad();
for (int j = 0; j < vc_load.size(); j++) {
- assert(vc_load.size() == m_vcs_per_class*m_virtual_networks);
+ assert(vc_load.size() == m_vcs_per_vnet*m_virtual_networks);
average_vc_load[j] += vc_load[j];
}
}
@@ -282,8 +285,8 @@ GarnetNetwork_d::printStats(ostream& out) const
<< " flits/cycle" << endl;
out << "-------------" << endl;
- for (int i = 0; i < m_vcs_per_class*m_virtual_networks; i++) {
- if (!m_in_use[i/m_vcs_per_class])
+ for (int i = 0; i < m_vcs_per_vnet*m_virtual_networks; i++) {
+ if (!m_in_use[i/m_vcs_per_vnet])
continue;
average_vc_load[i] = (double(average_vc_load[i]) /
diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.hh b/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.hh
index b4e264be1..6254bd383 100644
--- a/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.hh
+++ b/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.hh
@@ -59,6 +59,9 @@ class GarnetNetwork_d : public BaseGarnetNetwork
int getNumNodes() { return m_nodes; }
+ int getBuffersPerDataVC() {return m_buffers_per_data_vc; }
+ int getBuffersPerCtrlVC() {return m_buffers_per_ctrl_vc; }
+
// returns the queue requested for the given component
MessageBuffer* getToNetQueue(NodeID id, bool ordered, int network_num);
MessageBuffer* getFromNetQueue(NodeID id, bool ordered, int network_num);
@@ -71,14 +74,14 @@ class GarnetNetwork_d : public BaseGarnetNetwork
void
set_vnet_type(int vc, VNET_type vnet_type)
{
- int vnet = vc/getVCsPerClass();
+ int vnet = vc/getVCsPerVnet();
m_vnet_type[vnet] = vnet_type;
}
VNET_type
get_vnet_type(int vc)
{
- int vnet = vc/getVCsPerClass();
+ int vnet = vc/getVCsPerVnet();
return m_vnet_type[vnet];
}
@@ -130,6 +133,9 @@ class GarnetNetwork_d : public BaseGarnetNetwork
std::vector<NetworkLink_d *> m_link_ptr_vector; // All links in the network
std::vector<CreditLink_d *> m_creditlink_ptr_vector; // All links in net
std::vector<NetworkInterface_d *> m_ni_ptr_vector; // All NI's in Network
+
+ int m_buffers_per_data_vc;
+ int m_buffers_per_ctrl_vc;
};
inline std::ostream&
diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.py b/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.py
index ee7a4a480..a3a00525d 100644
--- a/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.py
+++ b/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.py
@@ -33,4 +33,5 @@ from BaseGarnetNetwork import BaseGarnetNetwork
class GarnetNetwork_d(BaseGarnetNetwork):
type = 'GarnetNetwork_d'
-
+ buffers_per_data_vc = Param.Int(4, "buffers per data virtual channel");
+ buffers_per_ctrl_vc = Param.Int(1, "buffers per ctrl virtual channel");
diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/GarnetRouter_d.py b/src/mem/ruby/network/garnet/fixed-pipeline/GarnetRouter_d.py
index c88568d2d..b2a01fb46 100644
--- a/src/mem/ruby/network/garnet/fixed-pipeline/GarnetRouter_d.py
+++ b/src/mem/ruby/network/garnet/fixed-pipeline/GarnetRouter_d.py
@@ -35,8 +35,8 @@ from BasicRouter import BasicRouter
class GarnetRouter_d(BasicRouter):
type = 'GarnetRouter_d'
cxx_class = 'Router_d'
- vcs_per_class = Param.Int(Parent.vcs_per_class,
- "virtual channels per message class")
+ vcs_per_vnet = Param.Int(Parent.vcs_per_vnet,
+ "virtual channels per virtual network")
virt_nets = Param.Int(Parent.number_of_virtual_networks,
"number of virtual networks")
diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.cc b/src/mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.cc
index 0dd51019c..558352253 100644
--- a/src/mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.cc
+++ b/src/mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.cc
@@ -47,7 +47,7 @@ NetworkInterface_d::NetworkInterface_d(int id, int virtual_networks,
m_id = id;
m_net_ptr = network_ptr;
m_virtual_networks = virtual_networks;
- m_vc_per_vnet = m_net_ptr->getVCsPerClass();
+ m_vc_per_vnet = m_net_ptr->getVCsPerVnet();
m_num_vcs = m_vc_per_vnet*m_virtual_networks;
m_vc_round_robin = 0;
diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/NetworkLink_d.cc b/src/mem/ruby/network/garnet/fixed-pipeline/NetworkLink_d.cc
index 38627b109..cc6ec6abf 100644
--- a/src/mem/ruby/network/garnet/fixed-pipeline/NetworkLink_d.cc
+++ b/src/mem/ruby/network/garnet/fixed-pipeline/NetworkLink_d.cc
@@ -39,9 +39,9 @@ NetworkLink_d::NetworkLink_d(const Params *p)
m_id = p->link_id;
linkBuffer = new flitBuffer_d();
m_link_utilized = 0;
- m_vc_load.resize(p->vcs_per_class * p->virt_nets);
+ m_vc_load.resize(p->vcs_per_vnet * p->virt_nets);
- for (int i = 0; i < (p->vcs_per_class * p->virt_nets); i++) {
+ for (int i = 0; i < (p->vcs_per_vnet * p->virt_nets); i++) {
m_vc_load[i] = 0;
}
}
diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/Router_d.cc b/src/mem/ruby/network/garnet/fixed-pipeline/Router_d.cc
index d8f460e2e..62ab5ce07 100644
--- a/src/mem/ruby/network/garnet/fixed-pipeline/Router_d.cc
+++ b/src/mem/ruby/network/garnet/fixed-pipeline/Router_d.cc
@@ -47,7 +47,7 @@ Router_d::Router_d(const Params *p)
: BasicRouter(p)
{
m_virtual_networks = p->virt_nets;
- m_vc_per_vnet = p->vcs_per_class;
+ m_vc_per_vnet = p->vcs_per_vnet;
m_num_vcs = m_virtual_networks * m_vc_per_vnet;
m_routing_unit = new RoutingUnit_d(this);
diff --git a/src/mem/ruby/network/garnet/flexible-pipeline/GarnetLink.py b/src/mem/ruby/network/garnet/flexible-pipeline/GarnetLink.py
index 4077f30e6..591ab4beb 100644
--- a/src/mem/ruby/network/garnet/flexible-pipeline/GarnetLink.py
+++ b/src/mem/ruby/network/garnet/flexible-pipeline/GarnetLink.py
@@ -37,8 +37,8 @@ class NetworkLink(SimObject):
type = 'NetworkLink'
link_id = Param.Int(Parent.link_id, "link id")
link_latency = Param.Int(Parent.latency, "link latency")
- vcs_per_class = Param.Int(Parent.vcs_per_class,
- "virtual channels per message class")
+ vcs_per_vnet = Param.Int(Parent.vcs_per_vnet,
+ "virtual channels per virtual network")
virt_nets = Param.Int(Parent.number_of_virtual_networks,
"number of virtual networks")
channel_width = Param.Int(Parent.bandwidth_factor,
diff --git a/src/mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.cc b/src/mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.cc
index d403633a8..62ae2dbd6 100644
--- a/src/mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.cc
+++ b/src/mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.cc
@@ -49,6 +49,7 @@ GarnetNetwork::GarnetNetwork(const Params *p)
: BaseGarnetNetwork(p)
{
m_buffer_size = p->buffer_size;
+ m_number_of_pipe_stages = p->number_of_pipe_stages;
// record the routers
for (vector<BasicRouter*>::const_iterator i =
@@ -221,9 +222,9 @@ GarnetNetwork::printStats(ostream& out) const
{
double average_link_utilization = 0;
vector<double> average_vc_load;
- average_vc_load.resize(m_virtual_networks*m_vcs_per_class);
+ average_vc_load.resize(m_virtual_networks*m_vcs_per_vnet);
- for (int i = 0; i < m_virtual_networks*m_vcs_per_class; i++) {
+ for (int i = 0; i < m_virtual_networks*m_vcs_per_vnet; i++) {
average_vc_load[i] = 0;
}
@@ -236,7 +237,7 @@ GarnetNetwork::printStats(ostream& out) const
m_link_ptr_vector[i]->getLinkUtilization();
vector<int> vc_load = m_link_ptr_vector[i]->getVcLoad();
for (int j = 0; j < vc_load.size(); j++) {
- assert(vc_load.size() == m_vcs_per_class*m_virtual_networks);
+ assert(vc_load.size() == m_vcs_per_vnet*m_virtual_networks);
average_vc_load[j] += vc_load[j];
}
}
@@ -246,8 +247,8 @@ GarnetNetwork::printStats(ostream& out) const
" flits/cycle" <<endl;
out << "-------------" << endl;
- for (int i = 0; i < m_vcs_per_class*m_virtual_networks; i++) {
- if (!m_in_use[i/m_vcs_per_class])
+ for (int i = 0; i < m_vcs_per_vnet*m_virtual_networks; i++) {
+ if (!m_in_use[i/m_vcs_per_vnet])
continue;
average_vc_load[i] = (double(average_vc_load[i]) /
diff --git a/src/mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.hh b/src/mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.hh
index a19e167a8..6e08330f3 100644
--- a/src/mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.hh
+++ b/src/mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.hh
@@ -57,6 +57,7 @@ class GarnetNetwork : public BaseGarnetNetwork
void init();
int getBufferSize() { return m_buffer_size; }
+ int getNumPipeStages() {return m_number_of_pipe_stages; }
// returns the queue requested for the given component
MessageBuffer* getToNetQueue(NodeID id, bool ordered, int network_num);
@@ -115,6 +116,7 @@ class GarnetNetwork : public BaseGarnetNetwork
std::vector<NetworkInterface *> m_ni_ptr_vector; // All NI's in Network
int m_buffer_size;
+ int m_number_of_pipe_stages;
};
inline std::ostream&
diff --git a/src/mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.py b/src/mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.py
index 0844fe3b4..7ad61a5ce 100644
--- a/src/mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.py
+++ b/src/mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.py
@@ -35,4 +35,4 @@ class GarnetNetwork(BaseGarnetNetwork):
type = 'GarnetNetwork'
buffer_size = Param.Int(0,
"default buffer size; 0 indicates infinite buffering");
-
+ number_of_pipe_stages = Param.Int(4, "router pipeline stages");
diff --git a/src/mem/ruby/network/garnet/flexible-pipeline/GarnetRouter.py b/src/mem/ruby/network/garnet/flexible-pipeline/GarnetRouter.py
index a7ddfb7fb..b626471a6 100644
--- a/src/mem/ruby/network/garnet/flexible-pipeline/GarnetRouter.py
+++ b/src/mem/ruby/network/garnet/flexible-pipeline/GarnetRouter.py
@@ -35,8 +35,8 @@ from BasicRouter import BasicRouter
class GarnetRouter(BasicRouter):
type = 'GarnetRouter'
cxx_class = 'Router'
- vcs_per_class = Param.Int(Parent.vcs_per_class,
- "virtual channels per message class")
+ vcs_per_vnet = Param.Int(Parent.vcs_per_vnet,
+ "virtual channels per virtual network")
virt_nets = Param.Int(Parent.number_of_virtual_networks,
"number of virtual networks")
diff --git a/src/mem/ruby/network/garnet/flexible-pipeline/NetworkInterface.cc b/src/mem/ruby/network/garnet/flexible-pipeline/NetworkInterface.cc
index df9f91c2d..a41c2768d 100644
--- a/src/mem/ruby/network/garnet/flexible-pipeline/NetworkInterface.cc
+++ b/src/mem/ruby/network/garnet/flexible-pipeline/NetworkInterface.cc
@@ -47,7 +47,7 @@ NetworkInterface::NetworkInterface(int id, int virtual_networks,
m_id = id;
m_net_ptr = network_ptr;
m_virtual_networks = virtual_networks;
- m_vc_per_vnet = m_net_ptr->getVCsPerClass();
+ m_vc_per_vnet = m_net_ptr->getVCsPerVnet();
m_num_vcs = m_vc_per_vnet*m_virtual_networks;
m_vc_round_robin = 0;
diff --git a/src/mem/ruby/network/garnet/flexible-pipeline/NetworkLink.cc b/src/mem/ruby/network/garnet/flexible-pipeline/NetworkLink.cc
index c6584700a..3886be69e 100644
--- a/src/mem/ruby/network/garnet/flexible-pipeline/NetworkLink.cc
+++ b/src/mem/ruby/network/garnet/flexible-pipeline/NetworkLink.cc
@@ -41,7 +41,7 @@ NetworkLink::NetworkLink(const Params *p)
m_latency = p->link_latency;
m_id = p->link_id;
int num_net = p->virt_nets;
- int num_vc = p->vcs_per_class;
+ int num_vc = p->vcs_per_vnet;
m_vc_load.resize(num_net * num_vc);
for (int i = 0; i < num_net * num_vc; i++)
diff --git a/src/mem/ruby/network/garnet/flexible-pipeline/Router.cc b/src/mem/ruby/network/garnet/flexible-pipeline/Router.cc
index 51af50b7d..9965d3211 100644
--- a/src/mem/ruby/network/garnet/flexible-pipeline/Router.cc
+++ b/src/mem/ruby/network/garnet/flexible-pipeline/Router.cc
@@ -44,7 +44,7 @@ Router::Router(const Params *p)
{
m_id = p->router_id;
m_virtual_networks = p->virt_nets;
- m_vc_per_vnet = p->vcs_per_class;
+ m_vc_per_vnet = p->vcs_per_vnet;
m_round_robin_inport = 0;
m_round_robin_start = 0;
m_num_vcs = m_vc_per_vnet * m_virtual_networks;