UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

取消
显示结果 
搜索替代 
您的意思是: 
Highlighted
Visitor yanjian
Visitor
168 次查看
注册日期: ‎11-28-2018

vivado hls

for (ap_uint<11> i = 0; i < r ; i++) {
for (ap_uint<11> j = 0; j < c ; j++) {
dsst[i][j] = 0;
}
}

ap_uint<11> x, y;

ap_uint<1> nw, no, ne; // north (pAbove)
ap_uint<1> we, me, ea;
ap_uint<1> sw, so, se; // south (pBelow)


// initialize row pointers


for (y = 1; y < r-1; y++) {
for (x = 1; x < c-1; x++) {
// shift col pointers left by one (scan left to right)
nw = arry_imga[y - 1][x - 1];
no = arry_imga[y - 1][x];
ne = arry_imga[y - 1][x + 1];
we = arry_imga[y][x - 1];
me = arry_imga[y][x];
ea = arry_imga[y][x + 1];
sw = arry_imga[y + 1][x - 1];
so = arry_imga[y + 1][x];
se = arry_imga[y + 1][x + 1];

int A = (no == 0 && ne == 1) + (ne == 0 && ea == 1) +
(ea == 0 && se == 1) + (se == 0 && so == 1) +
(so == 0 && sw == 1) + (sw == 0 && we == 1) +
(we == 0 && nw == 1) + (nw == 0 && no == 1);
int B = no + ne + ea + se + so + sw + we + nw;
int m1 = iter == 0 ? (no * ea * so) : (no * ea * we);
int m2 = iter == 0 ? (ea * so * we) : (no * so * we);

if (A == 1 && (B >= 2 && B <= 6) && m1 == 0 && m2 == 0)
dsst[y][x] = 1;
}
}
arry_imga &= (~dsst);

 

编译错误信息;

 


C:/Xilinx/Vivado_HLS/2016.3/include/floating_point_v7_0_bitacc_cmodel.h:135:0: note: this is the location of the previous definition
../../../../thin.cpp: In function 'void thinningIteration(ap_uint<1>, int, ap_uint<11>, ap_uint<11>)':
../../../../thin.cpp:9:23: error: cannot convert 'int*' to 'ap_uint<1>*' in assignment
../../../../thin.cpp:32:31: error: no match for 'operator[]' in 'ap_private<_AP_W, _AP_S, true>::operator[](const ap_private<_AP_W1, _AP_S1>&) [with int _AP_W2 = 33, bool _AP_S2 = true, int _AP_W = 1, bool _AP_S = false]((*(const ap_private<33, true, true>*)(& operator-(const ap_private<_AP_W, _AP_S>&, int) [with int _AP_W = 11, bool _AP_S = false, typename ap_private<_AP_W, _AP_S>::RType<32, true>::minus = ap_private<33, true, true>](1))))[operator-(const ap_private<_AP_W, _AP_S>&, int) [with int _AP_W = 11, bool _AP_S = false, typename ap_private<_AP_W, _AP_S>::RType<32, true>::minus = ap_private<33, true, true>](1)]'
../../../../thin.cpp:33:27: error: no match for 'operator[]' in 'ap_private<_AP_W, _AP_S, true>::operator[](const ap_private<_AP_W1, _AP_S1>&) [with int _AP_W2 = 33, bool _AP_S2 = true, int _AP_W = 1, bool _AP_S = false]((*(const ap_private<33, true, true>*)(& operator-(const ap_private<_AP_W, _AP_S>&, int) [with int _AP_W = 11, bool _AP_S = false, typename ap_private<_AP_W, _AP_S>::RType<32, true>::minus = ap_private<33, true, true>](1))))[x]'
../../../../thin.cpp:34:31: error: no match for 'operator[]' in 'ap_private<_AP_W, _AP_S, true>::operator[](const ap_private<_AP_W1, _AP_S1>&) [with int _AP_W2 = 33, bool _AP_S2 = true, int _AP_W = 1, bool _AP_S = false]((*(const ap_private<33, true, true>*)(& operator-(const ap_private<_AP_W, _AP_S>&, int) [with int _AP_W = 11, bool _AP_S = false, typename ap_private<_AP_W, _AP_S>::RType<32, true>::minus = ap_private<33, true, true>](1))))[operator+(const ap_private<_AP_W, _AP_S>&, int) [with int _AP_W = 11, bool _AP_S = false, typename ap_private<_AP_W, _AP_S>::RType<32, true>::plus = ap_private<33, true, true>](1)]'
../../../../thin.cpp:35:27: error: no match for 'operator[]' in 'ap_private<_AP_W, _AP_S, true>::operator[](const ap_private<_AP_W1, _AP_S1>&) [with int _AP_W2 = 11, bool _AP_S2 = false, int _AP_W = 1, bool _AP_S = false]((*(const ap_private<11, false, true>*)(& y.ap_uint<11>::<anonymous>)))[operator-(const ap_private<_AP_W, _AP_S>&, int) [with int _AP_W = 11, bool _AP_S = false, typename ap_private<_AP_W, _AP_S>::RType<32, true>::minus = ap_private<33, true, true>](1)]'
../../../../thin.cpp:36:23: error: no match for 'operator[]' in 'ap_private<_AP_W, _AP_S, true>::operator[](const ap_private<_AP_W1, _AP_S1>&) [with int _AP_W2 = 11, bool _AP_S2 = false, int _AP_W = 1, bool _AP_S = false]((*(const ap_private<11, false, true>*)(& y.ap_uint<11>::<anonymous>)))[x]'
../../../../thin.cpp:37:27: error: no match for 'operator[]' in 'ap_private<_AP_W, _AP_S, true>::operator[](const ap_private<_AP_W1, _AP_S1>&) [with int _AP_W2 = 11, bool _AP_S2 = false, int _AP_W = 1, bool _AP_S = false]((*(const ap_private<11, false, true>*)(& y.ap_uint<11>::<anonymous>)))[operator+(const ap_private<_AP_W, _AP_S>&, int) [with int _AP_W = 11, bool _AP_S = false, typename ap_private<_AP_W, _AP_S>::RType<32, true>::plus = ap_private<33, true, true>](1)]'
../../../../thin.cpp:38:31: error: no match for 'operator[]' in 'ap_private<_AP_W, _AP_S, true>::operator[](const ap_private<_AP_W1, _AP_S1>&) [with int _AP_W2 = 33, bool _AP_S2 = true, int _AP_W = 1, bool _AP_S = false]((*(const ap_private<33, true, true>*)(& operator+(const ap_private<_AP_W, _AP_S>&, int) [with int _AP_W = 11, bool _AP_S = false, typename ap_private<_AP_W, _AP_S>::RType<32, true>::plus = ap_private<33, true, true>](1))))[operator-(const ap_private<_AP_W, _AP_S>&, int) [with int _AP_W = 11, bool _AP_S = false, typename ap_private<_AP_W, _AP_S>::RType<32, true>::minus = ap_private<33, true, true>](1)]'
../../../../thin.cpp:39:27: error: no match for 'operator[]' in 'ap_private<_AP_W, _AP_S, true>::operator[](const ap_private<_AP_W1, _AP_S1>&) [with int _AP_W2 = 33, bool _AP_S2 = true, int _AP_W = 1, bool _AP_S = false]((*(const ap_private<33, true, true>*)(& operator+(const ap_private<_AP_W, _AP_S>&, int) [with int _AP_W = 11, bool _AP_S = false, typename ap_private<_AP_W, _AP_S>::RType<32, true>::plus = ap_private<33, true, true>](1))))[x]'
../../../../thin.cpp:40:31: error: no match for 'operator[]' in 'ap_private<_AP_W, _AP_S, true>::operator[](const ap_private<_AP_W1, _AP_S1>&) [with int _AP_W2 = 33, bool _AP_S2 = true, int _AP_W = 1, bool _AP_S = false]((*(const ap_private<33, true, true>*)(& operator+(const ap_private<_AP_W, _AP_S>&, int) [with int _AP_W = 11, bool _AP_S = false, typename ap_private<_AP_W, _AP_S>::RType<32, true>::plus = ap_private<33, true, true>](1))))[operator+(const ap_private<_AP_W, _AP_S>&, int) [with int _AP_W = 11, bool _AP_S = false, typename ap_private<_AP_W, _AP_S>::RType<32, true>::plus = ap_private<33, true, true>](1)]'
../../../../thin.cpp:54:17: error: wrong type argument to bit-complement
make: *** [obj/thin.o] Error 1
ERROR: [SIM 211-100] 'csim_design' failed: compilation error(s).
INFO: [SIM 211-3] *************** CSIM finish ***************
4
while executing
"source D:/xiilx/milianke/thinn/hlx_thin/hlx_thin/solution1/csim.tcl"
invoked from within
"hls::main D:/xiilx/milianke/thinn/hlx_thin/hlx_thin/solution1/csim.tcl"
("uplevel" body line 1)
invoked from within
"uplevel 1 hls::main {*}$args"
(procedure "hls_proc" line 5)
invoked from within
"hls_proc $argv"
Finished C simulation.

 

0 项奖励
1 条回复
Moderator
Moderator
52 次查看
注册日期: ‎05-23-2018

回复: vivado hls

Hi, @yanjian

报错信息显示数据类型转换错误,int类型无法转换为ap_uint<1>。发生错误的代码应该为:

nw = arry_imga[y - 1][x - 1];
no = arry_imga[y - 1][x];
ne = arry_imga[y - 1][x + 1];
we = arry_imga[y][x - 1];
me = arry_imga[y][x];
ea = arry_imga[y][x + 1];
sw = arry_imga[y + 1][x - 1];
so = arry_imga[y + 1][x];
se = arry_imga[y + 1][x + 1];

可以看一下这部分代码,保证等号两边的数据类型是匹配的。

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