cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Visitor
Visitor
242 Views
Registered: ‎06-11-2020

Vitis HLS cannot handle "struct" with AXIS interface synthesis

Vitis HLS seems cannot synthesis "struct-array" (with code line 5~8) as AXIS interface, even it's so simple. But the normal array can be correctly synthesized (with code line 3).

I see the "Vitis HLS Migration User Guide" has some topics for this, but the official workaround seems failed too.

Any suggestion?

Capture.PNG
0 Kudos
5 Replies
Highlighted
Moderator
Moderator
190 Views
Registered: ‎05-27-2018

Hi @Oxygen_Chu 

Please refer to UG1391 page28. Argument type of array of hls:: stream and the stream element has struct type, except ap_int/ ap_fixed are not supported.

 

struct ST {
int a;
ap_int<24> b;
};
void some_func(hls::stream<int> A[10], // OK. the stream element has scalar
type
hls::stream<ap_int<11> > B[10], // OK. the stream element has
ap_int type
hls::stream<ST> C[10] // Unsupported, the stream element has
struct type
) {
...
//internal storage is also unsupported
hls::stream<ST> internal_storage[10]
...
}

Thanks,
Wen

 

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
如果提供的信息能解决您的问题,请标记为“接受为解决方案”。
如果您认为帖子有帮助,请点击“奖励”。谢谢!
-------------------------------------------------------------------------------------------------
0 Kudos
Highlighted
Visitor
Visitor
157 Views
Registered: ‎06-11-2020

yes, I see the this workaround, but why Vitis HLS makes this conceptually-simple-code so complex and user-unfriendly?

The ultimate goal of HLS technology is to make C/C++ routing changed as less as possible, and seamlessly "translate" the software-oriented language into hardware circuit if there is no conceptual conflict (malloc/free is a counter-example).

I think the software-oriented "struct-array" has no conceptual conflict with hardware circuit, since the syntax "struct" is fundamentally a "group" of elements. The elements can be handled individually and/or as-a-whole.

I tried "#pragma HLS DISAGGREGATE" to ungroup the "struct" structure into individual elements(array), and use AXIS interface synthesis for each elements(array), it failed. I tried "#pragma HLS AGGREGATE" to group the "struct" structure as a whole, and use AXIS interface synthesis for this, it failed too. So I cannot understand why this.

Is it possible to improve the AXIS interface synthesis for "struct-array" in later version?

0 Kudos
Highlighted
Visitor
Visitor
154 Views
Registered: ‎06-11-2020

BTW, I cannot find UG1391 page28, since UG1391(2020.1) only has 23 pages in total.
:- (
0 Kudos
Highlighted
Moderator
Moderator
115 Views
Registered: ‎05-27-2018

Hi @Oxygen_Chu ,

Argument type of array of hls:: stream and the stream element has struct type is not supported. Have you ever tried the pointer instead of arrays? But if there is a random access, the struct types array would not be supported. You can go back to Vivado HLS for development.

 

hls::stream<axiWord> &inData

I found the code above on Ug1391 v2019.2 page28. But it cannot be found anymore.  Are you using 2020.1 version of Vitis HLS?

Wen

 

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
如果提供的信息能解决您的问题,请标记为“接受为解决方案”。
如果您认为帖子有帮助,请点击“奖励”。谢谢!
-------------------------------------------------------------------------------------------------
0 Kudos
Highlighted
Visitor
Visitor
100 Views
Registered: ‎06-11-2020

Yes, I use the Vitis HLS for Versal.

The access is sequential as shown in figure attached.

So it doesn't make sense, what do you think?

0 Kudos