summaryrefslogtreecommitdiff
path: root/src/mem/ruby/network/simple
diff options
context:
space:
mode:
authorNilay Vaish <nilay@cs.wisc.edu>2013-09-06 16:21:29 -0500
committerNilay Vaish <nilay@cs.wisc.edu>2013-09-06 16:21:29 -0500
commite7bd70e0790cb3a2665a7f13c0762b0ec71b519f (patch)
tree7d653d014ec05d175f4033353f832f4ee0a651ea /src/mem/ruby/network/simple
parent47d113696dd545933b818772f5e2cd7534947484 (diff)
downloadgem5-e7bd70e0790cb3a2665a7f13c0762b0ec71b519f.tar.xz
ruby: network: shorten variable names
Diffstat (limited to 'src/mem/ruby/network/simple')
-rw-r--r--src/mem/ruby/network/simple/SimpleNetwork.cc42
-rw-r--r--src/mem/ruby/network/simple/SimpleNetwork.hh2
-rw-r--r--src/mem/ruby/network/simple/Switch.cc22
-rw-r--r--src/mem/ruby/network/simple/Switch.hh2
4 files changed, 34 insertions, 34 deletions
diff --git a/src/mem/ruby/network/simple/SimpleNetwork.cc b/src/mem/ruby/network/simple/SimpleNetwork.cc
index 071e1adae..19b323948 100644
--- a/src/mem/ruby/network/simple/SimpleNetwork.cc
+++ b/src/mem/ruby/network/simple/SimpleNetwork.cc
@@ -83,7 +83,7 @@ SimpleNetwork::SimpleNetwork(const Params *p)
for (vector<BasicRouter*>::const_iterator i = p->routers.begin();
i != p->routers.end(); ++i) {
Switch* s = safe_cast<Switch*>(*i);
- m_switch_ptr_vector.push_back(s);
+ m_switches.push_back(s);
s->init_net_ptr(this);
}
}
@@ -109,8 +109,8 @@ SimpleNetwork::reset()
}
}
- for(int i = 0; i < m_switch_ptr_vector.size(); i++){
- m_switch_ptr_vector[i]->clearBuffers();
+ for(int i = 0; i < m_switches.size(); i++){
+ m_switches[i]->clearBuffers();
}
}
@@ -120,7 +120,7 @@ SimpleNetwork::~SimpleNetwork()
deletePointers(m_toNetQueues[i]);
deletePointers(m_fromNetQueues[i]);
}
- deletePointers(m_switch_ptr_vector);
+ deletePointers(m_switches);
deletePointers(m_buffers_to_free);
// delete m_topology_ptr;
}
@@ -132,17 +132,17 @@ SimpleNetwork::makeOutLink(SwitchID src, NodeID dest, BasicLink* link,
const NetDest& routing_table_entry)
{
assert(dest < m_nodes);
- assert(src < m_switch_ptr_vector.size());
- assert(m_switch_ptr_vector[src] != NULL);
+ assert(src < m_switches.size());
+ assert(m_switches[src] != NULL);
SimpleExtLink *simple_link = safe_cast<SimpleExtLink*>(link);
- m_switch_ptr_vector[src]->addOutPort(m_fromNetQueues[dest],
+ m_switches[src]->addOutPort(m_fromNetQueues[dest],
routing_table_entry,
simple_link->m_latency,
simple_link->m_bw_multiplier);
- m_endpoint_switches[dest] = m_switch_ptr_vector[src];
+ m_endpoint_switches[dest] = m_switches[src];
}
// From an endpoint node to a switch
@@ -152,7 +152,7 @@ SimpleNetwork::makeInLink(NodeID src, SwitchID dest, BasicLink* link,
const NetDest& routing_table_entry)
{
assert(src < m_nodes);
- m_switch_ptr_vector[dest]->addInPort(m_toNetQueues[src]);
+ m_switches[dest]->addInPort(m_toNetQueues[src]);
}
// From a switch to a switch
@@ -177,8 +177,8 @@ SimpleNetwork::makeInternalLink(SwitchID src, SwitchID dest, BasicLink* link,
// Connect it to the two switches
SimpleIntLink *simple_link = safe_cast<SimpleIntLink*>(link);
- m_switch_ptr_vector[dest]->addInPort(queues);
- m_switch_ptr_vector[src]->addOutPort(queues, routing_table_entry,
+ m_switches[dest]->addInPort(queues);
+ m_switches[src]->addOutPort(queues, routing_table_entry,
simple_link->m_latency,
simple_link->m_bw_multiplier);
}
@@ -239,9 +239,9 @@ SimpleNetwork::printStats(ostream& out) const
total_msg_counts[type] = 0;
}
- for (int i = 0; i < m_switch_ptr_vector.size(); i++) {
+ for (int i = 0; i < m_switches.size(); i++) {
const std::vector<Throttle*>* throttles =
- m_switch_ptr_vector[i]->getThrottles();
+ m_switches[i]->getThrottles();
for (int p = 0; p < throttles->size(); p++) {
@@ -281,16 +281,16 @@ SimpleNetwork::printStats(ostream& out) const
<< " total_bytes: " << total_bytes << endl;
out << endl;
- for (int i = 0; i < m_switch_ptr_vector.size(); i++) {
- m_switch_ptr_vector[i]->printStats(out);
+ for (int i = 0; i < m_switches.size(); i++) {
+ m_switches[i]->printStats(out);
}
}
void
SimpleNetwork::clearStats()
{
- for (int i = 0; i < m_switch_ptr_vector.size(); i++) {
- m_switch_ptr_vector[i]->clearStats();
+ for (int i = 0; i < m_switches.size(); i++) {
+ m_switches[i]->clearStats();
}
}
@@ -314,8 +314,8 @@ SimpleNetworkParams::create()
bool
SimpleNetwork::functionalRead(Packet *pkt)
{
- for (unsigned int i = 0; i < m_switch_ptr_vector.size(); i++) {
- if (m_switch_ptr_vector[i]->functionalRead(pkt)) {
+ for (unsigned int i = 0; i < m_switches.size(); i++) {
+ if (m_switches[i]->functionalRead(pkt)) {
return true;
}
}
@@ -334,8 +334,8 @@ SimpleNetwork::functionalWrite(Packet *pkt)
{
uint32_t num_functional_writes = 0;
- for (unsigned int i = 0; i < m_switch_ptr_vector.size(); i++) {
- num_functional_writes += m_switch_ptr_vector[i]->functionalWrite(pkt);
+ for (unsigned int i = 0; i < m_switches.size(); i++) {
+ num_functional_writes += m_switches[i]->functionalWrite(pkt);
}
for (unsigned int i = 0; i < m_buffers_to_free.size(); ++i) {
diff --git a/src/mem/ruby/network/simple/SimpleNetwork.hh b/src/mem/ruby/network/simple/SimpleNetwork.hh
index 60831ad0f..ae151429d 100644
--- a/src/mem/ruby/network/simple/SimpleNetwork.hh
+++ b/src/mem/ruby/network/simple/SimpleNetwork.hh
@@ -105,7 +105,7 @@ class SimpleNetwork : public Network
std::vector<bool> m_in_use;
std::vector<bool> m_ordered;
- std::vector<Switch*> m_switch_ptr_vector;
+ std::vector<Switch*> m_switches;
std::vector<MessageBuffer*> m_buffers_to_free;
std::vector<Switch*> m_endpoint_switches;
diff --git a/src/mem/ruby/network/simple/Switch.cc b/src/mem/ruby/network/simple/Switch.cc
index d951ea38d..b90b6eac0 100644
--- a/src/mem/ruby/network/simple/Switch.cc
+++ b/src/mem/ruby/network/simple/Switch.cc
@@ -43,12 +43,12 @@ using m5::stl_helpers::operator<<;
Switch::Switch(const Params *p) : BasicRouter(p)
{
- m_perfect_switch_ptr = new PerfectSwitch(m_id, this, p->virt_nets);
+ m_perfect_switch = new PerfectSwitch(m_id, this, p->virt_nets);
}
Switch::~Switch()
{
- delete m_perfect_switch_ptr;
+ delete m_perfect_switch;
// Delete throttles (one per output port)
deletePointers(m_throttles);
@@ -61,13 +61,13 @@ void
Switch::init()
{
BasicRouter::init();
- m_perfect_switch_ptr->init(m_network_ptr);
+ m_perfect_switch->init(m_network_ptr);
}
void
Switch::addInPort(const vector<MessageBuffer*>& in)
{
- m_perfect_switch_ptr->addInPort(in);
+ m_perfect_switch->addInPort(in);
for (int i = 0; i < in.size(); i++) {
in[i]->setReceiver(this);
@@ -104,7 +104,7 @@ Switch::addOutPort(const vector<MessageBuffer*>& out,
}
// Hook the queues to the PerfectSwitch
- m_perfect_switch_ptr->addOutPort(intermediateBuffers, routing_table_entry);
+ m_perfect_switch->addOutPort(intermediateBuffers, routing_table_entry);
// Hook the queues to the Throttle
throttle_ptr->addLinks(intermediateBuffers, out);
@@ -113,13 +113,13 @@ Switch::addOutPort(const vector<MessageBuffer*>& out,
void
Switch::clearRoutingTables()
{
- m_perfect_switch_ptr->clearRoutingTables();
+ m_perfect_switch->clearRoutingTables();
}
void
Switch::clearBuffers()
{
- m_perfect_switch_ptr->clearBuffers();
+ m_perfect_switch->clearBuffers();
for (int i = 0; i < m_throttles.size(); i++) {
if (m_throttles[i] != NULL) {
m_throttles[i]->clear();
@@ -130,7 +130,7 @@ Switch::clearBuffers()
void
Switch::reconfigureOutPort(const NetDest& routing_table_entry)
{
- m_perfect_switch_ptr->reconfigureOutPort(routing_table_entry);
+ m_perfect_switch->reconfigureOutPort(routing_table_entry);
}
const Throttle*
@@ -150,9 +150,9 @@ void
Switch::printStats(std::ostream& out) const
{
ccprintf(out, "switch_%d_inlinks: %d\n", m_id,
- m_perfect_switch_ptr->getInLinks());
+ m_perfect_switch->getInLinks());
ccprintf(out, "switch_%d_outlinks: %d\n", m_id,
- m_perfect_switch_ptr->getOutLinks());
+ m_perfect_switch->getOutLinks());
// Average link utilizations
double average_utilization = 0.0;
@@ -214,7 +214,7 @@ Switch::printStats(std::ostream& out) const
void
Switch::clearStats()
{
- m_perfect_switch_ptr->clearStats();
+ m_perfect_switch->clearStats();
for (int i = 0; i < m_throttles.size(); i++) {
if (m_throttles[i] != NULL)
m_throttles[i]->clearStats();
diff --git a/src/mem/ruby/network/simple/Switch.hh b/src/mem/ruby/network/simple/Switch.hh
index 8c265a4bf..f60a31ab3 100644
--- a/src/mem/ruby/network/simple/Switch.hh
+++ b/src/mem/ruby/network/simple/Switch.hh
@@ -84,7 +84,7 @@ class Switch : public BasicRouter
Switch(const Switch& obj);
Switch& operator=(const Switch& obj);
- PerfectSwitch* m_perfect_switch_ptr;
+ PerfectSwitch* m_perfect_switch;
SimpleNetwork* m_network_ptr;
std::vector<Throttle*> m_throttles;
std::vector<MessageBuffer*> m_buffers_to_free;