-3

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

以下是错误列表:

@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:不支持指针比较。projethls:solution1 2017 年 6 月 7 日 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:变量“this.assign.3”具有不可综合的类型“向量>”(可能的原因:指向指针或全局指针的指针)。projethls:solution1 2017 年 6 月 7 日 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:不支持从类型“i8*”到类型“指针”的指针重新解释。projethls:solution1 2017 年 6 月 7 日 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: 函数 'operator new(unsigned long long)' 没有函数体。projethls:solution1 2017 年 6 月 7 日 11:53:27

@E [SYNCHK-11] filtre/filtre/filtre_passhautbutter.cpp:16:函数 'filtre_passhautbutter' (filtre/filtre/filtre_passhautbutter.cpp:12) 的参数 'y' 具有不可合成的类型(可能的原因:结构变量由于不支持的类型转换或内存复制操作而无法分解)。projethls:solution1 2017 年 6 月 7 日 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;
}
4

1 回答 1

0

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

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

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

于 2017-06-08T08:39:09.417 回答