-3

I am new in vivado HLS , I'm trying to convert a c++ code to vhdl and I have some synthesis problems. I hope that someone can help me.

Here is a listing of the errors:

@E [SYNCHK-42] C:/Xilinx/Vivado_HLS/2013.4/win64/tools/clang/bin..\lib\clang\3.1/../../../include/c++/4.5.2\bits/stl_construct.h:80: pointer comparison is not supported. projethls:solution1 7 juin 2017 11:53:27

@E [SYNCHK-11] C:/Xilinx/Vivado_HLS/2013.4/win64/tools/clang/bin..\lib\clang\3.1/../../../include/c++/4.5.2\bits/stl_vector.h:113: Variable 'this.assign.3' has an unsynthesizable type 'vector >' (possible cause(s): pointer to pointer or global pointer). projethls:solution1 7 juin 2017 11:53:27

@E [SYNCHK-41] C:/Xilinx/Vivado_HLS/2013.4/win64/tools/clang/bin..\lib\clang\3.1/../../../include/c++/4.5.2\ext/new_allocator.h:89: unsupported pointer reinterpretation from type 'i8*' to type 'pointer'. projethls:solution1 7 juin 2017 11:53:27

@E [SYNCHK-71] C:/Xilinx/Vivado_HLS/2013.4/win64/tools/clang/bin..\lib\clang\3.1/../../../include/c++/4.5.2\ext/new_allocator.h:89: function 'operator new(unsigned long long)' has no function body. projethls:solution1 7 juin 2017 11:53:27

@E [SYNCHK-11] filtre/filtre/filtre_passhautbutter.cpp:16: Argument 'y' of function 'filtre_passhautbutter' (filtre/filtre/filtre_passhautbutter.cpp:12) has an unsynthesizable type (possible cause(s): structure variable cannot be decomposed due to unsupported type conversion or memory copy operation). projethls:solution1 7 juin 2017 11:53:27

here is the code:

// function

#include <iostream>
#include <stdlib.h>
#include <stdio.h>
#include <math.h> 
#include <vector>

using namespace std;

//Definier la fonction filtre_passhautbutter(x)  qui retouren un matrice de type double

vector <vector <double> > filtre_passhautbutter(vector <vector <double> > x)
{
    int heigth=6;
    int width=1;
    vector <vector <double> > y (heigth,vector<double>(width, 0.0));
    //Definir le vecteur b
    vector <double> b;
    b.push_back(0.9691);
    b.push_back(-2.9072);
    b.push_back(2.9072);
    b.push_back(-0.9691);
    //Definir le vecteur a
    vector <double> a;
    a.push_back(1.0000);
    a.push_back(-2.9372);
    a.push_back(2.8763);
    a.push_back(-0.9391);   

    //Remplir le vecteur y par les valeurs correspondentes
    for (int n=4; n< x.size() ;n++)
    {

        double calcul= (b[0]*x[n-1][0]) + (b[1]*x[n-2][0]) + (b[2]*x[n-3][0]) +(b[3]*x[n-4][0]) - (a[1]*y[n-2][0]) - (a[2]*y[n-3][0]) - (a[3]*y[n-4][0]);
        y[0].push_back(calcul);
    }
    return y;
}

//main:

#include <stdio.h>
#include <math.h> 
#include <vector>


using namespace std;
vector <vector <double> > filtre_passhautbutter(vector <vector <double> > x);

int main()
{
    int heigth=6;
    int width=1;
    vector <vector <double> > x;
    x.push_back(vector<double>(12.5));
    x.push_back(vector<double>(19.5));
    x.push_back(vector<double>(6));
    x.push_back(vector<double>(12));
    x.push_back(vector<double>(14.5));
    x.push_back(vector<double>(15));

    vector <vector <double> > y (heigth,vector<double>(width));
    y =filtre_passhautbutter(x);

    return 0;
}
s0611
  • 3
  • 3
  • 3
    I think the error messages are self-evident: your code includes constructs that are not supported by the synthesiser. In other words, you code is too high-level. High-level synthesis cannot just convert any code to hardware; compatible code needs to be written in a specific, low-level style, using a subset of the language. Have you read the instructions for your HLS tool? – Matthew Taylor Jun 07 '17 at 10:31
  • 1
    See Vivado Design Hub - [High-Level Synthesis (C based)](https://www.xilinx.com/support/documentation-navigation/design-hubs/dh0012-vivado-high-level-synthesis-hub.html), the Introduction block user guides. These include C++. –  Jun 07 '17 at 17:53

1 Answers1

0

The simple answer is: you cannot convert any random snippet of C/C++ code to (V)HDL. At least: Xilinx HLS cannot. The code has to be written in a specific way, using compatible data types, etc.

What do you want to achieve? Is your current approach (C++-to-HDL) the best approach? (Did you know that Xilinx has a filter design wizard? i.e. FIR Compiler)

If you really want to use HLS, you should start simple. Use a learning guide, which you can find online.

JHBonarius
  • 10,824
  • 3
  • 22
  • 41