Error Found unsupported dynamic matrix type at output port: 0, name 'centroid_x', in the file/function manual_fixpt.

8 ビュー (過去 30 日間)
niranjan
niranjan 2024 年 8 月 13 日
回答済み: Gyan Vaibhav 2024 年 8 月 13 日
i am trying to convert the matlab code to hdl version using HDL coder but i am receiving this error...could anyone help me to solve this error?
i am giving the 1d array input through text file
(ERROR : Found unsupported dynamic matrix type at output port: 0, name 'centroid_x', in the file/function manual_fixpt.)

回答 (1 件)

Gyan Vaibhav
Gyan Vaibhav 2024 年 8 月 13 日
Hi Niranjan,
You are getting the error because the function that you provided has a variable-sized array; the "centroid_x" arrays in the code are inferred as dimensions :120960x1 (up to 120960-element vectors).
One quick way to tell the inferred matrix sizes is to do:
codegen('manual', '-args', { ... }, '-config:lib', '-report')
...and look at the output codegen report. It's easy to examine the variable sizes that way.
Since, this particular algorithm does only element-wise calculations, you can modify it in order to make the variables non-varsize.
You can do this in two ways:
  1. Modify the code to return an array of a constant size, and also return the number of valid array elements, say N. You can return a constant-size array of 120960 elements of which the first N were valid outputs. The trailing elements (N+1..120960) can be discarded. The disadvantage of this case is that it consumes a lot of IO; in a realistic example, you may not have enough room on the FPGA to return 120960 elements all the time.
  2. Modify the code to return one element value at a time, and continue calling it in a loop until all outputs have been received. This code should use less resources (and many fewer IO pins), but requires more changes at the interface, so it may not be suitable.
Additionally, I think you are missing a break, statement in the
if idx > numValidEntries
% Exit the loop if there are no more valid entries
break;
end
Hope this helps.
Thanks,
Gyan

タグ

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by