• 0
Thausikan

For steam data communication between HLS IP and SDK

Question

Hi,

Currently I'm working with micorblaze and Kintex 7 board, for Pseudo_random bit sequence (PRBS) function. I have created HLS IP (PRBS), integrated IP with vivado and exported it to SDK. But in SDK, i am getting only "Single bit" value instead of sequence of random bits. Please anyone guide me. What`s wrong in my coding? Need help from anyone.

I need to get non-stop stream of random bits out of the IP and to display on Tera Terminal through XSDK.

Hls Source code

#include <stdint.h>
#include <stdio.h>
#include "ap_cint.h"

int PRBS_prj(int bit)
{
#pragma HLS INTERFACE s_axilite port=return bundle=a
   int start_state = 0xCD;
   int lfsr = start_state;
 
    unsigned period = 0;

do
    {
    /* taps:  3, 2 and 1 ; feedback polynomial:  x^3 + x^2 + 1 */
    bit = ((lfsr >> 0) ^ (lfsr >> 2) ^ (lfsr >> 3) ^ (lfsr >> 4) ) & 1;
    printf("%d", bit);
    lfsr = (lfsr >> 1) | (bit << 7);
            ++period;
        } while (lfsr != start_state);
return bit;
}

 

or

int main(void)
{
    static int lfsr = 0x3425u;
    unsigned int mask = 0xF0;
    int bit;                    /* Must be 16bit to allow bit<<15 later in the code */
        //taps: 16 14 13 11; feedback polynomial: x^16 + x^14 + x^13 + x^11 + 1 
        bit  = ((lfsr >> 0) ^ (lfsr >> 2) ^ (lfsr >> 3) ^ (lfsr >> 5) ) & 1;
        lfsr =  (lfsr >> 1) | (bit << 15);
      
        for (mask = 0xF0; mask; mask >>= 1)
        putchar('0' + !!(lfsr & mask));
 
    return lfsr;
}

HLS Console.PNG

Vivado IP.PNG

XSDK.PNG

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Hi @Thausikan,

I have not had much experience with HLS. I have reached out to some of my co-workers about your question to see if they have any input as well. Looking at your previous post on the Xilinx forums here your function prototype u32 XPrbs_prj_Get_return(XPrbs_prj *InstancePtr); wants a u32 but you are giving it a bool? 

cheers,

Jon

Edited by jpeyron

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now