6.2.5.14. Architecture-ARXMLImport¶
Instantiate and import an AUTOSAR classic ECU extract of System Description into an RFG
Required inputs: RFG
Analyzes the composition of Software Components and extracts communication links between them. The ARXML files to be provided shall contain an ECU extract of system description.
Important parts are:
- A System element specifying the Root-SW-Composition to be instantiated
- Software Component Types including internal behavior for all Software Component Types required for the full instantiation
- The SW-Connectors specifying communication in the hierarchical model
The import script is designed to accept all ARXML files. It is a valid approach to simply import all ARXML files of the project. However, one of these problems might be encountered:
- If more than one AUTOSAR-System node is contained, then all encountered AUTOSAR-System nodes will be instantiated, possibly resulting in duplicated SWCs.
- errors can be caused by name collisions in the name space of AUTOSAR packages. In this case, the rule emits error messages.
In the native system, communication is realized via the generated RTE code. In the RFG, the communication links are modeled based on the AUTOSAR XML model and without detailed analysis of the RTE code. The advantage is that the communication links in RFG are precise - while an analysis of RTE code may introduce false positive communication links.
The ARXML files are specified via the parameters arxml_files.
The following views are created in the RFG:
ARXMLContains all generated Software Components in hierarchical structure. Each software component contains Ports and Runnables. Use-Edges of different kinds are created from Runnables to the ports they are configured to use. The Ports of different SWCs are connected with edges of a subtype of Communication (for S/R communication) or Call (for C/S communication), if the corresponding ports are connected in the AUTOSAR model. (see parameter ar_view_name)ARXML_MappingProvides the mapping of viewCode Factsto viewARXML. The source nodes of theMaps_Toedges represent functions implementing a runnable or macros or functions implementing the RTE API. (see parameter mapping_view_name).Code FactsProvides the transitive closure of RTE communication. Each edge starts at a macro invocation or a function call to the RTE API (e.g.Rte_Write/Rte_Call. The target of the edge represents a C function which is invoked as a server runnable or a macro or C function representing the RTE API responsible for reception of the communication, e.g.Rte_Read(see parameter communication_view_name)
These RTE functions/macros are supported by the importer so that a mapping will be created for them in the View ARXML_Mapping:
Rte_IWriteRte_IReadRte_WriteRte_DReadRte_ReadRte_CallRte_Prm- additionally, runnable entities will be mapped to the implementing
Routinenodes.
Possible Messages
This rule has no predefined messages.
Options¶
This rule shares the following common options: exclude_messages_in_system_headers, excludes, includes, justification_checker, post_processing, provider, severity
The following places define options that affect this rule: Analysis-GlobalOptions
ar_system_categories¶
ar_system_categories : set[str] = {'ECU_EXTRACT', 'SYSTEM_EXTRACT'}
ar_systems¶
ar_systems : set[str] = set()
ar_view_name¶
ar_view_name : str | None = 'ARXML'
None to not instantiate the model. This can reduce the time for import
for use-cases where only a low-level import configured via option
basic_model_import is required.
arxml_files¶
arxml_files : set[bauhaus.analysis.config.LayerRelativePath] = set()
arxml_glob¶
arxml_glob : set[bauhaus.analysis.config.FileGlobPattern] = set()
**/*.arxml to
select all files in any subdirectory of the base directory. See also option arxml_files.
arxml_glob_base_dir¶
arxml_glob_base_dir : bauhaus.analysis.config.LayerRelativePath = '.'
base_view_name¶
base_view_name : str | None = 'Code Facts'
Code Facts.
This option will have no effect if no mapping should be generated.
basic_model_import¶
Create the basic package structure exposed in ARXML in the RFG. This is an optional additional import step, mainly useful for debugging or customer extensions. It exposes the raw AUTOSAR entities in RFG. To enable this feature, set basic_model_import.import_xml_model to true.
basic_model_import.arxml_implementation_model_view_name : str =
Name of a new view to create the internal AUTOSAR model into.'ARXML_Structure'
basic_model_import.arxml_model_view_name : str =
Name of a new view to create the internal AUTOSAR model into.'Low_Level_ARXML'
basic_model_import.arxml_to_instance_mapping_view_name : str =
Name of a new view to provide a mapping from the the'ARXML_Instantiation'arxml_model_view_nameto the instantiated prototype-based model inar_view_name.
basic_model_import.import_implementation_low_level_model : bool =
In future versions this switch might disappear. If this is set, generate the internal low-level AUTOSAR model in RFG. This closely resembles a subset of the data stored in the imported project's ARXML files, but contains some interpretation and omits some of the ARXML code. Currently, this is the model from which the viewFalsear_view_nameis instantiated.
basic_model_import.import_xml_model : bool =
Generate low-level AUTOSAR model in RFG. This represents the data stored in the imported project's ARXML files.False
communication_view_name¶
communication_view_name : str | None = 'Code Facts'
Code Facts.This can be set to
None if no additional dependencies should be
generated. This option has the prerequisites that ar_view_name,
base_view_name and mapping_view_name are configured.
export_warnings¶
export_warnings : bool = True
loglevel¶
loglevel : LogLevel = 'WARNING'
mapping_view_name¶
mapping_view_name : str | None = 'ARXML_Mapping'
None, if no mapping of the ar_view_name
to source code is needed. This option has the prerequisites that a
ar_view_name and base_view_name are configured.
plugin_class¶
plugin_class : typing.Any = None
autosar4.abstract_plugin.
This is instantiated, and .parse() is called on the
plugin_files.
The plugin can add additional AUTOSAR Nodes and Edges to the model before
instantiation into RFG.
plugin_files¶
plugin_files : set[bauhaus.analysis.config.LayerRelativePath] = set()
rte_edges_between_ports¶
rte_edges_between_ports : bool = True
unused_macro_def_view_name¶
unused_macro_def_view_name : str | None = 'File'
Macro representing
definitions of macros, even if the macro is not instantiated. This can safely
be configured to the default 'File' view in a standard RFG. This view is
used to eliminate warnings if Rte-macros are not found in the case where the
definition exists, but is not referenced in application source code. Set this
to None to see warnings about unused API.
Option Types¶
These types are used by options listed above:
LogLevel¶
An enumeration.WARNING
INFO
DEBUG