Research Article

Design Space Exploration of Deeply Nested Loop 2D Filtering and 6 Level FSBM Algorithm Mapped onto Systolic Array

Listing 3

URE algorithm for 2D filtering.
 For 𝑖 = 1 to π‘˜ 1
 For 𝑗 = 1 to π‘˜ 2
For π‘˜ = 1 to 4 //window size = 4 Γ— 3
             For 𝑙 = 1 to 3
            If ( 𝑖 == 1 && 𝑗 == 1)
                  𝑀 ( 𝑖 , 𝑗 , π‘˜ , 𝑙 ) = π‘Š n e w
            Else if( 𝑗 == π‘˜ 2 )
                  𝑀 ( 𝑖 , 𝑗 , π‘˜ , 𝑙 ) = 𝑀 ( 𝑖 βˆ’ 1 , 𝑗 , π‘˜ , 𝑙 ) ;//next 𝑖
            //[Dvw1 = 1 0 0 0]
            Else
             𝑀 ( 𝑖 , 𝑗 , π‘˜ , 𝑙 ) = 𝑀 ( 𝑖 , 𝑗 βˆ’ 1 , π‘˜ , 𝑙 ) ;
            // next 𝑗 [Dvw2 = 0 1 0 0]
            End if
  If ( 𝑖 == 1 && 𝑗 == 1)
   𝐼 ( 𝑖 , 𝑗 , π‘˜ , 𝑙 ) = 𝐼 n e w ;
  Else if( 𝑖 == 1 && 𝑗 > 1) // first rowβ€”second window calculation
   𝐼 ( 𝑖 , 𝑗 , π‘˜ , 𝑙 ) = 𝐼 ( 𝑖 , 𝑗 + 1 , π‘˜ , 𝑙 + 1 ) ; move to the next 𝑗 pixel – 𝑗 + 1; pixel dataβ€”reads in next column of pixel and
  old data is moved in the ( π‘˜ , 𝑙 ) plane-PE_array from ( π‘˜ , 𝑙 ) to ( π‘˜ , 𝑙 + 1);//[ 𝐃 𝐕 𝐱 𝟐 = 0 1 0 1]
  Else if (j==k 𝟐 )    // for next 𝑖
   𝐼 ( 𝑖 , 𝑗 , π‘˜ , 𝑙 ) = 𝐼 ( 𝑖 + 1 , 𝑗 , π‘˜ + 1 , 𝑙 ) ; // move to the next 𝑖 pixel 𝑖 + 1; pixel dataβ€”reads in next row of
  // pixel and old data is moved in the ( π‘˜ , 𝑙 ) plane-PE_array from ( π‘˜ , 𝑙 ) to ( π‘˜ + 1 , 𝑙 )
  //[ 𝐃 𝐕 𝐱 𝟏 = 1 0 1 0]
  End if
  If ( 𝑙 ==1 && π‘˜ == 1)
   𝑂 ( 𝑖 , 𝑗 , π‘˜ , 𝑙 ) = 0;
  Else if (k < 3)
   𝑂 ( 𝑖 , 𝑗 , π‘˜ , 𝑙 ) = 𝑂 ( 𝑖 , 𝑗 , π‘˜ , 𝑙 βˆ’ 1 ) + 𝐼 ( 𝑖 , 𝑗 , π‘˜ , 𝑙 ) βˆ— π‘Š ( 𝐼 , 𝑗 , π‘˜ , 𝑙 ) ;
  Else
   𝑂 ( 𝑖 , 𝑗 , π‘˜ , 𝑙 ) = 𝑂 ( 𝑖 , 𝑗 , π‘˜ βˆ’ 1 , 𝑙 ) + 𝐼 ( 𝑖 , 𝑗 , π‘˜ , 𝑙 ) βˆ— π‘Š ( 𝐼 , 𝑗 , π‘˜ , 𝑙 ) ;
  End;
End For 𝑙 , π‘˜ , 𝑗 , 𝑖 ;