diff options
Diffstat (limited to 'src/mem/ruby/network/garnet')
9 files changed, 33 insertions, 10 deletions
diff --git a/src/mem/ruby/network/garnet/BaseGarnetNetwork.cc b/src/mem/ruby/network/garnet/BaseGarnetNetwork.cc index 19b4c3d04..6c5e57103 100644 --- a/src/mem/ruby/network/garnet/BaseGarnetNetwork.cc +++ b/src/mem/ruby/network/garnet/BaseGarnetNetwork.cc @@ -28,16 +28,37 @@ * Authors: Niket Agarwal */ +#include "mem/ruby/network/BasicLink.hh" +#include "mem/ruby/network/Topology.hh" #include "mem/ruby/network/garnet/BaseGarnetNetwork.hh" BaseGarnetNetwork::BaseGarnetNetwork(const Params *p) : Network(p) { - m_flit_size = p->flit_size; + 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; + + // Currently Garnet only supports uniform bandwidth for all + // links and network interfaces. + for (std::vector<BasicExtLink*>::const_iterator i = + m_topology_ptr->params()->ext_links.begin(); + i != m_topology_ptr->params()->ext_links.end(); ++i) { + BasicExtLink* ext_link = (*i); + if (ext_link->params()->bandwidth_factor != m_ni_flit_size) { + fatal("Garnet only supports uniform bw across all links and NIs\n"); + } + } + for (std::vector<BasicIntLink*>::const_iterator i = + m_topology_ptr->params()->int_links.begin(); + i != m_topology_ptr->params()->int_links.end(); ++i) { + BasicIntLink* int_link = (*i); + if (int_link->params()->bandwidth_factor != m_ni_flit_size) { + fatal("Garnet only supports uniform bw across all links and NIs\n"); + } + } } void diff --git a/src/mem/ruby/network/garnet/BaseGarnetNetwork.hh b/src/mem/ruby/network/garnet/BaseGarnetNetwork.hh index 81b77ceea..4ff04b683 100644 --- a/src/mem/ruby/network/garnet/BaseGarnetNetwork.hh +++ b/src/mem/ruby/network/garnet/BaseGarnetNetwork.hh @@ -48,14 +48,14 @@ class BaseGarnetNetwork : public Network BaseGarnetNetwork(const Params *p); void init(); - int getFlitSize() {return m_flit_size; } + 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; } protected: - int m_flit_size; + int m_ni_flit_size; int m_number_of_pipe_stages; int m_vcs_per_class; int m_buffers_per_data_vc; diff --git a/src/mem/ruby/network/garnet/BaseGarnetNetwork.py b/src/mem/ruby/network/garnet/BaseGarnetNetwork.py index 3594e93b6..d2366ed1a 100644 --- a/src/mem/ruby/network/garnet/BaseGarnetNetwork.py +++ b/src/mem/ruby/network/garnet/BaseGarnetNetwork.py @@ -34,7 +34,7 @@ from Network import RubyNetwork class BaseGarnetNetwork(RubyNetwork): type = 'BaseGarnetNetwork' abstract = True - flit_size = Param.Int(16, "flit size in bytes") + 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"); 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 941746cbc..363ff2e44 100644 --- a/src/mem/ruby/network/garnet/fixed-pipeline/GarnetLink_d.py +++ b/src/mem/ruby/network/garnet/fixed-pipeline/GarnetLink_d.py @@ -41,7 +41,8 @@ class NetworkLink_d(SimObject): "virtual channels per message class") virt_nets = Param.Int(Parent.number_of_virtual_networks, "number of virtual networks") - channel_width = Param.Int(Parent.flit_size, "channel width == flit size") + channel_width = Param.Int(Parent.bandwidth_factor, + "channel width == bw factor") class CreditLink_d(NetworkLink_d): type = 'CreditLink_d' 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 92e49b328..1a216abb9 100644 --- a/src/mem/ruby/network/garnet/fixed-pipeline/GarnetRouter_d.py +++ b/src/mem/ruby/network/garnet/fixed-pipeline/GarnetRouter_d.py @@ -39,6 +39,6 @@ class GarnetRouter_d(BasicRouter): "virtual channels per message class") virt_nets = Param.Int(Parent.number_of_virtual_networks, "number of virtual networks") - flit_width = Param.Int(Parent.flit_size, "flit width == flit size") + flit_width = Param.Int(Parent.ni_flit_size, "flit width == flit size") 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 71fefa264..0dd51019c 100644 --- a/src/mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.cc +++ b/src/mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.cc @@ -129,7 +129,7 @@ NetworkInterface_d::flitisizeMessage(MsgPtr msg_ptr, int vnet) // Number of flits is dependent on the link bandwidth available. // This is expressed in terms of bytes/cycle or the flit size int num_flits = (int) ceil((double) m_net_ptr->MessageSizeType_to_int( - net_msg_ptr->getMessageSize())/m_net_ptr->getFlitSize() ); + net_msg_ptr->getMessageSize())/m_net_ptr->getNiFlitSize()); // loop to convert all multicast messages into unicast messages for (int ctr = 0; ctr < dest_nodes.size(); ctr++) { diff --git a/src/mem/ruby/network/garnet/flexible-pipeline/GarnetLink.py b/src/mem/ruby/network/garnet/flexible-pipeline/GarnetLink.py index 45c56fa9e..4077f30e6 100644 --- a/src/mem/ruby/network/garnet/flexible-pipeline/GarnetLink.py +++ b/src/mem/ruby/network/garnet/flexible-pipeline/GarnetLink.py @@ -41,7 +41,8 @@ class NetworkLink(SimObject): "virtual channels per message class") virt_nets = Param.Int(Parent.number_of_virtual_networks, "number of virtual networks") - channel_width = Param.Int(Parent.flit_size, "channel width == flit size") + channel_width = Param.Int(Parent.bandwidth_factor, + "channel width == bw factor") # Interior fixed pipeline links between routers class GarnetIntLink(BasicIntLink): diff --git a/src/mem/ruby/network/garnet/flexible-pipeline/GarnetRouter.py b/src/mem/ruby/network/garnet/flexible-pipeline/GarnetRouter.py index c35b7db38..1aabd375f 100644 --- a/src/mem/ruby/network/garnet/flexible-pipeline/GarnetRouter.py +++ b/src/mem/ruby/network/garnet/flexible-pipeline/GarnetRouter.py @@ -39,6 +39,6 @@ class GarnetRouter(BasicRouter): "virtual channels per message class") virt_nets = Param.Int(Parent.number_of_virtual_networks, "number of virtual networks") - flit_width = Param.Int(Parent.flit_size, "flit width == flit size") + flit_width = Param.Int(Parent.ni_flit_size, "flit width == flit size") diff --git a/src/mem/ruby/network/garnet/flexible-pipeline/NetworkInterface.cc b/src/mem/ruby/network/garnet/flexible-pipeline/NetworkInterface.cc index de51a7284..df9f91c2d 100644 --- a/src/mem/ruby/network/garnet/flexible-pipeline/NetworkInterface.cc +++ b/src/mem/ruby/network/garnet/flexible-pipeline/NetworkInterface.cc @@ -127,7 +127,7 @@ NetworkInterface::flitisizeMessage(MsgPtr msg_ptr, int vnet) // This is expressed in terms of bytes/cycle or the flit size int num_flits = (int) ceil((double) m_net_ptr->MessageSizeType_to_int( - net_msg_ptr->getMessageSize())/m_net_ptr->getFlitSize() ); + net_msg_ptr->getMessageSize())/m_net_ptr->getNiFlitSize()); // loop to convert all multicast messages into unicast messages for (int ctr = 0; ctr < dest_nodes.size(); ctr++) { |