综合(顶级功能警告)

Synthesis (Top Level Function Warnings)

我是 vivado HLS 的新手,我正在尝试将 c++ 代码转换为 vhdl,但我遇到了一些综合问题。我希望有人能帮助我。

以下是错误列表:

@E [SYNCHK-42] C:/Xilinx/Vivado_HLS/2013.4/win64/tools/clang/bin..\lib\clang.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.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.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.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

代码如下:

//函数

#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;
}

//主要内容:

#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;
}

简单的答案是:您不能将 C/C++ 代码的任何随机片段转换为 (V)HDL。至少:Xilinx HLS 不能。代码必须以特定的方式编写,使用兼容的数据类型等

你想达到什么目的?您当前的方法(C++ 到 HDL)是最好的方法吗? (您知道 Xilinx 有一个滤波器设计向导吗?即 FIR 编译器)

如果你真的想使用HLS,你应该从简单开始。使用可以在线找到的学习指南。