- 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.
- 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.
Error Found unsupported dynamic matrix type at output port: 0, name 'centroid_x', in the file/function manual_fixpt.
8 次查看(过去 30 天)
显示 更早的评论
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.)
0 个评论
回答(1 个)
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:
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
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!