NetworkInterface.cc (11666:10d59d546ea2) NetworkInterface.cc (11762:29d401db3746)
1/*
2 * Copyright (c) 2008 Princeton University
3 * Copyright (c) 2016 Georgia Institute of Technology
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are
8 * met: redistributions of source code must retain the above copyright

--- 36 unchanged lines hidden (view full) ---

45#include "mem/ruby/slicc_interface/Message.hh"
46
47using namespace std;
48using m5::stl_helpers::deletePointers;
49
50NetworkInterface::NetworkInterface(const Params *p)
51 : ClockedObject(p), Consumer(this), m_id(p->id),
52 m_virtual_networks(p->virt_nets), m_vc_per_vnet(p->vcs_per_vnet),
1/*
2 * Copyright (c) 2008 Princeton University
3 * Copyright (c) 2016 Georgia Institute of Technology
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are
8 * met: redistributions of source code must retain the above copyright

--- 36 unchanged lines hidden (view full) ---

45#include "mem/ruby/slicc_interface/Message.hh"
46
47using namespace std;
48using m5::stl_helpers::deletePointers;
49
50NetworkInterface::NetworkInterface(const Params *p)
51 : ClockedObject(p), Consumer(this), m_id(p->id),
52 m_virtual_networks(p->virt_nets), m_vc_per_vnet(p->vcs_per_vnet),
53 m_num_vcs(m_vc_per_vnet * m_virtual_networks)
53 m_num_vcs(m_vc_per_vnet * m_virtual_networks),
54 m_deadlock_threshold(p->garnet_deadlock_threshold),
55 vc_busy_counter(m_virtual_networks, 0)
54{
55 m_router_id = -1;
56 m_vc_round_robin = 0;
57 m_ni_out_vcs.resize(m_num_vcs);
58 m_ni_out_vcs_enqueue_time.resize(m_num_vcs);
59 outCreditQueue = new flitBuffer();
60
61 // instantiating the NI flit buffers

--- 247 unchanged lines hidden (view full) ---

309 for (int i = 0; i < m_vc_per_vnet; i++) {
310 int delta = m_vc_allocator[vnet];
311 m_vc_allocator[vnet]++;
312 if (m_vc_allocator[vnet] == m_vc_per_vnet)
313 m_vc_allocator[vnet] = 0;
314
315 if (m_out_vc_state[(vnet*m_vc_per_vnet) + delta]->isInState(
316 IDLE_, curCycle())) {
56{
57 m_router_id = -1;
58 m_vc_round_robin = 0;
59 m_ni_out_vcs.resize(m_num_vcs);
60 m_ni_out_vcs_enqueue_time.resize(m_num_vcs);
61 outCreditQueue = new flitBuffer();
62
63 // instantiating the NI flit buffers

--- 247 unchanged lines hidden (view full) ---

311 for (int i = 0; i < m_vc_per_vnet; i++) {
312 int delta = m_vc_allocator[vnet];
313 m_vc_allocator[vnet]++;
314 if (m_vc_allocator[vnet] == m_vc_per_vnet)
315 m_vc_allocator[vnet] = 0;
316
317 if (m_out_vc_state[(vnet*m_vc_per_vnet) + delta]->isInState(
318 IDLE_, curCycle())) {
319 vc_busy_counter[vnet] = 0;
317 return ((vnet*m_vc_per_vnet) + delta);
318 }
319 }
320 return ((vnet*m_vc_per_vnet) + delta);
321 }
322 }
323
324 vc_busy_counter[vnet] += 1;
325 panic_if(vc_busy_counter[vnet] > m_deadlock_threshold,
326 "%s: Possible network deadlock in vnet: %d at time: %llu \n",
327 name(), vnet, curTick());
328
320 return -1;
321}
322
323
324/** This function looks at the NI buffers
325 * if some buffer has flits which are ready to traverse the link in the next
326 * cycle, and the downstream output vc associated with this flit has buffers
327 * left, the link is scheduled for the next cycle

--- 116 unchanged lines hidden ---
329 return -1;
330}
331
332
333/** This function looks at the NI buffers
334 * if some buffer has flits which are ready to traverse the link in the next
335 * cycle, and the downstream output vc associated with this flit has buffers
336 * left, the link is scheduled for the next cycle

--- 116 unchanged lines hidden ---