Research Article

On Asymptotic Analysis of Packet and Wormhole Switched Routing Algorithm for Application-Specific Networks-on-Chip

Algorithm 3

NoC_WS_IRREGULAR_PNN.
Input: n, stores Number of parallel processing NoC.
Source, a NoC type array, stores the Source NoC Numbers a part of NoC structure.
Destination, a NoC type array, stores the Destination NoC Numbers a part of NoC structure.
Payload, a part of NoC structure that holds the data generated as Source NoC.
Output: Payload.
Initialize global variable
  Set graph =
  busy 5 =
  success 4 =
(2)Form a class packet
  Attributes:
    PUBLIC header 2 : INTEGER
    PUBLIC flit 4 : INTEGERs:
   METHOD: PUBLIC packet()
   BEGIN
      flit 0 = 0
      flit 1 = 0
      flit 2 = 0
      flit 3 = 0
   End
   End METHOD
  End class packet
  packet p 4
(3)Open the file "pairs.txt" with handle file1
  Open the file "pairs1.txt" with handle file2
  FOR pairs = 3 to pairs = 4
 WHILE (EOF of file1∣file2 is not reached)
   IF (pairs = 3)
     getline from file1 = ar
   ELSE
     getline from file2 = ar
     call puts with ar puts (ar)
  FOR i = 0 to 2
   Input source and destination of NoC packet
   Initialize s and d Set = ar and d = ar ] − 48
(4)IF s 2 THEN
   Initialize header header 0 = s−1
    ELSE
    header 0 = s
    IF d 2 THEN
     Initialize header header 1 = d−1
    ELSE
     Initialize header 1 header 1 = d
  End FOR
(5)Output header for all packets
   Initialize flit and busy FOR i = 0 to 3
   p i .flit = p i .header 0 and busy i .header i = 1
(6)FOR k = 0 to [value of pairs]
   IF flit = header 1 and flit ! = 99 and flit ! = 100 THEN
  flit = 99
(7)IF graph flit header = = 1 and flit ! = 99 and flit ! = 100 THEN
  IF busy = = 1 THEN
   IF busy 2 = = 0 THEN
  Assign flit 0 = 0
  Assign busy 2 = 1
  Assign flit = 2 0
(8)IF busy 3 = 0
  Initialize flit 0 = 0
  Assign busy 3 = 1
  Assign flit 0 = 3
(9)ELSE DO
  Assign flit 0 = 0
  Assign flit 0 t = header 1
  Assign flit 0 = 1
(10) ELSE IF flit 0 ! = 9 and flit 0 ! = 100 THEN               
  Initialize flag = 0
   FOR x = 0 to 5
  Set flag = 0
  FOR x = 0 to 5
  IF flit(x) = 1 and busy(x) = 0
   Assign flit 0 = 0
   Assign flit 0 = x
   Assign flit 0 = 1
   Assign flag = 1
(11) IF flag = 0
  Assign flit 0 = 100
(12) Print flit k FOR k = 0 to value of pairs
(13) Assign busy p k .flit 3 = 0
  Assign flit 3 = flit 2 ]
  Assign busy p k .flit 3 ] = 1
  Assign flit 2 = flit 1
  Assign busy p k .flit 3 = 1
  Assign flit 1 = flit 0
  Assign busy p k .flit 3 = 1
(14) Loop e = 1 to pairs
  IF flit(3) = 99
  Increment success pairs − 1
(15) Loop z = 1 to z = pairs
  Assign success z = success z /z
  Print [success z and efficiency
  Efficiency = (success z /total z )*100
The run time complexity of the Algorithm: NoC_WS_IRREGULAR_PNN is