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

조회 수: 1 (최근 30일)
Vishal Deep
Vishal Deep 2016년 6월 18일
댓글: Vishal Deep 2016년 6월 21일
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)

댓글을 달려면 로그인하십시오.

Community Treasure Hunt

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

Start Hunting!

Translated by