EPAA is similar to DPAA; it uses the same concept and matrices. However, the algorithm itself is a bit complicated compared to DPAA. Once a simulation kernel assigns EPAA to be the algorithm to find a path for all incoming timeslots during the initialization phase, and
pathIndex ← s e l e c t P a t h ( δo i , S )
This method returns the DEi that Siin will follow. In addition to the two subroutines presented in section6.1, an additional subroutine is used to determine a path for an incoming timeslots. This subroutine is validateConflect, and it is discussed below.
bool validateConflict(startHoldingT ime, swmi, SW Ci): The controller calls this sub- routine when two timeslots are scheduled to arrive at a given SWM simultaneously at the same startHoldingT ime. If both timeslots require the same switching state SWC, the sub- routine returns FALSE, and returns TRUE otherwise. Since jobs are stored in a FIFO queue, a queue iterator is used to traverse throughout the queue as it appears in Algorithm 7.1. Algorithm 5 Validate conflict algorithm
validateConflict (SHT, swmi, swci) Input : SHT Output
:
conf lictF ound
bool conflictFound=false
queue::Iterator it = queue::Iterator ( it->SWCQ, 0) queue::Iterator itEnd = it.end()
SwitchingCont * SWC do
SWC = ( SwitchingCont *) it()
if SWC->startHoldingTime==startHoldingTime then if SWC->switchingState!= switchingState then
conflectFound = true end
else it++ end
while it!=itEnd || conflictFound==false return conflictFound
EPAA has one additional variable to DPAA that is declared at the initialization phase, which is:
The algorithm runs exactly similar to DPAA, except in Scenario III, which is defined in EPAA as:
Scenario III: TSI is not empty and there is a SWC scheduled for at least one switch in the path. In this scenario, the algorithm calls the subroutine named validateConf lict (startHoldingT ime, swmi, SW Ci) subroutine to determine whether a conflict occurs or not. If a conflict exist with a previously scheduled SWC, the algorithm will increase the path index by one, reset the boolean variables, and start from the beginning (after the initialization and declaration stages), as shown below.
pathSWQEmpty=true ; b l o c k i n g=f a l s e ; p a t h I n d e x++; SHT=0;
SWConflict=true ;
However, if no conflict exists, the algorithm will return the selected DEi to the control algorithm as it appears in the flow chart in Figure 59 and the pesudocode is shown in Algorithm6. For additional explanation, a numeric example is presented below.
Numeric example: Assuming that f0 is assigned to swa0, such that [(0)(1)(2)(3)],
from Figure73. In addition, assuming that all timeslots but S3 departed the fabric and S3 is
using DE0. According to the control algorithm, the arrival time of S3 is t = 4. Meanwhile,
assuming that f1 is assigned to swa6, such that [(01)(2)(3)] from Figure 73 and the arrival
time is t = 5. During the guard-time prior to S0 in f1, the controller is trying to find a
path for S0 to be switched to S1, from equation 4.1. The required delay to perform the
interchanging process is δ1 0 = 5.
Now the controller will verify if blocking exist or not, such that two SWC for a given switch require a different switching state. This is achieved by XOR-ing the two SWCs corresponding to δ = 4 for path 0 (DE0), Figure 77, and δ = 5 for the same path, Figure
Algorithm 6 EPAA algorithm
selectPath (δ, S) Input : A nonnegative integer δ Output
:
pathIndex
bool blocking, pathSWQEmpty, SWConflict, pathFound=false int pathIndex=0,k=getNoSwitchesInPath()
simtime_t SHT do
blocking = SWConflict = false pathQueueIsEmpty=true SHT=0 for i ← 0 to i < k do
pathSWQEmpty= pathSWQEmpty & isEmpty(getModule(pathIndex,i)) end
if pathSWQEmpty==true then pathFound = true
else
for j ← 0 to j < k do
SHT = simTime() + cumulativeDelay[δ][j] * TimeslotDuration blocking= blocking | isBusy(getModule(pathIndex,j),SHT) end
if blocking==false then pathFound = true else
for m ← 0 to m < k do
SWConflict = SWConflict | validateConflicted (SHT, (getModule (pathIndex, m), getSWC(δ, m)); end if SWConflict==true then pathIndex++ else pathFound=true end end end
11010111 11100111 ⊕ 00 11 0000
If the XOR-ing operation results in (1), then blocking exists and an additional process is needed. On the other hand, the (0) value means blocking does not exist, regardless of the arrival time to the switch. In this example, blocking occurs on the third and fourth SWM (Splitter11 and Switch10 in Figure 55). Since blocking is likely to occur, the arrival time of each timeslot to the blocking switch must be investigated. Conflict happens when two timeslots arrive at the same SWM simultaneously. In this example, the arrival time at the third and fourth switch (swm2 and swm3) is investigated below using equation 5.1:
Cumulative delay for δ = 4: 00 00 0444 Cumulative delay for δ = 5: 00 01 1555
Assuming that ts = 1 for all timeslots, then: the arrival time for S3 and S0 at swm2 is:
S3: 3 + 0 ∗ 1 = 3 S0: 4 + 0 ∗ 1 = 4
And the arrival time for S3 and S0 at swm3 is:
S3: 3 + 0 ∗ 1 = 3 S0: 4 + 1 ∗ 1 = 5
Because S3 and S0 do not meet at either swm2 or swm3 at the same time, the algorithm
concludes that no conflict occurs and the path can be reserved.