Forum Discussion
Altera_Forum
Honored Contributor
8 years agoIntel HLS example reports
Hello, I am new to the concept of HLS. I am using Intel HLS and going to start with the examples that come with the installation of Quartus prime edition. Can anyone of you share the succe...
Altera_Forum
Honored Contributor
8 years agoHi,
1.To get the difference between float and fixed data type you can use the tutorials the installation directory. "..\intelFPGA_pro\17.1\hls\examples\tutorials" 2.Create simple project like multiplication to understand the difference.#include "HLS/hls.h"# include <stdio.h># include "HLS/ac_int.h"# include "HLS/ac_fixed.h"# include "HLS/extendedmath.h"# include "HLS/math.h"
typedef ac_int<8, false> fixed_8_t;
typedef ac_int<16, false> fixed_16_t;# define N 2
component void dut(fixed_8_t a, fixed_8_t b, fixed_8_t *dout)
{
unsigned int i;
fixed_16_t acc= 0;
fixed_8_t a_reg, b_reg, sub;
fixed_16_t sub2;
for(i=0; i<N; i++)
{
a_reg = a;
b_reg = b;
sub = a_reg - b_reg;
sub2 = sub*sub;
acc += sub2;
}
*dout = acc;
}
int main() {
fixed_8_t z;
fixed_16_t ip = &z;
fixed_8_t x={128,128};
fixed_8_t y={128,128};
dut(x,y,&z);
printf("%d \n",*ip);
getchar();
return 0;
}
3.What is the error you are getting from your code, can screenshot and post it? Best Regards, Anand Raj Shankar (This message was posted on behalf of Intel Corporation)