garnet: use vnet_type from protocol to decide buffer depths

The virtual channels within "response" vnets are made buffers_per_data_vc
deep (default=4), while virtual channels within other vnets are made
buffers_per_ctrl_vc deep (default = 1). This is for accurate power estimates.
This commit is contained in:
Tushar Krishna 2011-05-21 00:40:57 -04:00
parent de97d75965
commit fc1d2d9679
7 changed files with 24 additions and 45 deletions

View file

@ -36,7 +36,7 @@
enum flit_type {HEAD_, BODY_, TAIL_, HEAD_TAIL_, NUM_FLIT_TYPE_};
enum VC_state_type {IDLE_, VC_AB_, ACTIVE_, NUM_VC_STATE_TYPE_};
enum VNET_type {CTRL_VNET_, DATA_VNET_, NUM_VNET_TYPE_};
enum VNET_type {CTRL_VNET_, DATA_VNET_, NULL_VNET_, NUM_VNET_TYPE_};
enum flit_stage {I_, VA_, SA_, ST_, LT_, NUM_FLIT_STAGE_};
#define INFINITE_ 10000

View file

@ -52,6 +52,11 @@ GarnetNetwork_d::GarnetNetwork_d(const Params *p)
m_buffers_per_data_vc = p->buffers_per_data_vc;
m_buffers_per_ctrl_vc = p->buffers_per_ctrl_vc;
m_vnet_type.resize(m_virtual_networks);
for (int i = 0; i < m_vnet_type.size(); i++) {
m_vnet_type[i] = NULL_VNET_; // default
}
// record the routers
for (vector<BasicRouter*>::const_iterator i =
m_topology_ptr->params()->routers.begin();
@ -85,12 +90,6 @@ GarnetNetwork_d::init()
}
// false because this isn't a reconfiguration
m_topology_ptr->createLinks(this, false);
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()
@ -215,7 +214,8 @@ GarnetNetwork_d::makeInternalLink(SwitchID src, SwitchID dest, BasicLink* link,
void
GarnetNetwork_d::checkNetworkAllocation(NodeID id, bool ordered,
int network_num)
int network_num,
string vnet_type)
{
assert(id < m_nodes);
assert(network_num < m_virtual_networks);
@ -224,25 +224,26 @@ GarnetNetwork_d::checkNetworkAllocation(NodeID id, bool ordered,
m_ordered[network_num] = true;
}
m_in_use[network_num] = true;
if (vnet_type == "response")
m_vnet_type[network_num] = DATA_VNET_; // carries data (and ctrl) packets
else
m_vnet_type[network_num] = CTRL_VNET_; // carries only ctrl packets
}
MessageBuffer*
GarnetNetwork_d::getToNetQueue(NodeID id, bool ordered, int network_num,
std::string vnet_type)
string vnet_type)
{
// TODO:
//if (vnet_type == "response")
// mark vnet as data vnet and use buffers_per_data_vc
checkNetworkAllocation(id, ordered, network_num);
checkNetworkAllocation(id, ordered, network_num, vnet_type);
return m_toNetQueues[id][network_num];
}
MessageBuffer*
GarnetNetwork_d::getFromNetQueue(NodeID id, bool ordered, int network_num,
std::string vnet_type)
string vnet_type)
{
checkNetworkAllocation(id, ordered, network_num);
checkNetworkAllocation(id, ordered, network_num, vnet_type);
return m_fromNetQueues[id][network_num];
}

View file

@ -73,13 +73,6 @@ class GarnetNetwork_d : public BaseGarnetNetwork
void printConfig(std::ostream& out) const;
void print(std::ostream& out) const;
void
set_vnet_type(int vc, VNET_type vnet_type)
{
int vnet = vc/getVCsPerVnet();
m_vnet_type[vnet] = vnet_type;
}
VNET_type
get_vnet_type(int vc)
{
@ -124,7 +117,8 @@ class GarnetNetwork_d : public BaseGarnetNetwork
bool isReconfiguration);
private:
void checkNetworkAllocation(NodeID id, bool ordered, int network_num);
void checkNetworkAllocation(NodeID id, bool ordered, int network_num,
std::string vnet_type);
GarnetNetwork_d(const GarnetNetwork_d& obj);
GarnetNetwork_d& operator=(const GarnetNetwork_d& obj);

View file

@ -164,12 +164,6 @@ NetworkInterface_d::flitisizeMessage(MsgPtr msg_ptr, int vnet)
// flitisized and an output vc is acquired
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++) {
m_net_ptr->increment_injected_flits();

View file

@ -38,10 +38,10 @@ OutVcState_d::OutVcState_d(int id, GarnetNetwork_d *network_ptr)
m_vc_state = IDLE_;
m_time = g_eventQueue_ptr->getTime();
// this value is updated later for data VCs by set_credit_count()
m_credit_count = m_network_ptr->getBuffersPerCtrlVC();
if (m_network_ptr->get_vnet_type(id) == DATA_VNET_)
m_credit_count = m_network_ptr->getBuffersPerDataVC();
else
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);
assert(m_credit_count >= 1);
}

View file

@ -42,15 +42,6 @@ class OutVcState_d
int get_inport() { return m_in_port; }
int get_invc() { return m_in_vc; }
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_invc(int vc) { m_in_vc = vc; }

View file

@ -102,7 +102,6 @@ void
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]->set_credit_count();
m_outvc_state[vc]->set_inport(in_port);
m_outvc_state[vc]->set_invc(in_vc);
m_router->update_incredit(in_port, in_vc,