Simulink start takes long time to compile
조회 수: 100 (최근 30일)
이전 댓글 표시
I have a simulink model, with a few reference models. When I 'Update' the model, it is so fast.. But when I 'Run' the model, compliation takes more than 5 minutes. As per compile stats, below states are taking high time.
Cstat23: 163.72 seconds -- Running model reference normal mode DFS
Cstat28: 85.35 seconds -- Check And Compile Model Reference Normal Modes
Cstat451: 29.99 seconds -- Model initialize conditions_self
Cstat460: 28.79 seconds -- ShutdownModel
Could someone please help me to sort out this problem.
댓글 수: 0
채택된 답변
Daniel
2023년 6월 20일
편집: Daniel
2023년 6월 20일
In general, setting reference models to Accelerator mode can be useful if they're making your model run slowly. This generates and compiles code for the referenced models so they run as native code rather than going through the Simulink interpreter. You'll probably reduce the time in the run stage by using model referencing. The time spent in checking and compiling will probably increase since it will now need to generate some kind of code and compile the model.
To try accelerator mode, select the reference model that's taking a large chunk of your simulation time, and you can either click on "Normal" in the ribbon and change it to "Accelerator", or you can right-click on the Model block, select Block Properties from the context menu, and set the simulation mode there.
댓글 수: 2
Daniel
2023년 6월 20일
It will be difficult to provide more targeted suggestions without being able to see the model, I'm afraid. One thing about accelerator mode that I forgot to mention yesterday: Once the compile is complete, it's cached, so you won't go through compile delays every time unless you're updating every model every time. I would still recommend turning on accelerator mode and timing the model twice. Let me know the results after both the first run (when it actually builds the model) and the second run (when it should be cached).
추가 답변 (1개)
Andy Bartlett
2023년 6월 21일
The Tool knows lots of great techniques to speed up models. And even better, the tool conducts experiments to see if specific techniques speed things up or not, and then keeps only the model changes that speed things up.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Event Functions에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!