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

C codes for integrating HLS IP into XSDK

Jump to solution

I am trying for simple "Factorial function". Program executed in HLS, then IP generated and bitstream also generated. Export hardware and lunch SDK. I dont know how to write program codes for Factorial function to communicate directly in SDK.

 

Please share your ideas and help me. Pasted my codes.

 

#include "xuartlite.h"
#include "xuartlite_i.h"
#include "xuartlite_l.h"
#include "xil_cache.h"
#include "platform.h"
#include "xil_printf.h"
#include "xfactorial_hls.h"

#define NUM 12
int factorial_hls(u32 fact)
{
    while(1==1)
    {
    int i;
    fact=1;
    for(i = 1; i <= NUM; i++)
    {
 fact=i*fact;
    }
    return fact;
}
}

int main()

{
    u32 result;
    u32 fact;
init_platform();
          XFactorial_hls factorial;
          XFactorial_hls *factptr=&factorial;
          XFactorial_hls_Initialize(factptr,0);
          XFactorial_hls_Start(factptr);
          result = factorial_hls(fact);
          xil_printf("Factorial is %d\n", result);
              return 0;
          }

 

 

0 Kudos
1 Solution

Accepted Solutions
Explorer
Explorer
2,511 Views
Registered: ‎03-29-2017

Re: C codes for integrating HLS IP into XSDK

Jump to solution

Hi, I got result for this task. Whereas i am new to this tool so i feel difficulty in executing this task. Its very simple task.

0 Kudos
1 Reply
Explorer
Explorer
2,512 Views
Registered: ‎03-29-2017

Re: C codes for integrating HLS IP into XSDK

Jump to solution

Hi, I got result for this task. Whereas i am new to this tool so i feel difficulty in executing this task. Its very simple task.

0 Kudos