Simulink Embedded Coder Code generation takes too long depending on block inputs

3 visualizaciones (últimos 30 días)
Hi! I have a model that uses nearly all basic functions in simulink library, including stateflows memories etc. and thousands of parameters in sldd form. When i try to generate code for a subsystem in my model (either by ctrl+b or rtwbuild (I think they do same thing)), code generation takes several hours to complete. But if I isolate that subsystem in a new slx file with exact same model configuration settings, include .sldd's, give constant (inf sample rate) inputs and terminate outputs, code generation can be achieved in 3 minutes and the functioning of that block seems to be fine to me. What can I do in my big slx file to generate code of this block in 3 minutes aswell?
  1 comentario
Mark McBroom
Mark McBroom el 25 de Mzo. de 2023
You could try running the Performance Advisor to help locate the bottleneck. https://www.mathworks.com/help/simulink/ug/consult-the-performance-advisor.html
If your model is very large, you could also convert the larger subsystems to model references. MOdel references allow Simulink to incrementally update and generate code for each sub-model rather than trying to generate code for the entire large model at one time. An added benefit of using referenced models is that if you have a multicore computer, Simulink can generate code for child models in parallel on each of the cores ( requires Parallel Computing Toolbox ).

Iniciar sesión para comentar.

Respuestas (0)

Productos


Versión

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by