[Fixed-point converter] Passing constant struct to entry point
Afficher commentaires plus anciens
I have passed a constant struct to the input of MATLAB HDL Coder.Lets say param.a = 'red'
In the code, it is responsible for choosing a certain code path:
if param.a == 'red'
% do HDL Coder supported stuff
else
% do only MATLAB supported stuff
linspace(foo);
% etc. etc.
end
However the fixed-point converter still wants me to define a replacement function for linspace, even if it is not in the active code path. Somehow it does not understand, that param is constant.
As this thread suggests, I tried defining param as coder.Constant input, which did not help and I also used a System Object to wrap the code and put param in the nontunable properties
properties (Nontunable)
param
end
,to explicitly tell the fixed-point converter that param is constant, which is replied by
Property 'param' of class 'ExampleClass' is a structure type. Classes with structure properties are not supported.
Is there any possibility to let also the fixed-point converter know, that param is indeed compile time constant?
Réponse acceptée
Plus de réponses (1)
Kiran Kintali
le 19 Mar 2020
0 votes
please share dut.m and dut_tb.m with the sample code and data types. if you have project or input types to compile the code it would be benificial to debug the fixed-point issue. Thanks
Catégories
En savoir plus sur Test and Debug dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


