std::complex のサポート:
Vivado HLS では、複数のライターの問題のため、std::complex データ型をデータフロー内で直接使用することはできません。この問題は、値を初期化するために std クラスのコンストラクターが呼び出されることによります。この変数がチャネルとしてデータフロー内でも使用されると、上記の問題が発生します。Vitis では、次に示すように、std::complex
を no_ctor
属性と使用することがサポートされます。
// Nothing to do here.
void proc_1(std::complex<float> (&buffer)[50], const std::complex<float> *in);
void proc_2(hls::stream<std::complex<float>> &fifo, const std::complex<float> (&buffer)[50], std::complex<float> &acc);
void proc_3(std::complex<float> *out, hls::stream<std::complex<float>> &fifo, const std::complex<float> acc);
void top(std::complex<float> *out, const std::complex<float> *in) {
#pragma HLS DATAFLOW
std::complex<float> acc __attribute((no_ctor)); // here
std::complex<float> buffer[50] __attribute__((no_ctor)); // here
hls::stream<std::complex<float>, 5> fifo; // no need here (hls::stream has it internally)
proc_1(buffer, in);
proc_2(fifo, buffer, acc);
porc_3(out, fifo, acc);
}