|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectNode
public class Node
IP Node (Node class) is the resource that is used in the system for message generation as well as message consumption. Node is connected with a switch (depends on network type) through one input physical link and one output physical link.
Field Summary | |
---|---|
private int |
address
int type variable - holds the address of the node. |
private double |
clockRateFactor
The speed factor of the node with respect to the switches. |
private InputVCBuffer |
inputBuffer
An object of InputVCBuffer class. |
private int |
lastInVCServed
This variable keeps track of the last input virtual channel from which a flit has been received and transferred into the message center. |
private int |
lastOutVCServed
This variable keeps track of the last output virtual channel from which a flit has been transferred to the adjacent switch. |
private int |
lastSender
Since in one cycle only one packet can be assigned a free virtual channel, this variable keeps track of the packet number that was last serviced. |
private int |
lastUsedOwnInCycle
The last cycle in which it receives an flit from its adjacent switch. |
private int |
lastUsedOwnOutCycle
The last cycle in which it an flit is transferred to the adjacent switch. |
private int |
linkNo
The link number of the parent switch to which the node is connected. |
private boolean |
linkUsed
This is a boolean value which is set for a particual cycle, if the node transmits a flit to its adjacent node. |
private int |
messageCount
No of generated messages stored in the node's internal buffer that are yet to be transferred completely. |
private java.util.Vector[] |
messageList
Vector type variable - holds the reference of packets which are to transmit. |
private int[] |
messageVCIndex
An array of integer values containing the VC assigned to each generated message. |
private int |
nodeListIndex
The index for this node in the universal array of nodes in the |
private int[] |
nodeReceivedFlitCounter
It keeps track of the number of flits in a packet that are yet to be received. |
(package private) NodeTraffic |
nodeTraffic
Reference to the NodeTraffic class. |
private OutputVCBuffer |
outputBuffer
An object of OutputVCBufer class. |
private int[] |
outVCUsedList
An array of integers that keep track of whether a virtual channel has already been assigned or not. |
Switch |
parent
Reference to the parent switch object. |
private java.util.Vector[] |
receiveMessageList
Vector type variable - holds the reference of packets which have been received. |
private int |
vcCount
Total no. |
Constructor Summary | |
---|---|
Node(int address,
Switch parent,
int pLink,
int vcCount,
double clkRateFactor)
Constructor of Node class |
Method Summary | |
---|---|
boolean |
addInputBufferData(Flit flit,
int curCycle)
This method is called by the parent switch when flits are available in the switch sent by some other nodes to transfer to this node. |
private void |
checkForMsgFreeVC()
Performs the following operations. |
private void |
dumpMessage(java.util.Vector packet)
This method is invoked after a packet is completely received. |
private void |
fillEmptyBuffer(int curCycle)
Performs the following operations. |
void |
forwardFlitToNodeMessageCenter(int curCycle)
This method is called by the Network class at every cycle. |
private void |
forwardFlitToSwitch(int curCycle)
Performs the transmission of flit from the virtual channel (output buffer) to physical channel and ultimately the flit is stored in the corresponding virtual channel of the switch. |
private void |
generateMessage(int curCycle)
this method generates the message of L length. |
int |
getAddress()
Returns the address of the node. |
double |
getClockRateFactor()
Returns the clock rate factor of the node class. |
int |
getLastUsedOwnInCycle()
Returns the lastUsedOwnInCycle variable of the node class |
int |
getLastUsedOwnOutCycle()
Returns the lastUsedOwnOutCycle variable of the node class |
int |
getNodeListIndex()
Returns the nodeListIndex variable of this class. |
private int |
getNumUsedVC()
Returns the number of output virtual channels that are already occupied. |
boolean |
hasFreeSlotInInputVC(int vcId)
Checks whether the input virtual channel has a free slot or not. |
boolean |
isInputVCFree(int vcId)
Checks whether the input virtual channel is free or not. |
void |
setAddress(int addr)
Sets the address of the node. |
void |
setClockRateFactor(double clkRateFactor)
Sets the clock rate factor (variable clockRateFactor) of the node class. |
void |
setLastUsedOwnInCycle(int cycle)
Sets the lastUsedOwnInCycle variable of the node class |
void |
setLastUsedOwnOutCycle(int cycle)
Sets the lastUsedOwnOutCycle variable of the node class |
void |
setNodeListIndex(int index)
Sets the nodeListIndex variable of this class. |
void |
updateOutput(int curCycle)
This method is one of the core methods ot the Node class. |
void |
updateStatusAfterCycle(int curCycle)
This method is called after the operation of every cycle to update statistical counters and reset the temporary status variables. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private int address
int type variable - holds the address of the node. The address is represented in different ways for different types of networks.
For example for Mesh and Torus network the address is represented from row and column as well as position of the node in the switch. For Fat Tree network the address is represented from the level of the node and the position of the node in the level.
public Switch parent
private int[] messageVCIndex
private int messageCount
private java.util.Vector[] messageList
private java.util.Vector[] receiveMessageList
private int[] nodeReceivedFlitCounter
private int[] outVCUsedList
private int vcCount
private int linkNo
private int lastSender
private int lastOutVCServed
private int lastInVCServed
private int nodeListIndex
Network
private boolean linkUsed
private double clockRateFactor
private int lastUsedOwnInCycle
private int lastUsedOwnOutCycle
private InputVCBuffer inputBuffer
private OutputVCBuffer outputBuffer
NodeTraffic nodeTraffic
Constructor Detail |
---|
public Node(int address, Switch parent, int pLink, int vcCount, double clkRateFactor)
Constructor of Node class
The constructor instantiates all the necessary objects (e.g. input/output buffer, messageList and so) for internal uses and keeps references of external objects (e.g. parent switch)
address
- address of the nodeparent
- parent switch of the nodepLink
- the physical link number through which the node is connected
with the switchvcCount
- the number of virtual channel used for every physical channelclkRateFactor
- clock rate factor of the node with respect to those of the
switches.Method Detail |
---|
public void setClockRateFactor(double clkRateFactor)
clkRateFactor
- clock rate factorpublic double getClockRateFactor()
public void setLastUsedOwnInCycle(int cycle)
cycle
- the last cycle in which it receives an flit from its adjacent
switchpublic int getLastUsedOwnInCycle()
public void setLastUsedOwnOutCycle(int cycle)
cycle
- the last cycle in which it an flit is transferred to the
adjacent switch.public int getLastUsedOwnOutCycle()
public void setAddress(int addr)
addr
- addresspublic int getAddress()
private void generateMessage(int curCycle)
private int getNumUsedVC()
public void updateOutput(int curCycle)
It first checks if this is the right cycle to generate message.
It, then, looks up for a free VC to assign to its generated messages that are yet to be assigned a VC.
It calls the appropriate method (fillEmptyBuffer) to transfer a flit to the output buffer.
It calls the appropriate method (forwardFlitToSwitch) to transfer a flit to the adjacent switch.
curCycle
- current simulation cycle.private void checkForMsgFreeVC()
private void fillEmptyBuffer(int curCycle)
curCycle
- current simulation cycleprivate void forwardFlitToSwitch(int curCycle)
Performs the transmission of flit from the virtual channel (output buffer) to physical channel and ultimately the flit is stored in the corresponding virtual channel of the switch.
The method performs its activities in the order given below.
curCycle
- current simulation cyclepublic boolean isInputVCFree(int vcId)
vcId
- virtual channel no
public boolean hasFreeSlotInInputVC(int vcId)
vcId
- virtual channel no.
public boolean addInputBufferData(Flit flit, int curCycle)
flit
- flit datacurCycle
- current simulation cycle
public void forwardFlitToNodeMessageCenter(int curCycle)
curCycle
- current simulation cycleprivate void dumpMessage(java.util.Vector packet)
packet
- received packetpublic void updateStatusAfterCycle(int curCycle)
curCycle
- current simulation cyclepublic void setNodeListIndex(int index)
index
- index of this node class in the universal nodelistpublic int getNodeListIndex()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |