default=False,
help="""enable network fault model:
see src/mem/ruby/network/fault_model/""")
+ parser.add_option("--garnet-deadlock-threshold", action="store",
+ type="int", default=50000,
+ help="network-level deadlock threshold.")
def create_network(options, ruby):
network.vcs_per_vnet = options.vcs_per_vnet
network.ni_flit_size = options.link_width_bits / 8
network.routing_algorithm = options.routing_algorithm
+ network.garnet_deadlock_threshold = options.garnet_deadlock_threshold
if options.network == "simple":
network.setup_buffers()
"0: Weight-based Table, 1: XY, 2: Custom");
enable_fault_model = Param.Bool(False, "enable network fault model");
fault_model = Param.FaultModel(NULL, "network fault model");
+ garnet_deadlock_threshold = Param.UInt32(50000,
+ "network-level deadlock threshold")
class GarnetNetworkInterface(ClockedObject):
type = 'GarnetNetworkInterface'
"virtual channels per virtual network")
virt_nets = Param.UInt32(Parent.number_of_virtual_networks,
"number of virtual networks")
+ garnet_deadlock_threshold = Param.UInt32(Parent.garnet_deadlock_threshold,
+ "network-level deadlock threshold")
class GarnetRouter(BasicRouter):
type = 'GarnetRouter'
NetworkInterface::NetworkInterface(const Params *p)
: ClockedObject(p), Consumer(this), m_id(p->id),
m_virtual_networks(p->virt_nets), m_vc_per_vnet(p->vcs_per_vnet),
- m_num_vcs(m_vc_per_vnet * m_virtual_networks)
+ m_num_vcs(m_vc_per_vnet * m_virtual_networks),
+ m_deadlock_threshold(p->garnet_deadlock_threshold),
+ vc_busy_counter(m_virtual_networks, 0)
{
m_router_id = -1;
m_vc_round_robin = 0;
if (m_out_vc_state[(vnet*m_vc_per_vnet) + delta]->isInState(
IDLE_, curCycle())) {
+ vc_busy_counter[vnet] = 0;
return ((vnet*m_vc_per_vnet) + delta);
}
}
+
+ vc_busy_counter[vnet] += 1;
+ panic_if(vc_busy_counter[vnet] > m_deadlock_threshold,
+ "%s: Possible network deadlock in vnet: %d at time: %llu \n",
+ name(), vnet, curTick());
+
return -1;
}
int m_vc_round_robin; // For round robin scheduling
flitBuffer *outFlitQueue; // For modeling link contention
flitBuffer *outCreditQueue;
+ int m_deadlock_threshold;
NetworkLink *inNetLink;
NetworkLink *outNetLink;
std::vector<MessageBuffer *> inNode_ptr;
// The Message buffers that provides messages to the protocol
std::vector<MessageBuffer *> outNode_ptr;
+ // When a vc stays busy for a long time, it indicates a deadlock
+ std::vector<int> vc_busy_counter;
bool flitisizeMessage(MsgPtr msg_ptr, int vnet);
int calculateVC(int vnet);