Class InputVCBuffer

java.lang.Object
  extended by InputVCBuffer

public class InputVCBuffer
extends java.lang.Object

There is one input buffer for each of the input physical link. As we are using wormhole switching and virtual channel technique to avoid deadlock developed in wormhole switching input buffer provides these virtual channel support. A virtual channel is simply a buffer. So input buffer object holds as many buffer objects as many virtual channels are required. InputVCBuffer class defines such input buffer object.

Version:
1.0

Field Summary
private  boolean[] buffMidStatus
          An array of booleans of size VCN.
private  java.util.Vector[] data
          A Vector type object instantiated to hold the Buffer objects.
private  int[] flitCounter
          An array of integer of size VCN.
private  int[] pathInfo
          An array of integer of size VCN.
private  int pLinkNo
          The physical link no.
private  int[] routeInfo
          An array of integer of size VCN.
private  int vcCount
          Number of virtual channels per physical channel used in the system.
 
Constructor Summary
InputVCBuffer(int linkNo)
          Default Constructor.
InputVCBuffer(int vcCount, int linkNo)
          Instantiates all the necessary data required to manage the input buffer and then initialize all the data.
 
Method Summary
 boolean addBufferData(Flit flit, int vcId, int curCycle)
          Stores a flit in a specified virtual channel of the input buffer.
 Flit getBufferData(int vcId)
          Retrieve the flit from the specified virtual channel number of this input buffer object.
 int getFreeVC()
          Returns a free virtual channel on the physical link.
 int getNumSlotUsed()
          Returns total no.
 int getPathInfo(int vcId)
          Returns the outgoing path information for the packet occupying the virtual channel.
 int getRouteInfo(int vcId)
          Returns the outgoing physical link no.
 boolean hasFlitToSend(int vcId)
          Returns whether there are more flits to send from the virtual channel.
 boolean hasFreeSlotInVC(int vcId)
          Checks whether the virtual channel can hold another incoming flit of the packet that already holds the virtual channel.
 boolean isVCFree(int vcId)
          Checks whether a virtual channel can be assigned to an incoming packet.
 Flit removeBufferData(int vcId, int curCycle)
          Remove the flit from the specified virtual channel of the input buffer.
 void resetRouteInfo(int vcId)
          Resets the outgoing physical link no.
 void setPathInfo(int vcId, int dest)
          Sets the outgoing path information for the packet occupying the virtual channel.
 void setRouteInfo(int vcId, int dest)
          Sets the outgoing physical link no.
 void updateStatusAfterCycle()
          Re-initializes the temporary status variables after each cycle.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

data

private java.util.Vector[] data
A Vector type object instantiated to hold the Buffer objects. This vector holds VCN number of buffer objects, where VCN indicates number of virtual channels per physical channel used in the system.


vcCount

private int vcCount
Number of virtual channels per physical channel used in the system.


pLinkNo

private int pLinkNo
The physical link no. on which this input buffer is associated.


routeInfo

private int[] routeInfo
An array of integer of size VCN. One cell is for every virtual channel. It holds the routing path (outgoing physical channel ) for the incoming flits.


pathInfo

private int[] pathInfo
An array of integer of size VCN. One cell is for every virtual channel. It identifies the outgoing virtual channel on the routing path (outgoing physical channel, found from routeInfo) for the incoming flits.


flitCounter

private int[] flitCounter
An array of integer of size VCN. One cell is for every virtual channel. Every cell contains the number of remaining flits to transfer for the current packet before allocating the channel to a new packet. It is used to track the number of flit is to pass (in a packet)


buffMidStatus

private boolean[] buffMidStatus
An array of booleans of size VCN. It is used temporarily to hold the stattus of a buffer to indicate whether it can be used in the next cycle for storage. This value is set when a flit is removed from the buffer.

Constructor Detail

InputVCBuffer

public InputVCBuffer(int linkNo)
Default Constructor.

Parameters:
linkNo - Physical link no

InputVCBuffer

public InputVCBuffer(int vcCount,
                     int linkNo)
Instantiates all the necessary data required to manage the input buffer and then initialize all the data.

Parameters:
vcCount - Number of virtual channel for the input physical link.
linkNo - Physical link no.
Method Detail

addBufferData

public boolean addBufferData(Flit flit,
                             int vcId,
                             int curCycle)
Stores a flit in a specified virtual channel of the input buffer. The method is called by an Input Link Controller. Everytime a flit enters the input buffer, the no. of hops it has crossed is increased in this method. Similarly, the last service timestamp of the flit is also modified.

Parameters:
flit - Flit data
vcId - Virtual Channel no. to which this flit has to be delegated
curCycle - Current timestamp
Returns:
true (always, as before invoking this method, usually the status of the buffer is checked whether it can hold anymore flit)

removeBufferData

public Flit removeBufferData(int vcId,
                             int curCycle)
Remove the flit from the specified virtual channel of the input buffer. The method is called by an Input Link Controller. The flit can be removed if it is stored there at least one cycle ahead of the current timestamp specified by 'curCycle'.

Parameters:
vcId - Virtual channel number from where the flit is to be removed
curCycle - Current timestamp
Returns:
the flit data if available at the buffer and the flit is stored in the buffer one cycle prior to this operation, else returns null

getBufferData

public Flit getBufferData(int vcId)
Retrieve the flit from the specified virtual channel number of this input buffer object. Here the flit is not removed from the buffer. The flit may be required for testing. For those cases this method is called.

Parameters:
vcId - virtual channel number
Returns:
Flit data

updateStatusAfterCycle

public void updateStatusAfterCycle()
Re-initializes the temporary status variables after each cycle. If a flit has been removed from the buffer, it gets such information from the buffMidStatus variable. Then it decrements the flitCounter variables. Finallly, if all flits of the packet leaves the input buffer, then it re-initializes other route-info holding variables.


isVCFree

public boolean isVCFree(int vcId)
Checks whether a virtual channel can be assigned to an incoming packet.

Parameters:
vcId - Virtual channel no.
Returns:
true-if the VC is free, false-otherwise.

hasFreeSlotInVC

public boolean hasFreeSlotInVC(int vcId)
Checks whether the virtual channel can hold another incoming flit of the packet that already holds the virtual channel.

Parameters:
vcId - Virtual channel no.
Returns:
true-if the VC has free slots, false-otherwise.

setRouteInfo

public void setRouteInfo(int vcId,
                         int dest)
Sets the outgoing physical link no. that the packet occupying the virtual channel must follow to reach the destination.

Parameters:
vcId - Virtual channel no.
dest - Outgoing physical link no.

getRouteInfo

public int getRouteInfo(int vcId)
Returns the outgoing physical link no. that the packet occupying the virtual channel must follow to reach the destination.

Parameters:
vcId - Virtual channel no.
Returns:
Outgoing physical link no.

resetRouteInfo

public void resetRouteInfo(int vcId)
Resets the outgoing physical link no. information for the virtual channel

Parameters:
vcId - Virtual channel no.

getFreeVC

public int getFreeVC()
Returns a free virtual channel on the physical link.

Returns:
free Virtual channel no.

hasFlitToSend

public boolean hasFlitToSend(int vcId)
Returns whether there are more flits to send from the virtual channel.

Parameters:
vcId - Virtual channel no.
Returns:
true-if one or more flits occupy the virtual channel, false-if the virtual channel is empty.

setPathInfo

public void setPathInfo(int vcId,
                        int dest)
Sets the outgoing path information for the packet occupying the virtual channel. Path information is equals to (outgoing physical link no.* total no. of virtual channel + outgoing virtual channel no. on the outgoing link)

Parameters:
vcId - Virtual channel no
dest - Path information

getPathInfo

public int getPathInfo(int vcId)
Returns the outgoing path information for the packet occupying the virtual channel.

Parameters:
vcId - Virtual channel no
Returns:
Path information

getNumSlotUsed

public int getNumSlotUsed()
Returns total no. of slots occupied by various flits in the input buffer.

Returns:
Number of slots used