[Fixed-point converter] Passing constant struct to entry point
Mostrar comentarios más antiguos
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?
Respuesta aceptada
Más respuestas (1)
Kiran Kintali
el 19 de Mzo. de 2020
0 votos
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
Categorías
Más información sobre Test and Debug en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


