ruby: drop NetworkMessage class
authorNilay Vaish <nilay@cs.wisc.edu>
Sat, 4 Jul 2015 15:43:46 +0000 (10:43 -0500)
committerNilay Vaish <nilay@cs.wisc.edu>
Sat, 4 Jul 2015 15:43:46 +0000 (10:43 -0500)
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.

22 files changed:
src/mem/protocol/MESI_Two_Level-msg.sm
src/mem/protocol/MI_example-msg.sm
src/mem/protocol/MOESI_CMP_directory-msg.sm
src/mem/protocol/MOESI_CMP_token-msg.sm
src/mem/protocol/MOESI_hammer-msg.sm
src/mem/protocol/Network_test-msg.sm
src/mem/protocol/RubySlicc_Exports.sm
src/mem/ruby/SConscript
src/mem/ruby/common/NetDest.hh
src/mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.cc
src/mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.hh
src/mem/ruby/network/garnet/fixed-pipeline/RoutingUnit_d.cc
src/mem/ruby/network/garnet/flexible-pipeline/NetworkInterface.cc
src/mem/ruby/network/garnet/flexible-pipeline/NetworkInterface.hh
src/mem/ruby/network/garnet/flexible-pipeline/Router.cc
src/mem/ruby/network/simple/PerfectSwitch.cc
src/mem/ruby/network/simple/Throttle.cc
src/mem/ruby/slicc_interface/Message.hh
src/mem/ruby/slicc_interface/NetworkMessage.hh [deleted file]
src/mem/ruby/structures/RubyMemoryControl.cc
src/mem/slicc/ast/AssignStatementAST.py
src/mem/slicc/symbols/Type.py

index 85a54c1f288ff7cb42544910a122b10cc84e0742..d7b8b31188425ee2825956b6aaf0b9aed3a347df 100644 (file)
@@ -57,7 +57,7 @@ enumeration(CoherenceResponseType, desc="...") {
 }
 
 // RequestMsg
-structure(RequestMsg, desc="...", interface="NetworkMessage") {
+structure(RequestMsg, desc="...", interface="Message") {
   Address Addr,              desc="Physical address for this request";
   CoherenceRequestType Type,    desc="Type of request (GetS, GetX, PutX, etc)";
   RubyAccessMode AccessMode,    desc="user/supervisor access type";
@@ -86,7 +86,7 @@ structure(RequestMsg, desc="...", interface="NetworkMessage") {
 }
 
 // ResponseMsg
-structure(ResponseMsg, desc="...", interface="NetworkMessage") {
+structure(ResponseMsg, desc="...", interface="Message") {
   Address Addr,              desc="Physical address for this request";
   CoherenceResponseType Type,   desc="Type of response (Ack, Data, etc)";
   MachineID Sender,             desc="What component sent the data";
index 568b79786a12841c3cb64a66943769b9c39005cf..f7721c6e0c86abb3194c6477e72c51a1bb9e7eb0 100644 (file)
@@ -50,7 +50,7 @@ enumeration(CoherenceResponseType, desc="...") {
 }
 
 // RequestMsg (and also forwarded requests)
-structure(RequestMsg, desc="...", interface="NetworkMessage") {
+structure(RequestMsg, desc="...", interface="Message") {
   Address Addr,             desc="Physical address for this request";
   CoherenceRequestType Type,   desc="Type of request (GetS, GetX, PutX, etc)";
   MachineID Requestor,            desc="Node who initiated the request";
@@ -74,7 +74,7 @@ structure(RequestMsg, desc="...", interface="NetworkMessage") {
 }
 
 // ResponseMsg (and also unblock requests)
-structure(ResponseMsg, desc="...", interface="NetworkMessage") {
+structure(ResponseMsg, desc="...", interface="Message") {
   Address Addr,             desc="Physical address for this request";
   CoherenceResponseType Type,  desc="Type of response (Ack, Data, etc)";
   MachineID Sender,               desc="Node who sent the data";
@@ -108,7 +108,7 @@ enumeration(DMAResponseType, desc="...", default="DMAResponseType_NULL") {
   NULL,          desc="Invalid";
 }
 
-structure(DMARequestMsg, desc="...", interface="NetworkMessage") {
+structure(DMARequestMsg, desc="...", interface="Message") {
   DMARequestType Type,       desc="Request type (read/write)";
   Address PhysicalAddress,   desc="Physical address for this request";
   Address LineAddress,       desc="Line address for this request";
@@ -127,7 +127,7 @@ structure(DMARequestMsg, desc="...", interface="NetworkMessage") {
   }
 }
 
-structure(DMAResponseMsg, desc="...", interface="NetworkMessage") {
+structure(DMAResponseMsg, desc="...", interface="Message") {
   DMAResponseType Type,      desc="Response type (DATA/ACK)";
   Address PhysicalAddress,   desc="Physical address for this request";
   Address LineAddress,       desc="Line address for this request";
index 6452aa9f9be856998e99fcf99a8a7c682b56e785..eaef28f771407a7dbfba55e0e0f3f9871599d549 100644 (file)
@@ -84,7 +84,7 @@ structure(TriggerMsg, desc="...", interface="Message") {
 }
 
 // RequestMsg (and also forwarded requests)
-structure(RequestMsg, desc="...", interface="NetworkMessage") {
+structure(RequestMsg, desc="...", interface="Message") {
   Address Addr,             desc="Physical address for this request";
   int Len,                     desc="Length of Request";
   CoherenceRequestType Type,   desc="Type of request (GetS, GetX, PutX, etc)";
@@ -113,7 +113,7 @@ structure(RequestMsg, desc="...", interface="NetworkMessage") {
 }
 
 // ResponseMsg (and also unblock requests)
-structure(ResponseMsg, desc="...", interface="NetworkMessage") {
+structure(ResponseMsg, desc="...", interface="Message") {
   Address Addr,             desc="Physical address for this request";
   CoherenceResponseType Type,  desc="Type of response (Ack, Data, etc)";
   MachineID Sender,               desc="Node who sent the data";
index 6df417e0088eeae2f3f59563f52c5b0755486aa9..91e8c1dc826426a81c23b39a9a1758654362f46a 100644 (file)
@@ -57,7 +57,7 @@ enumeration(CoherenceResponseType, desc="...") {
 }
 
 // PersistentMsg
-structure(PersistentMsg, desc="...", interface="NetworkMessage") {
+structure(PersistentMsg, desc="...", interface="Message") {
   Address Addr,             desc="Physical address for this request";
   PersistentRequestType Type,  desc="Type of starvation request";
   MachineID Requestor,            desc="Node who initiated the request";
@@ -78,7 +78,7 @@ structure(PersistentMsg, desc="...", interface="NetworkMessage") {
 }
 
 // RequestMsg
-structure(RequestMsg, desc="...", interface="NetworkMessage") {
+structure(RequestMsg, desc="...", interface="Message") {
   Address Addr,             desc="Physical address for this request";
   CoherenceRequestType Type,   desc="Type of request (GetS, GetX, PutX, etc)";
   MachineID Requestor,            desc="Node who initiated the request";
@@ -101,7 +101,7 @@ structure(RequestMsg, desc="...", interface="NetworkMessage") {
 }
 
 // ResponseMsg
-structure(ResponseMsg, desc="...", interface="NetworkMessage") {
+structure(ResponseMsg, desc="...", interface="Message") {
   Address Addr,             desc="Physical address for this request";
   CoherenceResponseType Type,  desc="Type of response (Ack, Data, etc)";
   MachineID Sender,               desc="Node who sent the data";
@@ -134,7 +134,7 @@ enumeration(DMAResponseType, desc="...", default="DMAResponseType_NULL") {
   NULL,          desc="Invalid";
 }
 
-structure(DMARequestMsg, desc="...", interface="NetworkMessage") {
+structure(DMARequestMsg, desc="...", interface="Message") {
   DMARequestType Type,       desc="Request type (read/write)";
   Address PhysicalAddress,   desc="Physical address for this request";
   Address LineAddress,       desc="Line address for this request";
@@ -153,7 +153,7 @@ structure(DMARequestMsg, desc="...", interface="NetworkMessage") {
   }
 }
 
-structure(DMAResponseMsg, desc="...", interface="NetworkMessage") {
+structure(DMAResponseMsg, desc="...", interface="Message") {
   DMAResponseType Type,      desc="Response type (DATA/ACK)";
   Address PhysicalAddress,   desc="Physical address for this request";
   Address LineAddress,       desc="Line address for this request";
index 240b27ed780afac246c8cb4239b425fdc27017f9..12472ad98c0fea25e8f63b171b05fdf0401393f2 100644 (file)
@@ -86,7 +86,7 @@ structure(TriggerMsg, desc="...", interface="Message") {
 }
 
 // RequestMsg (and also forwarded requests)
-structure(RequestMsg, desc="...", interface="NetworkMessage") {
+structure(RequestMsg, desc="...", interface="Message") {
   Address Addr,             desc="Physical address for this request";
   CoherenceRequestType Type,   desc="Type of request (GetS, GetX, PutX, etc)";
   MachineID Requestor,            desc="Node who initiated the request";
@@ -113,7 +113,7 @@ structure(RequestMsg, desc="...", interface="NetworkMessage") {
 }
 
 // ResponseMsg (and also unblock requests)
-structure(ResponseMsg, desc="...", interface="NetworkMessage") {
+structure(ResponseMsg, desc="...", interface="Message") {
   Address Addr,             desc="Physical address for this request";
   CoherenceResponseType Type,  desc="Type of response (Ack, Data, etc)";
   MachineID Sender,               desc="Node who sent the data";
@@ -164,7 +164,7 @@ enumeration(DMAResponseType, desc="...", default="DMAResponseType_NULL") {
   NULL,          desc="Invalid";
 }
 
-structure(DMARequestMsg, desc="...", interface="NetworkMessage") {
+structure(DMARequestMsg, desc="...", interface="Message") {
   DMARequestType Type,       desc="Request type (read/write)";
   Address PhysicalAddress,   desc="Physical address for this request";
   Address LineAddress,       desc="Line address for this request";
@@ -183,7 +183,7 @@ structure(DMARequestMsg, desc="...", interface="NetworkMessage") {
   }
 }
 
-structure(DMAResponseMsg, desc="...", interface="NetworkMessage") {
+structure(DMAResponseMsg, desc="...", interface="Message") {
   DMAResponseType Type,      desc="Response type (DATA/ACK)";
   Address PhysicalAddress,   desc="Physical address for this request";
   Address LineAddress,       desc="Line address for this request";
index d40e74f5f372a02cce0bc20c51cdf7fb9b540f81..b4d78882323934097184ff721b6057a46661f527 100644 (file)
@@ -33,7 +33,7 @@ enumeration(CoherenceRequestType, desc="...") {
 }
 
 // RequestMsg (and also forwarded requests)
-structure(RequestMsg, desc="...", interface="NetworkMessage") {
+structure(RequestMsg, desc="...", interface="Message") {
   Address Addr,             desc="Physical address for this request";
   CoherenceRequestType Type,   desc="Type of request (GetS, GetX, PutX, etc)";
   MachineID Requestor,            desc="Node who initiated the request";
index 4162800c576e2dc7614dc7cef8cf7a1ef04ceb90..b2a8bcb000796537546efd197ab0d7dc03f3a409 100644 (file)
@@ -219,6 +219,7 @@ structure(SequencerMsg, desc="...", interface="Message") {
   DataBlock DataBlk,         desc="Data";
   int Len,                   desc="size in bytes of access";
   PrefetchBit Prefetch,      desc="Is this a prefetch request";
+  MessageSizeType MessageSize;
 
   bool functionalRead(Packet *pkt) {
     return testAndRead(PhysicalAddress, DataBlk, pkt);
index 8133820b9ddb2a040699951c33119ee7c1a007a5..091f550607fc8401bddf8a371259e059767c64df 100644 (file)
@@ -111,7 +111,6 @@ def MakeInclude(source):
 MakeInclude('slicc_interface/AbstractEntry.hh')
 MakeInclude('slicc_interface/AbstractCacheEntry.hh')
 MakeInclude('slicc_interface/Message.hh')
-MakeInclude('slicc_interface/NetworkMessage.hh')
 MakeInclude('slicc_interface/RubyRequest.hh')
 
 # External types
index 9914ca218c78b209a62f6ba66928e8ec8691ba72..e09be0c2cb26a74c1a9bb02577665592d0f9dc07 100644 (file)
@@ -26,7 +26,7 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-// NetDest specifies the network destination of a NetworkMessage
+// NetDest specifies the network destination of a Message
 // This is backward compatible with the Set class that was previously
 // used to specify network destinations.
 // NetDest supports both node networks and component networks
index 47ded231ca358e7296d6d6523ab4aafddaba3355..c7bd6178a4b40ed7693820e2e1397c81f4c7f70a 100644 (file)
@@ -37,7 +37,7 @@
 #include "mem/ruby/network/MessageBuffer.hh"
 #include "mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.hh"
 #include "mem/ruby/network/garnet/fixed-pipeline/flitBuffer_d.hh"
-#include "mem/ruby/slicc_interface/NetworkMessage.hh"
+#include "mem/ruby/slicc_interface/Message.hh"
 
 using namespace std;
 using m5::stl_helpers::deletePointers;
@@ -129,8 +129,8 @@ NetworkInterface_d::addNode(vector<MessageBuffer *>& in,
 bool
 NetworkInterface_d::flitisizeMessage(MsgPtr msg_ptr, int vnet)
 {
-    NetworkMessage *net_msg_ptr = safe_cast<NetworkMessage *>(msg_ptr.get());
-    NetDest net_msg_dest = net_msg_ptr->getInternalDestination();
+    Message *net_msg_ptr = msg_ptr.get();
+    NetDest net_msg_dest = net_msg_ptr->getDestination();
 
     // gets all the destinations associated with this message.
     vector<NodeID> dest_nodes = net_msg_dest.getAllDest();
@@ -152,8 +152,7 @@ NetworkInterface_d::flitisizeMessage(MsgPtr msg_ptr, int vnet)
         MsgPtr new_msg_ptr = msg_ptr->clone();
         NodeID destID = dest_nodes[ctr];
 
-        NetworkMessage *new_net_msg_ptr =
-            safe_cast<NetworkMessage *>(new_msg_ptr.get());
+        Message *new_net_msg_ptr = new_msg_ptr.get();
         if (dest_nodes.size() > 1) {
             NetDest personal_dest;
             for (int m = 0; m < (int) MachineType_NUM; m++) {
@@ -163,7 +162,7 @@ NetworkInterface_d::flitisizeMessage(MsgPtr msg_ptr, int vnet)
                     personal_dest.clear();
                     personal_dest.add((MachineID) {(MachineType) m, (destID -
                         MachineType_base_number((MachineType) m))});
-                    new_net_msg_ptr->getInternalDestination() = personal_dest;
+                    new_net_msg_ptr->getDestination() = personal_dest;
                     break;
                 }
             }
@@ -171,7 +170,7 @@ NetworkInterface_d::flitisizeMessage(MsgPtr msg_ptr, int vnet)
             // removing the destination from the original message to reflect
             // that a message with this particular destination has been
             // flitisized and an output vc is acquired
-            net_msg_ptr->getInternalDestination().removeNetDest(personal_dest);
+            net_msg_ptr->getDestination().removeNetDest(personal_dest);
         }
 
         for (int i = 0; i < num_flits; i++) {
index 0cb928d820827bdd76a3b187ddf5cf0ac7e6ffba..812e8b7fb6028875c98235e8beb2e947488b2801 100644 (file)
@@ -43,7 +43,6 @@
 #include "mem/ruby/slicc_interface/Message.hh"
 #include "params/GarnetNetworkInterface_d.hh"
 
-class NetworkMessage;
 class MessageBuffer;
 class flitBuffer_d;
 
index e68c08613fbc4461ea6b53f5301b1d8415f7cec4..8d8378738a2a8c2c62d54227cdb50068b87add28 100644 (file)
@@ -32,7 +32,7 @@
 #include "mem/ruby/network/garnet/fixed-pipeline/InputUnit_d.hh"
 #include "mem/ruby/network/garnet/fixed-pipeline/Router_d.hh"
 #include "mem/ruby/network/garnet/fixed-pipeline/RoutingUnit_d.hh"
-#include "mem/ruby/slicc_interface/NetworkMessage.hh"
+#include "mem/ruby/slicc_interface/Message.hh"
 
 RoutingUnit_d::RoutingUnit_d(Router_d *router)
 {
@@ -66,8 +66,8 @@ int
 RoutingUnit_d::routeCompute(flit_d *t_flit)
 {
     MsgPtr msg_ptr = t_flit->get_msg_ptr();
-    NetworkMessage* net_msg_ptr = safe_cast<NetworkMessage *>(msg_ptr.get());
-    NetDest msg_destination = net_msg_ptr->getInternalDestination();
+    Message *net_msg_ptr = msg_ptr.get();
+    NetDest msg_destination = net_msg_ptr->getDestination();
 
     int output_link = -1;
     int min_weight = INFINITE_;
index 32066f0e1059673e6fb20f44175c2ea6783459c6..d834ea1a355d80f3fa7cdee3604ed900ede2e9ef 100644 (file)
@@ -37,7 +37,7 @@
 #include "mem/ruby/network/MessageBuffer.hh"
 #include "mem/ruby/network/garnet/flexible-pipeline/NetworkInterface.hh"
 #include "mem/ruby/network/garnet/flexible-pipeline/flitBuffer.hh"
-#include "mem/ruby/slicc_interface/NetworkMessage.hh"
+#include "mem/ruby/slicc_interface/Message.hh"
 
 using namespace std;
 using m5::stl_helpers::deletePointers;
@@ -120,8 +120,8 @@ NetworkInterface::request_vc(int in_vc, int in_port, NetDest destination,
 bool
 NetworkInterface::flitisizeMessage(MsgPtr msg_ptr, int vnet)
 {
-    NetworkMessage *net_msg_ptr = safe_cast<NetworkMessage *>(msg_ptr.get());
-    NetDest net_msg_dest = net_msg_ptr->getInternalDestination();
+    Message *net_msg_ptr = msg_ptr.get();
+    NetDest net_msg_dest = net_msg_ptr->getDestination();
 
     // get all the destinations associated with this message.
     vector<NodeID> dest_nodes = net_msg_dest.getAllDest();
@@ -143,8 +143,7 @@ NetworkInterface::flitisizeMessage(MsgPtr msg_ptr, int vnet)
         MsgPtr new_msg_ptr = msg_ptr->clone();
         NodeID destID = dest_nodes[ctr];
 
-        NetworkMessage *new_net_msg_ptr =
-            safe_cast<NetworkMessage *>(new_msg_ptr.get());
+        Message *new_net_msg_ptr = new_msg_ptr.get();
         if (dest_nodes.size() > 1) {
             NetDest personal_dest;
             for (int m = 0; m < (int) MachineType_NUM; m++) {
@@ -154,7 +153,7 @@ NetworkInterface::flitisizeMessage(MsgPtr msg_ptr, int vnet)
                     personal_dest.clear();
                     personal_dest.add((MachineID) {(MachineType) m, (destID -
                         MachineType_base_number((MachineType) m))});
-                    new_net_msg_ptr->getInternalDestination() = personal_dest;
+                    new_net_msg_ptr->getDestination() = personal_dest;
                     break;
                 }
             }
@@ -163,7 +162,7 @@ NetworkInterface::flitisizeMessage(MsgPtr msg_ptr, int vnet)
             // removing the destination from the original message to reflect
             // that a message with this particular destination has been
             // flitisized and an output vc is acquired
-            net_msg_ptr->getInternalDestination().removeNetDest(personal_dest);
+            net_msg_ptr->getDestination().removeNetDest(personal_dest);
         }
         for (int i = 0; i < num_flits; i++) {
             m_net_ptr->increment_injected_flits(vnet);
@@ -179,7 +178,7 @@ NetworkInterface::flitisizeMessage(MsgPtr msg_ptr, int vnet)
         // This flit will be ready to traverse the link and into the next hop
         // only when an output vc is acquired at the next hop
         outNetLink->request_vc_link(
-                vc, new_net_msg_ptr->getInternalDestination(), curCycle());
+                vc, new_net_msg_ptr->getDestination(), curCycle());
     }
 
     return true ;
index 03cdf3dc6db26e58306fbd112defd12b1f3bf76b..9207c353ac206fb1587c1b58bd5c8ad3e4468710 100644 (file)
@@ -42,7 +42,6 @@
 #include "mem/ruby/slicc_interface/Message.hh"
 #include "params/GarnetNetworkInterface.hh"
 
-class NetworkMessage;
 class MessageBuffer;
 class flitBuffer;
 
index 0fc2c6be3ee26f80a074ab5790cd5bf9c827225b..ef985058e460583609ac4899fba9a68e36a573b8 100644 (file)
@@ -35,7 +35,7 @@
 #include "mem/ruby/network/garnet/flexible-pipeline/OutVcState.hh"
 #include "mem/ruby/network/garnet/flexible-pipeline/Router.hh"
 #include "mem/ruby/network/garnet/flexible-pipeline/VCarbiter.hh"
-#include "mem/ruby/slicc_interface/NetworkMessage.hh"
+#include "mem/ruby/slicc_interface/Message.hh"
 
 using namespace std;
 using m5::stl_helpers::deletePointers;
@@ -277,9 +277,8 @@ Router::routeCompute(flit *m_flit, int inport)
         scheduleEvent(Cycles(m_net_ptr->getNumPipeStages() - 1));
 
     if ((m_flit->get_type() == HEAD_) || (m_flit->get_type() == HEAD_TAIL_)) {
-        NetworkMessage *nm =
-            safe_cast<NetworkMessage*>(m_flit->get_msg_ptr().get());
-        NetDest destination = nm->getInternalDestination();
+        Message *nm = m_flit->get_msg_ptr().get();
+        NetDest destination = nm->getDestination();
 
         if (m_net_ptr->getNumPipeStages() > 1) {
             m_out_vc_state[outport][outvc]->setState(VC_AB_, curCycle() +
index 86cafbe151178e91ff7b3cac0153798764db13af..06072724eb9b3a88bfcfd7164d435ed839759bb1 100644 (file)
@@ -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
index 2da810edbcc202fa5ea86736b98820568b4b7da1..d722c91ea2049fdffcd0d53792b300abb571be94 100644 (file)
@@ -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);
 
index ea33c1340f6ae999d69ea08cf483ffd7c3dc0b2c..5d8ed9711e778ab637fc66176424bb9d62b36bb4 100644 (file)
@@ -34,6 +34,8 @@
 #include <stack>
 
 #include "mem/packet.hh"
+#include "mem/protocol/MessageSizeType.hh"
+#include "mem/ruby/common/NetDest.hh"
 
 class Message;
 typedef std::shared_ptr<Message> MsgPtr;
@@ -58,8 +60,11 @@ class Message
 
     virtual MsgPtr clone() const = 0;
     virtual void print(std::ostream& out) const = 0;
-    virtual void setIncomingLink(int) {}
-    virtual void setVnet(int) {}
+
+    virtual const MessageSizeType& getMessageSize() const
+    { panic("MessageSizeType() called on wrong message!"); }
+    virtual MessageSizeType& getMessageSize()
+    { panic("MessageSizeType() called on wrong message!"); }
 
     /**
      * The two functions below are used for reading / writing the message
@@ -87,11 +92,26 @@ class Message
     void setMsgCounter(uint64_t c) { m_msg_counter = c; }
     uint64_t getMsgCounter() const { return m_msg_counter; }
 
+    // Functions related to network traversal
+    virtual const NetDest& getDestination() const
+    { panic("getDestination() called on wrong message!"); }
+    virtual NetDest& getDestination()
+    { panic("getDestination() called on wrong message!"); }
+
+    int getIncomingLink() const { return incoming_link; }
+    void setIncomingLink(int link) { incoming_link = link; }
+    int getVnet() const { return vnet; }
+    void setVnet(int net) { vnet = net; }
+
   private:
     const Tick m_time;
     Tick m_LastEnqueueTime; // my last enqueue time
     Tick m_DelayedTicks; // my delayed cycles
     uint64_t m_msg_counter; // FIXME, should this be a 64-bit value?
+
+    // Variables for required network traversal
+    int incoming_link;
+    int vnet;
 };
 
 inline bool
diff --git a/src/mem/ruby/slicc_interface/NetworkMessage.hh b/src/mem/ruby/slicc_interface/NetworkMessage.hh
deleted file mode 100644 (file)
index 1b5edcf..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met: redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer;
- * redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution;
- * neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef __MEM_RUBY_SLICC_INTERFACE_NETWORKMESSAGE_HH__
-#define __MEM_RUBY_SLICC_INTERFACE_NETWORKMESSAGE_HH__
-
-#include <iostream>
-#include <memory>
-
-#include "mem/protocol/MessageSizeType.hh"
-#include "mem/ruby/common/NetDest.hh"
-#include "mem/ruby/slicc_interface/Message.hh"
-
-class NetworkMessage;
-typedef std::shared_ptr<NetworkMessage> NetMsgPtr;
-
-class NetworkMessage : public Message
-{
-  public:
-    NetworkMessage(Tick curTime)
-        : Message(curTime), m_internal_dest_valid(false)
-    { }
-
-    NetworkMessage(const NetworkMessage &other)
-        : Message(other), m_internal_dest(other.m_internal_dest),
-          m_internal_dest_valid(other.m_internal_dest_valid)
-    { }
-
-    virtual ~NetworkMessage() { }
-
-    virtual const NetDest& getDestination() const = 0;
-    virtual NetDest& getDestination() = 0;
-    virtual const MessageSizeType& getMessageSize() const = 0;
-    virtual MessageSizeType& getMessageSize() = 0;
-
-    const NetDest&
-    getInternalDestination() const
-    {
-        if (!m_internal_dest_valid)
-            return getDestination();
-
-        return m_internal_dest;
-    }
-
-    NetDest&
-    getInternalDestination()
-    {
-        if (!m_internal_dest_valid) {
-            m_internal_dest = getDestination();
-            m_internal_dest_valid = true;
-        }
-        return m_internal_dest;
-    }
-
-    virtual void print(std::ostream& out) const = 0;
-
-    int getIncomingLink() const { return incoming_link; }
-    void setIncomingLink(int link) { incoming_link = link; }
-    int getVnet() const { return vnet; }
-    void setVnet(int net) { vnet = net; }
-
-  private:
-    NetDest m_internal_dest;
-    bool m_internal_dest_valid;
-    int incoming_link;
-    int vnet;
-};
-
-inline std::ostream&
-operator<<(std::ostream& out, const NetworkMessage& obj)
-{
-    obj.print(out);
-    out << std::flush;
-    return out;
-}
-
-#endif // __MEM_RUBY_SLICC_INTERFACE_NETWORKMESSAGE_HH__
index adf3dcc535ee418564c0bc8bdfaa60c8132394f2..7e07a82bc47a18ab77aa430cb71f8d190332b15d 100644 (file)
 #include "mem/ruby/common/Address.hh"
 #include "mem/ruby/common/Global.hh"
 #include "mem/ruby/profiler/Profiler.hh"
-#include "mem/ruby/slicc_interface/NetworkMessage.hh"
+#include "mem/ruby/slicc_interface/Message.hh"
 #include "mem/ruby/slicc_interface/RubySlicc_ComponentMapping.hh"
 #include "mem/ruby/structures/RubyMemoryControl.hh"
 #include "mem/ruby/system/System.hh"
index 042204925b3ab27f7fac8adfd14547f775f24472..b9597935452848a05fc9b8986e5b308744261658 100644 (file)
@@ -47,11 +47,10 @@ class AssignStatementAST(StatementAST):
 
         if not (ltype == rtype or (ltype.isInterface and ltype['interface'] == rtype.ident)):
             # FIXME - beckmann
-            # the following if statement is a hack to allow NetDest
-            # objects to be assigned to Sets this allows for the
-            # previous NetworkMessage Destiantion 'Set class' to
-            # migrate to the new NetworkMessage Destiantion 'NetDest
-            # class'
+            # the following if statement is a hack to allow NetDest objects to
+            # be assigned to Sets this allows for the previous Message
+            # Destination 'Set class' to migrate to the new Message Destination
+            # 'NetDest class'
             if str(ltype) != "NetDest" and str(rtype) != "Set":
                 self.error("Assignment type mismatch '%s' and '%s'",
                            ltype, rtype)
index 2afd9958cba8598904620a663ee7ce63456e050d..e6e70400055d5dde6386f425e6d375b2b44b38d5 100644 (file)
@@ -61,10 +61,8 @@ class Type(Symbol):
         # check for interface that this Type implements
         if "interface" in self:
             interface = self["interface"]
-            if interface in ("Message", "NetworkMessage"):
+            if interface in ("Message"):
                 self["message"] = "yes"
-            if interface == "NetworkMessage":
-                self["networkmessage"] = "yes"
 
         # FIXME - all of the following id comparisons are fragile hacks
         if self.ident in ("CacheMemory"):
@@ -97,9 +95,7 @@ class Type(Symbol):
     @property
     def isPrimitive(self):
         return "primitive" in self
-    @property
-    def isNetworkMessage(self):
-        return "networkmessage" in self
+
     @property
     def isMessage(self):
         return "message" in self