How to solve "For MATLAB Function block generation, structure inputs to the top-level design function are not supported"

1 次查看(过去 30 天)
Hello, I come across a problem during using vision HDL coder. I coded as pixel-based processing, and try to stream the image frames. However, as for the control output, I just simply make it equal to ctrlIn. Below is my code, which differentiates the successive two frames:
function [pixOut,ctrlOut] = frame_difference(pixIn,ctrlIn,pixel_index)
persistent frame_buffer;
if isempty(frame_buffer)
frame_buffer = zeros(307200,1);
end
last_time_value = frame_buffer(pixel_index);
frame_buffer(pixel_index) = pixIn;
difference = abs(pixIn - last_time_value);
if (difference > 12)
pixvalue = 255;
else
pixvalue = 0;
end
pixOut = pixvalue;
ctrlOut = ctrlIn;
And the testbench is the same as example. However, when I tried to convert the block to verilog, I encountered the error: For MATLAB Function block generation, structure inputs to the top-level design function are not supported. Actually, in the document (https://www.mathworks.com/help/hdlcoder/ug/variables-and-constants.html), the structures are said to be supported (I am not using Turnkey or IP generation ).
How can I solve this problem? Can I just simply omit the control signal for both input and output? Thanks very much!
  4 个评论

请先登录,再进行评论。

回答(1 个)

Walter Roberson
Walter Roberson 2016-11-22
This is not something that I have experience with, but the two questions that come to mind are:
  • is it necessary to embed this in a subsystem and generate for the subsystem?
  • can a structure cross the HDL boundary, or does it need to be serialized or broken out into distinct pins? There are constructs that can be used inside the HDL but which cannot cross the boundaries intact.

Community Treasure Hunt

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

Start Hunting!

Translated by