merged Tushar's bug fix with public repository changes
This commit is contained in:
@@ -916,7 +916,7 @@ machine(L2Cache, "Token protocol") {
|
||||
action(uu_profileMiss, "\u", desc="Profile the demand miss") {
|
||||
peek(L1requestNetwork_in, RequestMsg) {
|
||||
// AccessModeType not implemented
|
||||
profile_L2Cache_miss(convertToGenericType(in_msg.Type), in_msg.AccessMode, MessageSizeTypeToInt(in_msg.MessageSize), in_msg.Prefetch, machineIDToNodeID(in_msg.Requestor));
|
||||
//profile_L2Cache_miss(convertToGenericType(in_msg.Type), in_msg.AccessMode, MessageSizeTypeToInt(in_msg.MessageSize), in_msg.Prefetch, machineIDToNodeID(in_msg.Requestor));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -978,7 +978,7 @@ machine(L2Cache, "MOSI Directory L2 Cache CMP") {
|
||||
|
||||
action(uu_profileMiss, "\u", desc="Profile the demand miss") {
|
||||
peek(L1RequestIntraChipL2Network_in, RequestMsg) {
|
||||
profile_L2Cache_miss(convertToGenericType(in_msg.Type), in_msg.AccessMode, MessageSizeTypeToInt(in_msg.MessageSize), in_msg.Prefetch, L1CacheMachIDToProcessorNum(in_msg.RequestorMachId));
|
||||
//profile_L2Cache_miss(convertToGenericType(in_msg.Type), in_msg.AccessMode, MessageSizeTypeToInt(in_msg.MessageSize), in_msg.Prefetch, L1CacheMachIDToProcessorNum(in_msg.RequestorMachId));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,6 @@ Time zero_time();
|
||||
NodeID intToID(int nodenum);
|
||||
int IDToInt(NodeID id);
|
||||
int addressToInt(Address addr);
|
||||
int MessageSizeTypeToInt(MessageSizeType size_type);
|
||||
bool multicast_retry();
|
||||
int numberOfNodes();
|
||||
int numberOfL1CachePerChip();
|
||||
|
||||
@@ -631,7 +631,7 @@ class Network < LibRubyObject
|
||||
vec += " buffer_size "+buffer_size.to_s
|
||||
vec += " link_latency "+adaptive_routing.to_s
|
||||
vec += " on_chip_latency "+on_chip_latency.to_s
|
||||
|
||||
vec += " control_msg_size "+control_msg_size.to_s
|
||||
end
|
||||
|
||||
def printTopology()
|
||||
|
||||
@@ -82,6 +82,8 @@ class Network < LibRubyObject
|
||||
|
||||
# on chip latency
|
||||
default_param :on_chip_latency, Integer, 1
|
||||
|
||||
default_param :control_msg_size, Integer, 8
|
||||
end
|
||||
|
||||
class GarnetNetwork < Network
|
||||
|
||||
@@ -26,9 +26,44 @@ void Network::init(const vector<string> & argv)
|
||||
m_adaptive_routing = (argv[i+1]=="true");
|
||||
else if (argv[i] == "link_latency")
|
||||
m_link_latency = atoi(argv[i+1].c_str());
|
||||
|
||||
else if (argv[i] == "control_msg_size")
|
||||
m_control_msg_size = atoi(argv[i+1].c_str());
|
||||
}
|
||||
|
||||
m_data_msg_size = RubySystem::getBlockSizeBytes() + m_control_msg_size;
|
||||
|
||||
assert(m_virtual_networks != 0);
|
||||
assert(m_topology_ptr != NULL);
|
||||
// printf ("HERE \n");
|
||||
}
|
||||
|
||||
int Network::MessageSizeType_to_int(MessageSizeType size_type)
|
||||
{
|
||||
switch(size_type) {
|
||||
case MessageSizeType_Undefined:
|
||||
ERROR_MSG("Can't convert Undefined MessageSizeType to integer");
|
||||
break;
|
||||
case MessageSizeType_Control:
|
||||
case MessageSizeType_Request_Control:
|
||||
case MessageSizeType_Reissue_Control:
|
||||
case MessageSizeType_Response_Control:
|
||||
case MessageSizeType_Writeback_Control:
|
||||
case MessageSizeType_Forwarded_Control:
|
||||
case MessageSizeType_Invalidate_Control:
|
||||
case MessageSizeType_Unblock_Control:
|
||||
case MessageSizeType_Persistent_Control:
|
||||
case MessageSizeType_Completion_Control:
|
||||
return m_control_msg_size;
|
||||
break;
|
||||
case MessageSizeType_Data:
|
||||
case MessageSizeType_Response_Data:
|
||||
case MessageSizeType_ResponseLocal_Data:
|
||||
case MessageSizeType_ResponseL2hit_Data:
|
||||
case MessageSizeType_Writeback_Data:
|
||||
return m_data_msg_size;
|
||||
break;
|
||||
default:
|
||||
ERROR_MSG("Invalid range for type MessageSizeType");
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -71,6 +71,8 @@ public:
|
||||
int getEndpointBandwidth() { return m_endpoint_bandwidth; }
|
||||
bool getAdaptiveRouting() {return m_adaptive_routing; }
|
||||
int getLinkLatency() { return m_link_latency; }
|
||||
int MessageSizeType_to_int(MessageSizeType size_type);
|
||||
|
||||
|
||||
// returns the queue requested for the given component
|
||||
virtual MessageBuffer* getToNetQueue(NodeID id, bool ordered, int netNumber) = 0;
|
||||
@@ -107,6 +109,8 @@ protected:
|
||||
Topology* m_topology_ptr;
|
||||
bool m_adaptive_routing;
|
||||
int m_link_latency;
|
||||
int m_control_msg_size;
|
||||
int m_data_msg_size;
|
||||
};
|
||||
|
||||
// Output operator declaration
|
||||
@@ -123,41 +127,4 @@ ostream& operator<<(ostream& out, const Network& obj)
|
||||
return out;
|
||||
}
|
||||
|
||||
// Code to map network message size types to an integer number of bytes
|
||||
const int CONTROL_MESSAGE_SIZE = 8;
|
||||
const int DATA_MESSAGE_SIZE = (RubySystem::getBlockSizeBytes()+8);
|
||||
|
||||
extern inline
|
||||
int MessageSizeType_to_int(MessageSizeType size_type)
|
||||
{
|
||||
switch(size_type) {
|
||||
case MessageSizeType_Undefined:
|
||||
ERROR_MSG("Can't convert Undefined MessageSizeType to integer");
|
||||
break;
|
||||
case MessageSizeType_Control:
|
||||
case MessageSizeType_Request_Control:
|
||||
case MessageSizeType_Reissue_Control:
|
||||
case MessageSizeType_Response_Control:
|
||||
case MessageSizeType_Writeback_Control:
|
||||
case MessageSizeType_Forwarded_Control:
|
||||
case MessageSizeType_Invalidate_Control:
|
||||
case MessageSizeType_Unblock_Control:
|
||||
case MessageSizeType_Persistent_Control:
|
||||
case MessageSizeType_Completion_Control:
|
||||
return CONTROL_MESSAGE_SIZE;
|
||||
break;
|
||||
case MessageSizeType_Data:
|
||||
case MessageSizeType_Response_Data:
|
||||
case MessageSizeType_ResponseLocal_Data:
|
||||
case MessageSizeType_ResponseL2hit_Data:
|
||||
case MessageSizeType_Writeback_Data:
|
||||
return DATA_MESSAGE_SIZE;
|
||||
break;
|
||||
default:
|
||||
ERROR_MSG("Invalid range for type MessageSizeType");
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif //NETWORK_H
|
||||
|
||||
@@ -114,7 +114,7 @@ bool NetworkInterface_d::flitisizeMessage(MsgPtr msg_ptr, int vnet)
|
||||
NetDest net_msg_dest = net_msg_ptr->getInternalDestination();
|
||||
Vector<NodeID> dest_nodes = net_msg_dest.getAllDest(); // gets all the destinations associated with this message.
|
||||
|
||||
int num_flits = (int) ceil((double) MessageSizeType_to_int(net_msg_ptr->getMessageSize())/m_net_ptr->getNetworkConfig()->getFlitSize() ); // Number of flits is dependent on the link bandwidth available. This is expressed in terms of bytes/cycle or the flit size
|
||||
int num_flits = (int) ceil((double) m_net_ptr->MessageSizeType_to_int(net_msg_ptr->getMessageSize())/m_net_ptr->getNetworkConfig()->getFlitSize() ); // Number of flits is dependent on the link bandwidth available. This is expressed in terms of bytes/cycle or the flit size
|
||||
|
||||
for(int ctr = 0; ctr < dest_nodes.size(); ctr++) // loop because we will be converting all multicast messages into unicast messages
|
||||
{
|
||||
|
||||
@@ -109,7 +109,7 @@ bool NetworkInterface::flitisizeMessage(MsgPtr msg_ptr, int vnet)
|
||||
NetworkMessage *net_msg_ptr = dynamic_cast<NetworkMessage*>(msg_ptr.ref());
|
||||
NetDest net_msg_dest = net_msg_ptr->getInternalDestination();
|
||||
Vector<NodeID> dest_nodes = net_msg_dest.getAllDest(); // gets all the destinations associated with this message.
|
||||
int num_flits = (int) ceil((double) MessageSizeType_to_int(net_msg_ptr->getMessageSize())/m_net_ptr->getNetworkConfig()->getFlitSize() ); // Number of flits is dependent on the link bandwidth available. This is expressed in terms of bytes/cycle or the flit size
|
||||
int num_flits = (int) ceil((double) m_net_ptr->MessageSizeType_to_int(net_msg_ptr->getMessageSize())/m_net_ptr->getNetworkConfig()->getFlitSize() ); // Number of flits is dependent on the link bandwidth available. This is expressed in terms of bytes/cycle or the flit size
|
||||
|
||||
for(int ctr = 0; ctr < dest_nodes.size(); ctr++) // loop because we will be converting all multicast messages into unicast messages
|
||||
{
|
||||
|
||||
@@ -169,7 +169,7 @@ void Switch::printStats(ostream& out) const
|
||||
int sum = message_counts[type].sum();
|
||||
if (sum != 0) {
|
||||
out << " outgoing_messages_switch_" << m_switch_id << "_link_" << link << "_" << type
|
||||
<< ": " << sum << " " << sum * MessageSizeType_to_int(type)
|
||||
<< ": " << sum << " " << sum * (RubySystem::getNetwork()->MessageSizeType_to_int(type))
|
||||
<< " " << message_counts[type] << " base_latency: " << throttle_ptr->getLatency() << endl;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -275,8 +275,8 @@ int network_message_to_size(NetworkMessage* net_msg_ptr)
|
||||
// Artificially increase the size of broadcast messages
|
||||
if (BROADCAST_SCALING > 1) {
|
||||
if (net_msg_ptr->getDestination().isBroadcast()) {
|
||||
return (MessageSizeType_to_int(net_msg_ptr->getMessageSize()) * MESSAGE_SIZE_MULTIPLIER * BROADCAST_SCALING);
|
||||
return (RubySystem::getNetwork()->MessageSizeType_to_int(net_msg_ptr->getMessageSize()) * MESSAGE_SIZE_MULTIPLIER * BROADCAST_SCALING);
|
||||
}
|
||||
}
|
||||
return (MessageSizeType_to_int(net_msg_ptr->getMessageSize()) * MESSAGE_SIZE_MULTIPLIER);
|
||||
return (RubySystem::getNetwork()->MessageSizeType_to_int(net_msg_ptr->getMessageSize()) * MESSAGE_SIZE_MULTIPLIER);
|
||||
}
|
||||
|
||||
@@ -106,11 +106,6 @@ extern inline int addressToInt(Address addr)
|
||||
return (int) addr.getLineAddress();
|
||||
}
|
||||
|
||||
extern inline int MessageSizeTypeToInt(MessageSizeType size_type)
|
||||
{
|
||||
return MessageSizeType_to_int(size_type);
|
||||
}
|
||||
|
||||
extern inline bool long_enough_ago(Time event)
|
||||
{
|
||||
return ((get_time() - event) > 200);
|
||||
|
||||
Reference in New Issue
Block a user