Class TorusRouter

java.lang.Object
  extended by TorusRouter
All Implemented Interfaces:
Router

public class TorusRouter
extends java.lang.Object
implements Router

The TorusRouter class is the implementation of the Router interface for the Torus Network.

This version contains an implementation of the deterministic routing algorithm for the Torus Network. To incorporate a different algorithm, modify the determineRoute() method, or you might want to change the class altogether.

Version:
1.0

Constructor Summary
TorusRouter()
           
 
Method Summary
 int determineRoute(int source, int dest, int switchAddr)
           Implementation of the determineRoute() method of the Router interface.
private  int torus8_static_route(int source, int dest, int switchAddr)
           This method also determines the next path to be taken in the switch having switchAddr by using the X-Y routing algorithm.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TorusRouter

public TorusRouter()
Method Detail

determineRoute

public int determineRoute(int source,
                          int dest,
                          int switchAddr)

Implementation of the determineRoute() method of the Router interface. Returns which path the flit passed be transmitted to ultimately reach the destination.

To incorporate a different routing algorithm, make necessary modifications.

Specified by:
determineRoute in interface Router
Parameters:
source - address of the source node
dest - address of the destination node
switchAddr - address of the switch where the routing is taking place
Returns:
output link number of the switch

torus8_static_route

private int torus8_static_route(int source,
                                int dest,
                                int switchAddr)

This method also determines the next path to be taken in the switch having switchAddr by using the X-Y routing algorithm. The algorithm turns the offsets (differences of x and y coordinate value between the source and destination) into zero but with some difference than that of Mesh network. Here the switches are round-way connected along with connection with adjacent switches. So during routing this round-way connection considered for optimal path. Like Mesh, here first the flits are transferred in one direction (let Y-axis). When the offset in that direction is zero then the flits are transferred in other direction (here X-axis).

This routing algorithm performs in the following way.

Parameters:
source - address of the source node
dest - address of the destination node
switchAddr - address of the switch where the routing is taking place
Returns:
output link number of the switch
See Also:
MeshRouter