Class Flit

java.lang.Object
  extended by Flit

public class Flit
extends java.lang.Object

A message (a packet) is the summation of some flits. Flit object simply contains encoded data as member variable. The data is divided into different fields. Both header and data flit contain flit type (1 bit) and virtual channel number used. For data flit the remaining bits of the data block is simply raw data taken from the message (packet). For header flit contains number bit used to represent the source and destination nodes, number of flits, source address and destination address sequentially.

Version:
1.0

Field Summary
private  int[] data
          Contains the array of 32 bit data.
private  int dest
          The address of the destination node.
private  int genTimeStamp
          The time stamp (simulation cycle) when the flit has been generated.
private  int hop
          The number of hops the flit has traversed
private  int lastServiceTimeStamp
          The time stamp (simulation cycle) when the flit has been last served.
private  int src
          The address of the source node.
 
Constructor Summary
Flit(int[] data, int genTimeStamp)
           
 
Method Summary
 int getAddressLength()
          Returns the number of bits required to encode an address in the flit.
 int[] getData()
          Returns the data of the flit.
 int getDest()
          Return the destination address of the flit.
 int getDestinationNode()
          Returns the address of the destination node.
 int getGenTimeStamp()
          Returns the generation time stamp of the flit
 int getHopCount()
          Returns the hop count that the flit has traversed
 int getLastServiceTimeStamp()
          Returns the last service time when the flit was served
 int getPacketLength()
          Returns the number of flits in the packet to which this flit belongs.
 int getSource()
          Return the source address of the flit.
 int getSourceNode()
          Returns the address of the source node.
 int getType()
          Returns the type of the flit.
 int getVirtualChannelNo()
          Returns the virtual channel information of the flit
 void increaseHop()
          Increases the hop count of the flit, after it traverses a physical link.
 void setDest(int dest)
          Sets the destination address of the flit
 void setGenTimeStamp(int timeStamp)
          Sets the generation time stamp
 void setLastServiceTimeStamp(int timeStamp)
          Sets the last service time information by the specified time stamp
 void setSource(int src)
          Sets the source address of the flit.
 void setVirtualChannelNo(int vcId)
          Sets the virtual channel information of the flit data
 java.lang.String toString()
          Returns the Hex value of the flit data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

data

private int[] data
Contains the array of 32 bit data.


genTimeStamp

private int genTimeStamp
The time stamp (simulation cycle) when the flit has been generated.


lastServiceTimeStamp

private int lastServiceTimeStamp
The time stamp (simulation cycle) when the flit has been last served.


src

private int src
The address of the source node.


dest

private int dest
The address of the destination node.


hop

private int hop
The number of hops the flit has traversed

Constructor Detail

Flit

public Flit(int[] data,
            int genTimeStamp)
Method Detail

increaseHop

public void increaseHop()
Increases the hop count of the flit, after it traverses a physical link.


getHopCount

public int getHopCount()
Returns the hop count that the flit has traversed

Returns:
the hop count

getType

public int getType()
Returns the type of the flit.

Returns:
one bit information to distinguish HEADER or DATA flit

getVirtualChannelNo

public int getVirtualChannelNo()
Returns the virtual channel information of the flit

Returns:
virtual channel number

getAddressLength

public int getAddressLength()
Returns the number of bits required to encode an address in the flit.

Returns:
number of bits to encode an address

getPacketLength

public int getPacketLength()
Returns the number of flits in the packet to which this flit belongs.

Returns:
packet length in flits

getSourceNode

public int getSourceNode()
Returns the address of the source node. While doing so, it decodes the flit data to retrieve the sought information. As the address might overlap in two adjacent 32 bit data, it takes care of such situation.

Returns:
address of the source node.

getDestinationNode

public int getDestinationNode()
Returns the address of the destination node. While doing so, it decodes the flit data to retrieve the sought information. As the address might overlap in two adjacent 32 bit data, it takes care of such situation.

Returns:
address of the destination node.

getData

public int[] getData()
Returns the data of the flit.

Returns:
an intege array of data of the flit

toString

public java.lang.String toString()
Returns the Hex value of the flit data.

Overrides:
toString in class java.lang.Object

setVirtualChannelNo

public void setVirtualChannelNo(int vcId)
Sets the virtual channel information of the flit data

Parameters:
vcId - virtual channel number

setLastServiceTimeStamp

public void setLastServiceTimeStamp(int timeStamp)
Sets the last service time information by the specified time stamp

Parameters:
timeStamp - the time stamp (simulation cycle) when the flit receives some service

getLastServiceTimeStamp

public int getLastServiceTimeStamp()
Returns the last service time when the flit was served

Returns:
the last service time information

setGenTimeStamp

public void setGenTimeStamp(int timeStamp)
Sets the generation time stamp

Parameters:
timeStamp - the time information when the flit is generated

getGenTimeStamp

public int getGenTimeStamp()
Returns the generation time stamp of the flit

Returns:
generation time of the flit.

getSource

public int getSource()
Return the source address of the flit.

Returns:
address of the source node

getDest

public int getDest()
Return the destination address of the flit.

Returns:
address of the destination node

setSource

public void setSource(int src)
Sets the source address of the flit.

Parameters:
src - address of the source node

setDest

public void setDest(int dest)
Sets the destination address of the flit

Parameters:
dest - address of the destination node