cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
ZeD4805
Visitor
Visitor
235 Views
Registered: ‎04-05-2021

Possible linker problem Vitis HLS

I've been trying to install and reinstall Vitis HLS for some time now and I never fully got it to work.

I use the 2020.2 Vitis HLS on Ubuntu 20.04LTS.

 

Synthesis runs without errors and produces correct results, but any interaction with c simulation fails (both C simulation and co simulation fail).

For C simulation:

INFO: [SIM 2] *************** CSIM start ***************
INFO: [SIM 4] CSIM will launch GCC as the compiler.
Compiling(apcc) ../../../../func.c in debug mode
INFO: [HLS 200-10] Running '/tools/Xilinx/Vivado/2020.2/bin/unwrapped/lnx64.o/apcc'
INFO: [HLS 200-10] For user 'zed4805' on host 'computer' (Linux_x86_64 version 5.8.0-50-generic) on Sun May 09 18:42:22 WEST 2021
INFO: [HLS 200-10] On os Ubuntu 20.04.2 LTS
INFO: [HLS 200-10] In directory '/home/zed4805/Downloads/verydesperatenow/verydesperatenow/solution1/csim/build'
INFO: [APCC 202-3] Tmp directory is /tmp/apcc_db_zed4805/128181620582142744205
INFO: [APCC 202-1] APCC is done.
Generating csim.exe
ERR: [SIM 102] C simulation failed, no 'main' function.
ERR: [SIM 100] 'csim_design' failed: compilation error(s).
INFO: [SIM 3] *************** CSIM finish ***************

I have 3 files, 2 source and one testbench: func.h, func.c and test_func.h  .

func.h

 

 

 

 

#ifndef FOO
#define FOO
void foo(int in[3], char a, char b, char c, int out[3]);
#endif

 

 

 

 

func.c

 

 

 

 

#include "func.h"

void foo(int in[3], char a, char b, char c, int out[3]) {
  int x,y;
  for(int i = 0; i < 3; i++) {
    x = in[i];
    y = a*x + b + c;
    out[i] = y;
  }
}

 

 

 

 

test_func.h

 

 

 

 

#include "func.h"

int main(int argv, char** argv){
	int in[3] = {1, 1, 1};
	int out[3] = {0, 0 ,0};

	foo(in, 2, 3, 5, out);

	return 0;
}

 

 

 

 

 

Other strange interactions: can't browse top functions for code files, example files do not work, examining the properties on the source files shows no toolchain as follows:

ZeD4805_0-1620583919345.png

What am I missing?

0 Kudos
1 Reply
randyh
Xilinx Employee
Xilinx Employee
214 Views
Registered: ‎01-04-2013

To me it looks like some naming issues. I renamed test_func.h to test_func.c and it seemed to work ok. I also had to change the name of one of your argv to arg1

I see the same thing on the Tool Chain Editor for func.h, but see it for func.c, not sure why

0 Kudos