- 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 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
MathWorks Support Team
el 4 de Mzo. de 2025
Respondida: MathWorks Support Team
el 4 de Mzo. de 2025
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?
Respuesta aceptada
MathWorks Support Team
el 4 de Mzo. de 2025
Please try the following to mitigate this behavior:
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Linear Plant Specification en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!