|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectOctalSwitch
public class OctalSwitch
Field Summary | |
---|---|
private int |
address
|
private InputLinkController[] |
inputLC
|
private int[] |
lastVCServedList
|
private boolean[] |
LinkUseStatus
|
Node[] |
nodeList
|
private int |
noOfPhysicalLink
|
private int |
noOfVirtualLink
|
private OutputLinkController[] |
outputLC
|
private Router |
router
|
private int |
switchIndex
|
private int[] |
switchingInfoVector
|
OctalSwitch[] |
switchList
|
Constructor Summary | |
---|---|
OctalSwitch(int pLink,
int vLink,
int address,
int noOfAdjNode,
int noOfAdjSwitch,
int switchIndex)
|
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)
|
void |
createRouter()
Instantiates a concrete Router instance for this particular architecture. |
private void |
createSwitchingInfoVector()
|
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)
|
private void |
forwardFlitToSwitch(OctalSwitch adjSwitch,
int linkNo,
int curCycle)
|
int |
getAddress()
Returns the address of the 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()
|
int |
getSwitchingInfoVector(int dest)
Returns the input virtual channel information for a packet flowing through the output virtual channel. |
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)
Transfers the flits from the input buffers to the output buffers. |
void |
moveSwitchOutputBufferToInputBufferOfNodeSwitch(int curCycle)
Transfers the flits from the output buffers to the input buffers of the adjacent switches or nodes. |
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(OctalSwitch octalSwitch,
int linkNo)
|
void |
setAdjacentSwitch(Switch octalSwitch,
int linkNo)
Assigns a switch reference to which this Switch is connected. |
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 noVlink)
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. |
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)
Assigns or updates the path information for the flits stored in the input buffers. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private int[] lastVCServedList
public OctalSwitch[] switchList
public Node[] nodeList
private int noOfPhysicalLink
private int noOfVirtualLink
private int address
private int switchIndex
private InputLinkController[] inputLC
private OutputLinkController[] outputLC
private boolean[] LinkUseStatus
private Router router
private int[] switchingInfoVector
Constructor Detail |
---|
public OctalSwitch(int pLink, int vLink, int address, int noOfAdjNode, int noOfAdjSwitch, int switchIndex)
Method Detail |
---|
public int getSwitchIndex()
public void setNoOfPhysicalLink(int no)
Switch
setNoOfPhysicalLink
in interface Switch
no
- maximum number of physical linkspublic int getNoOfPhysicalLink()
Switch
getNoOfPhysicalLink
in interface Switch
public void setNoOfVirtualLink(int noVlink)
Switch
setNoOfVirtualLink
in interface Switch
noVlink
- number of virtual channel per physical linkpublic int getNoOfVirtualLink()
Switch
getNoOfVirtualLink
in interface Switch
public void setAddress(int addr)
Switch
setAddress
in interface Switch
addr
- address of the switchpublic int getAddress()
Switch
getAddress
in interface Switch
public void createRouter()
Switch
createRouter
in interface Switch
private void createLinkController(int linkCount, int vcCount)
public 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 setAdjacentSwitch(OctalSwitch octalSwitch, int linkNo)
public 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()
Switch
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)
Switch
updateSwitchOutPathRequest
in interface Switch
curCycle
- simualtion cycleInputLinkController.setOutPathRequest(int)
public void moveInputBufferToOutputBuffer(int curCycle)
Switch
moveInputBufferToOutputBuffer
in interface Switch
curCycle
- simulation cycleprivate void forwardFlitToSwitch(OctalSwitch adjSwitch, int linkNo, int curCycle)
private void forwardFlitToNode(Node adjNode, int linkNo, int curCycle)
public void moveSwitchOutputBufferToInputBufferOfNodeSwitch(int curCycle)
Switch
moveSwitchOutputBufferToInputBufferOfNodeSwitch
in interface Switch
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 void setAdjacentSwitch(Switch octalSwitch, int linkNo)
Switch
setAdjacentSwitch
in interface Switch
octalSwitch
- adjacent switch referencelinkNo
- the physical link number that connects these two switches
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |