Main Content

Configure Lookup Tables for AUTOSAR Calibration and Measurement

In Simulink®, you can implement standard axis (STD_AXIS), common axis (COM_AXIS), and fix axis (FIX_AXIS) lookup tables for AUTOSAR applications. AUTOSAR applications can use lookup tables in either or both of two ways:

  • Implement fast search operations.

  • Support tuning of the application with calibration and measurement tools.

To model lookup tables for automotive application tuning, use the classes Simulink.LookupTable and Simulink.Breakpoint. By creating Simulink.LookupTable and Simulink.Breakpoint objects in the model workspace, you can store and share lookup table and breakpoint data and configure the data for AUTOSAR code generation.

Configure STD_AXIS Lookup Tables by Using Lookup Table Objects

This example shows how to create STD_AXIS lookup tables in Simulink, using Simulink.LookupTable objects, and configure the lookup tables for AUTOSAR code generation. The example uses the model mAutosarLutObjs.slx. To open the model file, enter this MATLAB® command:

openExample('mAutosarLutObjs');
  1. Model an AUTOSAR lookup table in a STD_AXIS configuration.

    1. In a mapped AUTOSAR software component model, add an AUTOSAR Blockset Curve or Map block. This example adds a Curve block.

    2. Open the Curve block and configure it to generate a routine from the AUTOSAR 4.0 code replacement library (CRL). As you modify block settings, the block dialog box updates the name of the targeted AUTOSAR routine.

      In the block dialog box, make these selections:

      • To generate a floating-point routine, select IFL (floating-point).

      • In the Table Specification tab, to specify table data using a lookup table object, set Data Specification to Lookup table object.

    3. In the model workspace, create a Simulink.LookupTable object and configure it to store the lookup table data.

      Advanced tab of Properties dialog box for Simulink.LookupTable object, L_4_single. Support tunable size is selected.

    4. In the Curve block dialog box, Table Specification tab, enter the Simulink.LookupTable object name in the Name field.

    5. In the block dialog box, Algorithm tab, set Integer Rounding Mode to Zero. Leave Interpolation Method set to Linear point-slope and Index Search Method set to Linear search.

    Table data appears in generated AUTOSAR C code as fields of a single structure. To control the characteristics of the structure type, such as its name, use the properties of the object.

  2. Connect the Curve or Map block.

    • Add AUTOSAR operating points to the lookup tables. Connect a root-level inport to the Curve or Map block. Alternatively, configure an input signal to the Curve or Map block with static global memory.

    • Connect an outport to the Curve or Map block.

  3. In the AUTOSAR code perspective, use the Code Mappings editor to map Simulink.LookupTable objects to AUTOSAR internal calibration parameters. In the Parameters tab, select each Simulink.LookupTable object that you created. Map each object to AUTOSAR parameter type ConstantMemory, SharedParameter, or Auto. To accept software mapping defaults, specify Auto.

    In this example, STD_AXIS lookup table object L_4_single is mapped to AUTOSAR ConstantMemory.

  4. For each parameter, if you select a parameter type other than Auto, click the icon to view or modify other code and calibration attributes. For more information on parameter properties, see Map Model Workspace Parameters to AUTOSAR Component Parameters.

  5. Configure the model to generate C code based on the AUTOSAR 4.0 library. Open the Configuration Parameters dialog box and select Code Generation > Interface. Set the Code replacement libraries parameter to AUTOSAR 4.0. For more information, see Code Generation with AUTOSAR Code Replacement Library.

  6. Build the model. The generated C code contains the expected Ifl and Ifx lookup function calls and Rte data access function calls. For example, you can search the HTML code generation report for the Ifl or Ifx routine prefix.

    The generated ARXML files contain data types of category CURVE (1-D lookup table data) and MAP (2-D lookup table data). For lookup table objects mapped to ConstantMemory parameters InstantiationDataDefProps are also included in the generated ARXML.

    <INSTANTIATION-DATA-DEF-PROPSS>
         <INSTANTIATION-DATA-DEF-PROPS>
             <PARAMETER-INSTANCE>
                 <LOCAL-PARAMETER-REF DEST="PARAMETER-DATA-PROTOTYPE">/pkg/swc/fromScratch/mLUTobjs/L_4_single</LOCAL-PARAMETER-REF>
             </PARAMETER-INSTANCE>
             <SW-DATA-DEF-PROPS>
                 ...
                 <SW-CALPRM-AXIS>
                    <SW-AXIS-INDEX>1</SW-AXIS-INDEX>
                    <SW-AXIS-INDIVIDUAL>
                        ...
                        <AUTOSAR-VARIABLE-IREF>
                            <PORT-PROTOTYPE-REF DEST="R-PORT-PROTOTYPE">/pkg/swc/fromScratch/In1</PORT-PROTOTYPE-REF>
                            <TARGET-DATA-PROTOTYPE-REF DEST="VARIABLE-DATA-PROTOTYPE">/pkg/if/In1/In1</TARGET-DATA-PROTOTYPE-REF>
                        </AUTOSAR-VARIABLE-IREF>
                        ...    
                     </SW-AXIS-INDIVIDUAL>
                 </SW-CALPRM-AXIS>
                  ...
              </SW-DATA-DEF-PROPS>
           </INSTANTIATION-DATA-DEF-PROPS>
    </INSTANTIATION-DATA-DEF-PROPSS>

    The data types have the data calibration properties that you configured.

Configure COM_AXIS Lookup Tables by Using Lookup Table and Breakpoint Objects

This example shows how to create COM_AXIS lookup tables in Simulink, using Simulink.LookupTable and Simulink.Breakpoint objects, and configure the lookup tables for AUTOSAR code generation. The example uses the model mAutosarLutObjs.slx. To open the model file, enter this MATLAB command:

openExample('mAutosarLutObjs')

In this example, to model an AUTOSAR lookup table in a COM_AXIS configuration, you pair AUTOSAR Blockset Prelookup blocks with Curve Using Prelookup or Map Using Prelookup blocks.

  1. Configure Prelookup blocks.

    1. In a mapped AUTOSAR software component model, add one or more AUTOSAR Blockset Prelookup blocks. This example adds one Prelookup block.

    2. Open each block and configure it to generate a routine from the AUTOSAR 4.0 code replacement library (CRL). As you modify block settings, the block updates the name of the targeted AUTOSAR routine.

      In the block dialog box, make these selections:

      • To generate a floating-point routine, select IFL (floating-point).

      • In the Table Specification tab, to specify breakpoint data using a breakpoint object, set Breakpoints specification to Breakpoint object.

    3. For each breakpoint vector, in the model workspace, create and configure a Simulink.Breakpoint object.

    4. In the Prelookup block dialog box, Table Specification tab, enter the Simulink.Breakpoint object name in the Name field. You can reduce memory consumption by sharing breakpoint data between lookup tables.

    5. In the block dialog box, Algorithm tab, set Integer Rounding Mode to Zero. Leave Index Search Method set to Linear search.

  2. Configure Curve Using Prelookup and Map Using Prelookup blocks.

    1. In the model, add one or more AUTOSAR Blockset Curve Using Prelookup or Map Using Prelookup blocks. Each block immediately follows a Prelookup block with which it is paired. This example adds one Curve Using Prelookup block.

    2. Open each Curve Using Prelookup or Map Using Prelookup block and configure it to generate a routine from the AUTOSAR 4.0 code replacement library (CRL). As you modify block settings, the block dialog box updates the name of the targeted AUTOSAR routine.

      In the block dialog box, make these selections:

      • To generate a floating-point routine, select IFL (floating-point).

      • In the Table Specification tab, to specify table data using a lookup table object, set Data Specification to Lookup table object.

    3. For each set of table data, in the model workspace, create and configure a Simulink.LookupTable object.

    4. In each Curve Using Prelookup or Map Using Prelookup block dialog box, Table Specification tab, enter a Simulink.LookupTable object name in the Name field.

    5. In the block dialog box, Algorithm tab, set Integer Rounding Mode to Zero. Leave Interpolation Method set to Linear point-slope.

    Each set of table data appears in the generated C code as a separate array variable. If the table size is tunable, each breakpoint vector appears as a structure. The structure contains a field to store the breakpoint data and, optionally, a field to store the length of the vector. The second field enables you to tune the effective size of the table. If the table size is not tunable, each breakpoint vector appears as an array.

  3. Connect the Prelookup, Curve Using Prelookup, and Map Using Prelookup blocks.

    • Add AUTOSAR operating points to the lookup tables. Connect root-level inports to the Prelookup blocks. Alternatively, configure input signals to the Prelookup blocks with static global memory.

    • Connect outports to the Curve Using Prelookup and Map Using Prelookup blocks.

    • Connect each Prelookup block to its matched Curve Using Prelookup or Map Using Prelookup block.

  4. In the AUTOSAR code perspective, use the Code Mappings editor to map Simulink.LookupTable and Simulink.Breakpoint objects to AUTOSAR internal calibration parameters. In the Parameters tab, select each Simulink.LookupTable and Simulink.Breakpoint object that you created. Map each object to AUTOSAR parameter type ConstantMemory, SharedParameter, or Auto. To accept software mapping defaults, specify Auto.

    In this example, COM_AXIS breakpoint object Bp_4_single and lookup table object Lcom_4_single are mapped to AUTOSAR SharedParameters. All instances of the AUTOSAR software component share the COM_AXIS parameters.

  5. For each parameter, if you select a parameter type other than Auto, click the icon to view or modify other code and calibration attributes. For more information on parameter properties, see Map Model Workspace Parameters to AUTOSAR Component Parameters.

  6. Configure the model to generate C code based on the AUTOSAR 4.0 library. Open the Configuration Parameters dialog box and select Code Generation > Interface. Set the Code replacement library parameter to AUTOSAR 4.0. For more information, see Code Generation with AUTOSAR Code Replacement Library.

  7. Build the model. The generated C code contains the expected Ifl and Ifx lookup function calls and Rte data access function calls. For example, you can search the HTML code generation report for the Ifl or Ifx routine prefix.

    The generated ARXML files contain data types of category CURVE (1-D table data), MAP (2-D table data), and COM_AXIS (axis data). The data types have the data calibration properties that you configured.

Configure FIX_AXIS Lookup Tables by Using Simulink Parameter Objects

This example shows how to create FIX_AXIS lookup tables in Simulink, using Simulink.Parameter objects, and configure the lookup tables for AUTOSAR code generation.

  1. Model an AUTOSAR lookup table in a FIX_AXIS configuration.

    1. In a mapped AUTOSAR software component model, add a Simulink 1-D Lookup Table block.

    2. In the model workspace, create a Simulink.Parameter object and configure it to store the lookup table values.

    3. Open the 1-D Lookup Table block. In the Table and Breakpoints tab, to configure the table to fix axis, set Breakpoints specification to Even spacing.

    4. In the 1-D Lookup Table block dialog box, Table and breakpoints tab, enter the Simulink.Parameter object name in the Value field.

    5. In the block dialog box, Algorithm tab, set Extrapolation Method to Clip. Enable Use last table values for inputs at or above last breakpoint.

  2. Connect an inport and outport to the 1-D Lookup Table block.

  3. In the AUTOSAR code perspective, use the Code Mappings editor to map Simulink.Parameter object to AUTOSAR internal calibration parameters. In the Parameters tab, select each Simulink.Parameter object that you created. Map the object to AUTOSAR parameter type ConstantMemory, SharedParameter, or Auto. To accept software mapping defaults, specify Auto.

  4. For each parameter, if you select a parameter type other than Auto, click the icon to view or modify other code and calibration attributes. For more information on parameter properties, see Map Model Workspace Parameters to AUTOSAR Component Parameters.

  5. Configure the model to generate C code based on the AUTOSAR 4.0 library. Open the Configuration Parameters dialog box and select Code Generation > Interface. Set the Code replacement library parameter to AUTOSAR 4.0. For more information, see Code Generation with AUTOSAR Code Replacement Library.

  6. Build the model. The generated C code contains the expected Ifx lookup function call and Rte data access function calls. For example, you can search the HTML code generation report for the Ifx routine prefix.

    The generated ARXML files contain data types of category CURVE (1-D table data). The data types have the data calibration properties that you configured.

Note

For FIX_AXIS lookup table objects, the axes values are fixed and not tunable. The table data can be tuned.

Configure Array Layout for Multidimensional Lookup Tables

If an AUTOSAR model contains multidimensional lookup tables, you can configure the layout of lookup table array data for code generation as column-major or row-major. In the Simulink Configuration Parameters dialog box, Interface pane, set Array layout (Simulink Coder) to Column-major (the default) or Row-major. The array layout selection affects code generation, including C code and exported ARXML descriptions.

If you select row-major layout, go to the Math and Data Types pane and select the configuration option Use algorithms optimized for row-major array layout. The algorithm selection affects simulation and code generation.

Exporting multidimensional lookup tables generates ARXML lookup table descriptions with the SwRecordLayout category set to either COLUMN_DIR or ROW_DIR. For example, this program listing shows the SwRecordLayout descriptions exported for an AUTOSAR model that contains a 2-dimensional row-major lookup table. The lookup table is implemented by using an AUTOSAR Map block.

<AR-PACKAGE>
    <SHORT-NAME>SwRecordLayouts</SHORT-NAME>
    <ELEMENTS>
        <SW-RECORD-LAYOUT UUID="...">
            <SHORT-NAME>Map_s16</SHORT-NAME>
            <SW-RECORD-LAYOUT-GROUP>
                <SHORT-LABEL>Val</SHORT-LABEL>
                <CATEGORY>ROW_DIR</CATEGORY>
                <SW-RECORD-LAYOUT-GROUP-AXIS>1</SW-RECORD-LAYOUT-GROUP-AXIS>
                <SW-RECORD-LAYOUT-GROUP-INDEX>X</SW-RECORD-LAYOUT-GROUP-INDEX>
                <SW-RECORD-LAYOUT-GROUP-FROM>1</SW-RECORD-LAYOUT-GROUP-FROM>
                <SW-RECORD-LAYOUT-GROUP-TO>-1</SW-RECORD-LAYOUT-GROUP-TO>
                <SW-RECORD-LAYOUT-GROUP>
                    <SW-RECORD-LAYOUT-GROUP-AXIS>2</SW-RECORD-LAYOUT-GROUP-AXIS>
                    <SW-RECORD-LAYOUT-GROUP-INDEX>Y</SW-RECORD-LAYOUT-GROUP-INDEX>
                    <SW-RECORD-LAYOUT-GROUP-FROM>1</SW-RECORD-LAYOUT-GROUP-FROM>
                    <SW-RECORD-LAYOUT-GROUP-TO>-1</SW-RECORD-LAYOUT-GROUP-TO>
                    <SW-RECORD-LAYOUT-V>
                        <SHORT-LABEL>Val</SHORT-LABEL>
                        <BASE-TYPE-REF DEST="SW-BASE-TYPE">
                          /DataTypes/SwBaseTypes/sint32
                        </BASE-TYPE-REF>
                        <SW-RECORD-LAYOUT-V-AXIS>0</SW-RECORD-LAYOUT-V-AXIS>
                        <SW-RECORD-LAYOUT-V-PROP>VALUE</SW-RECORD-LAYOUT-V-PROP>
                        <SW-RECORD-LAYOUT-V-INDEX>X Y</SW-RECORD-LAYOUT-V-INDEX>
                    </SW-RECORD-LAYOUT-V>
                </SW-RECORD-LAYOUT-GROUP>
            </SW-RECORD-LAYOUT-GROUP>
        </SW-RECORD-LAYOUT>
        <SW-RECORD-LAYOUT UUID="...">
            <SHORT-NAME>Distr_s8_M</SHORT-NAME>
            <SW-RECORD-LAYOUT-GROUP>
                <SHORT-LABEL>Y</SHORT-LABEL>
                <CATEGORY>INDEX_INCR</CATEGORY>
                <SW-RECORD-LAYOUT-GROUP-AXIS>1</SW-RECORD-LAYOUT-GROUP-AXIS>
                <SW-RECORD-LAYOUT-GROUP-FROM>1</SW-RECORD-LAYOUT-GROUP-FROM>
                <SW-RECORD-LAYOUT-GROUP-TO>-1</SW-RECORD-LAYOUT-GROUP-TO>
                <SW-RECORD-LAYOUT-V>
                    <SHORT-LABEL>VALUE</SHORT-LABEL>
                    <BASE-TYPE-REF DEST="SW-BASE-TYPE">
                      /DataTypes/SwBaseTypes/sint32
                    </BASE-TYPE-REF>
                    <SW-RECORD-LAYOUT-V-AXIS>1</SW-RECORD-LAYOUT-V-AXIS>
                    <SW-RECORD-LAYOUT-V-PROP>VALUE</SW-RECORD-LAYOUT-V-PROP>
                </SW-RECORD-LAYOUT-V>
            </SW-RECORD-LAYOUT-GROUP>
        </SW-RECORD-LAYOUT>
    </ELEMENTS>
</AR-PACKAGE>

Importing ARXML files with multidimensional lookup table descriptions creates Simulink lookup tables with Array layout set to Column-major or Row-major. If the ARXML files contain only row-major multidimensional lookup table descriptions, the ARXML importer creates Simulink lookup tables with Array layout set to Row-major and Use algorithms optimized for row-major array layout enabled.

Parameterizing Instances of Reusable Referenced Model Lookup Tables and Breakpoints

In an AUTOSAR model hierarchy, you can parameterize a lookup table or breakpoint by placing it inside a referenced model and then parameterizing the referenced model. Parameterizing a referenced model involves configuring the referenced model to use model arguments, and then setting model argument values in the parent model.

Parameterizing instances of reusable referenced model lookup tables allows you to place multiple instances of lookup table sub-units in an AUTOSAR model hierarchy. You can use sub-unit level testing with the lookup tables.

When a referenced model contains a lookup table or breakpoint, and the containing top model passes lookup table parameter values or breakpoint object to the model arguments of the referenced model, top-model export generates application data types for the lookup table parameters or breakpoints.

Consider this top model, which parameterizes two instances of a referenced model 2-D lookup table. Top-model parameter LUTForInst1 is mapped to an AUTOSAR PerInstanceParameter and its values are passed to a model argument of the first lookup table instance. Top-model parameter LUTForInst2 is mapped to an AUTOSAR SharedParameter and its values are passed to a model argument of the second lookup table instance.

The referenced model contains the 2-D lookup table and defines instance parameter LUT_arg. For more information about configuring instance parameters in a referenced model and specifying instance-specific values at the Model block, see Parameterize Instances of a Reusable Referenced Model.

When you build the top model, the exported ARXML defines application primitive data types Appl_LUTForInst1 and Appl_LUTForInst2 and maps them to implementation data type LUT_arg_Type.

<APPLICATION-PRIMITIVE-DATA-TYPE UUID="...">
    <SHORT-NAME>Appl_LUTForInst1</SHORT-NAME>
    <CATEGORY>MAP</CATEGORY>
    ...
</APPLICATION-PRIMITIVE-DATA-TYPE>
<APPLICATION-PRIMITIVE-DATA-TYPE UUID="...">
    <SHORT-NAME>Appl_LUTForInst2</SHORT-NAME>
    <CATEGORY>MAP</CATEGORY>
    ...
</APPLICATION-PRIMITIVE-DATA-TYPE>

<DATA-TYPE-MAP>
    <APPLICATION-DATA-TYPE-REF DEST="APPLICATION-PRIMITIVE-DATA-TYPE">
      /DataTypes/ApplDataTypes/Appl_LUTForInst1
    </APPLICATION-DATA-TYPE-REF>
    <IMPLEMENTATION-DATA-TYPE-REF DEST="IMPLEMENTATION-DATA-TYPE">
      /DataTypes/LUT_arg_Type
    </IMPLEMENTATION-DATA-TYPE-REF>
</DATA-TYPE-MAP>
<DATA-TYPE-MAP>
    <APPLICATION-DATA-TYPE-REF DEST="APPLICATION-PRIMITIVE-DATA-TYPE">
      /DataTypes/ApplDataTypes/Appl_LUTForInst2
    </APPLICATION-DATA-TYPE-REF>
    <IMPLEMENTATION-DATA-TYPE-REF DEST="IMPLEMENTATION-DATA-TYPE">
      /DataTypes/LUT_arg_Type
    </IMPLEMENTATION-DATA-TYPE-REF>
</DATA-TYPE-MAP>

The application primitive data types are then referenced by the AUTOSAR per-instance parameter LUTForInst1 and the AUTOSAR shared parameter LUTForInst2.

<PER-INSTANCE-PARAMETERS>
    <PARAMETER-DATA-PROTOTYPE UUID="...">
        <SHORT-NAME>LUTForInst1</SHORT-NAME>
        <CATEGORY>MAP</CATEGORY>
        ...
        <TYPE-TREF DEST="APPLICATION-PRIMITIVE-DATA-TYPE">
          /DataTypes/ApplDataTypes/Appl_LUTForInst1
        </TYPE-TREF>
        <INIT-VALUE>
            <CONSTANT-REFERENCE>
                <SHORT-LABEL>LUTForInst1</SHORT-LABEL>
                <CONSTANT-REF DEST="CONSTANT-SPECIFICATION">
                  /DataTypes/Constants/LUTForInst1
                </CONSTANT-REF>
            </CONSTANT-REFERENCE>
        </INIT-VALUE>
    </PARAMETER-DATA-PROTOTYPE>
</PER-INSTANCE-PARAMETERS>

<SHARED-PARAMETERS>
    <PARAMETER-DATA-PROTOTYPE UUID="...">
        <SHORT-NAME>LUTForInst2</SHORT-NAME>
        <CATEGORY>MAP</CATEGORY>
        ...
        <TYPE-TREF DEST="APPLICATION-PRIMITIVE-DATA-TYPE">
          /DataTypes/ApplDataTypes/Appl_LUTForInst2
        </TYPE-TREF>
        <INIT-VALUE>
            <CONSTANT-REFERENCE>
                <SHORT-LABEL>LUTForInst2</SHORT-LABEL>
                <CONSTANT-REF DEST="CONSTANT-SPECIFICATION">
                  /DataTypes/Constants/LUTForInst2
                </CONSTANT-REF>
            </CONSTANT-REFERENCE>
        </INIT-VALUE>
    </PARAMETER-DATA-PROTOTYPE>
</SHARED-PARAMETERS>

The exported ARXML lookup table descriptions can be round-tripped between Simulink and AUTOSAR authoring tools.

Exporting Lookup Table Constants as Record Value Specification

You can configure a model to export the lookup table constants as Application value specification or Record value specification. Refer to the example model from Configure STD_AXIS Lookup Tables by Using Lookup Table Objects.

By default the lookup table constants are exported as Application value specification. The generated ARXML file contains Application value specification as shown below:

<CONSTANT-SPECIFICATION UUID="...">
    <SHORT-NAME>L_4_single</SHORT-NAME>
    <VALUE-SPEC>
        <APPLICATION-VALUE-SPECIFICATION>
            <SHORT-LABEL>L_4_single</SHORT-LABEL>
            <CATEGORY>CURVE</CATEGORY>
            <SW-AXIS-CONTS>
                <SW-AXIS-CONT>
                    <CATEGORY>STD_AXIS</CATEGORY>
                    <UNIT-REF DEST="UNIT">/pkg/dt/NoUnit</UNIT-REF>
                    <SW-AXIS-INDEX>1</SW-AXIS-INDEX>
                    <SW-ARRAYSIZE>
                        <V>4</V>
                    </SW-ARRAYSIZE>
                    <SW-VALUES-PHYS>
                        <V>1</V>
                        <V>2</V>
                        <V>3</V>
                        <V>4</V>
                    </SW-VALUES-PHYS>
                </SW-AXIS-CONT>
            </SW-AXIS-CONTS>
                <SW-VALUE-CONT>
                    <UNIT-REF DEST="UNIT">/pkg/dt/NoUnit</UNIT-REF>
                    <SW-ARRAYSIZE>
                        <V>4</V>
                    </SW-ARRAYSIZE>
                    <SW-VALUES-PHYS>
                        <V>10</V>
                        <V>20</V>
                        <V>30</V>
                        <V>40</V>
                    </SW-VALUES-PHYS>
                </SW-VALUE-CONT>
        </APPLICATION-VALUE-SPECIFICATION>
    </VALUE-SPEC>
</CONSTANT-SPECIFICATION>

To export the constants as Record value specification, open the AUTOSAR > AUTOSAR Dictionary and disable the Export Lookup Table Application Value Specification option.

Alternatively use the command:

modelProperties = autosar.api.getAUTOSARProperties(<modelName>);
modelProperties.set('XmlOptions','ExportLookupTableApplicationValueSpecification',false);

Build the model. The generated ARXML contains the Record Value Specification as shown below.

<CONSTANT-SPECIFICATION UUID="...">
    <SHORT-NAME>L_4_single</SHORT-NAME>
    <VALUE-SPEC>
        <RECORD-VALUE-SPECIFICATION>
            <SHORT-LABEL>L_4_single</SHORT-LABEL>    
            <FIELDS>
                <NUMERICAL-VALUE-SPECIFICATION>
            <SHORT-LABEL>Nx</SHORT-LABEL>
            <VALUE>4</VALUE>
        </NUMERICAL-VALUE-SPECIFICATION>
        <ARRAY-VALUE-SPECIFICATION>
            <SHORT-LABEL>Bp1</SHORT-LABEL>
            <ELEMENTS>
                <NUMERICAL-VALUE-SPECIFICATION>
                    <SHORT-LABEL>Bp1_rt_Array_Float_4_1</SHORT-LABEL>
                    <VALUE>1</VALUE>
                </NUMERICAL-VALUE-SPECIFICATION>
                <NUMERICAL-VALUE-SPECIFICATION>
                    <SHORT-LABEL>Bp1_rt_Array_Float_4_2</SHORT-LABEL>
                    <VALUE>2</VALUE>
                </NUMERICAL-VALUE-SPECIFICATION>
                <NUMERICAL-VALUE-SPECIFICATION>
                    <SHORT-LABEL>Bp1_rt_Array_Float_4_3</SHORT-LABEL>
                    <VALUE>3</VALUE>
                </NUMERICAL-VALUE-SPECIFICATION>
                <NUMERICAL-VALUE-SPECIFICATION>
                    <SHORT-LABEL>Bp1_rt_Array_Float_4_4</SHORT-LABEL>
                    <VALUE>4</VALUE>
                </NUMERICAL-VALUE-SPECIFICATION>
            </ELEMENTS>
        </ARRAY-VALUE-SPECIFICATION>
        <ARRAY-VALUE-SPECIFICATION>
            <SHORT-LABEL>Table</SHORT-LABEL>
            <ELEMENTS>
                <NUMERICAL-VALUE-SPECIFICATION>
                    <SHORT-LABEL>Table_rt_Array_Float_4_1</SHORT-LABEL>
                    <VALUE>10</VALUE>
                </NUMERICAL-VALUE-SPECIFICATION>
                <NUMERICAL-VALUE-SPECIFICATION>
                    <SHORT-LABEL>Table_rt_Array_Float_4_2</SHORT-LABEL>
                    <VALUE>20</VALUE>
                </NUMERICAL-VALUE-SPECIFICATION>
                <NUMERICAL-VALUE-SPECIFICATION>
                    <SHORT-LABEL>Table_rt_Array_Float_4_3</SHORT-LABEL>
                    <VALUE>30</VALUE>
                </NUMERICAL-VALUE-SPECIFICATION>
                <NUMERICAL-VALUE-SPECIFICATION>
                    <SHORT-LABEL>Table_rt_Array_Float_4_4</SHORT-LABEL>
                    <VALUE>40</VALUE>
                </NUMERICAL-VALUE-SPECIFICATION>
            </ELEMENTS>
        </ARRAY-VALUE-SPECIFICATION>
    </FIELDS>
</RECORD-VALUE-SPECIFICATION>
</VALUE-SPEC>
</CONSTANT-SPECIFICATION>

Exporting AdminData Record Layout Annotations

AUTOSAR Blockset supports AdminData record layout annotations in ARXML lookup table descriptions.

Importing ARXML lookup table and axis descriptions that contain AdminData record layout annotations creates Simulink® lookup tables and breakpoints in which the AdminData annotations determine the order of structure elements.

Exporting lookup table AdminData is disabled by default. To enable export of AdminData, set the API-only XML option 'ExportSwRecordLayoutAnnotationsOnAdminData' to true. For example:

hModel = 'mAutosarLutObjs';
open_system(hModel);
arProps = autosar.api.getAUTOSARProperties(hModel);
set(arProps,'XmlOptions','ExportSwRecordLayoutAnnotationsOnAdminData',true);
evalc('slbuild(hModel)');

When AdminData export is enabled, exporting Simulink® lookup tables and breakpoints with structure elements generates lookup table and axis ImplementationDataTypes that include structure element AdminData annotations. For example:

<IMPLEMENTATION-DATA-TYPE UUID="...">
    <SHORT-NAME>LUT_4_single</SHORT-NAME>
    <CATEGORY>STRUCTURE</CATEGORY>
    <SUB-ELEMENTS>
        <IMPLEMENTATION-DATA-TYPE-ELEMENT UUID="...">
            <SHORT-NAME>Nx</SHORT-NAME>
            <CATEGORY>TYPE_REFERENCE</CATEGORY>
            <ADMIN-DATA>
                <SDGS>
                    <SDG GID="DV:RecLayoutAnnotation">
                        <SD GID="DV:Type">NO_AXIS_PTS_X</SD>
                    </SDG>
                </SDGS>
            </ADMIN-DATA>
            ...
        </IMPLEMENTATION-DATA-TYPE-ELEMENT>
        <IMPLEMENTATION-DATA-TYPE-ELEMENT UUID="...">
            <SHORT-NAME>Bp1</SHORT-NAME>
            <CATEGORY>TYPE_REFERENCE</CATEGORY>
            <ADMIN-DATA>
                <SDGS>
                    <SDG GID="DV:RecLayoutAnnotation">
                        <SD GID="DV:Type">AXIS_PTS_X</SD>
                    </SDG>
                </SDGS>
            </ADMIN-DATA>
            ...
        </IMPLEMENTATION-DATA-TYPE-ELEMENT>
        ...
    </SUB-ELEMENTS>
</IMPLEMENTATION-DATA-TYPE>

AdminData record layout annotations can be used with third-party AUTOSAR tools.

See Also

| | | | | | | |

Related Examples

More About