2017-06-07 39 views
-2

我是新的vivado HLS,我試圖將C++代碼轉換爲vhdl,並且我有一些綜合問題。我希望有人能幫助我。合成(頂級功能警告)

這裏是錯誤的列表:

@E [SYNCHK-42] C:/Xilinx/Vivado_HLS/2013.4/win64/tools/clang/bin .. \ lib中\鐺\ 3.1/../../../include/c++/4.5.2\bits/stl_construct.h:80:不支持指針比較。 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:變量'this.assign.3'有一個不可合成的類型'vector>'(可能的原因:指針或全局指針指針)。 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:不支持的指針從類型'i8 *'重新解釋爲類型'指針'。 projethls:解決方法1 7朱安2017十一點53分27秒

@E [SYNCHK-71] C:/Xilinx/Vivado_HLS/2013.4/win64/tools/clang/bin .. \ lib中\鐺\ 3.1 /../ ../../include/c++/4.5.2\ext/new_allocator.h:89:函數'operator new(unsigned long long)'沒有函數體。 projethls:solution1 7 juin 2017 11:53:27

@E [SYNCHK-11] filtre/filtre/filtre_passhautbutter.cpp:16:函數'filtre_passhautbutter'的參數'y'(filtre/filtre/filtre_passhautbutter.cpp: 12)有一個不可合成的類型(可能的原因:結構變量由於不受支持的類型轉換或內存複製操作而無法分解)。 projethls:解決方法1 7朱安2017年十一點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; 
} 
+3

我認爲錯誤消息是不言而喻的:你的代碼包括不受合成支持的構造。換句話說,你的代碼太高級了。高級綜合不能將任何代碼轉換成硬件;兼容的代碼需要使用該語言的子集以特定的低級別風格編寫。您是否閱讀過HLS工具的說明? –

+1

見Vivado設計中心 - [高級綜合(C類)(https://www.xilinx.com/support/documentation-navigation/design-hubs/dh0012-vivado-high-level-synthesis-hub.html ),介紹塊用戶指南。這些包括C++。 – user1155120

回答

1

答案很簡單:是:你不能將任何隨機的C/C++代碼片段轉換爲(V)HDL。至少:賽靈思HLS不能。代碼必須以特定的方式寫入,使用兼容的數據類型等。

你想實現什麼?你目前的方法(C++ - HDL)是最好的方法嗎? (你知道嗎,賽靈思有一個濾波器設計嚮導?即FIR編譯器)

如果你真的想使用HLS,你應該從簡單的開始。使用您可以在網上找到的學習指南。