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.
This commit is contained in:
parent
44e599a1a4
commit
26eaba4cb5
19 changed files with 46 additions and 45 deletions
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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]) /
|
||||
|
|
|
@ -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&
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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")
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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]) /
|
||||
|
|
|
@ -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&
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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")
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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++)
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue