Rte_Type.h in model reference

29 views (last 30 days)
Melih
Melih on 1 Dec 2023
Edited: Simon on 21 May 2024
I have a autosar classic component that has a model reference is using datatypes defined in the component. Code generation is successfull but, I can not get the metrics report.
Error messages as follows
In component code generation report, section static code metrics: (3 Lines error)
component.h line 65 identifier "XYZ" is undefined, XYZ is a enum class
component.c line 32 identifier "ABC" is undefined, ABC is a enum value
model reference.h Line 34 expected a declaration
In model reference code generation report, section static code metrics: (1 Line error)
model reference.h Line 26 cannot open source file "Rte_Type.h"

Answers (1)

Venkat Siddarth Reddy
Venkat Siddarth Reddy on 14 Dec 2023
Hi @Melih,
I understand that you are trying to generate metrics report for an AUTOSAR classic component with a model reference which uses datatypes defined in it.
From the context provided and the error message,it seems that the generated code includes a header file that is not generated by the model hierachy or there are few external dependencies for the header file.
In this case, you wont be able to generate the metrics report.
This is a limitation, please refer to the below documentation:
The workaround is to copy the missing file(i.e Rte_Type.h) to the working or build folder of the model,and you should be able to generate the metrics report.
I hope this resolves your query,
Regards
Venkat Siddarth V.
  2 Comments
Melih
Melih on 7 Feb 2024
Hi Venkat Siddarth,
I provided generated Rte_Type.h and tried once more and now the referenced model can also use same Rte_Type.h.
Now issue is that, in my component I am using Application Data Types (as in autosar context, also inport and outports in the model also using this datatype) in the models (let say, datatype1), however I checked the code, it only includes Implementation Data Type (as in autosar context, this is never used in the port definitions) in the code (let say datatype2); however code generation of the same definition (datatype1) in the reference model result in different datatype usage.
So in short (not really :)),
I am using datatype1 for to define a port in an Autosar component, also same datatype1 in referenced model.
Generated code is using datatype1 in Autosar component code, while datatype2 in reference model code.
In Rte_Type.h only has datatype1. Datatype2 is not defined, although both typetype1 and typedef2 have header file definition of "Rte_Type.h"
datatype1 and datatype2 are Application and Implementation Data Type definitions, basically exactly same in terms of NumericType.
I want to generate all typedef definitions which are used in the model in Rte_Type.h. But, seems that some types are missed and skipped for some reason.
Cheers, Melih
Simon
Simon on 21 May 2024
Edited: Simon on 21 May 2024
I have the same issue, that some bus data types are missed/skipped during the code generation and therefore we can not integrate any SWC which uses referenced models. Even more critical it is when we want to integrate a protected model, here we do not know which data types are used inside the protected model.
Is there any model settings for Code Generation which needs to be set so that all data type definitoins in referenced models are also generated during the build process?
Matlab Version that I am using: R2024a Update 3
Best regards,
Simon

Sign in to comment.

Categories

Find more on AUTOSAR Blockset in Help Center and File Exchange

Products


Release

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!