There are fourteen pair wise deadlock freeArcpairs as shown in Table. 5.1. By using any of these fourteen pairs with XY-routing, fourteen deadlock free routing algorithms for Torus NoC are possible. In this section, we consider one routing algorithm using (EWs + NSe) Arcs with XY-Turns. We have presented the algorithmic steps in Algorithm 1 and shown the deadlock freedom for the algorithm using DDG.
6.3.1 Routing steps for Algorithm 1
A deadlock free routing algorithm using (EWs + NSe)Arcs with XY-routing is presented in Algorithm 1. EWs Arc is applicable if the packet is destined West-South direction and the EW wraparound channel could help in reducing hop counts. The condition for applicability of EWs Arc is given in line# 4 in Algorithm 1. If EWs Arc is applicable (line# 4 in Algorithm 1), the packet moves towards East boundary until the East boundary of the
Algorithm 1 WS-SE Algorithm
1: function WS-SE(S, D)
2: . S= (xs, ys) and D= (xd, yd) are the source(S) and destination(D) co-ordinates of a packet in an NxN Torus NoC. Between a source and destination pair, the X-distance is ∆x =|xd−xs| and the Y-distance is ∆y =|yd−ys|. After each move, S is updated.
The packet reaches destination whenS =D.
3: while ( (xs 6=xd) ∨ (ys6=yd) )do
4: if ( (ys> yd) ∧ (xs > xd) ∧ (∆x> N/2) ) then
5: EWsArc is applicable. Keeps on moving in East direction.
6: Once East boundary is reached, move using EW wraparound channel.
7: Move one step South for the EWsArc after taking EW wraparound channel.
8: Follow XY-routing.
9: else if ( (xs < xd) ∧ (ys > yd) ∧ (∆y > N/2) ) then
10: NSeArc is applicable. Keeps on moving in North direction.
11: Once North boundary is reached, move using NS channel.
12: Move one step East for NSe Arc after taking the NS wraparound channel.
13: Follow XY-routing.
14: else
15: Follow XY-routing.
16: end if
17: end while
18: end function
Mesh sub-network is reached. At the East boundary, it takes EW wraparound channel and reaches the West boundary. In the next step, the packet moves one hop distance in the South direction as per the rules of EWs Arc. After that, XY-routing is followed until it reaches the destination.
Similarly, NSe Arc is applicable if the packet is destined towards the South-East direction and the NS wraparound channel helps in reducing the hop counts. A packet traverses using NSe Arc if the condition (line#9 in Algorithm 1) is satisfied. Conditions for taking Arcs ensure that EWs would not be taken at bottom row and NSe would not be taken at right most column. Therefore, none of the packet will use both the Arcs. If neither EWs Arc nor NSe Arc conditions are applicable, control goes to line#15 and XY-routing is followed until the packet reaches its destination. If neither EWs nor NSe Arc is applicable, XY-routing is followed. Even after traversing through EWs or NSe Arc, a packet follows XY-Turns for the rest of the paths. Since the Arcs are applicable only to the packets that are destined towards West-South or South-East direction, we term Algorithm 1 as WS-SE algorithm.
The conditions for EWs and NSe Arcs can be checked at any order in the algorithm and it would not effect the routing of a packet by the algorithm.
R1 R2 R3 R4 R5 R6 R7 R8
R9 R10 R11 R12 R13 R14 R15 R16
R17 R18 R19 R20 R21 R22 R23 R24
R25 R26 R27 R28 R29 R30 R31 R32
R33 R34 R35 R36 R37 R38 R39 R40
R41 R42 R43 R44 R45 R46 R47 R48
R49 R50 R51 R52 R53 R54 R55 R56
R57 R58 R59 R60 R61 R62 R63 R64
p1(47, 10) p2 (60, 14)
p3(21, 39)
Figure 6.3: Paths for packet p1(47, 10), p2(60, 14) and p3(21, 39) as per Algorithm 1
Example 6.1. The routing path for packet p1(47, 10), p2(60, 14) and p3(21, 39) in a 8x8 Torus NoC with respect to Algorithm 1 are shown in Fig. 6.3. The packet p1(47, 10) uses EWs Arc and the hop count saved is 9 - 7 = 2. Here, 9 is the hop count for XY-routing and 7 is the hop counts due to use of EWs Arc. The packet p2(60, 14) uses NSe Arc and the hop count saved is 8 - 4 = 4. For the packet p3(21, 39) no Arc is applicable. It follows XY-routing and hop count traversed is 4. There is no saving in hop counts.
In a similar way, fourteen such routing algorithms are possible from the deadlock free Arc pairs in Table. 5.1 with XY-Turns in the Mesh sub-network. Hop count savings by Arc based algorithm depends on the traffic distribution as well. For example, Algorithm1would be more effective if more traffics are destined towards West-South or South-East direction.
For uniform traffic, since traffic distribution is uniform, all of the fourteen algorithms are expected to perform similar way in their effectiveness in saving hop counts. One packet
using only one Arc in this algorithm. The conditions for Arcs can be checked in any order in Algorithm 1. It would not effect the routing of a packet.
SE
( b )
SE NSe
S
E
EWs
( a )
S N
W E
k
j s a
b c
d e
f
g ( c ) h
i l
Figure 6.4: (a) EWs and NSe Arcs ( b ) Dependency graph: deadlock is not possible by EWs and NSe Arcs
6.3.2 Deadlock freedom for Algorithm 1
The EWs Arc introduces SE Turn when a packet has to move back to reach destination after taking the Arc and shown in Fig. 6.4(a). Therefore, five Turns namely EN, ES, WN, WS and SE are considered for the movement in the Mesh sub-network. Cycle creation is not possible with these five Turns which is shown in Fig. 6.4(b). Therefore, the first condition of Theorem 6.2.1 for deadlock freedom is satisfied.
For checking the second condition, let us consider a directional dependency graph using EWs and NSeArcsin Fig. 6.4(c). Since each individual Arcsare deadlock free with respect to XY-routing, let us check if deadlock is possible by resultant effects of both EWs and NSe Arcs. Let a sequence of packets produce a directional dependency via vertices s → a → b → c → d → e → f → g → h → i → l. Though this graph involved both EWs and
NSe Arcs, cycle creation is still not possible. A NW turn is needed at a point i for creating two possible cycle via vertices j or k. For another possible cycle, a NE turn is needed at a pointl. Since both NW and NE turns are not permitted here, cycle creation is not possible.
Therefore, Algorithm 1using EWs and NSe Arcswith XY-routing in the Mesh sub-network is deadlock free.