03-12-2018 11:00 AM
I believe I have found a bug with DATAPACK on a interface with type stream<struct>. I have created a project as attached in case any of you want to reproduce the error. I run it with Vivado 2017.4 in Ubuntu 16.04. You will see dependency error in cosim if you run "vivado_hls -f script.tcl". I understand there may be some limitation about cosim, however, if you check the generated code, you can see that the data ports of the internal fifo are tied to 0, which means it is impossible to store any input data at all. I have found it working if I:
1) comment out all DATAPACK pragma in the code
2) use non-struct type
3) copy moveTo and rename it to moveTo1, and replace one of the moveTo with moveTo1.
Here is the synthesizable code:
void moveTo(hls::stream<SomeStruct>& i_data, hls::stream<SomeStruct>& o_data)
#pragma HLS INLINE off
#pragma HLS PIPELINE II=1
if (! i_data.empty())
void data_pack_test(hls::stream<SomeStruct>& i_data, hls::stream<SomeStruct>& o_data)
#pragma HLS DATAFLOW
#pragma HLS INTERFACE axis port=i_data
#pragma HLS INTERFACE axis port=o_data
#pragma HLS DATA_PACK variable=i_data
#pragma HLS DATA_PACK variable=o_data
static hls::stream<SomeStruct> int_data;
#pragma HLS STREAM variable=int_data depth=16 dim=1
#pragma HLS DATA_PACK variable=int_data
03-13-2018 01:12 AM
I have found this in Vivado HLS user guide, maybe it can help you.
Moreover, you could trie to use an ap_uint<16> instead of a struct and check if it works. Of course, in this case you have to manually access the two 8-bit fields within the 16-bit value.
03-13-2018 06:20 AM
Thanks for the reply. Your link just proves that my code is supported in cosimulation, note the words "but not two or more".
Anyway, cosim is just a way to help Xilinx employee to reproduce the problem, the real project is that the synthesized function results in wrong HDL and does not work in hardware. Here is the internal fifo part of synthesized verilog. You can clearly see that the data port is tied to 0, so there is no chance to work. You can also write your own test bench to test it.