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: 
Contributor
Contributor
569 Views
Registered: ‎05-10-2018

A problem is difficult to solve about accelerating compiler, please help me to solve it. Thank you very much

I am compiling a project about the algorithm predict. This project of algorithm has been compiled normally without using hardware acceleration.  I have encountered a function to speed up the compilation error when I use the "Toggle SW/HW function" to accelerate this function, The function which I want to hardware accelerate and error is  shown as follows. Please help me how to solve it? Any suggestions are very grateful!

 

function:

 

int ttest(float data_0[use_rows], float data_1[use_rows], float data_2[1], float data_3[1])
{
// ttest 检验
float dif[use_rows];
float dif_sd[use_rows];
float sd = 0.0;
float mean_0 = 0.0;
// 计算总体的差值
for (int i = 0 ; i < count_0; i ++)
{
dif[i] = data_0[i] - data_1[i];
}
// 计算平均收益
for (int i = 0 ; i < count_0 ; i ++)
{
mean_0 += dif[i];
}
mean_0 = mean_0 / (count_0);
// 计算标准差
for (int i = 0 ; i < count_0 ; i ++)
{
dif_sd[i] = (dif[i] - mean_0) * (dif[i] - mean_0);
}
for (int i = 0 ; i < count_0 ; i ++)
{
sd += dif_sd[i];
}
sd = sd / ((count_0 - 1 ) * count_0);
sd = pow(sd,0.5);
// string result = to_string(mean_0) + "," + to_string(sd);
for (int i=0; i<1; i++)
{
data_2[i]= mean_0;
data_3[i] = sd;
}
return 1;
}

 

 

The error:

 

Creating block diagram (BD)
Creating top.bd.tcl
Rewrite caller functions
Compile caller rewrite file D:/QFtest/test/Debug/_sds/swstubs/main.cpp
D:/QFtest/test/Debug/_sds/swstubs/main.cpp:102:99: error: expected identifier before ')' token
int _p0_ttest_1_noasync(float data_0[2000], float data_1[2000], float data_2[1], float data_3[1], );
^
D:/QFtest/test/Debug/_sds/swstubs/main.cpp: In function 'int main(int, char**)':
D:/QFtest/test/Debug/_sds/swstubs/main.cpp:138:69: error: too few arguments to function 'int _p0_ttest_1_noasync(float*, float*, float*, float*, int)'
_p0_ttest_1_noasync(data_use_0,data_use_1,data_use_2,data_use_3);
^
D:/QFtest/test/Debug/_sds/swstubs/main.cpp:102:5: note: declared here
int _p0_ttest_1_noasync(float data_0[2000], float data_1[2000], float data_2[1], float data_3[1], );
^~~~~~~~~~~~~~~~~~~
ERROR: [SdsCompiler 83-5019] Exiting sds++ : Error when calling 'aarch64-linux-gnu-g++ -c D:/QFtest/test/Debug/_sds/swstubs/main.cpp -ID:/QFtest/test/src -ID:/QFtest/test/src -Wall -O0 -g -fmessage-length=0 -MMD -MP -D __SDSCC__ -I E:/XilinX/SDx/2018.2/target/aarch64-linux/include -D HLS_NO_XIL_FPO_LIB -I E:/XilinX/Vivado/2018.2/include -o D:/QFtest/test/Debug/_sds/swstubs/main.o'
sds++ log file saved as D:/QFtest/test/Debug/_sds/reports/sds.log
ERROR: [SdsCompiler 83-5004] Build failed

 

 

 

Error.PNG
0 Kudos
3 Replies
Xilinx Employee
Xilinx Employee
539 Views
Registered: ‎10-28-2013

Re: A problem is difficult to solve about accelerating compiler, please help me to solve it. Thank you very much

@sharpmddr,

 

Can you provide info on how your hardware function is being called? From the logs, it looks like the call you're making is not terminated correct based upon this line:

 

D:/QFtest/test/Debug/_sds/swstubs/main.cpp:102:99: error: expected identifier before ')' token

 

Thanks

Steve 

0 Kudos
Contributor
Contributor
522 Views
Registered: ‎05-10-2018

Re: A problem is difficult to solve about accelerating compiler, please help me to solve it. Thank you very much

=======================Hardware Accelerate Head File===========================

 

#include <string>

#include <iostream>

#include <fstream>

#include <sstream>

#include <math.h>

 

using namespace std;

const int rows = 40000;

const int columns = 5;

const int use_rows = 2000;

 

extern int count_0; // Reference global variable count_0

 

int ttest(float data_0[use_rows], float data_1[use_rows], float data_2[1], float data_3[1]);

 

========================Main Function=============================================

int count_0; //set a global counter

int main(int argc, char *argv[])

{

      

       unsigned long long s = sds_clock_counter();//clock_counter_start

      for (int label = 0; label <36; label ++)

       {

           count_0 = 0;

           float data_use_0[use_rows];

           float data_use_1[use_rows];

           float data_use_2[1];

           float data_use_3[1];

           process_data();  //this function will change the value of the global counter(count_0)

           ttest(data_use_0,data_use_1,data_use_2,data_use_3);

          

           cout << data_use_2[0] << endl;

           cout << data_use_3[0] << endl;

         }

 

       unsigned long long e = sds_clock_counter();//clock_counter_end

         printf("\t Clock cycle: %llu\n", e - s);

         printf("\t Time: %.4f [sec]\n", (e - s)*1.0/sds_clock_frequency());

       return 0;

}

0 Kudos
Xilinx Employee
Xilinx Employee
511 Views
Registered: ‎10-28-2013

Re: A problem is difficult to solve about accelerating compiler, please help me to solve it. Thank you very much

I am not able to reproduce the issue with a clean workspace targeting the ZCU102. I am looking at the swstubs file created by SDx, and I am not seeing any missing information.

 

Have you tried cleaning the project and rebuilding?

 

Looks to be some files might not have been in-sync during build.

 

Steve

0 Kudos