summaryrefslogtreecommitdiff
path: root/src/mem/ruby/network/simple
diff options
context:
space:
mode:
authorNilay Vaish <nilay@cs.wisc.edu>2015-07-04 10:43:46 -0500
committerNilay Vaish <nilay@cs.wisc.edu>2015-07-04 10:43:46 -0500
commit16ac48e6a419b75e6a9e86fab9cd2fd62ef9a574 (patch)
tree3b4753b480fb2b6cb8ff35680d72990831a4be44 /src/mem/ruby/network/simple
parentbaa3eb0de3b2b0f4a7edf35c5d165b11d1d95872 (diff)
downloadgem5-16ac48e6a419b75e6a9e86fab9cd2fd62ef9a574.tar.xz
ruby: drop NetworkMessage class
This patch drops the NetworkMessage class. The relevant data members and functions have been moved to the Message class, which was the parent of NetworkMessage.
Diffstat (limited to 'src/mem/ruby/network/simple')
-rw-r--r--src/mem/ruby/network/simple/PerfectSwitch.cc12
-rw-r--r--src/mem/ruby/network/simple/Throttle.cc9
2 files changed, 10 insertions, 11 deletions
diff --git a/src/mem/ruby/network/simple/PerfectSwitch.cc b/src/mem/ruby/network/simple/PerfectSwitch.cc
index 86cafbe15..06072724e 100644
--- a/src/mem/ruby/network/simple/PerfectSwitch.cc
+++ b/src/mem/ruby/network/simple/PerfectSwitch.cc
@@ -35,7 +35,7 @@
#include "mem/ruby/network/simple/PerfectSwitch.hh"
#include "mem/ruby/network/simple/SimpleNetwork.hh"
#include "mem/ruby/network/simple/Switch.hh"
-#include "mem/ruby/slicc_interface/NetworkMessage.hh"
+#include "mem/ruby/slicc_interface/Message.hh"
using namespace std;
@@ -112,7 +112,7 @@ void
PerfectSwitch::operateVnet(int vnet)
{
MsgPtr msg_ptr;
- NetworkMessage* net_msg_ptr = NULL;
+ Message *net_msg_ptr = NULL;
// This is for round-robin scheduling
int incoming = m_round_robin_start;
@@ -149,12 +149,12 @@ PerfectSwitch::operateVnet(int vnet)
// Peek at message
msg_ptr = buffer->peekMsgPtr();
- net_msg_ptr = safe_cast<NetworkMessage*>(msg_ptr.get());
+ net_msg_ptr = msg_ptr.get();
DPRINTF(RubyNetwork, "Message: %s\n", (*net_msg_ptr));
output_links.clear();
output_link_destinations.clear();
- NetDest msg_dsts = net_msg_ptr->getInternalDestination();
+ NetDest msg_dsts = net_msg_ptr->getDestination();
// Unfortunately, the token-protocol sends some
// zero-destination messages, so this assert isn't valid
@@ -264,8 +264,8 @@ PerfectSwitch::operateVnet(int vnet)
// Change the internal destination set of the message so it
// knows which destinations this link is responsible for.
- net_msg_ptr = safe_cast<NetworkMessage*>(msg_ptr.get());
- net_msg_ptr->getInternalDestination() =
+ net_msg_ptr = msg_ptr.get();
+ net_msg_ptr->getDestination() =
output_link_destinations[i];
// Enqeue msg
diff --git a/src/mem/ruby/network/simple/Throttle.cc b/src/mem/ruby/network/simple/Throttle.cc
index 2da810edb..d722c91ea 100644
--- a/src/mem/ruby/network/simple/Throttle.cc
+++ b/src/mem/ruby/network/simple/Throttle.cc
@@ -34,7 +34,7 @@
#include "mem/ruby/network/simple/Throttle.hh"
#include "mem/ruby/network/MessageBuffer.hh"
#include "mem/ruby/network/Network.hh"
-#include "mem/ruby/slicc_interface/NetworkMessage.hh"
+#include "mem/ruby/slicc_interface/Message.hh"
#include "mem/ruby/system/System.hh"
using namespace std;
@@ -44,7 +44,7 @@ const int MESSAGE_SIZE_MULTIPLIER = 1000;
const int BROADCAST_SCALING = 1;
const int PRIORITY_SWITCH_LIMIT = 128;
-static int network_message_to_size(NetworkMessage* net_msg_ptr);
+static int network_message_to_size(Message* net_msg_ptr);
Throttle::Throttle(int sID, NodeID node, Cycles link_latency,
int link_bandwidth_multiplier, int endpoint_bandwidth,
@@ -121,8 +121,7 @@ Throttle::operateVnet(int vnet, int &bw_remaining, bool &schedule_wakeup,
if (m_units_remaining[vnet] == 0 && in->isReady()) {
// Find the size of the message we are moving
MsgPtr msg_ptr = in->peekMsgPtr();
- NetworkMessage* net_msg_ptr =
- safe_cast<NetworkMessage*>(msg_ptr.get());
+ Message *net_msg_ptr = msg_ptr.get();
m_units_remaining[vnet] +=
network_message_to_size(net_msg_ptr);
@@ -257,7 +256,7 @@ Throttle::print(ostream& out) const
}
int
-network_message_to_size(NetworkMessage* net_msg_ptr)
+network_message_to_size(Message *net_msg_ptr)
{
assert(net_msg_ptr != NULL);