Hi,
1.What for the below lines are used and where is the function?
--- Quote Start ---
//call reference function
ref_sol(a, b, &ref_res);
--- Quote End ---
2.How "check results" session of code works?
With few modification I have compiled the code.
#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"
using namespace ihc;
component void sol (int a, int b, int *dout)
{
int i;
int acc= 0;
int a_reg, b_reg, sub, sub2;
//int N=10;
for(i=0; i<sizeof(a); i++)
{
# pragma HLS PIPELINE II=1
a_reg = a;
b_reg = b;
sub = a_reg - b_reg;
sub2 = sub*sub;
acc += sub2;
}
*dout = acc;
}
int main(void)
{
int i, k, cnt;
int ret_val = 0;
int N=10;
int a, b;
int aa, bb;
long long int ref_res;
int res;
cnt = 0;
//create random data
for(i=0; i<N; i++)
{
a = rand() % (1024*16);
b = rand() % (1024*16);
aa = (int) a;
bb = (int) b;
}
//call design Under Test
sol( aa, bb, &res);
return ret_val;
}
VisualStudio's link.exe is not on the path. Guessing its location.
VS100COMNTOOLS environment variable is set to c:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Tools\.
Looks like you have VisualStudio2010 installed. Using it.
Setting environment for using Microsoft Visual Studio 2010 x64 tools.
Adding c:\intelFPGA_pro\17.1\hls\bin to PATH
Adding c:\intelFPGA_pro\17.1\hls\host\windows64\bin to PATH
c:\intelFPGA_pro\17.1\hls>cd c:\Users\anandr1x\Desktop\hls\u
The system cannot find the path specified.
c:\intelFPGA_pro\17.1\hls>cd c:\Users\anandr1x\Desktop\hls\userhls
c:\Users\x\Desktop\hls\userhls>build.bat test-x86-64
i++ -march=x86-64 sol.cpp -o test-x86-64.exe
sol.cpp:17:18: warning: sizeof on array function parameter will return size of 'int *' instead of 'int '
for(i=0; i<sizeof(a); i++)
^
sol.cpp:11:25: note: declared here
component void sol (int a, int b, int *dout)
^
1 warning generated.
Run test-x86-64.exe to execute the test.
c:\Users\x\Desktop\hls\userhls>build.bat test-fpga
i++ -march=Arria10 sol.cpp -o test-fpga.exe
sol.cpp:17:18: warning: sizeof on array function parameter will return size of 'int *' instead of 'int '
for(i=0; i<sizeof(a); i++)
^
sol.cpp:11:25: note: declared here
component void sol (int a, int b, int *dout)
^
1 warning generated.
sol.cpp:17:18: warning: sizeof on array function parameter will return size of 'int *' instead of 'int '
for(i=0; i<sizeof(a); i++)
^
sol.cpp:11:25: note: declared here
component void sol (int a, int b, int *dout)
^
1 warning generated.
Error: Cannot remove ./test-fpga.prj: Can't remove file ./test-fpga.prj/quartus: Permission denied
Run test-fpga.exe to execute the test.
let me know if this has helped resolve the issue you are facing or if you need any further assistance.
please open a new thread if question does not matches with the thread title Best Regards,
Anand Raj Shankar
(This message was posted on behalf of Intel Corporation)