|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Switch
Switches are the objects of the network where switching of flits from various input ports to output ports are performed as well as the path which will be taken from the various output paths is selected (routing). To support the wormhole switching the switch provides various facilities.
The Switch interface defines all the necessary functions that any class simulating the characteristics of the switch in the NoC must implement.
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. |
void |
createRouter()
Instantiates a concrete Router instance for this particular architecture. |
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). |
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 |
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(Switch switchref,
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. |
Method Detail |
---|
void setNoOfPhysicalLink(int no)
no
- maximum number of physical linksint getNoOfPhysicalLink()
void setNoOfVirtualLink(int noVlink)
noVlink
- number of virtual channel per physical linkint getNoOfVirtualLink()
void setAddress(int addr)
addr
- address of the switchint getAddress()
void setAdjacentNode(Node node, int linkNo)
node
- NodelinkNo
- the physical link number that connects the nodeNode
int getNumAdjacentNode()
void setAdjacentSwitch(Switch switchref, int linkNo)
switchref
- adjacent switch referencelinkNo
- the physical link number that connects these two switchesInputLinkController getInputLinkController(int linkNo)
linkNo
- link number
InputLinkController
void setInputLinkController(int linkNo, InputLinkController iLC)
linkNo
- link numberiLC
- input link controllerInputLinkController
OutputLinkController getOutputLinkController(int linkNo)
linkNo
- link number
void setOutputLinkController(int linkNo, OutputLinkController oLC)
linkNo
- link numberoLC
- output link controllervoid resetSwitchingInfoVector()
boolean addInputBufferData(int linkNo, Flit flit, int curCycle)
linkNo
- link numberflit
- Flit datacurCycle
- simulation cycle
InputVCBuffer.addBufferData(Flit, int, int)
boolean addOutputBufferData(int linkNo, Flit flit, int vcId, int curCycle)
linkNo
- link numberflit
- Flit datavcId
- virtual channel numbercurCycle
- simulation cycle
OutputLinkController.addOutputBufferData(Flit, int, int)
boolean setSwitchingInfoVector(int dest, int src)
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)
int getSwitchingInfoVector(int dest)
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).
dest
- encoded output virtual channel information
InputLinkController.setOutPathRequest(int)
Flit removeInputBufferData(int linkNo, int vcId, int curCycle)
linkNo
- input physical link numbervcId
- input virtual channel numbercurCycle
- simulation cycle
InputLinkController.removeInputBufferData(int, int)
Flit removeOutputBufferData(int linkNo, int vcId, int curCycle)
linkNo
- output physical link numbervcId
- output virtual channel numbercurCycle
- simulation cycle
OutputLinkController.removeOutputBufferData(int, int)
int determineRoute(int src, int dest)
src
- address of the source nodedest
- address of the destination node
Router.determineRoute(int, int, int)
boolean hasFreeSlotInVCBuffer(int linkNo, int vcId)
linkNo
- input physical link numbervcId
- virtual channel number on the input link
InputLinkController.hasFreeSlotInVCBuffer(int)
void updateSwitchOutPathRequest(int curCycle)
curCycle
- simualtion cycleInputLinkController.setOutPathRequest(int)
void moveInputBufferToOutputBuffer(int curCycle)
curCycle
- simulation cyclevoid moveSwitchOutputBufferToInputBufferOfNodeSwitch(int curCycle)
curCycle
- boolean isVCFreeInSwitch(int linkNo, int vcId)
linkNo
- input physical link numbervcId
- virtual channel number
InputLinkController.isVCFree(int)
int getNumLinkActive()
void updateStatusAfterCycle(int curCycle)
curCycle
- simulation cyclevoid createRouter()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |