在具有不同启动间隔不同的Vitis HLS中,运行两个功能?
如何合成具有不同启动间隔的两个独立函数的顶部函数,并使它们并行运行,使顶部功能的II保持在两个函数的最低II中?
#include <iostream>
struct data1{
int a;
int b;
int c;
};
struct data2{
int a;
int b;
int c;
};
int proc1(data1 data){
#pragma HLS PIPELINE II=3
int t = data.a^2 + data.b^2;
int q = t*data.a*data.b;
int ret = data.c?t:q;
return ret;
}
int proc2(data2 data){
#pragma HLS PIPELINE II=1
int q = data.a*data.b;
int t = t^2 + data.a^2 + data.b^2;
int ret = data.c?t:q;
return ret;
}
int top_func(data1 d1, data2 d2){
#pragma HLS PIPELINE II=1
int out1, out2;
out1 = proc1(d1);
out2 = proc2(d2);
int x = out1*out2;
return x;
}
此代码显示了我想要的要旨,我具有proc1功能,具有II = 3 AD PROC2功能,II = 1。我希望我的顶部功能具有ii = 1,但这不是我得到的。该工具使顶部功能的II提高到3。是否有任何将顶部功能的实用性或指令作为1?
这是C综合后的时间表查看器图: 计划查看器图
How to synthesize a top function that instantiates two independent functions with different Initiation Intervals and make them run in parallel, keeping the II of top function to the minimum of II's of the two functions?
#include <iostream>
struct data1{
int a;
int b;
int c;
};
struct data2{
int a;
int b;
int c;
};
int proc1(data1 data){
#pragma HLS PIPELINE II=3
int t = data.a^2 + data.b^2;
int q = t*data.a*data.b;
int ret = data.c?t:q;
return ret;
}
int proc2(data2 data){
#pragma HLS PIPELINE II=1
int q = data.a*data.b;
int t = t^2 + data.a^2 + data.b^2;
int ret = data.c?t:q;
return ret;
}
int top_func(data1 d1, data2 d2){
#pragma HLS PIPELINE II=1
int out1, out2;
out1 = proc1(d1);
out2 = proc2(d2);
int x = out1*out2;
return x;
}
This code shows the gist of what i wanted, I have proc1 function with II=3 ad proc2 function with II=1. I want my top function with an II=1, but that nots what i am getting. The tool makes the II of the top function to 3. Is there any pragma or directive that will make the II of top function as 1?
Here is the Schedule Viewer graph after the C synthesis:
Schedule Viewer Graph
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请查看用户指南
根据定义,TLF的II不能比其调用的任何功能都小。它必须至少等待时钟周期,然后才能再次调用该函数。如果您确实需要1个II,那么您可以尝试通过添加Pragmas来帮助HLS来减少Proc1的II。请参阅 ug902 以获取更多信息关于如何这样做。
Please check the user guide UG902:
By definition the II of the TLF cannot be smaller than any functions it calls. It has to wait at least that amount of clock cycles before the function can be called again. If you really need an II of 1 then you may try to reduce II of proc1 by adding pragmas to assist HLS. Refer to UG902 for more information on how to do so.