diff options
Diffstat (limited to 'src/mem/ruby/network/garnet/fixed-pipeline')
-rw-r--r-- | src/mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.cc | 10 | ||||
-rw-r--r-- | src/mem/ruby/network/garnet/fixed-pipeline/RoutingUnit_d.cc | 4 |
2 files changed, 8 insertions, 6 deletions
diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.cc b/src/mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.cc index da86c32fa..2a2536d53 100644 --- a/src/mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.cc +++ b/src/mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.cc @@ -107,7 +107,8 @@ void NetworkInterface_d::addNode(Vector<MessageBuffer*>& in, Vector<MessageBuff bool NetworkInterface_d::flitisizeMessage(MsgPtr msg_ptr, int vnet) { - NetworkMessage *net_msg_ptr = dynamic_cast<NetworkMessage*>(msg_ptr.ref()); + NetworkMessage *net_msg_ptr = + safe_cast<NetworkMessage *>(msg_ptr.get()); NetDest net_msg_dest = net_msg_ptr->getInternalDestination(); Vector<NodeID> dest_nodes = net_msg_dest.getAllDest(); // gets all the destinations associated with this message. @@ -120,10 +121,11 @@ bool NetworkInterface_d::flitisizeMessage(MsgPtr msg_ptr, int vnet) { return false ; } - MsgPtr new_msg_ptr = *(msg_ptr.ref()); + MsgPtr new_msg_ptr = msg_ptr->clone(); NodeID destID = dest_nodes[ctr]; - NetworkMessage *new_net_msg_ptr = dynamic_cast<NetworkMessage*>(new_msg_ptr.ref()); + NetworkMessage *new_net_msg_ptr = + safe_cast<NetworkMessage *>(new_msg_ptr.get()); if(dest_nodes.size() > 1) { NetDest personal_dest; @@ -145,7 +147,7 @@ bool NetworkInterface_d::flitisizeMessage(MsgPtr msg_ptr, int vnet) { m_net_ptr->increment_injected_flits(); flit_d *fl = new flit_d(i, vc, vnet, num_flits, new_msg_ptr); - fl->set_delay(g_eventQueue_ptr->getTime() - (msg_ptr.ref())->getTime()); + fl->set_delay(g_eventQueue_ptr->getTime() - msg_ptr->getTime()); m_ni_buffers[vc]->insert(fl); } m_ni_enqueue_time[vc] = g_eventQueue_ptr->getTime(); diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/RoutingUnit_d.cc b/src/mem/ruby/network/garnet/fixed-pipeline/RoutingUnit_d.cc index 0c215efd3..fabda735a 100644 --- a/src/mem/ruby/network/garnet/fixed-pipeline/RoutingUnit_d.cc +++ b/src/mem/ruby/network/garnet/fixed-pipeline/RoutingUnit_d.cc @@ -61,8 +61,8 @@ void RoutingUnit_d::RC_stage(flit_d *t_flit, InputUnit_d *in_unit, int invc) int RoutingUnit_d::routeCompute(flit_d *t_flit) { MsgPtr msg_ptr = t_flit->get_msg_ptr(); - NetworkMessage* net_msg_ptr = NULL; - net_msg_ptr = dynamic_cast<NetworkMessage*>(msg_ptr.ref()); + NetworkMessage* net_msg_ptr = + safe_cast<NetworkMessage*>(msg_ptr.get()); NetDest msg_destination = net_msg_ptr->getInternalDestination(); int output_link = -1; |