AUTOSAR CP SWS IFXLibrary
AUTOSAR CP SWS IFXLibrary
AUTOSAR CP R23-11
4
AUTOSAR • Editorial changes
2019-11-28 R19-11 Release • Changed Document Status from Final to
Management published
AUTOSAR
2018-10-31 4.4.0 Release • Editorial changes
Management
• A new requirement (SWS_Ifx_00251)
has been added under Section 7.6 to
provide clarity on the rounding
AUTOSAR mechanism for intermediate result
2017-12-08 4.3.1 Release calculation.
Management
• A requirement (SWS_Ifx_00250) has
been removed as it is not realizable for
all the scenarios
• Added a new requirement (SWS_Ifx_
00250) to provide info on symmetricity
for interpolation services
4
• Added a new statement in Section 8.5
below the formula to provide more clarity
to the users
• Editorial changes
5
4
• Rounding mechanism specified for
DPRatio calculation
Disclaimer
This work (specification and/or software implementation) and the material contained in
it, as released by AUTOSAR, is for the purpose of information only. AUTOSAR and the
companies that have contributed to it shall not be liable for any use of the work.
The material contained in this work is protected by copyright and other types of intel-
lectual property rights. The commercial exploitation of the material contained in this
work requires a license to such intellectual property rights.
This work may be utilized or reproduced without any modification, in any form or by
any means, for informational purposes only. For any other purpose, no part of the work
may be utilized or reproduced, in any form or by any means, without permission in
writing from the publisher.
The work has been developed for automotive applications only. It has neither been
developed, nor tested for non-automotive applications.
The word AUTOSAR and the AUTOSAR logo are registered trademarks.
Contents
1 Introduction and functional overview 8
3 Related documentation 10
3.1 Input documents & related standards and norms . . . . . . . . . . . . . 10
3.2 Related specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
4 Constraints and assumptions 11
4.1 Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
4.2 Applicability to car domains . . . . . . . . . . . . . . . . . . . . . . . . . 11
5 Dependencies to other modules 12
5.1 File structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
6 Requirements Tracing 13
7 Functional specification 15
7.1 Error Classification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
7.1.1 Development Errors . . . . . . . . . . . . . . . . . . . . . . . . 15
7.1.2 Runtime Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
7.1.3 Transient Faults . . . . . . . . . . . . . . . . . . . . . . . . . . 15
7.1.4 Production Errors . . . . . . . . . . . . . . . . . . . . . . . . . 15
7.1.5 Extended Production Errors . . . . . . . . . . . . . . . . . . . . 15
7.2 Initialization and shutdown . . . . . . . . . . . . . . . . . . . . . . . . . . 15
7.3 Using Library API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
7.4 library implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
8 API specification 18
8.1 Imported types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
8.2 Type definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
8.3 Comment about rounding . . . . . . . . . . . . . . . . . . . . . . . . . . 19
8.4 Comment about routines optimization . . . . . . . . . . . . . . . . . . . . 20
8.4.1 Target optimization . . . . . . . . . . . . . . . . . . . . . . . . . 20
8.4.2 Optimization for routine numbers . . . . . . . . . . . . . . . . . 20
8.5 Interpolation routines definitions . . . . . . . . . . . . . . . . . . . . . . . 20
8.5.1 Distributed data point search and interpolation . . . . . . . . . 22
8.5.1.1 Data Point Search . . . . . . . . . . . . . . . . . . . . 22
8.5.1.2 Curve interpolation . . . . . . . . . . . . . . . . . . . . 24
8.5.1.3 Curve look-up . . . . . . . . . . . . . . . . . . . . . . . 25
8.5.1.4 Map interpolation . . . . . . . . . . . . . . . . . . . . . 26
8.5.1.5 Map look-up . . . . . . . . . . . . . . . . . . . . . . . . 28
8.5.1.6 Map look-up without rounding . . . . . . . . . . . . . . 30
8.5.2 Integrated data point search and interpolation . . . . . . . . . 31
8.5.2.1 Integrated curve interpolation . . . . . . . . . . . . . . 31
10 Configuration specification 72
10.1 How to read this chapter . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
10.2 Containers and configuration parameters . . . . . . . . . . . . . . . . . . 72
10.3 Published Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
A Not applicable requirements 73
Ifx routines specification specifies the functionality, API and the configuration of the
AUTOSAR library dedicated to interpolation routines for fixed point values.
The interpolation library contains the following routines:
• Distributed data point search and interpolation
• Integrated data point search and interpolation
All routines are re-entrant and can be used by multiple applications at the same time.
3 Related documentation
[1] Glossary
AUTOSAR_FO_TR_Glossary
[2] IFX_RecordLayout_Blueprint
AUTOSAR_MOD_IFX_RecordLayout_Blueprint.arxml
[3] ISO/IEC 9899:1990 Programming Language - C
https://www.iso.org
[4] ASAM MCD-2MC Version 1.6
http://www.asam.net
[5] General Specification of Basic Software Modules
AUTOSAR_CP_SWS_BSWGeneral
[6] Requirements on Libraries
AUTOSAR_CP_SRS_Libraries
4.1 Limitations
No limitations.
6 Requirements Tracing
The following tables reference the requirements specified in [6] and links to the fulfill-
ment of these. Please note that if column “Satisfied by” is empty for a specific require-
ment this means that this requirement is not fulfilled by this document.
Requirement Description Satisfied by
[SRS_BSW_00003] All software modules shall provide [SWS_Ifx_00815]
version and identification information
[SRS_BSW_00007] All Basic SW Modules written in C [SWS_Ifx_00809]
language shall conform to the MISRA
C 2012 Standard.
[SRS_BSW_00304] All AUTOSAR Basic Software [SWS_Ifx_00812]
Modules shall use only AUTOSAR
data types instead of native C data
types
[SRS_BSW_00306] AUTOSAR Basic Software Modules [SWS_Ifx_00813]
shall be compiler and platform
independent
[SRS_BSW_00318] Each AUTOSAR Basic Software [SWS_Ifx_00815]
Module file shall provide version
numbers in the header file
[SRS_BSW_00321] The version numbers of AUTOSAR [SWS_Ifx_00815]
Basic Software Modules shall be
enumerated according specific rules
[SRS_BSW_00348] All AUTOSAR standard types and [SWS_Ifx_00811]
constants shall be placed and
organized in a standard type header
file
[SRS_BSW_00374] All Basic Software Modules shall [SWS_Ifx_00814]
provide a readable module vendor
identification
[SRS_BSW_00378] AUTOSAR shall provide a boolean [SWS_Ifx_00812]
type
[SRS_BSW_00379] All software modules shall provide a [SWS_Ifx_00814]
module identifier in the header file
and in the module XML description
file.
[SRS_BSW_00402] Each module shall provide version [SWS_Ifx_00814]
information
[SRS_BSW_00407] Each BSW module shall provide a [SWS_Ifx_00815] [SWS_Ifx_00816]
function to read out the version
information of a dedicated module
implementation
[SRS_BSW_00411] All AUTOSAR Basic Software [SWS_Ifx_00816]
Modules shall apply a naming rule for
enabling/disabling the existence of
the API
[SRS_BSW_00437] Memory mapping shall provide the [SWS_Ifx_00810]
possibility to define RAM segments
which are not to be initialized during
startup
[SRS_BSW_00448] Module SWS shall not contain [SWS_Ifx_00999]
requirements from other modules
[SRS_LIBS_00001] The functional behavior of each [SWS_Ifx_00818]
library functions shall not be
configurable
5
4
Requirement Description Satisfied by
[SRS_LIBS_00002] A library shall be operational before [SWS_Ifx_00800]
all BSW modules and application
SW-Cs
[SRS_LIBS_00003] A library shall be operational until the [SWS_Ifx_00801]
shutdown
[SRS_LIBS_00015] It shall be possible to configure the [SWS_Ifx_00806]
microcontroller so that the library
code is shared between all callers
[SRS_LIBS_00017] Usage of macros should be avoided [SWS_Ifx_00807]
[SRS_LIBS_00018] A library function may only call library [SWS_Ifx_00808]
functions
Table 6.1: RequirementsTracing
7 Functional specification
[SWS_Ifx_00812] dAll AUTOSAR library Modules should use the AUTOSAR data
types (integers, boolean) instead of native C data types, unless this library is clearly
identified to be compliant only with a platform.c(SRS_BSW_00304, SRS_BSW_00378)
[SWS_Ifx_00813] dAll AUTOSAR library Modules should avoid direct use of compiler
and platform specific keyword, unless this library is clearly identified to be compliant
only with a platform. eg. #pragma, typeof etc.c(SRS_BSW_00306)
[SWS_Ifx_00820] dIf input value is less than first distribution entry then first value of
the distribution array shall be returned or used in the interpolation routines. If input
value is greater than last distribution entry then last value of the distribution array shall
be returned or used in the interpolation routines.c()
[SWS_Ifx_00821] dAxis distribution passed to Ifx routines shall have normal monotony
sequence.c()
[SWS_Ifx_00251] dThe intermediate results during unscaling in interpolation calcula-
tion shall be Rounded towards zero.c()
8 API specification
c()
It is observed that since the sizes of the integer types provided by the C language are
implementation-defined, the range of values that may be represented within each of
the integer types will vary between implementations.
Thus, in order to improve the portability of the software these types are defined in Plat-
form_Types.h [AUTOSAR_SWS_PlatformTypes]. The following mnemonic are used in
the library routine names.
Size Platform Type Mnemonic Range
unsigned 8-Bit boolean NA [ TRUE, FALSE ]
signed 8-Bit sint8 s8 [ -128, 127 ]
signed 16-Bit sint16 s16 [ -32768, 32767 ]
signed 32-Bit sint32 s32 [ -2147483648, 2147483647
]
unsigned 8-Bit uint8 u8 [ 0, 255 ]
unsigned 16-Bit uint16 u16 [ 0, 65535 ]
unsigned 32-Bit uint32 u32 [ 0, 4294967295 ]
c()
[SWS_Ifx_00003] dRatio shall have resolution of 2-16 c()
[SWS_Ifx_00248] dRatio shall be rounded towards zeroc()
[SWS_Ifx_00200] dIfx_DPResultU16_Type structure shall not be read/write/modified
by the user directly. Only Ifx routines shall have access to this structure.c()
The routines described in this library may be realized as regular routines or inline func-
tions. For ROM optimization purposes, it is recommended that the c routines be real-
ized as individual source files so they may be linked in on an as-needed basis.
For example, depending on the target, two types of optimization can be done:
• 00302
Some routines can be replaced by another routine using integer promotion
• Some routines can be replaced by the combination of a limiting routine and a
routine with a different signature.
Many routines can be omitted by exchanging ’X’ and ’Y’ data types. With this method,
reduction in total number of routines is possible in case of Map interpolation routines.
This optimization of routine numbers is done based on below mentioned rules.
• Rule 1: Bigger data type of ’X’ and ’Y’ comes first . (16 Bit before 8 Bit)
• Rule 2: unsigned before signed (u16 before s16)
• Order: u32, s32, u16, s16, u8, s8
In this case, below routine can be replaced as :
Ifx_IntIpoMap_s8u16_u16
With
Ifx_IntIpoMap_u16s8_u16
Note: swapped inputs need another map value order in memory, see record layout
section
y1 = value at x1
Quantization error is by design and shall not be compensated in implementation.
In this interpolation method data point search (e.g. index and ratio) is calculated using
routine Ifx_DPSearch_<InTypeMn> which returns result structure Ifx_DPResultU16_
Type. It contains index and ratio information. This result can be used by curve interpo-
lation, curve look-up interpolation, map interpolation and map look-up interpolation.
c()
[SWS_Ifx_00006] dIf (X_array[0] <= Xin <= X_array[N-1]), then returned Index shall be
the lowest index.
c()
[SWS_Ifx_00016] dindex = dpResult->Index
if dPResult->Ratio == 0
Result = Val_array[index]
else
Result = Val_array[index] + (Val_array[index+1] - Val_array[index]) * dpResult->Ratio
Note:
In case of missing HW support the Software solution mentioned below could also be
used to avoid 64-bit arithmetic operation.
if (Val_array[index] <= Val_array[index+1]) then
Result = Val_array[index] + (Val_array[index+1] - Val_array[index]) * dpResult->Ratio
if (Val_array[index] > Val_array[index+1]) then
Result = Val_array[index] - (Val_array[index] - Val_array[index+1]) * dpResult->Ratioc()
[SWS_Ifx_00201] dDo not call this routine until you have searched the axis using the
Ifx_DPSearch routine. Only then it is ensured that the search result (Ifx_DPResult
U16_Type) contains valid data and is not used uninitialized.c()
c()
[SWS_Ifx_00021] dResult = Val_array[dpResult->Index]c()
[SWS_Ifx_00202] dDo not call this routine until you have searched the axis using the
Ifx_DPSearch routine. Only then it is ensured that the search result (Ifx_DPResult
U16_Type) contains valid data and is not used uninitialized.c()
c()
[SWS_Ifx_00026] dBased on searched indices and ratios information using the rele-
vant Ifx_DPSearch routine, this routine calculates and returns the interpolation result
for map.
BaseIndex = dpResultX->Index * num_value + dpResultY->Index
if (dpResultX->Ratio == 0)
if (dpResultY->Ratio == 0)
Result = Val_array [BaseIndex]
else
LowerY = Val_array [BaseIndex]
UpperY = Val_array [BaseIndex + 1]
Result = LowerY + (UpperY - LowerY) * dpResultY->Ratio
else
if (dpResultY->Ratio == 0)
LowerX = Val_array[BaseIndex]
UpperX = Val_array[BaseIndex + num_value]
Result = LowerX + (UpperX - LowerX) * dpResultX->Ratio
else
LowerY = Val_array [BaseIndex]
UpperY = Val_array [BaseIndex + 1]
LowerX = LowerY + (UpperY - LowerY) * dpResultY->Ratio
LowerY = Val_array[BaseIndex + num_value]
UpperY = Val_array[BaseIndex + num_value + 1]
UpperX = LowerY + (UpperY - LowerY) * dpResultY->Ratio
Result = LowerX + (UpperX - LowerX) * dpResultX->Ratioc()
[SWS_Ifx_00203] dDo not call this routine until you have searched the axis using the
Ifx_DPSearch routine. Only then it is ensured that the search result (Ifx_DPResult
U16_Type) contains valid data and is not used uninitialized.c()
[SWS_Ifx_00027] dHere is the list of implemented routines.c()
Routine ID[hex] Routine prototype
0x010 uint8 Ifx_IpoMap_u8 ( const Ifx_DPResultU16_Type*,
const Ifx_DPResultU16_Type*,
uint16,
const uint8 *)
0x011 uint16 Ifx_IpoMap_u16 ( const Ifx_DPResultU16_Type*,
const Ifx_DPResultU16_Type*,
uint16,
const uint16 *)
5
4
Routine ID[hex] Routine prototype
0x012 sint8 Ifx_IpoMap_s8 ( const Ifx_DPResultU16_Type*,
const Ifx_DPResultU16_Type*,
uint16,
const sint8 *)
0x013 sint16 Ifx_IpoMap_s16 ( const Ifx_DPResultU16_Type*,
const Ifx_DPResultU16_Type*,
uint16,
const sint16 *)
0x0C7 sint32 Ifx_IpoMap_s32 ( const Ifx_DPResultU16_
Type*dpResultX,
const Ifx_DPResultU16_Type*dpResultY,
uint16 num_value,
const sint32 * Val_array)
0x0C8 uint32 Ifx_IpoMap_u32 ( const Ifx_DPResultU16_
Type*dpResultX,
const Ifx_DPResultU16_Type*dpResultY,
uint16 num_value,
const uint32 * Val_array)
c()
c()
[SWS_Ifx_00206] dBaseIndex = dpResultX->Index * num_value + dpResultY->Indexc
()
[SWS_Ifx_00207] dReturn Value = Val_array [BaseIndex]c()
[SWS_Ifx_00208] dDo not call this routine until you have searched the axis using the
Ifx_DPSearch routine. Only then it is ensured that the search result (Ifx_DPResult
U16_Type) contains valid data and is not used uninitialized.c()
[SWS_Ifx_00209] dHere is the list of implemented routines.c()
Routine ID[hex] Routine prototype
0x0A5 uint8 Ifx_LkUpBaseMap_u8 ( const Ifx_DPResultU16_Type*,
const Ifx_DPResultU16_Type*,
uint16,
const uint8 *)
0x0A6 uint16 Ifx_LkUpBaseMap_u16 ( const Ifx_DPResultU16_
Type*,
const Ifx_DPResultU16_Type*,
uint16,
const uint16 *)
5
4
Routine ID[hex] Routine prototype
0x0A7 sint8 Ifx_LkUpBaseMap_s8 ( const Ifx_DPResultU16_Type*,
const Ifx_DPResultU16_Type*,
uint16,
const sint8 *)
0x0A8 sint16 Ifx_LkUpBaseMap_s16 ( const Ifx_DPResultU16_
Type*,
const Ifx_DPResultU16_Type*,
uint16,
const sint16 *)
0x0CB sint32 Ifx_LkUpBaseMap_s32 ( const Ifx_DPResultU16_
Type* dpResultX,
const Ifx_DPResultU16_Type* dpResultY,
uint16 num_value,
const sint32* Val_array)
0x0CC uint32 Ifx_LkUpBaseMap_u32 ( const Ifx_DPResultU16_
Type* dpResultX,
const Ifx_DPResultU16_Type* dpResultY,
uint16 num_Val,
const uint32* Val_array)
In this method of interpolation, single routine does data point search (e.g. Index and
ratio) and interpolation for curve, map or look-up table.
4
X_array Pointer to the X axis distribution array
Val_array Pointer to the result axis distribution array
Parameters (inout) None
Parameters (out) None
Return value <OutType> Result of the Interpolation
Description This routine calculates interpolation of a curve at position Xin using below equation.
Available via Ifx.h
c()
[SWS_Ifx_00036] dIf (X_array[0] < Xin < X_array[N -1]), then
index = lowest index for which (Xin < X_array[index + 1]).
RatioX = (Xin - X_array[index]) / (X_array [index+1] - X_array [index])
Result = Val_array[index] + (Val_array[index+1] - Val_array[index])*RatioXc()
[SWS_Ifx_00037] dInput value matches with one of the distribution array value then
result shall be respective Y array element indicated by index.
If (Xin == X_array[index]) then,
Result = Val_array[index]c()
[SWS_Ifx_00038] dIf (Xin < X_array[0]) then,
Result = Val_array[0]c()
c()
[SWS_Ifx_00046] dIf (X_array[0] < Xin < X_array[N -1]), then
index = lowest index for which (Xin < X_array[index + 1]).
Result = Val_array[index]c()
[SWS_Ifx_00047] dInput value matches with one of the distribution array value then
result shall be respective Y array element indicated by index.
If (Xin == X_array[index]) then,
Result = Val_array[index]c()
[SWS_Ifx_00048] dIf (Xin < X_array[0]) then,
Result = Val_array[0]c()
[SWS_Ifx_00049] dIf (Xin > X_array[N-1]) then,
Result = Val_array[N-1]c()
[SWS_Ifx_00050] dThe minimum value of N shall be 1c()
c()
[SWS_Ifx_00056] dX axis distribution points shall be calculated based on Offset and
Shift values.
X_array [index] = Offset + index * 2Shift
If Offset = 10, Shift = 2 and N = 5 then,
X_array[5] = {10, 14, 18, 22, 26}c()
[SWS_Ifx_00057] dIf (X_array[0] < Xin < X_array[N -1]), then
index = lowest index for which (Xin < X_array[index + 1]).
RatioX = (Xin - X_array[index]) / (X_array [index+1] - X_array [index])
Result = Val_array[index] + (Val_array[index+1] - Val_array[index]) * RatioXc()
[SWS_Ifx_00058] dInput value matches with one of the distribution array value then
result shall be respective Y array element indicated by index.
If (Xin == X_array[index])
Result = Val_array[index]c()
4
Parameters (out) None
Return value <OutType> Entry point of the result array
Description This routine returns respective entry value of the result distribution array at position Xin based
on below equations.
Available via Ifx.h
c()
[SWS_Ifx_00071] dX axis distribution points shall be calculated based on Offset and
Shift values.
X_array [index] = Offset + index * 2Shift
If Offset = 10, Shift = 2 and N = 5 then,
X_array[5] = {10, 14, 18, 22, 26}c()
[SWS_Ifx_00072] dIf (X_array[0] < Xin < X_array[N -1]), then
index = lowest index for which (Xin < X_array[index + 1]).
Result = Val_array[index]c()
[SWS_Ifx_00073] dInput value matches with one of the distribution array value then
result shall be respective Y array element indicated by index.
If (Xin == X_array[index]) then,
Result = Val_array[index]c()
[SWS_Ifx_00074] dIf (Xin < X_array[0]) then,
Result = Val_array[0]c()
[SWS_Ifx_00075] dIf (Xin > X_array[N-1]) then,
Result = Val_array[N-1]c()
[SWS_Ifx_00076] dThe minimum value of N shall be 1c()
[SWS_Ifx_00077] dHere is the list of implemented routinesc()
Routine ID[hex] Routine prototype
0x045 uint8 Ifx_IntLkUpFixCur_u8_u8 (uint8, uint8, const uint8 *,
uint8, uint8)
0x046 uint16 Ifx_IntLkUpFixCur_u16_u16 (uint16, uint16, const
uint16 *, uint16, uint16)
0x047 sint8 Ifx_IntLkUpFixCur_s8_s8 (sint8, sint8, const sint8 *,
sint8, sint8)
0x048 sint16 Ifx_IntLkUpFixCur_s16_s16 (sint16, sint16, const
sint16 *, sint16, sint16)
0x0D3 sint32 Ifx_IntLkUpFixCur_s32_s32 (sint32 Xin, sint32 N,
const sint32* Val_array, sint32 offset, sint32 shift)
0x0D4 uint32 Ifx_IntLkUpFixCur_u32_u32 (uint32 Xin, uint32 N,
const uint32* Val_array, uint32 offset, uint32 shift)
c()
[SWS_Ifx_00081] dX axis distribution points shall be calculated based on Offset and
Interval values.
X_array [index] = offset + index * Interval
If Offset = 5, Interval = 12 and N = 5 then,
X_array[5] = {5, 17, 29, 41, 53}c()
[SWS_Ifx_00082] dIf (X_array[0] < Xin < X_array[N -1]), then
index = lowest index for which (Xin < X_array[index + 1]).
RatioX = (Xin - X_array[index]) / (X_array [index+1] - X_array [index])
Result = Val_array[index] + (Val_array[index+1] - Val_array[index]) * RatioXc()
[SWS_Ifx_00083] dInput value matches with one of the distribution array value then
result shall be respective Y array element indicated by index.
If (Xin == X_array[index])
Result = Val_array[index]c()
4
Return value <OutType> Entry point of the result array
Description This routine returns respective entry value of the result distribution array at position Xin based
on below equations.
Available via Ifx.h
c()
[SWS_Ifx_00091] dX axis distribution points shall be calculated based on Offset and
Interval values.
X_array [index] = offset + index * Interval
If Offset = 5, Interval = 12 and N = 5 then,
X_array[5] = {5, 17, 29, 41, 53}c()
[SWS_Ifx_00092] dIf (X_array[0] < Xin < X_array[N -1]), then
index = lowest index for which (Xin < X_array[index + 1]).
Result = Val_array[index]c()
[SWS_Ifx_00093] dInput value matches with one of the distribution array value then
result shall be respective Y array element indicated by index.
If (Xin == X_array[index])
Result = Val_array[index]c()
[SWS_Ifx_00094] dIf (Xin < X_array[0]) then,
Result = Val_array[0]c()
[SWS_Ifx_00095] dIf (Xin > X_array[N-1]) then,
Result = Val_array[N-1]c()
[SWS_Ifx_00096] dThe minimum value of N shall be 1c()
[SWS_Ifx_00097] dHere is the list of implemented routines.c()
Routine ID[hex] Routine prototype
0x050 uint8 Ifx_IntLkUpFixICur_u8_u8 ( uint8, uint8, const uint8 *,
uint8, uint8)
0x051 uint16 Ifx_IntLkUpFixICur_u16_u16 (uint16, uint16, const
uint16 *, uint16, uint16)
0x052 sint8 Ifx_IntLkUpFixICur_s8_s8 ( sint8, sint8, const sint8 *,
sint8, sint8)
0x053 sint16 Ifx_IntLkUpFixICur_s16_s16 ( sint16, sint16, const
sint16 *, sint16, sint16)
0x0D7 sint32 Ifx_IntLkUpFixICur_s32_s32 ( sint32 Xin, sint32 N,
const sint32 * Val_array, sint32 offset, sint32 Interval)
0x0D8 uint32 Ifx_IntLkUpFixICur_u32_u32 ( uint32 Xin, uint32 N,
const uint32 * Val_array, uint32 offset, uint32 Interval)
c()
[SWS_Ifx_00099] dIndex calculation :
indexX = minimum value of index if (X_array[indexX] < Xin < X_array[indexX+1])
indexY = minimum value of index if (Y_array[indexY] < Yin < Y_array[indexY+1])
BaseIndex = IndexX * Ny + indexYc()
[SWS_Ifx_00100] dRatio calculation :
RatioX = (Xin - X_array[indexX]) / (X_array [indexX+1] - X_array [indexX])
RatioY = (Yin - Y_array[indexY]) / (Y_array [indexY+1] - Y_array [indexY])c()
[SWS_Ifx_00101] dLowerY = Val_array [BaseIndex]
UpperY = Val_array [BaseIndex + 1]
LowerX = LowerY + (UpperY - LowerY) * RatioY
LowerY = Val_array [BaseIndex + Ny]
4
Routine ID[hex] Routine prototype
0x062 sint8 Ifx_IntIpoMap_u16u8_s8 (uint16, uint8, uint16, uint16,
const uint16 *, const uint8 *, const sint8 * )
0x063 sint16 Ifx_IntIpoMap_u16u8_s16 (uint16, uint8, uint16,
uint16, const uint16 *, const uint8 *, const sint16 * )
0x064 uint8 Ifx_IntIpoMap_u16u16_u8 (uint16, uint16, uint16,
uint16, const uint16 *, const uint16 *, const uint8 * )
0x065 uint16 Ifx_IntIpoMap_u16u16_u16 (uint16, uint16, uint16,
uint16, const uint16 *, const uint16 *, const uint16 * )
0x066 sint8 Ifx_IntIpoMap_u16u16_s8 (uint16, uint16, uint16,
uint16, const uint16 *, const uint16 *, const sint8 * )
0x067 sint16 Ifx_IntIpoMap_u16u16_s16 (uint16, uint16, uint16,
uint16, const uint16 *, const uint16 *, const sint16 * )
0x068 uint8 Ifx_IntIpoMap_u16s8_u8 (uint16, sint8, uint16, uint16,
const uint16 *, const sint8 *, const uint8 * )
0x069 uint16 Ifx_IntIpoMap_u16s8_u16 (uint16, sint8, uint16,
uint16, const uint16 *, const sint8 *, const uint16 * )
0x06A sint8 Ifx_IntIpoMap_u16s8_s8 (uint16, sint8, uint16, uint16,
const uint16 *, const sint8 *, const sint8 * )
0x06B sint16 Ifx_IntIpoMap_u16s8_s16 (uint16, sint8, uint16,
uint16, const uint16 *, const sint8 *, const sint16 * )
0x06C uint8 Ifx_IntIpoMap_u16s16_u8 (uint16, sint16, uint16,
uint16, const uint16 *, const sint16 *, const uint8 * )
0x06D uint16 Ifx_IntIpoMap_u16s16_u16 (uint16, sint16, uint16,
uint16, const uint16 *, const sint16 *, const uint16 * )
0x06E sint8 Ifx_IntIpoMap_u16s16_s8 (uint16, sint16, uint16,
uint16, const uint16 *, const sint16 *, const sint8 * )
0x06F sint16 Ifx_IntIpoMap_u16s16_s16 (uint16, sint16, uint16,
uint16, const uint16 *, const sint16 *, const sint16 * )
0x070 uint8 Ifx_IntIpoMap_s16u8_u8 (sint16, uint8, sint16, sint16,
const sint16 *, const uint8 *, const uint8 * )
0x071 uint16 Ifx_IntIpoMap_s16u8_u16 (sint16, uint8, sint16,
sint16, const sint16 *, const uint8 *, const uint16 * )
0x072 sint8 Ifx_IntIpoMap_s16u8_s8 (sint16, uint8, sint16, sint16,
const sint16 *, const uint8 *, const sint8 * )
0x073 sint16 Ifx_IntIpoMap_s16u8_s16 (sint16, uint8, sint16,
sint16, const sint16 *, const uint8 *, const sint16 * )
0x074 uint8 Ifx_IntIpoMap_s16s8_u8 (sint16, sint8, sint16, sint16,
const sint16 *, const sint8 *, const uint8 * )
0x075 uint16 Ifx_IntIpoMap_s16s8_u16 (sint16, sint8, sint16,
sint16, const sint16 *, const sint8 *, const uint16 * )
0x076 sint8 Ifx_IntIpoMap_s16s8_s8 (sint16, sint8, sint16, sint16,
const sint16 *, const sint8 *, const sint8 * )
0x077 sint16 Ifx_IntIpoMap_s16s8_s16 (sint16, sint8, sint16,
sint16, const sint16 *, const sint8 *, const sint16 * )
0x078 uint8 Ifx_IntIpoMap_s16s16_u8 (sint16, sint16, sint16,
sint16, const sint16 *, const sint16 *, const uint8 * )
0x079 uint16 Ifx_IntIpoMap_s16s16_u16 (sint16, sint16, sint16,
sint16, const sint16 *, const sint16 *, const uint16 * )
0x07A sint8 Ifx_IntIpoMap_s16s16_s8 (sint16, sint16, sint16,
sint16, const sint16 *, const sint16 *, const sint8 * )
0x07B sint16 Ifx_IntIpoMap_s16s16_s16 (sint16, sint16, sint16,
sint16, const sint16 *, const sint16 *, const sint16 * )
5
4
Routine ID[hex] Routine prototype
0x07C uint8 Ifx_IntIpoMap_u8u8_u8 (uint8, uint8, uint8, uint8, const
uint8 *, const uint8 *, const uint8 * )
0x07D uint16 Ifx_IntIpoMap_u8u8_u16 (uint8, uint8, uint8, uint8,
const uint8 *, const uint8 *, const uint16 * )
0x07E sint8 Ifx_IntIpoMap_u8u8_s8 (uint8, uint8, uint8, uint8, const
uint8 *, const uint8 *, const sint8 * )
0x07F sint16 Ifx_IntIpoMap_u8u8_s16 (uint8, uint8, uint8, uint8,
const uint8 *, const uint8 *, const sint16 * )
0x080 uint8 Ifx_IntIpoMap_u8s8_u8 (uint8, sint8, uint8, uint8, const
uint8 *, const sint8 *, const uint8 * )
0x081 uint16 Ifx_IntIpoMap_u8s8_u16 (uint8, sint8, uint8, uint8,
const uint8 *, const sint8 *, const uint16 * )
0x082 sint8 Ifx_IntIpoMap_u8s8_s8 (uint8, sint8, uint8, uint8, const
uint8 *, const sint8 *, const sint8 * )
0x083 sint16 Ifx_IntIpoMap_u8s8_s16 (uint8, sint8, uint8, uint8,
const uint8 *, const sint8 *, const sint16 * )
0x084 uint8 Ifx_IntIpoMap_s8s8_u8 (sint8, sint8, sint8, sint8, const
sint8 *, const sint8 *, const uint8 * )
0x085 uint16 Ifx_IntIpoMap_s8s8_u16 (sint8, sint8, sint8, sint8,
const sint8 *, const sint8 *, const uint16 * )
0x086 sint8 Ifx_IntIpoMap_s8s8_s8 (sint8, sint8, sint8, sint8, const
sint8 *, const sint8 *, const sint8 * )
0x087 sint16 Ifx_IntIpoMap_s8s8_s16 (sint8, sint8, sint8, sint8,
const sint8 *, const sint8 *, const sint16 * )
0x0D9 sint32 Ifx_IntIpoMap_s32s32_s32 (sint32 Xin, sint32 Yin,
sint32 Nx, sint32 Ny, const sint32 * X_array, const sint32 *
Y_array, const sint32 * Val_array)
0x0DA uint32 Ifx_IntIpoMap_u32u32_u32 (uint32 Xin, uint32 Yin,
uint32 Nx, uint32 Ny, const uint32 * X_array, const uint32 *
Y_array, const uint32 * Val_array)
c()
[SWS_Ifx_00112] dIndex calculation:
indexX = minimum value of index if (X_array[indexX] < Xin < X_array[indexX+1])
indexY = minimum value of index if (Y_array[indexY] < Yin < Y_array[indexY+1])
BaseIndex = IndexX * Ny + indexYc()
[SWS_Ifx_00113] dRatio calculation:
if (indexX < (Nx - 1))
RatioX = (Xin - X_array[indexX]) / (X_array [indexX+1] - X_array [indexX])
else
RatioX = 0
if (indexY < (Ny - 1))
RatioY = (Yin - Y_array[indexY]) / (Y_array [indexY+1] - Y_array [indexY])
else
RatioY = 0c()
[SWS_Ifx_00114] dif(RatioX < 0.5 && RatioY < 0.5) then
Result = Val_array [BaseIndex]
if(RatioX ≥ 0.5 && RatioY < 0.5) then
Result = Val_array [BaseIndex + Ny]
if(RatioX < 0.5 && RatioY ≥ 0.5) then
Result = Val_array [BaseIndex + 1]
if(RatioX ≥ 0.5 && RatioY ≥ 0.5) then
Result = Val_array [BaseIndex + Ny + 1]c()
[SWS_Ifx_00116] dIf (Xin == X_array[indexX]) and (Yin == Y_array[indexY])
Result = Val_array [BaseIndex]c()
[SWS_Ifx_00117] dIf Xin < X_array[0], then
indexX = 0c()
[SWS_Ifx_00118] dIf Xin > X_array[Nx-1], then
indexX = Nx - 1c()
[SWS_Ifx_00119] dIf Yin < Y_array[0], then
indexY = 0c()
[SWS_Ifx_00120] dIf Yin > Y_array[Ny-1], then
indexY = Ny - 1c()
[SWS_Ifx_00121] dThe minimum value of Nx and Ny shall be 1c()
[SWS_Ifx_00122] dHere is the list of implemented routines.c()
Routine ID[hex] Routine prototype
0x08A uint8 Ifx_IntLkUpMap_u8u8_u8(uint8, uint8, uint8, uint8,
const uint8 *, const uint8 *, const uint8 *)
0x08B sint8 Ifx_IntLkUpMap_s8s8_s8 (sint8, sint8, sint8, sint8,
const sint8 *, const sint8 *, const sint8 *)
0x08C uint16 Ifx_IntLkUpMap_u16u16_u16 (uint16, uint16, uint16,
uint16, const uint16 *, const uint16 *, const uint16 *)
0x08D sint16 Ifx_IntLkUpMap_s16s16_s16 (sint16, sint16, sint16,
sint16, const sint16 *, const sint16 *, const sint16 *)
0x0DB sint32 Ifx_IntLkUpMap_s32s32_s32 (sint32 Xin, sint32 Yin,
sint32 Nx, sint32 Ny, const sint32 * X_array, const sint32 *
Y_array, const sint32 * Val_array)
5
4
Routine ID[hex] Routine prototype
0x0DC uint32 Ifx_IntLkUpMap_u32u32_u32 (uint32 Xin, uint32 Yin,
uint32 Nx, uint32 Ny, const uint32 * X_array, const uint32 *
Y_array, const uint32 * Val_array)
c()
[SWS_Ifx_00212] dIndex calculation:
indexX = minimum value of index if (X_array[indexX] < Xin < X_array[indexX+1])
indexY = minimum value of index if (Y_array[indexY] < Yin < Y_array[indexY+1])
BaseIndex = IndexX * Ny + indexYc()
[SWS_Ifx_00214] dReturn Value = Val_array [BaseIndex]c()
[SWS_Ifx_00216] dIf (Xin == X_array[indexX]) and (Yin == Y_array[indexY])
Result = Val_array [BaseIndex]c()
[SWS_Ifx_00217] dIf Xin < X_array[0], then
indexX = 0c()
[SWS_Ifx_00218] dIf Xin > X_array[Nx-1], then
indexX = Nx - 1c()
c()
[SWS_Ifx_00124] dX and Y axis distribution points shall be calculated based on Offset
and Shift values.
X_array[index] = OffsetX + index * 2ShiftX
Y_array[index] = OffsetY + index * 2ShiftY
If Offset = 10, Shift = 2 and N = 5 then,
axis = {10, 14, 18, 22, 26} (applicable to X and Y axis)c()
[SWS_Ifx_00125] dIndex calculation :
indexX = minimum value of index if (X_array[indexX] < Xin < X_array[indexX+1])
indexY = minimum value of index if (Y_array[indexY] < Yin < Y_array[indexY+1])
4
OffsetX Offset of the first sampling value for X-axis
ShiftX ’Shift’ is the power of 2, (2ˆShiftX) represents X-axis distribution
point interval
OffsetY Offset of the first sampling value for Y-axis
ShiftY ’Shift’ is the power of 2, (2ˆShiftY) represents Y-axis distribution
point interval
Parameters (inout) None
Parameters (out) None
Return value <OutType> Entry point of the result array
Description This routine returns respective entry value of the result distribution array at position Xin and Yin
based on below equations.
Available via Ifx.h
c()
[SWS_Ifx_00140] dX and Y axis distribution points shall be calculated based on Offset
and Shift values.
X_array[index] = offsetX + index * 2ShiftX
Y_array[index] = offsetY + index * 2ShiftY
If Offset = 10, shift = 2 and N = 5 then,
axis = {10, 14, 18, 22, 26} (applicable to X and Y axis)c()
[SWS_Ifx_00141] dIndex calculation:
indexX = minimum value of index if (X_array[indexX] < Xin < X_array[indexX+1])
indexY = minimum value of index if (Y_array[indexY] < Yin < Y_array[indexY+1])
BaseIndex = IndexX * Ny + indexYc()
[SWS_Ifx_00143] dRatio calculation:
if (indexX < (Nx - 1))
RatioX = (Xin - X_array[indexX]) / (X_array [indexX+1] - X_array [indexX])
else
RatioX = 0
if (indexY < (Ny - 1))
RatioY = (Yin - Y_array[indexY]) / (Y_array [indexY+1] - Y_array [indexY])
else
RatioY = 0c()
[SWS_Ifx_00144] dif(RatioX < 0.5 && RatioY < 0.5) then
Result = Val_array [BaseIndex]
c()
[SWS_Ifx_00226] dX and Y axis distribution points shall be calculated based on Offset
and Shift values.
X_array[index] = offsetX + index * 2ShiftX
Y_array[index] = offsetY + index * 2ShiftY
If Offset = 10, shift = 2 and N = 5 then,
axis = {10, 14, 18, 22, 26} (applicable to X and Y axis)c()
[SWS_Ifx_00227] dIndex calculation:
indexX = minimum value of index if (X_array[indexX] < Xin < X_array[indexX+1])
c()
[SWS_Ifx_00154] dX and Y axis distribution points shall be calculated based on Offset
and Interval values.
X_array[index] = offsetX + index * IntervalX
Y_array[index] = offsetY + index * IntervalY
If Offset = 10, Interval = 2 and N = 5 then,
axis = {10, 12, 14, 16, 18} (applicable to X and Y axis)c()
[SWS_Ifx_00155] dIndex calculation :
indexX = minimum value of index if (X_array[indexX] < Xin < X_array[indexX+1])
indexY = minimum value of index if (Y_array[indexY] < Yin < Y_array[indexY+1])
BaseIndex = IndexX * Ny + indexYc()
4
OffsetX Offset of the first sampling value for X-axis
IntervalX represents X-axis distribution point interval
OffsetY Offset of the first sampling value for Y-axis
IntervalY represents Y-axis distribution point interval
Parameters (inout) None
Parameters (out) None
Return value <OutType> Entry point of the result array
Description This routine returns respective entry value of the result distribution array at position Xin and Yin
based on below equations.
Available via Ifx.h
c()
[SWS_Ifx_00170] dX and Y axis distribution points shall be calculated based on Offset
and Interval values.
X_array[index] = offsetX + index * IntervalX
Y_array[index] = offsetY + index * IntervalY
If Offset = 10, Interval = 2 and N = 5 then,
axis = {10, 12, 14, 16, 18} (applicable to X and Y axis)c()
[SWS_Ifx_00171] dIndex calculation:
indexX = minimum value of index if (X_array[indexX] < Xin < X_array[indexX+1])
indexY = minimum value of index if (Y_array[indexY] < Yin < Y_array[indexY+1])
BaseIndex = IndexX * Ny + indexYc()
[SWS_Ifx_00173] dRatio calculation:
if (indexX < (Nx - 1))
RatioX = (Xin - X_array[indexX]) / (X_array [indexX+1] - X_array [indexX])
else
RatioX = 0
if (indexY < (Ny - 1))
RatioY = (Yin - Y_array[indexY]) / (Y_array [indexY+1] - Y_array [indexY])
else
RatioY = 0c()
[SWS_Ifx_00174] dif(RatioX < 0.5 && RatioY < 0.5) then
Result = Val_array [BaseIndex]
if(RatioX ≥ 0.5 && RatioY < 0.5) then
c()
[SWS_Ifx_00237] dX and Y axis distribution points shall be calculated based on Offset
and Interval values.
X_array[index] = offsetX + index * IntervalX
Y_array[index] = offsetY + index * IntervalY
If Offset = 10, Interval = 2 and N = 5 then,
axis = {10, 12, 14, 16, 18} (applicable to X and Y axis)c()
[SWS_Ifx_00238] dIndex calculation:
indexX = minimum value of index if (X_array[indexX] < Xin < X_array[indexX+1])
indexY = minimum value of index if (Y_array[indexY] < Yin < Y_array[indexY+1])
c()
[SWS_Ifx_91003] d
Based on searched indices and ratios information using the relevant Ifx_DPSearch
routine, this routine calculates and returns the interpolation result for 3D cuboids.
The axis order memory representation is [z][x][y]. This is the column-major orientation
COLUMN_DIR from the ASAM standard. The first axis z specifies the selected slice.
Implementation:
Linear interpolation along x-axis between the result of two 2D interpolations between
neighbouring X/Y Maps.
num_slice = num_x * num_y
if(dpResultZ->Ratio==0)
Result=Ifx_IpoMap_<OutTypeMn> (dpResultX, dpResultY, num_y, Val_array[num_
slice * dpResultZ->Index])
else
LowerXY=Ifx_IpoMap_<OutTypeMn> (dpResultX, dpResultY, num_y, Val_array[num_
slice * dpResultZ ->Index])
c()
Record layout specifies calibration data serialization in the ECU memory which de-
scribes the shape of the characteristics. Single record layout can be referred by multi-
ple instances of interpolation ParameterDataPrototype. Record layouts can be nested
particular values refer to the particular property of the object. With different properties
of record layouts it is possible to specify complex objects.
2. If the "X" and "Y" inputs are swapped then, values "Val" of maps have to be in ROW_
DIR order.
According to ASAM standard [ASAM MCD-2MC Version 1.5.1 and 1.6], COLUMN_DIR
and ROW_DIR are formats of storing map values (Val[]) and more information can be
found in ASAM standard.
The "Z" input of cuboids is the third dimension and selects the slice X / Y or Y / X - 2D
maps.
Example for cuboids order:
2x2x2 cuboid representation in memory shall be COLUMN_DIR according to the ASAM
standard : [1 2 3 4 5 6 7 8]
COLUMN_DIR order [z][x][y]:
Slice 1:
[1 2
3 4]
Slice 2:
[5 6
7 8]
Below table specifies record layouts supported for distributed interpolation routines.
[SWS_Ifx_00185] d
Record layout Name Element1 Element2
Distr_s8 sint8 N sint8 X[]
Distr_u8 uint8 N uint8 X[]
Distr_s16 sint16 N sint16 X[]
Distr_u16 uint16 N uint16 X[]
Cur_u8 uint8 Val[]
Cur_u16 uint16 Val[]
Cur_s8 sint8 Val[]
Cur_s16 sint16 Val[]
Map_u8 uint8 Val[]
Map_u16 uint16 Val[]
Map_s8 sint8 Val[]
Map_s16 sint16 Val[]
Cur_u32 uint32 Val[]
Cur_s32 sint32 Val[]
5
4
Map_u32 uint32 Val[]
Map_s32 sint32 Val[]
Cub_s8 sint8 Val[]
Cub_s16 sint16 Val[]
Cub_u8 uint8 Val[]
Cub_u16 uint16 Val[]
c()
Below table specifies record layouts supported for integrated interpolation routines.
[SWS_Ifx_00186] d
For IntTypeMn, OutTypeMN of {s8, u8,s16, u16,s32, u32}
IntCur_<nTypeMn>_<OutTypeMn>
FixIntCur_<InTypeMn>_<OutTypeMn>
IntMap_<InTypeMn><InTypeMn>_<OutTypeMn>
FixIntMap_<InTypeMn><InTypeMn>_<OutTypeMn>
For InTypeMn, OutTypeMn of {s8, u8, s16, u16}
IntCub_<InTypeMn><InTypeMn><InTypeMn>_<OutTypeMn>
Remark:
All combinations have to be defined in IFX_RecordLayout_Blueprint, AUTOSAR_
MOD_IFX_RecordLayout_Blueprint.arxml
Note: As mentioned in in chapter 8.4, interpolation routines optimization is achieved
by swaping X and Y axis during function call for Call-back notifications for below men-
tioned record layouts.
From Map_u8u16_u8 (S. No 61) to Map_s16u16_s16 (S. No 84)c()
8.7.1 Ifx_GetVersionInfo
None
None
None
9 Sequence diagrams
Not applicable.
10 Configuration specification
In general, this chapter defines configuration parameters and their clustering into con-
tainers. In order to support the specification Chapter 10.1 describes fundamentals.
It also specifies a template (table) you shall use for the parameter specification. We
intend to leave Chapter 10.1 in the specification to guarantee comprehension.
Chapter 10.2 specifies the structure (containers) and the parameters of the module
Ifx.
Chapter 10.3 specifies published information of the module Ifx.
none
Number Heading
[SWS_Ifx_00002] Definition of datatype Ifx_DPResultU16_Type
[SWS_Ifx_00014]
[SWS_Ifx_00017]
[SWS_Ifx_00022]
[SWS_Ifx_00027]
[SWS_Ifx_00032]
[SWS_Ifx_00041]
[SWS_Ifx_00051]
[SWS_Ifx_00062]
[SWS_Ifx_00077]
[SWS_Ifx_00087]
[SWS_Ifx_00097]
[SWS_Ifx_00110]
[SWS_Ifx_00122]
[SWS_Ifx_00136]
[SWS_Ifx_00151]
[SWS_Ifx_00166]
[SWS_Ifx_00181]
[SWS_Ifx_00209]
[SWS_Ifx_00222]
[SWS_Ifx_00236]
[SWS_Ifx_00247]
[SWS_Ifx_91001] Definition of imported datatypes of module Ifx
Table B.1: Changed Specification Items in R23-11
none