0

When I try to sythnise using the Vivado HLS, I get this errors for the same line:

CRITICAL WARNING: [SYNCHK 200-43] pcd_triangulation/pcd_triangulation.cpp:156: use or assignment of a non-static pointer 'current.0.i.reg2mem' (this pointer may refer to different memory locations).

CRITICAL WARNING: [SYNCHK 200-11] pcd_triangulation/pcd_triangulation.cpp:156: Constant 'start' has an unsynthesizable type 'lass.triangle.2.28.31 = type { [3 x �lass.triangle.2.28.3...' (possible cause(s): pointer to pointer or global pointer).

CRITICAL WARNING: [SYNCHK 200-11] pcd_triangulation/pcd_triangulation.cpp:156: Constant 'start' has an unsynthesizable type '^lass.triangle.2.28.31 = type { [3 x �lass.triangle.2.28.3...' (possible cause(s): structure variable cannot be decomposed due to (1) unsupported type conversion; (2) memory copy operation; (3) function pointer used in struct; (4) unsupported pointer comparison).

CRITICAL WARNING: [SYNCHK 200-42] pcd_triangulation/pcd_triangulation.cpp:156: pointer comparison is not supported.

The code is in C++. So this is the code which gives the warnings above:

if(start->child[0]==NULL && start->child[1]==NULL && start->child[2]==NULL)

start is a global pointer to class (triangle *start) and child[i] is an array points to the same class inside the class (member)(triangle *child[3]).

class triangle {
   public:
    triangle *child[3];
    ...
}

triangle *start;

inline triangle *mylocate(int p) {
    if (start->child[0] == NULL && start->child[1] == NULL &&
        start->child[2] == NULL) {
        return start;

        ...
    }
}

Can anyone help me to solve these issues?

smac89
  • 39,374
  • 15
  • 132
  • 179
Marios
  • 1
  • 2

2 Answers2

0

I don't know anything about vivado, but it claims that "pointer comparison is not supported". You're comparing pointers.

So it's not supported. So you can't do pointers comparison :/

brainsandwich
  • 472
  • 3
  • 10
0

When you use Vivado HLS you must keep in mind some important things: you are translating C or C++ code in hardware. What does it mean? Well, it is not possible to allocate memory dinamically, the function to synthetize must have some PHISICAL ports (for the inputs, outputs and controls) and other many many important issues. A pointer, in this particolar contenst, is the adress of a port that will never change as long as the HW will remain the same once the bitstream is created. To conclude the answer: you must re-write the C or C++ code in a specific way if you want to synthetize it with transistor connections. If you have experience in writing VHDL or Verilog it is a optimum starting point. You should rewrite your function maybe having a look on this document.

Leos313
  • 5,152
  • 6
  • 40
  • 69