Simulink Embedded Coder Code generation takes too long depending on block inputs
3 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
Mark McBroom
2023 年 3 月 25 日
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 ).
回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!