Class OutputLinkController

java.lang.Object
  extended by OutputLinkController

public class OutputLinkController
extends java.lang.Object

Output Link Controller controls the outgoing flits. It helps in sending the flits to the input link controllers of adjacent switches and nodes by using round robin algorithm among the virtual channels as at a time a single flit from one virtual channel can be sent. It works as a wrapper of the output buffer where output virtual channels are implemented.

Version:
1.0

Field Summary
private  int linkNo
          The input physical link to whitch the link controller is associated
private  int numLinkCount
          The number of physical links for the switch
private  int numVCCount
          The number of virtual channels per physical link
private  OutputVCBuffer outputBuffer
          OutputVCBuffers associated with the physical link
private  Switch parentSwitch
          Base class type variable of different types of switches for different types of networks.
 
Constructor Summary
OutputLinkController(Switch parent, int linkNo, int vcCount, int linkCount)
          Constructor for the OutputLinkController class.
 
Method Summary
 boolean addOutputBufferData(Flit flit, int vcId, int curCycle)
          Adds a flit to a output FIFO buffer at a specified virtual channel.
 Flit getBufferData(int vcId)
          Returns a flit from the virtual channel specified in the parameter
 int getFreeVC_NEW(Flit vc)
          An alternative of getFreeVC();
 int getFreeVC()
          Returns free virtual channel index for the corresponding physical link.
 OutputVCBuffer getOutputBuffer()
          Returns the output buffer associated with the output link controller.
 boolean hasFlitToSend(int vcId)
          Returns true, if the virtual channel has more flits to send.
 boolean hasFreeSlotInVCBuffer(int vcId)
          Returns true, if the virtual channel has more slots to store additional flit.
 Flit removeOutputBufferData(int vcId, int curCycle)
          Removes a flit from a virtual channel.
 void updateStatusAfterCycle()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parentSwitch

private Switch parentSwitch
Base class type variable of different types of switches for different types of networks. It holds the reference of the switch to which the link controller is attached.

See Also:
Switch

outputBuffer

private OutputVCBuffer outputBuffer
OutputVCBuffers associated with the physical link


linkNo

private int linkNo
The input physical link to whitch the link controller is associated


numVCCount

private int numVCCount
The number of virtual channels per physical link


numLinkCount

private int numLinkCount
The number of physical links for the switch

Constructor Detail

OutputLinkController

public OutputLinkController(Switch parent,
                            int linkNo,
                            int vcCount,
                            int linkCount)
Constructor for the OutputLinkController class.

Parameters:
parent - switch to which the link controller is attached.
linkNo - physical link to which the link controller is attached.
vcCount - total no. of virtual channels per physical link
linkCount - total no. of physical links associated with the switch
Method Detail

addOutputBufferData

public boolean addOutputBufferData(Flit flit,
                                   int vcId,
                                   int curCycle)
Adds a flit to a output FIFO buffer at a specified virtual channel.

Parameters:
flit - flit data, either Header or Data flit
vcId - virtual channel no. to which this flit is to be added/
curCycle - cycle at which the operation is being performed
Returns:
true - if flits can be added, false - otherwise

removeOutputBufferData

public Flit removeOutputBufferData(int vcId,
                                   int curCycle)
Removes a flit from a virtual channel.

Parameters:
vcId - virtual channel index
curCycle - current simulation cycle
Returns:
Flit
See Also:
OutputVCBuffer

hasFreeSlotInVCBuffer

public boolean hasFreeSlotInVCBuffer(int vcId)
Returns true, if the virtual channel has more slots to store additional flit. False-otherwise.

Parameters:
vcId - virtual channel index
Returns:
boolean value
See Also:
OutputVCBuffer

hasFlitToSend

public boolean hasFlitToSend(int vcId)
Returns true, if the virtual channel has more flits to send. False-otherwise.

Parameters:
vcId - virtual channel index
Returns:
boolean value
See Also:
OutputVCBuffer

updateStatusAfterCycle

public void updateStatusAfterCycle()

getBufferData

public Flit getBufferData(int vcId)
Returns a flit from the virtual channel specified in the parameter

Parameters:
vcId - virtual channel number
Returns:
Flit data
See Also:
OutputVCBuffer, Flit

getFreeVC

public int getFreeVC()
Returns free virtual channel index for the corresponding physical link.

Returns:
the index of the free virtual channel for this output link
See Also:
OutputVCBuffer

getFreeVC_NEW

public int getFreeVC_NEW(Flit vc)
An alternative of getFreeVC();

Parameters:
vc - virtual channel number
Returns:
a free output virtual channel number

getOutputBuffer

public OutputVCBuffer getOutputBuffer()
Returns the output buffer associated with the output link controller.

Returns:
output buffer
See Also:
OutputVCBuffer