|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectFatTreeSwitch
public class FatTreeSwitch
This switch is used for building the Butterfly Fat Tree topology network. This type of switch is interconnected with different number of switches/nodes according to its position in the network. The switches are arranged according to a butter fly fat tree hierarchy. Here every switch has two parent switches except the top level switches. Every switch has four child switches except the lowest level switches. Lowest level switches have four child IP Nodes (Node class, resource of the network). All the resources (IP Nodes) are at level 0.
Field Summary | |
---|---|
private int |
address
This is an int type variable used to hold the address of the switch in the network. |
private FatTreeSwitch[] |
downSwitchList
This is an array of FatTreeSwitch used to store the list of reference of adjacent child switches if any. |
private int |
indexInLevel
This is an int type variable used to store the index value of this switch it its level in the fat tree network. |
private InputLinkController[] |
inputLC
These are array of InputLinkController used to store the list of input link
controller objects instantiated for input communication management with
the adjacent nodes and switches. |
private int[] |
lastVCServedList
In order to facilitate round-robin service for the virtual channels, this array keeps track of the index of last served virtual channel on different links. |
private int |
level
This is an int type variable used to store the level value of this switch in the fat tree network. |
private boolean[] |
LinkUseStatus
This array keeps track of the status of the output links if there are any transmission of flits in a particular simulation cycle. |
private Node[] |
nodeList
This is array of Node used to store the list of references of adjacent nodes. |
private int |
noOfPhysicalLink
This is an int type variable used to hold the number of physical links attached with the switch to perform communication between adjacent switches and nodes. |
private int |
noOfVirtualLink
This is an int type variable used to hold the number of virtual channel used for every physical link. |
private OutputLinkController[] |
outputLC
These are array of OutputLinkController used to store the list of output link
controller objects instantiated for output communication management with
the adjacent nodes and switches. |
private Router |
router
This is an object of type Router. |
private int |
switchIndex
Index of the switch in the global array of switches in the |
private int[] |
switchingInfoVector
This is an array of int variable having the size of noOfPhysicalLink * noOfVirtualLink. |
private FatTreeSwitch[] |
upSwitchList
This is an array of FatTreeSwitch used to store the list of reference of adjacent parent switches if any. |
Constructor Summary | |
---|---|
FatTreeSwitch(int address,
int switchIndex)
This is the constructor of the FatTreeSwitch used for butterfly fat tree topology. |
Method Summary | |
---|---|
boolean |
addInputBufferData(int linkNo,
Flit flit,
int curCycle)
Adds a flit to the input buffer on a particular physical link. |
boolean |
addOutputBufferData(int linkNo,
Flit flit,
int vcId,
int curCycle)
Adds a flit to the output buffer on a particular physical link. |
private void |
createLinkController(int linkCount,
int vcCount)
Instantiates the input and output link controllers. |
void |
createRouter()
Assigns a Router implementation of the Butterfly Fat Tree network. |
private void |
createSwitchingInfoVector()
Instantiates and initializes the switchingInfoVector data structure to hold the path mapping information. |
int |
determineRoute(int src,
int dest)
Determines the outgoing link to switch a packet orgininated from a source node (src) and destined to the destination node (dest). |
private void |
forwardFlitToNode(Node adjNode,
int linkNo,
int curCycle)
Transfers a flit to an adjacent node. |
private void |
forwardFlitToSwitch(FatTreeSwitch adjSwitch,
int linkNo,
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. |
int |
getAddress()
Returns the address of the switch. |
int |
getAdjacentLinkNo(FatTreeSwitch fatSwitch)
Returns the number of the output physical link that connects a neighboring switch, either situated above or beneath this switch. |
InputLinkController |
getInputLinkController(int linkNo)
Returns the input link controller of the switch on a particular physical link. |
int |
getNoOfPhysicalLink()
Returns the maximum number of physical links information. |
int |
getNoOfVirtualLink()
Returns the number of virtual channel per physical link information. |
int |
getNumAdjacentNode()
Returns the number of adjacent nodes to which the switch is connected. |
int |
getNumLinkActive()
Returns the number of physical links for the switch |
OutputLinkController |
getOutputLinkController(int linkNo)
Returns the output link controller of the switch on a particular physical link. |
int |
getSwitchIndex()
Returns the index of the switch in the level of the Butterfly Fat Tree network where it is placed. |
int |
getSwitchingInfoVector(int dest)
Returns the input virtual channel information for a packet flowing through the output virtual channel. |
int |
getSwitchLevel()
Returns the level of the Butterfly Fat Tree network where the switch is placed. |
boolean |
hasFreeSlotInVCBuffer(int linkNo,
int vcId)
Checks whether there is one or more slots in the input virtual channel of an input buffer or not. |
boolean |
isVCFreeInSwitch(int linkNo,
int vcId)
Checks if the virtual channels in the input buffer of a particular physical link is available to be assigned to a new incoming packet. |
void |
moveInputBufferToOutputBuffer(int curCycle)
This method is called by network in every cycle to transfer flit from input buffer to output buffer. |
void |
moveSwitchOutputBufferToInputBufferOfNodeSwitch(int curCycle)
This method is called by Network in every cycle to transfer flit from output buffer of the switch to input buffer of adjacent nodes and switches. |
Flit |
removeInputBufferData(int linkNo,
int vcId,
int curCycle)
Removes a flit data from an input virtual channel of the input buffer on a particular physical link. |
Flit |
removeOutputBufferData(int linkNo,
int vcId,
int curCycle)
Removes a flit data from an output virtual channel of the output buffer on a particular physical link. |
void |
resetSwitchingInfoVector()
Resets the switching info vector of the Switch instance which keeps track of the assignment of a output virtual channel to a packet on a input virtual channel. |
void |
setAddress(int addr)
Sets the address of the switch. |
void |
setAdjacentNode(Node node,
int linkNo)
Assigns a node reference to which this Switch is connected. |
void |
setAdjacentSwitch(Switch sw,
int linkNo)
This method is not required for other purpose, so left as a blank implementation of the corresponding specified in the Switch interface. |
void |
setChildSwitch(FatTreeSwitch fatSwitch,
int linkNo)
Sets a child switch. |
void |
setInputLinkController(int linkNo,
InputLinkController iLC)
Assigns an input link controller to the switch on a particular physical link. |
void |
setNoOfPhysicalLink(int no)
Sets the maximum number of physical links information. |
void |
setNoOfVirtualLink(int no)
Sets the number of virtual channel per physical link information. |
void |
setOutputLinkController(int linkNo,
OutputLinkController oLC)
Assigns an output link controller to the switch on a particular physical link. |
void |
setParentSwitch(FatTreeSwitch fatSwitch,
int linkNo)
Sets a parent switch. |
boolean |
setSwitchingInfoVector(int dest,
int src)
Sets the path information for a pair of input virtual channel and output virtual channel. |
void |
updateStatusAfterCycle(int curCycle)
Updates the statistical counters for a particular simulation cycle and re-initializes the temporary status variables. |
void |
updateSwitchOutPathRequest(int curCycle)
This method is called by network in every cycle to set the request of transferring flit from the input buffer to output buffer of the respective switch. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private int address
private int switchIndex
Network
private int noOfPhysicalLink
private int noOfVirtualLink
private int level
private int indexInLevel
private int[] lastVCServedList
private FatTreeSwitch[] upSwitchList
private FatTreeSwitch[] downSwitchList
private Node[] nodeList
private InputLinkController[] inputLC
InputLinkController
used to store the list of input link
controller objects instantiated for input communication management with
the adjacent nodes and switches. There exists exactly one input link
controller for every physical link.
private OutputLinkController[] outputLC
OutputLinkController
used to store the list of output link
controller objects instantiated for output communication management with
the adjacent nodes and switches. There exists exactly one output link
controller for every physical link.
private boolean[] LinkUseStatus
private Router router
private int[] switchingInfoVector
Constructor Detail |
---|
public FatTreeSwitch(int address, int switchIndex)
address
- Address of the switchswitchIndex
- index of this switch in the global array of switches in theNetwork.createFatTreeNetwork()
Method Detail |
---|
public void createRouter()
createRouter
in interface Switch
private void createLinkController(int linkCount, int vcCount)
linkCount
- number of physical linksvcCount
- number of virtual channels per linkpublic void setAdjacentNode(Node node, int linkNo)
Switch
setAdjacentNode
in interface Switch
node
- NodelinkNo
- the physical link number that connects the nodeNode
public int getNumAdjacentNode()
Switch
getNumAdjacentNode
in interface Switch
public void setParentSwitch(FatTreeSwitch fatSwitch, int linkNo)
fatSwitch
- parent switchlinkNo
- index of the physical linkpublic void setChildSwitch(FatTreeSwitch fatSwitch, int linkNo)
fatSwitch
- child switchlinkNo
- index of the physical linkpublic InputLinkController getInputLinkController(int linkNo)
Switch
getInputLinkController
in interface Switch
linkNo
- link number
InputLinkController
public void setInputLinkController(int linkNo, InputLinkController iLC)
Switch
setInputLinkController
in interface Switch
linkNo
- link numberiLC
- input link controllerInputLinkController
public OutputLinkController getOutputLinkController(int linkNo)
Switch
getOutputLinkController
in interface Switch
linkNo
- link number
public void setOutputLinkController(int linkNo, OutputLinkController oLC)
Switch
setOutputLinkController
in interface Switch
linkNo
- link numberoLC
- output link controllerprivate void createSwitchingInfoVector()
public void resetSwitchingInfoVector()
resetSwitchingInfoVector
in interface Switch
public boolean addInputBufferData(int linkNo, Flit flit, int curCycle)
Switch
addInputBufferData
in interface Switch
linkNo
- link numberflit
- Flit datacurCycle
- simulation cycle
InputVCBuffer.addBufferData(Flit, int, int)
public boolean addOutputBufferData(int linkNo, Flit flit, int vcId, int curCycle)
Switch
addOutputBufferData
in interface Switch
linkNo
- link numberflit
- Flit datavcId
- virtual channel numbercurCycle
- simulation cycle
OutputLinkController.addOutputBufferData(Flit, int, int)
public boolean setSwitchingInfoVector(int dest, int src)
Switch
setSwitchingInfoVector
in interface Switch
dest
- ((output link number * number of VC per link) + output virtual
channel number)src
- ((input link number * number of VC per link) + input virtual
channel number)
InputLinkController.setOutPathRequest(int)
public int getSwitchingInfoVector(int dest)
Switch
Returns the input virtual channel information for a packet flowing through the output virtual channel.
This pair of values identify the switching path in the switch for a packet.
Here the input virtual channel information is encoded as ((input link number * number of VC per link) + input virtual channel number) and the output virtual channel information is encoded as ((output link number * number of VC per link) + output virtual channel number).
getSwitchingInfoVector
in interface Switch
dest
- encoded output virtual channel information
InputLinkController.setOutPathRequest(int)
public Flit removeInputBufferData(int linkNo, int vcId, int curCycle)
Switch
removeInputBufferData
in interface Switch
linkNo
- input physical link numbervcId
- input virtual channel numbercurCycle
- simulation cycle
InputLinkController.removeInputBufferData(int, int)
public Flit removeOutputBufferData(int linkNo, int vcId, int curCycle)
Switch
removeOutputBufferData
in interface Switch
linkNo
- output physical link numbervcId
- output virtual channel numbercurCycle
- simulation cycle
OutputLinkController.removeOutputBufferData(int, int)
public int determineRoute(int src, int dest)
Switch
determineRoute
in interface Switch
src
- address of the source nodedest
- address of the destination node
Router.determineRoute(int, int, int)
public boolean hasFreeSlotInVCBuffer(int linkNo, int vcId)
Switch
hasFreeSlotInVCBuffer
in interface Switch
linkNo
- input physical link numbervcId
- virtual channel number on the input link
InputLinkController.hasFreeSlotInVCBuffer(int)
public void updateSwitchOutPathRequest(int curCycle)
updateSwitchOutPathRequest
in interface Switch
curCycle
- current simulation cycleInputLinkController.setOutPathRequest(int)
public void moveInputBufferToOutputBuffer(int curCycle)
moveInputBufferToOutputBuffer
in interface Switch
curCycle
- current simulation cycleInputLinkController
,
Network.moveSwitchTrafficFromInputBufferToOutputBuffer(int)
private void forwardFlitToSwitch(FatTreeSwitch adjSwitch, int linkNo, 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.
This method is called by moveSwitchOutputBufferToInputBufferOfNodeSwitch(int curCycle) method of this switch to complete transmission between this switch and actual parameter adjSwitch (an adjacent switch) for this current cycle.
The method performs its activities in the order given below.
adjSwitch
- adjacent Butterfly Fat Tree switchlinkNo
- physical link number which connects the switch 'adjSwitch'curCycle
- simulation cycleprivate void forwardFlitToNode(Node adjNode, int linkNo, int curCycle)
Transfers a flit to an adjacent node.
This method is called by moveSwitchOutputBufferToInputBufferOfNodeSwitch(int curCycle) method of this switch to complete transmission between this switch and parameter adjNode for this current cycle.
The method performs its activities in the order given below.
adjNode
- node referencelinkNo
- physical link number that connects the node to the switchcurCycle
- simulation cyclepublic void moveSwitchOutputBufferToInputBufferOfNodeSwitch(int curCycle)
moveSwitchOutputBufferToInputBufferOfNodeSwitch
in interface Switch
curCycle
- simulation cycleNetwork.moveSwitchTrafficFromOutputBufferToInputBufferOfNodeSwitch(int)
,
forwardFlitToNode(Node, int, int)
,
forwardFlitToSwitch(FatTreeSwitch, int, int)
public boolean isVCFreeInSwitch(int linkNo, int vcId)
Switch
isVCFreeInSwitch
in interface Switch
linkNo
- input physical link numbervcId
- virtual channel number
InputLinkController.isVCFree(int)
public int getNumLinkActive()
Switch
getNumLinkActive
in interface Switch
public void updateStatusAfterCycle(int curCycle)
Switch
updateStatusAfterCycle
in interface Switch
curCycle
- simulation cyclepublic int getSwitchLevel()
public int getSwitchIndex()
public void setAddress(int addr)
Switch
setAddress
in interface Switch
addr
- address of the switchpublic int getAddress()
Switch
getAddress
in interface Switch
public int getAdjacentLinkNo(FatTreeSwitch fatSwitch)
fatSwitch
- neighboring Fat Tree Switch
public void setAdjacentSwitch(Switch sw, int linkNo)
setAdjacentSwitch
in interface Switch
sw
- adjacent switch referencelinkNo
- the physical link number that connects these two switchespublic void setNoOfVirtualLink(int no)
Switch
setNoOfVirtualLink
in interface Switch
no
- number of virtual channel per physical linkpublic void setNoOfPhysicalLink(int no)
Switch
setNoOfPhysicalLink
in interface Switch
no
- maximum number of physical linkspublic int getNoOfPhysicalLink()
Switch
getNoOfPhysicalLink
in interface Switch
public int getNoOfVirtualLink()
Switch
getNoOfVirtualLink
in interface Switch
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |