Hi,
As per my understanding, to optimize the large "ARID_DEF" struct by splitting it into smaller sub-structs, you can use the following as a possible workaround:
- Use Simulink Data Dictionary (SLDD) to Segment Variables: In the Simulink Data Dictionary, group related variables into smaller "Simulink.Bus" objects. Assign the "Simulink.Bus" objects to subsystems/functions within the model.
- Custom Storage Classes: Define custom storage classes for the variables using Embedded Coder. Group variables by assigning them to specific "Simulink.Signal" or "Simulink.Parameter" objects with unique storage classes.
- Manual Splitting in the Generated Code: Post-process the generated code to reorganize the "ARID_DEF" struct into smaller structs. Use "coder.cstructname" to control how specific variables appear in the struct.
- Subsystem Partitioning: Partition your Simulink model into smaller subsystems that encapsulate related variables. The generated code will create structs local to each subsystem, splitting the large "ARID_DEF" struct.
Please refer to the following MathWorks Documentation for "coder.cstructname" for better understanding:
Hope this helps!