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.
: 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;
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;
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");
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,
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();
{
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;
}
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];
}
}
<< " 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]) /
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);
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];
}
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&
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");
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")
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;
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;
}
}
: 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);
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,
: 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 =
{
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;
}
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];
}
}
" 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]) /
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);
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&
type = 'GarnetNetwork'
buffer_size = Param.Int(0,
"default buffer size; 0 indicates infinite buffering");
-
+ number_of_pipe_stages = Param.Int(4, "router pipeline stages");
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")
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;
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++)
{
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;