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: 
Explorer
Explorer
1,991 Views
Registered: ‎03-29-2017

HLS:How to use memcpy to transfer random bits consecutively into XSDK

I am trying this program for hardware implementation. Using kintex 7 and microblaze, i need to get random bits 0`s and 1`s in a consecutive manner at Tera Terminal through stream communication HLS IP and XSDK. Please suggest me.

 

HLS Source code

 

void PRBS(int bit, int *d)
{
     unsigned lfsr  = 0xCD;
       int bit, i,j;
       int buff1[50], buff2[50];
         
memycpy(buff1, d, 50*sizeof(int));
        for ( i = 0; i < 50; i++)
              {
              bit = ((lfsr >> 0) ^ (lfsr >> 2) ^ (lfsr >> 3) ^ (lfsr >> 4) ) & 1;
              buff1[i] = bit; //storing bit value in buff1
           
              lfsr = (lfsr >> 1) | (bit << 7);
              }
        for (j = 0; j < 50; j++)
        {
        buff2[j] = buff1[50-j] ; // from buff1 storing bit value into buff2 for reading the bits in consecutive ways
        }

memycpy(d, buff2, 50*sizeof(int));
}

 

0 Kudos