Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HLS Resize IP code does not compile #3

Closed
Q-point opened this issue Feb 20, 2019 · 5 comments
Closed

HLS Resize IP code does not compile #3

Q-point opened this issue Feb 20, 2019 · 5 comments

Comments

@Q-point
Copy link

Q-point commented Feb 20, 2019

Resize IP HLS code fails on Vivado HLS 2018.3:

In file included from C:/Xilinx/Vivado/2018.3/include/hls_fpo.h:186:0,
from C:/Xilinx/Vivado/2018.3/include/hls_half.h:44,
from C:/Xilinx/Vivado/2018.3/include/etc/ap_private.h:90,
from C:/Xilinx/Vivado/2018.3/include/ap_common.h:641,
from C:/Xilinx/Vivado/2018.3/include/ap_int.h:54,
from ../../../../xf_resize_config.h:34,
from ../../../../xf_resize_accel.cpp:30:
C:/Xilinx/Vivado/2018.3/include/floating_point_v7_0_bitacc_cmodel.h:135:0: note: this is the location of the previous definition
#define __GMP_LIBGMP_DLL 1

@e Simulation failed.
ERROR: [SIM 211-100] CSim failed with errors.
INFO: [SIM 211-3] *************** CSIM finish ***************
4
while executing
"source hls_script.tcl"
invoked from within
"hls::main hls_script.tcl"
("uplevel" body line 1)
invoked from within
"uplevel 1 hls::main {*}$args"
(procedure "hls_proc" line 5)
invoked from within
"hls_proc $argv"

@yunqu
Copy link

yunqu commented Feb 28, 2019

Should be fixed in #5
but I have not tested the functionality.

@Q-point
Copy link
Author

Q-point commented Mar 2, 2019

Seems like the issue is with the .png file on the added script. When I feed it a jpeg file it works.

@Q-point
Copy link
Author

Q-point commented Mar 2, 2019

Well the CSIm works but synthesis fails anyways.
So the code uploaded is not correct.
``
INFO: [HLS 200-10] Analyzing design file 'xf_resize_accel.cpp' ...
ERROR: [HLS 200-70] Compilation errors found: In file included from xf_resize_accel.cpp:1:
In file included from xf_resize_accel.cpp:30:
In file included from ./xf_resize_config.h:35:
In file included from ../include\common/xf_common.h:34:
../include\common/xf_structs.h:531:52: error: use of undeclared identifier 'lround'
in_pix = ( tmp >= max ? max : (tmp < 0 ? 0 : lround(tmp)) );
^
In file included from xf_resize_accel.cpp:1:
In file included from xf_resize_accel.cpp:30:
In file included from ./xf_resize_config.h:37:
In file included from ../include\imgproc/xf_resize.hpp:34:
In file included from ../include\imgproc/xf_resize_headers.h:40:
../include\imgproc/xf_resize_nn_bilinear.hpp:75:9: error: no member named 'cout' in namespace 'std'
std::cout << "Insufficient number of words to resize in X" << std::endl;

../include\imgproc/xf_resize_nn_bilinear.hpp:75:71: error: no member named 'endl' in namespace 'std'
std::cout << "Insufficient number of words to resize in X" << std::endl;
                                                              ~~~~~^
In file included from xf_resize_accel.cpp:1:
In file included from xf_resize_accel.cpp:30:
In file included from ./xf_resize_config.h:37:
In file included from ../include\imgproc/xf_resize.hpp:34:
In file included from ../include\imgproc/xf_resize_headers.h:45:
../include\imgproc/xf_resize_up_nn.hpp:215:9: error: no member named 'cout' in namespace 'std'
std::cout << "Error: not matching" <<std::endl;
~~~~~^
../include\imgproc/xf_resize_up_nn.hpp:215:46: error: no member named 'endl' in namespace 'std'
std::cout << "Error: not matching" <<std::endl;
                                     ~~~~~^
In file included from xf_resize_accel.cpp:1:
In file included from xf_resize_accel.cpp:30:
In file included from ./xf_resize_config.h:34:
In file included from C:/Xilinx/Vivado/2018.3/common/technology/autopilot\ap_int.h:349:
In file included from C:/Xilinx/Vivado/2018.3/common/technology/autopilot\ap_fixed.h:55:
C:/Xilinx/Vivado/2018.3/common/technology/autopilot\ap_fixed_base.h:837:13: warning: shift count is negative [-Wshift-count-negative]
   ret.V <<= (_AP_I - _AP_W);
         ^   ~~~~~~~~~~~~~~~
C:/Xilinx/Vivado/2018.3/common/technology/autopilot\ap_int_base.h:361:18: note: in instantiation of member function 'ap_fixed_base<50, 21, true, 5, 3, 0>::to_ap_int_base' requested here
 Base::V = op.to_ap_int_base().V;
              ^
C:/Xilinx/Vivado/2018.3/common/technology/autopilot\ap_int.h:231:9: note: in instantiation of function template specialization 'ap_int_base<17, false>::ap_int_base<50, 21, true, 5, 3, 0>' requested here
   : Base((ap_fixed_base<_AP_W2, _AP_I2, true, _AP_Q2, _AP_O2, _AP_N2>)op) {}
     ^
../include\imgproc/xf_resize_nn_bilinear.hpp:170:17: note: in instantiation of function template specialization 'ap_uint<17>::ap_uint<50, 21, 5, 3, 0>' requested here
nextYScale = indexy_pre+scaley;
             ^
../include\imgproc/xf_resize_nn_bilinear.hpp:309:5: note: in instantiation of function template specialization 'computeInterpolation<1, 42, 20, 17, 32, 3, 12, 2, 1>' requested here
 computeInterpolation<INTERPOLATION_TYPE, COMP_INDEX_WIDTH, COMP_INDEX_INT, INDEX_INT, SCALE_WIDTH, SCALE_INT, WEIGHT_WIDTH, WEIGHT_INT, NPPC>(imgInput.rows, imgInput.cols, j<<(xfNPixelsPerCycle<NPPC>::datashift), output_rows_count, scalex, scaleXParallel, scaley, indexx, indexy, nextYScale, WeightX, WeightY, indexx_pre_comp, indexy_pre_comp);
 ^
../include\imgproc/xf_resize.hpp:125:3: note: in instantiation of function template specialization 'resizeNNBilinear<9, 360, 640, 1, 360, 640, 1, 2>' requested here
resizeNNBilinear<TYPE, SRC_ROWS, SRC_COLS, NPC, DST_ROWS, DST_COLS, INTERPOLATION_TYPE, MAX_DOWN_SCALE>(_src,_dst);
^
xf_resize_accel.cpp:81:2: note: in instantiation of function template specialization 'xf::resize<1, 9, 360, 640, 360, 640, 1, 2>' requested here
xf::resize <1, XF_8UC3, 360, 640, 360, 640, XF_NPPC1, 2> (_src, _dst);
^
In file included from xf_resize_accel.cpp:1:
In file included from xf_resize_accel.cpp:30:
In file included from ./xf_resize_config.h:34:
In file included from C:/Xilinx/Vivado/2018.3/common/technology/autopilot\ap_int.h:349:
In file included from C:/Xilinx/Vivado/2018.3/common/technology/autopilot\ap_fixed.h:55:
C:/Xilinx/Vivado/2018.3/common/technology/autopilot\ap_fixed_base.h:837:13: warning: shift count is negative [-Wshift-count-negative]
   ret.V <<= (_AP_I - _AP_W);
         ^   ~~~~~~~~~~~~~~~
C:/Xilinx/Vivado/2018.3/common/technology/autopilot\ap_int_base.h:361:18: note: in instantiation of member function 'ap_fixed_base<42, 20, true, 5, 3, 0>::to_ap_int_base' requested here
 Base::V = op.to_ap_int_base().V;
              ^
C:/Xilinx/Vivado/2018.3/common/technology/autopilot\ap_int.h:231:9: note: in instantiation of function template specialization 'ap_int_base<17, false>::ap_int_base<42, 20, true, 5, 3, 0>' requested here
   : Base((ap_fixed_base<_AP_W2, _AP_I2, true, _AP_Q2, _AP_O2, _AP_N2>)op) {}
     ^
../include\imgproc/xf_resize_nn_bilinear.hpp:171:13: note: in instantiation of function template specialization 'ap_uint<17>::ap_uint<42, 20, 5, 3, 0>' requested here
indexy = (ap_uint<INDEX_INT>)indexy_pre;
         ^
../include\imgproc/xf_resize_nn_bilinear.hpp:309:5: note: in instantiation of function template specialization 'computeInterpolation<1, 42, 20, 17, 32, 3, 12, 2, 1>' requested here
 computeInterpolation<INTERPOLATION_TYPE, COMP_INDEX_WIDTH, COMP_INDEX_INT, INDEX_INT, SCALE_WIDTH, SCALE_INT, WEIGHT_WIDTH, WEIGHT_INT, NPPC>(imgInput.rows, imgInput.cols, j<<(xfNPixelsPerCycle<NPPC>::datashift), output_rows_count, scalex, scaleXParallel, scaley, indexx, indexy, nextYScale, WeightX, WeightY, indexx_pre_comp, indexy_pre_comp);
 ^
../include\imgproc/xf_resize.hpp:125:3: note: in instantiation of function template specialization 'resizeNNBilinear<9, 360, 640, 1, 360, 640, 1, 2>' requested here
resizeNNBilinear<TYPE, SRC_ROWS, SRC_COLS, NPC, DST_ROWS, DST_COLS, INTERPOLATION_TYPE, MAX_DOWN_SCALE>(_src,_dst);
^
xf_resize_accel.cpp:81:2: note: in instantiation of function template specialization 'xf::resize<1, 9, 360, 640, 360, 640, 1, 2>' requested here
xf::resize <1, XF_8UC3, 360, 640, 360, 640, XF_NPPC1, 2> (_src, _dst);
^
In file included from xf_resize_accel.cpp:1:
In file included from xf_resize_accel.cpp:30:
In file included from ./xf_resize_config.h:34:
In file included from C:/Xilinx/Vivado/2018.3/common/technology/autopilot\ap_int.h:349:
In file included from C:/Xilinx/Vivado/2018.3/common/technology/autopilot\ap_fixed.h:55:
C:/Xilinx/Vivado/2018.3/common/technology/autopilot\ap_fixed_base.h:837:13: warning: shift count is negative [-Wshift-count-negative]
   ret.V <<= (_AP_I - _AP_W);
         ^   ~~~~~~~~~~~~~~~
C:/Xilinx/Vivado/2018.3/common/technology/autopilot\ap_int_base.h:361:18: note: in instantiation of member function 'ap_fixed_base<43, 21, true, 5, 3, 0>::to_ap_int_base' requested here
 Base::V = op.to_ap_int_base().V;
              ^
C:/Xilinx/Vivado/2018.3/common/technology/autopilot\ap_int.h:231:9: note: in instantiation of function template specialization 'ap_int_base<17, false>::ap_int_base<43, 21, true, 5, 3, 0>' requested here
   : Base((ap_fixed_base<_AP_W2, _AP_I2, true, _AP_Q2, _AP_O2, _AP_N2>)op) {}
     ^
../include\imgproc/xf_resize_nn_bilinear.hpp:176:17: note: in instantiation of function template specialization 'ap_uint<17>::ap_uint<43, 21, 5, 3, 0>' requested here
nextYScale = indexy_pre+(ap_fixed<COMP_INDEX_WIDTH,COMP_INDEX_INT>)scaley;
             ^
../include\imgproc/xf_resize_nn_bilinear.hpp:309:5: note: in instantiation of function template specialization 'computeInterpolation<1, 42, 20, 17, 32, 3, 12, 2, 1>' requested here
 computeInterpolation<INTERPOLATION_TYPE, COMP_INDEX_WIDTH, COMP_INDEX_INT, INDEX_INT, SCALE_WIDTH, SCALE_INT, WEIGHT_WIDTH, WEIGHT_INT, NPPC>(imgInput.rows, imgInput.cols, j<<(xfNPixelsPerCycle<NPPC>::datashift), output_rows_count, scalex, scaleXParallel, scaley, indexx, indexy, nextYScale, WeightX, WeightY, indexx_pre_comp, indexy_pre_comp);
 ^
../include\imgproc/xf_resize.hpp:125:3: note: in instantiation of function template specialization 'resizeNNBilinear<9, 360, 640, 1, 360, 640, 1, 2>' requested here
resizeNNBilinear<TYPE, SRC_ROWS, SRC_COLS, NPC, DST_ROWS, DST_COLS, INTERPOLATION_TYPE, MAX_DOWN_SCALE>(_src,_dst);
^
xf_resize_accel.cpp:81:2: note: in instantiation of function template specialization 'xf::resize<1, 9, 360, 640, 360, 640, 1, 2>' requested here
xf::resize <1, XF_8UC3, 360, 640, 360, 640, XF_NPPC1, 2> (_src, _dst);
^
In file included from xf_resize_accel.cpp:1:
In file included from xf_resize_accel.cpp:30:
In file included from ./xf_resize_config.h:34:
In file included from C:/Xilinx/Vivado/2018.3/common/technology/autopilot\ap_int.h:349:
In file included from C:/Xilinx/Vivado/2018.3/common/technology/autopilot\ap_fixed.h:55:
C:/Xilinx/Vivado/2018.3/common/technology/autopilot\ap_fixed_base.h:837:13: warning: shift count is negative [-Wshift-count-negative]
   ret.V <<= (_AP_I - _AP_W);
         ^   ~~~~~~~~~~~~~~~
C:/Xilinx/Vivado/2018.3/common/technology/autopilot\ap_int_base.h:361:18: note: in instantiation of member function 'ap_fixed_base<32, 22, true, 5, 3, 0>::to_ap_int_base' requested here
 Base::V = op.to_ap_int_base().V;
              ^
C:/Xilinx/Vivado/2018.3/common/technology/autopilot\ap_int.h:231:9: note: in instantiation of function template specialization 'ap_int_base<8, false>::ap_int_base<32, 22, true, 5, 3, 0>' requested here
   : Base((ap_fixed_base<_AP_W2, _AP_I2, true, _AP_Q2, _AP_O2, _AP_N2>)op) {}
     ^
../include\imgproc/xf_resize_nn_bilinear.hpp:64:12: note: in instantiation of function template specialization 'ap_uint<8>::ap_uint<32, 22, 5, 3, 0>' requested here
pixel = (typename DataType<DEPTH,NPPC>::cname)((ap_fixed<32,22>)(P1 + P2 + P3 + P4));
        ^
../include\imgproc/xf_resize_nn_bilinear.hpp:112:5: note: in instantiation of function template specialization 'interpolatePixel<9, 1, 1>' requested here
 interpolatePixel<DEPTH, INTERPOLATION_TYPE, NPPC>(unpackX1temp[indexx[i]-initIndex], unpackX2temp[indexx[i]-initIndex], unpackX1temp[indexx[i]-initIndex+1], unpackX2temp[indexx[i]-initIndex+1], Wx[i], Wy, currentoutput);
 ^
../include\imgproc/xf_resize_nn_bilinear.hpp:407:7: note: in instantiation of function template specialization 'computeOutputPixel<9, 1, 1, 17, 2>' requested here
   computeOutputPixel<SRC_TYPE,INTERPOLATION_TYPE,NPPC,INDEX_INT,BUFFER_WORDS>(P0Buf,P1Buf,((indexx[0]>>xfNPixelsPerCycle<NPPC>::datashift)<<xfNPixelsPerCycle<NPPC>::datashift),indexx,WeightX,WeightY,temp_store_output);
   ^
../include\imgproc/xf_resize.hpp:125:3: note: in instantiation of function template specialization 'resizeNNBilinear<9, 360, 640, 1, 360, 640, 1, 2>' requested here
resizeNNBilinear<TYPE, SRC_ROWS, SRC_COLS, NPC, DST_ROWS, DST_COLS, INTERPOLATION_TYPE, MAX_DOWN_SCALE>(_src,_dst);
^
xf_resize_accel.cpp:81:2: note: in instantiation of function template specialization 'xf::resize<1, 9, 360, 640, 360, 640, 1, 2>' requested here
xf::resize <1, XF_8UC3, 360, 640, 360, 640, XF_NPPC1, 2> (_src, _dst);
^
4 warnings and 5 errors generated.
Failed during preprocessing.
 while executing
"source C:/PYNQ-HelloWorld-master/boards/ip/hls/resize/hls_proj/solution1/csynth.tcl"
 invoked from within
"hls::main C:/PYNQ-HelloWorld-master/boards/ip/hls/resize/hls_proj/solution1/csynth.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 synthesis.
``

@yunqu
Copy link

yunqu commented Mar 4, 2019

It doesn't look like you are using that pull request?

@Q-point
Copy link
Author

Q-point commented Mar 5, 2019

OK, i got it working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants