フィルターのクリア

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 件のコメント
Walter Roberson
Walter Roberson 2016 年 11 月 22 日
Which MATLAB release are you using?

サインインしてコメントする。

回答 (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