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:

  • ARXML Contains 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_Mapping Provides the mapping of view Code Facts to view ARXML. The source nodes of the Maps_To edges represent functions implementing a runnable or macros or functions implementing the RTE API. (see parameter mapping_view_name).
  • Code Facts Provides 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_IWrite
  • Rte_IRead
  • Rte_Write
  • Rte_DRead
  • Rte_Read
  • Rte_Call
  • Rte_Prm
  • additionally, runnable entities will be mapped to the implementing Routine nodes.

Possible Messages

This rule has no predefined messages.

Options

ar_system_categories

ar_system_categories : set[str] = {'ECU_EXTRACT', 'SYSTEM_EXTRACT'}

Categories of System nodes to be considered for instantiation.
 

ar_systems

ar_systems : set[str] = set()

Set of Systems in the AUTOSAR model to be instantiated. May be empty to import all systems. Note that only Systems of the categories configured in ar_system_categories are considered.
 

ar_view_name

ar_view_name : str | None = 'ARXML'

Name of view to store imported AUTOSAR elements in. This can be set to 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 files to be imported. Provide at least one.
 

arxml_glob

arxml_glob : set[bauhaus.analysis.config.FileGlobPattern] = set()

Relative to directory configured in arxml_glob_base_dir or absolute globbing patterns for ARXML files to be imported. Use pattern **/*.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 = '.'

Directory containing all arxml files specified via relative glob patterns in option arxml_glob.
 

base_view_name

base_view_name : str | None = 'Code Facts'

Name of the base view. This is the source for the mapping generated in mapping_view_name. It is recommended to configure this to 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 = 'ARXML_Structure'

Name of a new view to create the internal AUTOSAR model into.
 

basic_model_import.arxml_model_view_name : str = 'Low_Level_ARXML'

Name of a new view to create the internal AUTOSAR model into.
 

basic_model_import.arxml_to_instance_mapping_view_name : str = 'ARXML_Instantiation'

Name of a new view to provide a mapping from the the arxml_model_view_name to the instantiated prototype-based model in ar_view_name.
 

basic_model_import.import_implementation_low_level_model : bool = False

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 view ar_view_name is instantiated.
 

basic_model_import.import_xml_model : bool = False

Generate low-level AUTOSAR model in RFG. This represents the data stored in the imported project's ARXML files.
 

communication_view_name

communication_view_name : str | None = 'Code Facts'

Name of the communication view from source artifacts to related source artifacts. Additional dependencies are created in this view. Typically it would be set to 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

Export output messages to the analysis database.
 

loglevel

loglevel : LogLevel = 'WARNING'

Logging mode. WARNING only outputs errors and warnings, INFO additionally prints info messages, DEBUG additionally outputs info and debug messages.
 

mapping_view_name

mapping_view_name : str | None = 'ARXML_Mapping'

Name of the mapping view of source artifacts onto model artifacts. This can be set to 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

Plugin python class (use class_name as argument), derived from 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()

Files to be analyzed by a plugin python class (plugin must be provided via Python configuration)
 

rte_edges_between_ports

rte_edges_between_ports : bool = True

Call and Communication edges are created to model RTE relations. If this is set to True, these edges are created at the direct representation of the ports (Macro or Routine generated by RTE generator). If this is False (default), the relations are inserted between runnables (Routine nodes) and thus should be located in application source code.
 

unused_macro_def_view_name

unused_macro_def_view_name : str | None = 'File'

Name of a view, which contains nodes of type 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