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

1 view (last 30 days)
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

Answers (1)

Tim McBrayer
Tim McBrayer on 20 Jun 2016
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 Comment
Vishal Deep
Vishal Deep on 21 Jun 2016
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)

Sign in to comment.

Categories

Find more on Code Generation in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!