Main Content

Update AUTOSAR Software Component

After you create a Simulink® model that represents an AUTOSAR software component, composition, or architecture, the ARXML description of the component or composition can change independently. Using arxml.importer function updateModel, you can import the modified ARXML description and update the model to reflect the changes. The update generates an HTML report that details automatic updates applied to the model, and additional manual changes that you must perform.

Update Model with AUTOSAR Software Component Changes

To update a model with AUTOSAR software component changes described in ARXML files:

  1. Open a model for which you previously imported or exported ARXML files. This example uses the example ARXML file ThrottlePositionControlComposition.arxml to create a Controller model.

    openExample('autosarblockset/ImportAUTOSARComponentToSimulinkExample',...
    'supportingfile','ThrottlePositionControlComposition.arxml');
    % Create and open AUTOSAR controller component model
    ar = arxml.importer('ThrottlePositionControlComposition.arxml');
    createComponentAsModel(ar,'/Company/Components/Controller',...
      'ModelPeriodicRunnablesAs','AtomicSubsystem');
  2. Issue MATLAB® commands to import ARXML descriptions into the model and update the model with changes.

    Note

    The imported ARXML descriptions must contain the AUTOSAR software component mapped by the model.

    For example, the following commands update the Controller model with changes from ARXML file ThrottlePositionControlComposition_updated.arxml.

    openExample('autosarblockset/ImportAUTOSARComponentToSimulinkExample',...
    'supportingfile','ThrottlePositionControlComposition_updated.arxml');
    % Update AUTOSAR controller component model
    ar2 = arxml.importer('ThrottlePositionControlComposition_updated.arxml');
    updateModel(ar2,'Controller');
    ### Updating model Controller
    ### Saving original model as Controller_backup.slx
    ### Creating HTML report Controller_update_report.html

    The AUTOSAR Update Report opens.

  3. Examine the report.

    1. Verify that the ARXML importer has updated the model content and configuration based on the ARXML changes.

    2. Optionally, click compare models to compare the original model with the updated model. Tabular and graphical views of the differences open. You can click a changed element in the tabular view to navigate to a graphical view of the change.

    3. Optionally, use the Find field to search for a term. You can quickly navigate to specific elements or other strings of interest.

  4. If the report lists required manual model changes, such as deleting a Simulink block, perform the required changes.

    If you make a required change to the model, further configuration could be required to pass validation. To see if more manual model changes are required, repeat the update procedure, rerunning the updateModel function with the same ARXML files.

For live-script update examples, see Import AUTOSAR Component to Simulink and Import AUTOSAR Composition to Simulink.

Update AUTOSAR Classic Architecture Model from ARXML

To update an existing AUTOSAR architecture configured for the Classic Platform from ARXML files:

  1. From the Modeling tab in the Component section, select Update from ARXML.

    Update from ARXML button.

    The AUTOSAR Updater App opens.

  2. Select the ARXML file to update the model, composition, or architecture. Click Next.

    AUTOSAR Updated App with ARXML file selected.

    Note

    The imported ARXML descriptions must contain the AUTOSAR software component mapped by the model.

  3. On the Update Composition tab, optionally configure modeling options by enabling the checkbox. Click Finish.

    Select update options tab of AUTOSAR Updated App.

    The AUTOSAR Update Report opens.

  4. Examine the report.

    1. Verify that the ARXML importer updated the model content and configuration based on the ARXML changes.

    2. Optionally, click compare models to compare the original model with the updated model. Tabular and graphical views of the differences open. You can click a changed element in the tabular view to navigate to a graphical view of the change.

    3. Optionally, use the Find field to search for a term. You can quickly navigate to specific elements or other strings of interest.

  5. If the report lists required manual model changes, such as deleting a Simulink block, perform the required changes.

    If you make a required change to the model, further configuration could be required to pass validation. To see if more manual model changes are required, repeat the update procedure, rerunning the updateModel function with the same ARXML files.

You can also update the architecture programmatically:

arModel = autosar.arch.loadModel("ControllerArchitecture");
impObj = arxml.importer("ControllerArchitecture.arxml");
updateModel(impObj, arModel);
For more information see the updateModel function.

AUTOSAR Update Report Section Examples

An ARXML update operation generates an AUTOSAR Update Report in HTML format. The report displays change information in sections:

Automatic Model Changes

The AUTOSAR Update Report section Automatic Model Changes lists Simulink block additions, block property updates, and model parameter updates made by the importer. For example:

In the updated model, green highlighting identifies added blocks.

Automatic Workspace Changes

The AUTOSAR Update Report section Automatic Workspace Changes lists Simulink data object additions and property updates made by the importer. For example:

Required Manual Model Changes

The AUTOSAR Update Report section Required Manual Model Changes lists model changes, such as block deletions, that are required. For example:

In the updated model, red highlighting identifies the block to delete.

Automatic AUTOSAR Element Changes

The AUTOSAR Update Report section Automatic AUTOSAR Element Changes lists AUTOSAR element additions and property updates made by the importer. For example:

Referenced AUTOSAR Software Components

The AUTOSAR Update Report section Referenced AUTOSAR Software Components has a subsection Updated Components which lists the references components that were updated as a result of updating the top-level architecture model. Selecting the model name of the listed referenced components will open the AUTOSAR Update Report for the referenced model.

Referenced AUTOSAR Software Components with Updated Components section.

See Also

Related Examples

More About