Class MeshRouter

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

public class MeshRouter
extends java.lang.Object
implements Router

The MeshRouter class is the implementation of the Router interface for the Mesh Network.

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

Version:
1.0

Constructor Summary
MeshRouter()
           
 
Method Summary
 int determineRoute(int source, int dest, int switchAddr)
           Implementation of the determineRoute() method of the Router interface.
private  int mesh8_static_route(int source, int dest, int switchAddr)
           Deterministic XY routing algorithm for the Mesh Network.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MeshRouter

public MeshRouter()
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

mesh8_static_route

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

Deterministic XY routing algorithm for the Mesh Network.

This method 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. If the both the offset is zero then destination is reached. For this 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 -
dest -
switchAddr -
Returns:
output link number