- Turn on this configuration parameter in your SLX model: https://www.mathworks.com/help/ecoder/ref/generateseparateinternaldataperentrypointfunction.html
- Use a mult-instance storage class for the data and have the "CodeInterfacePackaging" configuration parameter set to "nonreusable" from the top-level model. This can change the data be a global variable instead of a struct in the generated code.
Why is there a large array allocated in the design work struct during AUTOSAR code generation with an MPC Interior Point Solver in R2024a?
조회 수: 6 (최근 30일)
이전 댓글 표시
MathWorks Support Team
2025년 3월 4일
답변: MathWorks Support Team
2025년 3월 4일
I am generating code from an R2024a AUTOSAR model where I am using MathWorks dense MPC interior point solver with N horizons on my engine control module (ECM). The generated code for the AUTOSAR component creates a single large array that stores a number of intermediary solver variables, as well as solver output, in the generated design work struct. This results in a required contiguous memory block > 380KB for N horizons, which is too large for my ECM.
Is there an optimization or customizations to the SLX or TLC that will results in generated code with this design work array broken up into the sub-arrays as global variables?
채택된 답변
MathWorks Support Team
2025년 3월 4일
Please try the following to mitigate this behavior:
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Linear Plant Specification에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!