UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Observer bva_rzn
Observer
400 Views
Registered: ‎07-04-2017

Reading pixels from RAM

Hi,

 

Through the stream, 22 image blocks with a size of 32 by 32 pixels arrive in the module. Pixels in each block follow line by line. Each 32-by-32-pixel block is sequentially written to a RAM of 32 by 720 pixels.
After receiving 22 blocks and filling the RAM, I start row by row from the RAM to give out pixels.
Is it possible to reduce latency? Is it possible to optimize the code?

 

void S2S(hls::stream<u16stream> &inStream1,
         hls::stream<u16stream> &OutStream)
{

    static unsigned short Buf1[32][720];

    L11:for(int k2=0; k2<22; k2++)
    {//L11
       xL1:for(int i=0; i<32;i++)
          xL11:for(int j=0; j<32; j++){//xL11
          #pragma HLS PIPELINE
            u16stream lap;
            inStream1.read(lap);
            Buf1[i][j+k2*32] = lap.data;
          }//xL11
    }//L11

    L12:for(int i=0;i<32;i++){//L12
       xL12:for(int k2=0;k2<720;k2++)
        {//xL12
          #pragma HLS PIPELINE
            u16stream lap;
            lap.data = Buf1[i][k2];

            lap.user = ((i==0)&&(k2==0)) ? 1:0;
            lap.last = (k2==719) ? 1:0;
            OutStream.write(lap);
       }//xL12
      }//L12
}

0 Kudos