111666Stushar@ece.gatech.eduREADME for Garnet2.0 211666Stushar@ece.gatech.eduWritten By: Tushar Krishna (tushar@ece.gatech.edu) 311666Stushar@ece.gatech.eduLast Updated: Jul 9, 2016 411666Stushar@ece.gatech.edu------------------------------------------------------- 511666Stushar@ece.gatech.edu 611666Stushar@ece.gatech.eduGarnet Network Parameters and Setup: 711666Stushar@ece.gatech.edu- GarnetNetwork.py 811666Stushar@ece.gatech.edu * defaults can be overwritten from command line (see configs/network/Network.py) 911666Stushar@ece.gatech.edu- GarnetNetwork.hh/cc 1011666Stushar@ece.gatech.edu * sets up the routers and links 1111666Stushar@ece.gatech.edu * collects stats 1211666Stushar@ece.gatech.edu 1311666Stushar@ece.gatech.edu 1411666Stushar@ece.gatech.eduCODE FLOW 1511666Stushar@ece.gatech.edu- NetworkInterface.cc::wakeup() 1611666Stushar@ece.gatech.edu * Every NI connected to one coherence protocol controller on one end, and one router on the other. 1711666Stushar@ece.gatech.edu * receives messages from coherence protocol buffer in appropriate vnet and converts them into network packets and sends them into the network. 1811666Stushar@ece.gatech.edu * garnet2.0 adds the ability to capture a network trace at this point. 1911666Stushar@ece.gatech.edu * receives flits from the network, extracts the protocol message and sends it to the coherence protocol buffer in appropriate vnet. 2011666Stushar@ece.gatech.edu * manages flow-control (i.e., credits) with its attached router. 2111666Stushar@ece.gatech.edu * The consuming flit/credit output link of the NI is put in the global event queue with a timestamp set to next cycle. 2211666Stushar@ece.gatech.edu The eventqueue calls the wakeup function in the consumer. 2311666Stushar@ece.gatech.edu 2411666Stushar@ece.gatech.edu- NetworkLink.cc::wakeup() 2511666Stushar@ece.gatech.edu * receives flits from NI/router and sends it to NI/router after m_latency cycles delay 2611666Stushar@ece.gatech.edu * Default latency value for every link can be set from command line (see configs/network/Network.py) 2711666Stushar@ece.gatech.edu * Per link latency can be overwritten in the topology file 2811666Stushar@ece.gatech.edu * The consumer of the link (NI/router) is put in the global event queue with a timestamp set after m_latency cycles. 2911666Stushar@ece.gatech.edu The eventqueue calls the wakeup function in the consumer. 3011666Stushar@ece.gatech.edu 3111666Stushar@ece.gatech.edu- Router.cc::wakeup() 3211666Stushar@ece.gatech.edu * Loop through all InputUnits and call their wakeup() 3311666Stushar@ece.gatech.edu * Loop through all OutputUnits and call their wakeup() 3411666Stushar@ece.gatech.edu * Call SwitchAllocator's wakeup() 3511666Stushar@ece.gatech.edu * Call CrossbarSwitch's wakeup() 3611666Stushar@ece.gatech.edu * The router's wakeup function is called whenever any of its modules (InputUnit, OutputUnit, SwitchAllocator, CrossbarSwitch) have 3711666Stushar@ece.gatech.edu a ready flit/credit to act upon this cycle. 3811666Stushar@ece.gatech.edu 3911666Stushar@ece.gatech.edu- InputUnit.cc::wakeup() 4011666Stushar@ece.gatech.edu * Read input flit from upstream router if it is ready for this cycle 4111666Stushar@ece.gatech.edu * For HEAD/HEAD_TAIL flits, perform route computation, and update route in the VC. 4211666Stushar@ece.gatech.edu * Buffer the flit for (m_latency - 1) cycles and mark it valid for SwitchAllocation starting that cycle. 4311666Stushar@ece.gatech.edu * Default latency for every router can be set from command line (see configs/network/Network.py) 4411666Stushar@ece.gatech.edu * Per router latency (i.e., num pipeline stages) can be set in the topology file 4511666Stushar@ece.gatech.edu 4611666Stushar@ece.gatech.edu- OutputUnit.cc::wakeup() 4711666Stushar@ece.gatech.edu * Read input credit from downstream router if it is ready for this cycle 4811666Stushar@ece.gatech.edu * Increment the credit in the appropriate output VC state. 4911666Stushar@ece.gatech.edu * Mark output VC as free if the credit carries is_free_signal as true 5011666Stushar@ece.gatech.edu 5111666Stushar@ece.gatech.edu- SwitchAllocator.cc::wakeup() 5211666Stushar@ece.gatech.edu * Note: SwitchAllocator performs VC arbitration and selection within it. 5311666Stushar@ece.gatech.edu * SA-I (or SA-i): Loop through all input VCs at every input port, and select one in a round robin manner. 5411666Stushar@ece.gatech.edu * For HEAD/HEAD_TAIL flits only select an input VC whose output port has at least one free output VC. 5511666Stushar@ece.gatech.edu * For BODY/TAIL flits, only select an input VC that has credits in its output VC. 5611666Stushar@ece.gatech.edu * Place a request for the output port from this VC. 5711666Stushar@ece.gatech.edu * 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. 5811666Stushar@ece.gatech.edu * For HEAD/HEAD_TAIL flits, perform outvc allocation (i.e., select a free VC from the output port). 5911666Stushar@ece.gatech.edu * For BODY/TAIL flits, decrement a credit in the output vc. 6011666Stushar@ece.gatech.edu * Read the flit out from the input VC, and send it to the CrossbarSwitch 6111666Stushar@ece.gatech.edu * Send a increment_credit signal to the upstream router for this input VC. 6211666Stushar@ece.gatech.edu * for HEAD_TAIL/TAIL flits, mark is_free_signal as true in the credit. 6311666Stushar@ece.gatech.edu * The input unit sends the credit out on the credit link to the upstream router. 6411666Stushar@ece.gatech.edu * Reschedule the Router to wakeup next cycle for any flits ready for SA next cycle. 6511666Stushar@ece.gatech.edu 6611666Stushar@ece.gatech.edu- CrossbarSwitch.cc::wakeup() 6711666Stushar@ece.gatech.edu * Loop through all input ports, and send the winning flit out of its output port onto the output link. 6811666Stushar@ece.gatech.edu * The consuming flit output link of the router is put in the global event queue with a timestamp set to next cycle. 6911666Stushar@ece.gatech.edu The eventqueue calls the wakeup function in the consumer. 7011666Stushar@ece.gatech.edu 7111666Stushar@ece.gatech.edu 72