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!

Showing results for 
Search instead for 
Did you mean: 
Newbie ssb_shakti
Registered: ‎08-02-2017

Error while linking hls_math.h in vivado 2017.2

I have written following top function:


#include <hls_math.h>
#define AMP 10
float sine_wave(int n)
#pragma HLS INTERFACE s_axilite port=n bundle=CTRL_BUS
#pragma HLS INTERFACE s_axilite port=return bundle=CTRL_BUS
float result = AMP*(hls::sinf(6.283*1000*0.0001*n));

return result;




with test bench as follows:


#include <hls_math.h>

#include <stdio.h>
#define SIZE 20

float sine_wave(int n);

int main()
int i;
float res;

for(i=1; i<=SIZE ; i++ )
res = sine_wave(i);
printf("the sampled value of sine wave is : %0.3f\n", res);

return 0;




while performing "Run C Simulation"  i am getting following error:


INFO: [SIM 2] *************** CSIM start ***************
INFO: [SIM 4] CSIM will launch GCC as the compiler.
Compiling ../../../test_core.cpp in debug mode
In file included from C:/Xilinx/Vivado_HLS/2017.2/include/floating_point_v7_0_bitacc_cmodel.h:143:0,
from C:/Xilinx/Vivado_HLS/2017.2/include/hls_fpo.h:172,
from C:/Xilinx/Vivado_HLS/2017.2/include/hls_half.h:57,
from C:/Xilinx/Vivado_HLS/2017.2/include/ap_int.h:74,
from C:/Xilinx/Vivado_HLS/2017.2/include/hls_math.h:47,
from ../../../test_core.cpp:1:
C:/Xilinx/Vivado_HLS/2017.2/include/gmp.h:62:0: warning: "__GMP_LIBGMP_DLL" redefined [enabled by default]
C:/Xilinx/Vivado_HLS/2017.2/include/floating_point_v7_0_bitacc_cmodel.h:135:0: note: this is the location of the previous definition

cc1plus.exe: out of memory allocating 16008 bytes
make: *** [obj/test_core.o] Error 1
CRITICAL WARNING: [SIM 100] 'csim_design' failed: compilation error(s).
INFO: [SIM 3] *************** CSIM finish ***************

0 Kudos
1 Reply
Scholar u4223374
Registered: ‎04-26-2015

Re: Error while linking hls_math.h in vivado 2017.2

Yes, it's a known problem. Due to be fixed in 2017.3 (link). Until then, either run HLS under Linux (where the Clang compiler won't cause this problem) or use 2016.4 under Windows.