How can I handle variable matrix size error in HDL code generation?

1 次查看(过去 30 天)
I am working on a image processing algorithm. I want to convert that into Verilog HDL through MATLAB HDL coder. But the error I am facing while converting is Error '' : Error: variable-size matrix type is not supported for HDL code generation. I also tried to define the size of the variable beforehand using zeros(); but this is also not working. Please help me to get over this issue.
function img_or = Intra_Order(image_wide, image_high, org)
img_or = zeros(1,1966080);
img_or = uint8(img_or);
org = reshape(org,[1080,1920]);
img = reshape(org',[1,1920*1080]);
write_addr = 1;
%file_size = image_wide * image_high;
% Order input frame
for i=0:(image_high/64 - 1)
for j = 0:(image_wide/64 - 1)
for k = 0:63
read_addr = j*64 + i*image_wide*64 + image_wide*k + 1;
img_or(write_addr:write_addr+63) = img(read_addr:read_addr+63);
write_addr = write_addr + 64;
end
end
end

回答(1 个)

Tim McBrayer
Tim McBrayer 2016-6-20
You are using image_wide and image_high to determine your loop limits, which are input variables. You will at least have an issue with your loops being reported as unbounded. You are aiming for hardware; everything needs to have a size.
  1 个评论
Vishal Deep
Vishal Deep 2016-6-21
I changed image_wide and image_high to 1920 and 1080 respectively. But still the same error. The error is in this line or in the variable img_or
img_or(write_addr:write_addr+63) = img(read_addr:read_addr+63)

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Image Processing Toolbox 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by