I was able to reproduce the issue on an example Simulink model. The structures generated were as follows:
For such cases, you can change the identifier configuration to get all the identifiers in the desired configuration.
Simulink allows you to specify the format in which the identifiers (variables) would be named in the generated code by going to Model Properties > Code Generation > Identifiers and setting the different types of identifiers.
For this issue, you can change the ‘Global Types’ identifier format to ‘$N$R$M_T’. The ‘$R’ token inserts ‘root model name’ into the identifier which, in this case, is desired. The ‘$N’ token was already being generated before as it corresponds to the name of the object for which the identifier is generated.‘$M’ handles the name-mangling to prevent naming conflicts.
For example, using the example model (called "testit") mentioned above and setting the format as above, the structure names changed as shown below.
Check out this documentation page for the different tokens that can be used in Identifier Format Control and their respective descriptions:
Hope this helps!