gem5/src/mem/ruby/network/garnet2.0
Matthew Poremba 501f170924 ruby: Check all VNETs for injection in garnet NetworkInterface
The NetworkInterface wakeup currently iterates over all VNETs and breaks the
loop if a VNET is unable to allocate a VC. This can cause a deadlock if a
lower numbered VNET is unable to allocate a VC while a higher numbered VNET
has idle VCs. This seems like a bug as Garnet 1.0 uses a while loop over an
if-statement, suggesting the break was intended for this while loop. This
patch removes the break statement, which allows up to one message to be
dequeued from a VNET and injected into the network.
2017-01-19 11:58:49 -05:00
..
CommonTypes.hh ruby: garnet2.0 2016-10-06 14:35:22 -04:00
Credit.cc ruby: garnet2.0 2016-10-06 14:35:22 -04:00
Credit.hh ruby: garnet2.0 2016-10-06 14:35:22 -04:00
CreditLink.hh ruby: garnet2.0 2016-10-06 14:35:22 -04:00
CrossbarSwitch.cc ruby: garnet2.0 2016-10-06 14:35:22 -04:00
CrossbarSwitch.hh ruby: garnet2.0 2016-10-06 14:35:22 -04:00
flit.cc ruby: garnet2.0 2016-10-06 14:35:22 -04:00
flit.hh ruby: garnet2.0 2016-10-06 14:35:22 -04:00
flitBuffer.cc ruby: garnet2.0 2016-10-06 14:35:22 -04:00
flitBuffer.hh ruby: garnet2.0 2016-10-06 14:35:22 -04:00
GarnetLink.cc ruby: Fix potential bugs in garnet2.0 2016-11-21 15:41:30 -05:00
GarnetLink.hh ruby: Fix potential bugs in garnet2.0 2016-11-21 15:41:30 -05:00
GarnetLink.py ruby: garnet2.0 2016-10-06 14:35:22 -04:00
GarnetNetwork.cc ruby: garnet2.0 2016-10-06 14:35:22 -04:00
GarnetNetwork.hh ruby: garnet2.0 2016-10-06 14:35:22 -04:00
GarnetNetwork.py ruby: Detect garnet network-level deadlock. 2016-12-15 16:59:17 -05:00
InputUnit.cc ruby: garnet2.0 2016-10-06 14:35:22 -04:00
InputUnit.hh ruby: garnet2.0 2016-10-06 14:35:22 -04:00
NetworkInterface.cc ruby: Check all VNETs for injection in garnet NetworkInterface 2017-01-19 11:58:49 -05:00
NetworkInterface.hh ruby: Detect garnet network-level deadlock. 2016-12-15 16:59:17 -05:00
NetworkLink.cc ruby: garnet2.0 2016-10-06 14:35:22 -04:00
NetworkLink.hh ruby: garnet2.0 2016-10-06 14:35:22 -04:00
OutputUnit.cc ruby: garnet2.0 2016-10-06 14:35:22 -04:00
OutputUnit.hh ruby: garnet2.0 2016-10-06 14:35:22 -04:00
OutVcState.cc ruby: garnet2.0 2016-10-06 14:35:22 -04:00
OutVcState.hh ruby: garnet2.0 2016-10-06 14:35:22 -04:00
README.txt ruby: garnet2.0 2016-10-06 14:35:22 -04:00
Router.cc ruby: garnet2.0 2016-10-06 14:35:22 -04:00
Router.hh ruby: garnet2.0 2016-10-06 14:35:22 -04:00
RoutingUnit.cc ruby: Add M5_VAR_USED before variables used only inside assert in garnet2.0. 2016-10-06 21:06:00 -04:00
RoutingUnit.hh ruby: garnet2.0 2016-10-06 14:35:22 -04:00
SConscript ruby: garnet2.0 2016-10-06 14:35:22 -04:00
SwitchAllocator.cc ruby: garnet2.0 2016-10-06 14:35:22 -04:00
SwitchAllocator.hh ruby: garnet2.0 2016-10-06 14:35:22 -04:00
VirtualChannel.cc ruby: garnet2.0 2016-10-06 14:35:22 -04:00
VirtualChannel.hh ruby: garnet2.0 2016-10-06 14:35:22 -04:00

README for Garnet2.0
Written By: Tushar Krishna (tushar@ece.gatech.edu)
Last Updated: Jul 9, 2016
-------------------------------------------------------

Garnet Network Parameters and Setup:
- GarnetNetwork.py
    * defaults can be overwritten from command line (see configs/network/Network.py)
- GarnetNetwork.hh/cc
    * sets up the routers and links
    * collects stats


CODE FLOW
- NetworkInterface.cc::wakeup()
    * Every NI connected to one coherence protocol controller on one end, and one router on the other.
    * receives messages from coherence protocol buffer in appropriate vnet and converts them into network packets and sends them into the network.
        * garnet2.0 adds the ability to capture a network trace at this point.
    * receives flits from the network, extracts the protocol message and sends it to the coherence protocol buffer in appropriate vnet.
    * manages flow-control (i.e., credits) with its attached router.
    * The consuming flit/credit output link of the NI is put in the global event queue with a timestamp set to next cycle.
      The eventqueue calls the wakeup function in the consumer.

- NetworkLink.cc::wakeup()
    * receives flits from NI/router and sends it to NI/router after m_latency cycles delay
        * Default latency value for every link can be set from command line (see configs/network/Network.py)
        * Per link latency can be overwritten in the topology file
    * The consumer of the link (NI/router) is put in the global event queue with a timestamp set after m_latency cycles.
      The eventqueue calls the wakeup function in the consumer.

- Router.cc::wakeup()
    * Loop through all InputUnits and call their wakeup()
    * Loop through all OutputUnits and call their wakeup()
    * Call SwitchAllocator's wakeup()
    * Call CrossbarSwitch's wakeup()
    * The router's wakeup function is called whenever any of its modules (InputUnit, OutputUnit, SwitchAllocator, CrossbarSwitch) have
      a ready flit/credit to act upon this cycle.

- InputUnit.cc::wakeup()
    * Read input flit from upstream router if it is ready for this cycle
    * For HEAD/HEAD_TAIL flits, perform route computation, and update route in the VC.
    * Buffer the flit for (m_latency - 1) cycles and mark it valid for SwitchAllocation starting that cycle.
        * Default latency for every router can be set from command line (see configs/network/Network.py)
        * Per router latency (i.e., num pipeline stages) can be set in the topology file

- OutputUnit.cc::wakeup()
    * Read input credit from downstream router if it is ready for this cycle
    * Increment the credit in the appropriate output VC state.
    * Mark output VC as free if the credit carries is_free_signal as true

- SwitchAllocator.cc::wakeup()
    * Note: SwitchAllocator performs VC arbitration and selection within it.
    * SA-I (or SA-i): Loop through all input VCs at every input port, and select one in a round robin manner.
        * For HEAD/HEAD_TAIL flits only select an input VC whose output port has at least one free output VC.
        * For BODY/TAIL flits, only select an input VC that has credits in its output VC.
    * Place a request for the output port from this VC.
    * SA-II (or SA-o): Loop through all output ports, and select one input VC (that placed a request during SA-I) as the winner for this output port in a round robin manner.
        * For HEAD/HEAD_TAIL flits, perform outvc allocation (i.e., select a free VC from the output port).
        * For BODY/TAIL flits, decrement a credit in the output vc.
    * Read the flit out from the input VC, and send it to the CrossbarSwitch
    * Send a increment_credit signal to the upstream router for this input VC.
        * for HEAD_TAIL/TAIL flits, mark is_free_signal as true in the credit.
        * The input unit sends the credit out on the credit link to the upstream router.
    * Reschedule the Router to wakeup next cycle for any flits ready for SA next cycle.

- CrossbarSwitch.cc::wakeup()
    * Loop through all input ports, and send the winning flit out of its output port onto the output link.
    * The consuming flit output link of the router is put in the global event queue with a timestamp set to next cycle.
      The eventqueue calls the wakeup function in the consumer.