garnet: separate data and ctrl VCs
Separate data VCs and ctrl VCs in garnet, as ctrl VCs have 1 buffer per VC, while data VCs have > 1 buffers per VC. This is for correct power estimations.
This commit is contained in:
parent
afd754dc0d
commit
59163f824c
10 changed files with 56 additions and 5 deletions
|
@ -36,7 +36,8 @@ BaseGarnetNetwork::BaseGarnetNetwork(const Params *p)
|
||||||
m_flit_size = p->flit_size;
|
m_flit_size = p->flit_size;
|
||||||
m_number_of_pipe_stages = p->number_of_pipe_stages;
|
m_number_of_pipe_stages = p->number_of_pipe_stages;
|
||||||
m_vcs_per_class = p->vcs_per_class;
|
m_vcs_per_class = p->vcs_per_class;
|
||||||
m_buffer_size = p->buffer_size;
|
m_buffers_per_data_vc = p->buffers_per_data_vc;
|
||||||
|
m_buffers_per_ctrl_vc = p->buffers_per_ctrl_vc;
|
||||||
m_using_network_testing = p->using_network_testing;
|
m_using_network_testing = p->using_network_testing;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -51,13 +51,15 @@ class BaseGarnetNetwork : public Network
|
||||||
int getFlitSize() {return m_flit_size; }
|
int getFlitSize() {return m_flit_size; }
|
||||||
int getNumPipeStages() {return m_number_of_pipe_stages; }
|
int getNumPipeStages() {return m_number_of_pipe_stages; }
|
||||||
int getVCsPerClass() {return m_vcs_per_class; }
|
int getVCsPerClass() {return m_vcs_per_class; }
|
||||||
int getBufferSize() {return m_buffer_size; }
|
int getBuffersPerDataVC() {return m_buffers_per_data_vc; }
|
||||||
|
int getBuffersPerCtrlVC() {return m_buffers_per_ctrl_vc; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
int m_flit_size;
|
int m_flit_size;
|
||||||
int m_number_of_pipe_stages;
|
int m_number_of_pipe_stages;
|
||||||
int m_vcs_per_class;
|
int m_vcs_per_class;
|
||||||
int m_buffer_size;
|
int m_buffers_per_data_vc;
|
||||||
|
int m_buffers_per_ctrl_vc;
|
||||||
bool m_using_network_testing;
|
bool m_using_network_testing;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -37,5 +37,6 @@ class BaseGarnetNetwork(RubyNetwork):
|
||||||
flit_size = Param.Int(16, "flit size in bytes")
|
flit_size = Param.Int(16, "flit size in bytes")
|
||||||
number_of_pipe_stages = Param.Int(4, "router pipeline stages");
|
number_of_pipe_stages = Param.Int(4, "router pipeline stages");
|
||||||
vcs_per_class = Param.Int(4, "virtual channels per message class");
|
vcs_per_class = Param.Int(4, "virtual channels per message class");
|
||||||
buffer_size = Param.Int(4, "buffer size in bytes");
|
buffers_per_data_vc = Param.Int(4, "buffers per data virtual channel");
|
||||||
|
buffers_per_ctrl_vc = Param.Int(1, "buffers per ctrl virtual channel");
|
||||||
using_network_testing = Param.Bool(False, "network testing enable");
|
using_network_testing = Param.Bool(False, "network testing enable");
|
||||||
|
|
|
@ -36,6 +36,7 @@
|
||||||
|
|
||||||
enum flit_type {HEAD_, BODY_, TAIL_, HEAD_TAIL_, NUM_FLIT_TYPE_};
|
enum flit_type {HEAD_, BODY_, TAIL_, HEAD_TAIL_, NUM_FLIT_TYPE_};
|
||||||
enum VC_state_type {IDLE_, VC_AB_, ACTIVE_, NUM_VC_STATE_TYPE_};
|
enum VC_state_type {IDLE_, VC_AB_, ACTIVE_, NUM_VC_STATE_TYPE_};
|
||||||
|
enum VNET_type {CTRL_VNET_, DATA_VNET_, NUM_VNET_TYPE_};
|
||||||
enum flit_stage {I_, VA_, SA_, ST_, LT_, NUM_FLIT_STAGE_};
|
enum flit_stage {I_, VA_, SA_, ST_, LT_, NUM_FLIT_STAGE_};
|
||||||
|
|
||||||
#define INFINITE_ 10000
|
#define INFINITE_ 10000
|
||||||
|
|
|
@ -107,6 +107,12 @@ GarnetNetwork_d::init()
|
||||||
for (int i = 0; i < m_router_ptr_vector.size(); i++) {
|
for (int i = 0; i < m_router_ptr_vector.size(); i++) {
|
||||||
m_router_ptr_vector[i]->init();
|
m_router_ptr_vector[i]->init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_vnet_type.resize(m_virtual_networks);
|
||||||
|
for (int i = 0; i < m_vnet_type.size(); i++) {
|
||||||
|
m_vnet_type[i] = CTRL_VNET_;
|
||||||
|
// DATA_VNET_ updated later based on traffic
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GarnetNetwork_d::~GarnetNetwork_d()
|
GarnetNetwork_d::~GarnetNetwork_d()
|
||||||
|
|
|
@ -68,6 +68,21 @@ class GarnetNetwork_d : public BaseGarnetNetwork
|
||||||
void printConfig(std::ostream& out) const;
|
void printConfig(std::ostream& out) const;
|
||||||
void print(std::ostream& out) const;
|
void print(std::ostream& out) const;
|
||||||
|
|
||||||
|
void
|
||||||
|
set_vnet_type(int vc, VNET_type vnet_type)
|
||||||
|
{
|
||||||
|
int vnet = vc/getVCsPerClass();
|
||||||
|
m_vnet_type[vnet] = vnet_type;
|
||||||
|
}
|
||||||
|
|
||||||
|
VNET_type
|
||||||
|
get_vnet_type(int vc)
|
||||||
|
{
|
||||||
|
int vnet = vc/getVCsPerClass();
|
||||||
|
return m_vnet_type[vnet];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
inline void increment_injected_flits() { m_flits_injected++; }
|
inline void increment_injected_flits() { m_flits_injected++; }
|
||||||
inline void increment_received_flits() { m_flits_received++; }
|
inline void increment_received_flits() { m_flits_received++; }
|
||||||
|
|
||||||
|
@ -106,6 +121,7 @@ class GarnetNetwork_d : public BaseGarnetNetwork
|
||||||
GarnetNetwork_d(const GarnetNetwork_d& obj);
|
GarnetNetwork_d(const GarnetNetwork_d& obj);
|
||||||
GarnetNetwork_d& operator=(const GarnetNetwork_d& obj);
|
GarnetNetwork_d& operator=(const GarnetNetwork_d& obj);
|
||||||
|
|
||||||
|
std::vector<VNET_type > m_vnet_type;
|
||||||
// int m_virtual_networks;
|
// int m_virtual_networks;
|
||||||
// int m_nodes;
|
// int m_nodes;
|
||||||
int m_flits_received, m_flits_injected;
|
int m_flits_received, m_flits_injected;
|
||||||
|
|
|
@ -163,6 +163,13 @@ NetworkInterface_d::flitisizeMessage(MsgPtr msg_ptr, int vnet)
|
||||||
// flitisized and an output vc is acquired
|
// flitisized and an output vc is acquired
|
||||||
net_msg_ptr->getInternalDestination().removeNetDest(personal_dest);
|
net_msg_ptr->getInternalDestination().removeNetDest(personal_dest);
|
||||||
}
|
}
|
||||||
|
if (num_flits > 1) { // data packet
|
||||||
|
// defining ctrl vnet to be 1-flit packets
|
||||||
|
// and data vnet to be > 1 flit packets
|
||||||
|
m_net_ptr->set_vnet_type(vc, DATA_VNET_);
|
||||||
|
m_out_vc_state[vc]->set_credit_count();
|
||||||
|
}
|
||||||
|
|
||||||
for (int i = 0; i < num_flits; i++) {
|
for (int i = 0; i < num_flits; i++) {
|
||||||
m_net_ptr->increment_injected_flits();
|
m_net_ptr->increment_injected_flits();
|
||||||
flit_d *fl = new flit_d(i, vc, vnet, num_flits, new_msg_ptr);
|
flit_d *fl = new flit_d(i, vc, vnet, num_flits, new_msg_ptr);
|
||||||
|
|
|
@ -37,5 +37,11 @@ OutVcState_d::OutVcState_d(int id, GarnetNetwork_d *network_ptr)
|
||||||
m_id = id;
|
m_id = id;
|
||||||
m_vc_state = IDLE_;
|
m_vc_state = IDLE_;
|
||||||
m_time = g_eventQueue_ptr->getTime();
|
m_time = g_eventQueue_ptr->getTime();
|
||||||
m_credit_count = m_network_ptr->getBufferSize();
|
|
||||||
|
// this value is updated later for data VCs by set_credit_count()
|
||||||
|
m_credit_count = m_network_ptr->getBuffersPerCtrlVC();
|
||||||
|
|
||||||
|
// (num_flits > 1) is used to determine ctrl vs data vnet
|
||||||
|
// in NetworkInterface_d.cc
|
||||||
|
assert(m_credit_count == 1);
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,6 +42,16 @@ class OutVcState_d
|
||||||
int get_inport() { return m_in_port; }
|
int get_inport() { return m_in_port; }
|
||||||
int get_invc() { return m_in_vc; }
|
int get_invc() { return m_in_vc; }
|
||||||
int get_credit_count() { return m_credit_count; }
|
int get_credit_count() { return m_credit_count; }
|
||||||
|
void
|
||||||
|
set_credit_count()
|
||||||
|
{
|
||||||
|
// only need to initialize credit count for data VCs
|
||||||
|
// constructor sets this to BuffersPerCtrlVC by default
|
||||||
|
|
||||||
|
if (m_network_ptr->get_vnet_type(m_id) == DATA_VNET_)
|
||||||
|
m_credit_count = m_network_ptr->getBuffersPerDataVC();
|
||||||
|
}
|
||||||
|
|
||||||
void set_inport(int port) { m_in_port = port; }
|
void set_inport(int port) { m_in_port = port; }
|
||||||
void set_invc(int vc) { m_in_vc = vc; }
|
void set_invc(int vc) { m_in_vc = vc; }
|
||||||
inline bool
|
inline bool
|
||||||
|
|
|
@ -102,6 +102,7 @@ void
|
||||||
OutputUnit_d::update_vc(int vc, int in_port, int in_vc)
|
OutputUnit_d::update_vc(int vc, int in_port, int in_vc)
|
||||||
{
|
{
|
||||||
m_outvc_state[vc]->setState(ACTIVE_, g_eventQueue_ptr->getTime() + 1);
|
m_outvc_state[vc]->setState(ACTIVE_, g_eventQueue_ptr->getTime() + 1);
|
||||||
|
m_outvc_state[vc]->set_credit_count();
|
||||||
m_outvc_state[vc]->set_inport(in_port);
|
m_outvc_state[vc]->set_inport(in_port);
|
||||||
m_outvc_state[vc]->set_invc(in_vc);
|
m_outvc_state[vc]->set_invc(in_vc);
|
||||||
m_router->update_incredit(in_port, in_vc,
|
m_router->update_incredit(in_port, in_vc,
|
||||||
|
|
Loading…
Reference in a new issue