Hello,

Thanks for the advice. I found this guide:

http://www.xilinx.com/support/documenta ... thesis.pdfAs I told before, I made a little change in the hlsdemo code, I am able to run correctly a sin and cosin function in the Zedboard, I provided the code above.

Now I am trying to test little pieces of a bigger code I am trying to implement. In this case I am trying to give the FPGA 2 floats and retrieve the square root of those floats. I just made a little change in the later code, just changing these lines

- Code: Select all
`//extern float sinf(float);`

//extern float cosf(float);

extern float sqrtf(float);

void mycalc(float *x1, float *x2) {

*x1 = sqrtf(*x1);

*x2 = sqrtf(*x2);

}

I write the entire code at the end of this entry.

"sqrtf" is supported for synthesis while originally "sqrt" not.

When I activate solutions it seems that it works correctly, but then I get errors when using the ISE to generate the bitstream.

ERROR:HDLCompiler:1654 - "C:\...\hls-starter-1.0\coprocess\example\syn\verilog\xillybus_wrapper_fsqrt_32ns_32ns_32_12.v" Line 35: Instantiating <xillybus_wrapper_ap_fsqrt_10_no_dsp_32_u> from unknown module <xillybus_wrapper_ap_fsqrt_10_no_dsp_32>

I checked that with sqrtf I get 8 .v files, while in the sin and cosin I got 13 .v files.

I would really appreciate some help to address this problem with the "missing" (I guess) .v files.

Thanks in advance.

- Code: Select all
`#include <math.h>`

#include <stdint.h>

#include "xilly_debug.h"

//extern float cosf(float);

extern float sqrtf(float);

void mycalc(float *x1, float *x2) {

*x1 = sqrtf(*x1);

*x2 = sqrtf(*x2);

}

void xillybus_wrapper(int *in, int *out) {

#pragma AP interface ap_fifo port=in

#pragma AP interface ap_fifo port=out

#pragma AP interface ap_ctrl_none port=return

uint32_t tmp1, tmp2;

float x1, x2, y1, y2;

xilly_puts("Hello, world\n");

// Handle input data

tmp1 = *in++;

tmp2 = *in++;

x1 = *((float *) &tmp1);

x2 = *((float *) &tmp2); // Convert uint32_t to float

// Debug output

xilly_puts("x1=");

xilly_decprint(x1, 1);

xilly_puts("\n");

// Run the calculations

mycalc(&x1, &x2);

y1 = x1;

y2 = x2; // This helps HLS in the conversion below

// Handle output data

tmp1 = *((uint32_t *) &y1);

tmp2 = *((uint32_t *) &y2); // Convert float to uint32_t

*out++ = tmp1;

*out++ = tmp2;

}