AUTOSAR SWS IFXLibrary PDF
AUTOSAR SWS IFXLibrary PDF
Disclaimer
This specification 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 specification.
The material contained in this specification is protected by copyright and other types
of Intellectual Property Rights. The commercial exploitation of the material contained
in this specification requires a license to such Intellectual Property Rights.
This specification 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 specification may be utilized or reproduced, in any form or by any means, without
permission in writing from the publisher.
The AUTOSAR specifications have been developed for automotive applications only.
They have neither been developed, nor tested for non-automotive applications.
The word AUTOSAR and the AUTOSAR logo are registered trademarks.
Any such exemplary items are contained in the specifications for illustration purposes
only, and they themselves are not part of the AUTOSAR Standard. Neither their
presence in such specifications, nor any later documentation of AUTOSAR confor-
mance of products actually implementing such exemplary items, imply that intellectu-
al property rights covering such exemplary items are licensed under the same rules
as applicable to the AUTOSAR Standard.
Table of Contents
3 Related documentation........................................................................................ 9
3.1 Input documents ........................................................................................... 9
3.2 Related standards and norms ...................................................................... 9
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 traceability .................................................................................. 14
Known Limitations
A Application Layer
U
T
Runtime Environment (RTE)
O
S Basic Software
A
R
L
I
B
ECU Hardware
Figure : Layered architecture
Ifx routines specification specifies the functionality, API and the configuration of the
AUTOSAR library dedicated to interpolation routines for fixed point values.
All routines are re-entrant and can be used by multiple applications at the same time.
Abbreviation / Description:
Acronym:
Cur Curve for Interpolation
DPSearch Data point search
DPResult Data point result
Ifx Interpolation Fixed point
IpoCur Interpolation of curve used for distributed search and interpolation
LkUpCur Curve look-up used for distributed search and interpolation
IpoMap Interpolation of map used for distributed search and interpolation
LkUpMap Map look-up used for distributed search and interpolation
IntIpoCur Integrated interpolation of curve
IntLkUpCur Integrated curve look-up
IntIpoFixCur Integrated interpolation of fixed curve
IntLkUpFixCur Integrated fixed curve look-up
IntIpoFixICur Integrated interpolation of fixed interval curve
IntLkUpFixICur Integrated fixed interval curve look-up
IntIpoMap Integrated interpolation of map
IntLkUpMap Integrated map look-up
IntIpoFixMap Integrated interpolation of fixed map
IntLkUpFixMap Integrated fixed map look-up
IntIpoFixIMap Integrated interpolation of fixed interval map
IntLkUpFixIMap Integrated fixed interval map look-up
Lib Library
Map Map for Interpolation
s8 Mnemonic for the sint8, specified in AUTOSAR_SWS_PlatformTypes
s16 Mnemonic for the sint16, specified in AUTOSAR_SWS_PlatformTypes
s32 Mnemonic for the sint32, specified in AUTOSAR_SWS_PlatformTypes
u8 Mnemonic for the uint8, specified in AUTOSAR_SWS_PlatformTypes
u16 Mnemonic for the uint16, specified in AUTOSAR_SWS_PlatformTypes
u32 Mnemonic for the uint32, specified in AUTOSAR_SWS_PlatformTypes
3 Related documentation
[12] IFX_RecordLayout_Blueprint,
AUTOSAR_MOD_IFX_RecordLayout_Blueprint.arxml
[14] MISRA-C 2004: Guidelines for the use of the C language in critical systems, Oc-
tober 2004
4.1 Limitations
No limitations.
Option 1 : <Name> can be function name providing one C file per function,
eg.: Ifx_IntIpoMap_u16u8_u8.c etc.
Option 3 : <Name> can be removed so that single C file shall contain all Ifx functions,
eg.: Ifx.c.
Using above options gives certain flexibility of choosing suitable granularity with re-
duced number of C files. Linking only on-demand is also possible in case of some
options.
6 Requirements traceability
Requirement Description Satisfied by
- - SWS_Ifx_00002
- - SWS_Ifx_00003
- - SWS_Ifx_00004
- - SWS_Ifx_00006
- - SWS_Ifx_00008
- - SWS_Ifx_00009
- - SWS_Ifx_00010
- - SWS_Ifx_00011
- - SWS_Ifx_00013
- - SWS_Ifx_00014
- - SWS_Ifx_00015
- - SWS_Ifx_00016
- - SWS_Ifx_00017
- - SWS_Ifx_00020
- - SWS_Ifx_00021
- - SWS_Ifx_00022
- - SWS_Ifx_00025
- - SWS_Ifx_00026
- - SWS_Ifx_00027
- - SWS_Ifx_00030
- - SWS_Ifx_00031
- - SWS_Ifx_00032
- - SWS_Ifx_00033
- - SWS_Ifx_00035
- - SWS_Ifx_00036
- - SWS_Ifx_00037
- - SWS_Ifx_00038
- - SWS_Ifx_00039
- - SWS_Ifx_00040
- - SWS_Ifx_00041
- - SWS_Ifx_00045
- - SWS_Ifx_00046
- - SWS_Ifx_00047
- - SWS_Ifx_00048
- - SWS_Ifx_00049
- - SWS_Ifx_00050
- - SWS_Ifx_00051
14 of 71 Document ID 396: AUTOSAR_SWS_IFXLibrary
- AUTOSAR confidential -
Specification of Fixed Point Interpolation Routines
AUTOSAR Release 4.2.2
- - SWS_Ifx_00055
- - SWS_Ifx_00056
- - SWS_Ifx_00057
- - SWS_Ifx_00058
- - SWS_Ifx_00059
- - SWS_Ifx_00060
- - SWS_Ifx_00061
- - SWS_Ifx_00062
- - SWS_Ifx_00070
- - SWS_Ifx_00071
- - SWS_Ifx_00072
- - SWS_Ifx_00073
- - SWS_Ifx_00074
- - SWS_Ifx_00075
- - SWS_Ifx_00076
- - SWS_Ifx_00077
- - SWS_Ifx_00080
- - SWS_Ifx_00081
- - SWS_Ifx_00082
- - SWS_Ifx_00083
- - SWS_Ifx_00084
- - SWS_Ifx_00085
- - SWS_Ifx_00086
- - SWS_Ifx_00087
- - SWS_Ifx_00090
- - SWS_Ifx_00091
- - SWS_Ifx_00092
- - SWS_Ifx_00093
- - SWS_Ifx_00094
- - SWS_Ifx_00095
- - SWS_Ifx_00096
- - SWS_Ifx_00097
- - SWS_Ifx_00098
- - SWS_Ifx_00099
- - SWS_Ifx_00100
- - SWS_Ifx_00101
- - SWS_Ifx_00102
- - SWS_Ifx_00103
- - SWS_Ifx_00104
- - SWS_Ifx_00105
- - SWS_Ifx_00106
- - SWS_Ifx_00107
- - SWS_Ifx_00108
- - SWS_Ifx_00109
- - SWS_Ifx_00110
- - SWS_Ifx_00111
- - SWS_Ifx_00112
- - SWS_Ifx_00113
- - SWS_Ifx_00114
- - SWS_Ifx_00116
- - SWS_Ifx_00117
- - SWS_Ifx_00118
- - SWS_Ifx_00119
- - SWS_Ifx_00120
- - SWS_Ifx_00121
- - SWS_Ifx_00122
- - SWS_Ifx_00123
- - SWS_Ifx_00124
- - SWS_Ifx_00125
- - SWS_Ifx_00126
- - SWS_Ifx_00127
- - SWS_Ifx_00128
- - SWS_Ifx_00129
- - SWS_Ifx_00130
- - SWS_Ifx_00131
- - SWS_Ifx_00132
- - SWS_Ifx_00133
- - SWS_Ifx_00134
- - SWS_Ifx_00135
- - SWS_Ifx_00136
- - SWS_Ifx_00139
- - SWS_Ifx_00140
- - SWS_Ifx_00141
- - SWS_Ifx_00143
- - SWS_Ifx_00144
- - SWS_Ifx_00145
- - SWS_Ifx_00146
- - SWS_Ifx_00147
- - SWS_Ifx_00148
- - SWS_Ifx_00149
- - SWS_Ifx_00150
- - SWS_Ifx_00151
- - SWS_Ifx_00153
- - SWS_Ifx_00154
- - SWS_Ifx_00155
- - SWS_Ifx_00156
- - SWS_Ifx_00157
- - SWS_Ifx_00158
- - SWS_Ifx_00159
- - SWS_Ifx_00160
- - SWS_Ifx_00161
- - SWS_Ifx_00162
- - SWS_Ifx_00163
- - SWS_Ifx_00164
- - SWS_Ifx_00165
- - SWS_Ifx_00166
- - SWS_Ifx_00169
- - SWS_Ifx_00170
- - SWS_Ifx_00171
- - SWS_Ifx_00173
- - SWS_Ifx_00174
- - SWS_Ifx_00175
- - SWS_Ifx_00176
- - SWS_Ifx_00177
- - SWS_Ifx_00178
- - SWS_Ifx_00179
- - SWS_Ifx_00180
- - SWS_Ifx_00181
- - SWS_Ifx_00185
- - SWS_Ifx_00186
- - SWS_Ifx_00200
- - SWS_Ifx_00201
- - SWS_Ifx_00202
- - SWS_Ifx_00203
- - SWS_Ifx_00204
- - SWS_Ifx_00205
- - SWS_Ifx_00206
- - SWS_Ifx_00207
- - SWS_Ifx_00208
- - SWS_Ifx_00209
- - SWS_Ifx_00211
- - SWS_Ifx_00212
- - SWS_Ifx_00214
- - SWS_Ifx_00216
- - SWS_Ifx_00217
- - SWS_Ifx_00218
- - SWS_Ifx_00219
- - SWS_Ifx_00220
- - SWS_Ifx_00221
- - SWS_Ifx_00222
- - SWS_Ifx_00225
- - SWS_Ifx_00226
- - SWS_Ifx_00227
- - SWS_Ifx_00229
- - SWS_Ifx_00230
- - SWS_Ifx_00231
- - SWS_Ifx_00232
- - SWS_Ifx_00233
- - SWS_Ifx_00234
- - SWS_Ifx_00235
- - SWS_Ifx_00236
- - SWS_Ifx_00237
- - SWS_Ifx_00238
- - SWS_Ifx_00240
- - SWS_Ifx_00241
- - SWS_Ifx_00242
- - SWS_Ifx_00243
- - SWS_Ifx_00244
- - SWS_Ifx_00245
- - SWS_Ifx_00246
- - SWS_Ifx_00247
- - SWS_Ifx_00248
- - SWS_Ifx_00249
- - SWS_Ifx_00820
- - SWS_Ifx_00821
- - SWS_Ifx_00823
BSW - SWS_Ifx_00999
SRS_BSW_00003 All software modules shall provide version and identifica- SWS_Ifx_00815
tion information
SRS_BSW_00007 All Basic SW Modules written in C language shall con- SWS_Ifx_00809
form to the MISRA C 2004 Standard.
SRS_BSW_00304 All AUTOSAR Basic Software Modules shall use the SWS_Ifx_00812
following data types instead of native C data types
SRS_BSW_00306 AUTOSAR Basic Software Modules shall be compiler SWS_Ifx_00813
and platform independent
SRS_BSW_00318 Each AUTOSAR Basic Software Module file shall provide SWS_Ifx_00815
version numbers in the header file
SRS_BSW_00321 The version numbers of AUTOSAR Basic Software Mo- SWS_Ifx_00815
dules shall be enumerated according specific rules
SRS_BSW_00348 All AUTOSAR standard types and constants shall be SWS_Ifx_00811
placed and organized in a standard type header file
SRS_BSW_00374 All Basic Software Modules shall provide a readable SWS_Ifx_00814
module vendor identification
SRS_BSW_00378 AUTOSAR shall provide a boolean type SWS_Ifx_00812
SRS_BSW_00379 All software modules shall provide a module identifier in SWS_Ifx_00814
the header file and in the module XML description file.
SRS_BSW_00402 Each module shall provide version information SWS_Ifx_00814
SRS_BSW_00407 Each BSW module shall provide a function to read out SWS_Ifx_00815,
the version information of a dedicated module implemen- SWS_Ifx_00816
tation
SRS_BSW_00411 All AUTOSAR Basic Software Modules shall apply a SWS_Ifx_00816
naming rule for enabling/disabling the existence of the
API
SRS_BSW_00436 - SWS_Ifx_00810
SRS_LIBS_00001 The functional behavior of each library functions shall not SWS_Ifx_00818
be configurable
SRS_LIBS_00002 A library shall be operational before all BSW modules SWS_Ifx_00800
and application SW-Cs
SRS_LIBS_00003 A library shall be operational until the shutdown SWS_Ifx_00801
SRS_LIBS_00005 Each library shall provide one header file with its public SWS_Ifx_00001
interface
SRS_LIBS_00013 The error cases, resulting in the check at runtime of the SWS_Ifx_00817,
value of input parameters, shall be listed in SWS SWS_Ifx_00819
SRS_LIBS_00015 It shall be possible to configure the microcontroller so SWS_Ifx_00806
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 functions SWS_Ifx_00808
7 Functional specification
[SWS_Ifx_00823]⌈
No error classification definition as DET call not supported by library
⌋()
[SWS_Ifx_00817] ⌈ The functions shall not call the DET for error notification. ⌋
(SRS_LIBS_00013)
[SWS_Ifx_00800] ⌈ Ifx library shall not require initialization phase. A Library func-
tion may be called at the very first step of ECU initialization, e.g. even by the OS or
EcuM, thus the library shall be ready.⌋ (SRS_LIBS_00002)
The statement ‘Ifx.h’ shall be placed by the developer or an application code genera-
tor but not by the RTE generator
20 of 71 Document ID 396: AUTOSAR_SWS_IFXLibrary
- AUTOSAR confidential -
Specification of Fixed Point Interpolation Routines
AUTOSAR Release 4.2.2
[SWS_Ifx_00806] ⌈ The Ifx library shall be implemented in a way that the code can
be shared among callers in different memory partitions.⌋ (SRS_LIBS_00015)
[SWS_Ifx_00808] ⌈ A library function can call other library functions because all
library functions shall be re-entrant. A library function shall not call any BSW modules
functions, e.g. the DET. ⌋ (SRS_LIBS_00018)
[SWS_Ifx_00812] ⌈ All 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. ⌋ (SRS_BSW_00304,
SRS_BSW_00378)
[SWS_Ifx_00813] ⌈ All AUTOSAR library Modules should avoid direct use of com-
piler and platform specific keyword, unless this library is clearly identified to be com-
pliant only with a platform. eg. #pragma, typeof etc.⌋ (SRS_BSW_00306)
[SWS_Ifx_00820] ⌈ If 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.⌋ ()
[SWS_Ifx_00821] ⌈ Axis distribution passed to Ifx routines shall have strong mo-
notony sequence.⌋ ()
8 Routine specification
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
PlatformTypes.h [AUTOSAR_SWS_PlatformTypes]. The following mnemonic are
used in the library routine names.
Name: Ifx_DPResultU16_Type
Type: Structure
Element: uint16 Index Data point index
uint16 Ratio Data point ratio
Description: Structure used for data point search for index and ratio
⌋ ()
[SWS_Ifx_00003]⌈
Ratio shall have resolution of 2-16
⌋()
23 of 71 Document ID 396: AUTOSAR_SWS_IFXLibrary
- AUTOSAR confidential -
Specification of Fixed Point Interpolation Routines
AUTOSAR Release 4.2.2
[SWS_Ifx_00248]⌈
Ratio shall be rounded towards zero
⌋()
[SWS_Ifx_00200]⌈
Ifx_DPResultU16_Type structure shall not be read/write/modified by the user directly.
Only Ifx routines shall have access to this structure.
⌋()
The routines described in this library may be realized as regular routines or inline
functions. For ROM optimization purposes, it is recommended that the c routines be
realized 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:
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 rou-
tine 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
Ifx_IntIpoMap_s8u16_u16
With
Ifx_IntIpoMap_u16s8_u16
Note: swapped inputs need another map value order in memory, see record layout
section
Y Linear interpolation
Lookup interpolati-
on points
Data
original curve
Above figure differentiates linear and lookup integration method. Linear method in-
terpolates result considering two data points, whereas lookup interpolation returns
entry data point.
Data point arrays can be grouped as one array or one structure for all elements as
shown below.
X axis distribution = 0 to 64
Y axis distribution = 1 to 6
Interpolation routines accepts arguments separately to support above scenarios.
Routine call example is given below for array and structure grouping respectively.
Example :
uint8 Ifx_IntIpoCur_u8_u8 (15, Curve_u8[0], &Curve_u8[1], &Curve_u8[6]);
uint8 Ifx_IntIpoCur_u8_u8 (15, Curve_u8.N, &Curve_u8.X, &Curve_u8.Y);
In this interpolation method data point search (e.g. index and ratio) is calculated us-
ing routine Ifx_DPSearch_<InTypeMn> which returns result structure
Ifx_DPResultU16_Type. It contains index and ratio information. This result can be
used by curve interpolation, curve look-up interpolation, map interpolation and map
look-up interpolation.
[SWS_Ifx_00004] ⌈
[SWS_Ifx_00006]⌈
If (X_array[0] < Xin < X_array[N-1]), then returned Index shall be the lowest index for
which (Xin < X_array[index + 1]).
27 of 71 Document ID 396: AUTOSAR_SWS_IFXLibrary
- AUTOSAR confidential -
Specification of Fixed Point Interpolation Routines
AUTOSAR Release 4.2.2
[SWS_Ifx_00008]⌈
If the input value matches with one of the distribution array values, then return the
respective index and ratio = 0.
If (Xin == X_array[index]), then
dpResult ->Index = index
dpResult ->Ratio = 0
⌋()
[SWS_Ifx_00009]⌈
If (Xin < X_array[0]), then return first index of an array and ratio = 0
dpResult ->Index = 0
dpResult ->Ratio = 0
⌋()
[SWS_Ifx_00010]⌈
If (Xin > X_array[N-1]), then return last index of an array and ratio = 0
dpResult ->Index = N - 1
dpResult ->Ratio = 0
⌋()
[SWS_Ifx_00011]⌈
The minimum value of N shall be 1
⌋()
[SWS_Ifx_00013]⌈
This routine returns index and ratio through the structure of type
Ifx_DPResultU16_Type
⌋()
[SWS_Ifx_00015] ⌈
[SWS_Ifx_00016]⌈
index = dpResult->Index
if dPResult->Ratio == 0
Result = Val_array[index]
else
Result = Val_array[index] + (Val_array[index+1] - Val_array[index]) * dpResult->Ratio
⌋()
[SWS_Ifx_00201]⌈
Do not call this routine until you have searched the axis using the Ifx_DPSearch rou-
tine. Only then it is ensured that the search result (Ifx_DPResultU16_Type) contains
valid data and is not used uninitialized.
⌋()
[SWS_Ifx_00020] ⌈
[SWS_Ifx_00021]⌈
Result = Val_array[dpResult->Index]
⌋()
[SWS_Ifx_00202]⌈
Do not call this routine until you have searched the axis using the Ifx_DPSearch rou-
tine. Only then it is ensured that the search result (Ifx_DPResultU16_Type) contains
valid data and is not used uninitialized.
⌋()
[SWS_Ifx_00025] ⌈
⌋ ()
[SWS_Ifx_00026]⌈
Based on searched indices and ratios information using the relevant Ifx_DPSearch
routine, this routine calculates and returns the interpolation result for map.
[SWS_Ifx_00203]⌈
Do not call this routine until you have searched the axis using the Ifx_DPSearch rou-
tine. Only then it is ensured that the search result (Ifx_DPResultU16_Type) contains
valid data and is not used uninitialized.
⌋()
const Ifx_DPResultU16_Type*,
uint16,
const sint16 *)
⌋()
[SWS_Ifx_00030] ⌈
[SWS_Ifx_00031]⌈
BaseIndex = dpResultX->Index * num_value + dpResultY->Index
⌋()
[SWS_Ifx_00033]⌈
if(dpResultX->Ratio < 0.5 && dpResultY->Ratio < 0.5) then
return Val_array [BaseIndex]
[SWS_Ifx_00204]⌈
Do not call this routine until you have searched the axis to ensure the search result
contains valid data and is not used uninitialized.
32 of 71 Document ID 396: AUTOSAR_SWS_IFXLibrary
- AUTOSAR confidential -
Specification of Fixed Point Interpolation Routines
AUTOSAR Release 4.2.2
⌋()
[SWS_Ifx_00205] ⌈
[SWS_Ifx_00206]⌈
BaseIndex = dpResultX->Index * num_value + dpResultY->Index
⌋()
33 of 71 Document ID 396: AUTOSAR_SWS_IFXLibrary
- AUTOSAR confidential -
Specification of Fixed Point Interpolation Routines
AUTOSAR Release 4.2.2
[SWS_Ifx_00207]⌈
Return Value = Val_array [BaseIndex]
⌋()
[SWS_Ifx_00208]⌈
Do not call this routine until you have searched the axis using the Ifx_DPSearch rou-
tine. Only then it is ensured that the search result (Ifx_DPResultU16_Type) contains
valid data and is not used uninitialized.
⌋()
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.
8.5.2.1 Integrated curve interpolation
[SWS_Ifx_00035] ⌈
[SWS_Ifx_00036]⌈
If (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])*RatioX
⌋()
[SWS_Ifx_00037]⌈
Input value matches with one of the distribution array value then result shall be re-
spective Y array element indicated by index.
If (Xin == X_array[index]) then,
Result = Val_array[index]
⌋()
[SWS_Ifx_00038]⌈
If (Xin < X_array[0]) then,
Result = Val_array[0]
⌋()
[SWS_Ifx_00039]⌈
If (Xin > X_array[N-1]) then,
Result = Val_array[N-1]
⌋()
[SWS_Ifx_00040]⌈
The minimum value of N shall be 1
⌋()
[SWS_Ifx_00045] ⌈
[SWS_Ifx_00046]⌈
If (X_array[0] < Xin < X_array[N -1]), then
index = lowest index for which (Xin < X_array[index + 1]).
Result = Val_array[index]
⌋()
[SWS_Ifx_00047]⌈
Input value matches with one of the distribution array value then result shall be re-
spective Y array element indicated by index.
If (Xin == X_array[index]) then,
Result = Val_array[index]
⌋()
[SWS_Ifx_00048]⌈
If (Xin < X_array[0]) then,
Result = Val_array[0]
⌋()
[SWS_Ifx_00049]⌈
36 of 71 Document ID 396: AUTOSAR_SWS_IFXLibrary
- AUTOSAR confidential -
Specification of Fixed Point Interpolation Routines
AUTOSAR Release 4.2.2
[SWS_Ifx_00050]⌈
The minimum value of N shall be 1
⌋()
Description: This routine calculates interpolation of a curve at position Xin using below equa-
tions.
⌋ ()
[SWS_Ifx_00056]⌈
X axis distribution points shall be calculated based on Offset and Shift values.
X_array [index] = Offset + index * 2Shift
[SWS_Ifx_00057]⌈
If (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]) * RatioX
⌋()
[SWS_Ifx_00058]⌈
Input value matches with one of the distribution array value then result shall be re-
spective Y array element indicated by index.
If (Xin == X_array[index])
Result = Val_array[index]
⌋()
[SWS_Ifx_00059]⌈
If (Xin < X_array[0]) then,
Result = Val_array[0]
⌋()
[SWS_Ifx_00060]⌈
If (Xin > X_array[N-1]) then,
Result = Val_array[N-1]
⌋()
[SWS_Ifx_00061]⌈
The minimum value of N shall be 1
⌋()
[SWS_Ifx_00070] ⌈
[SWS_Ifx_00071]⌈
X axis distribution points shall be calculated based on Offset and Shift values.
X_array [index] = Offset + index * 2Shift
[SWS_Ifx_00072]⌈
If (X_array[0] < Xin < X_array[N -1]), then
index = lowest index for which (Xin < X_array[index + 1]).
Result = Val_array[index]
⌋()
[SWS_Ifx_00073]⌈
Input value matches with one of the distribution array value then result shall be re-
spective Y array element indicated by index.
If (Xin == X_array[index]) then,
Result = Val_array[index]
⌋()
[SWS_Ifx_00074]⌈
[SWS_Ifx_00075]⌈
If (Xin > X_array[N-1]) then,
Result = Val_array[N-1]
⌋()
[SWS_Ifx_00076]⌈
The minimum value of N shall be 1
⌋()
[SWS_Ifx_00080] ⌈
[SWS_Ifx_00081]⌈
40 of 71 Document ID 396: AUTOSAR_SWS_IFXLibrary
- AUTOSAR confidential -
Specification of Fixed Point Interpolation Routines
AUTOSAR Release 4.2.2
X axis distribution points shall be calculated based on Offset and Interval values.
X_array [index] = offset + index * Interval
[SWS_Ifx_00082]⌈
If (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]) * RatioX
⌋()
[SWS_Ifx_00083]⌈
Input value matches with one of the distribution array value then result shall be re-
spective Y array element indicated by index.
If (Xin == X_array[index])
Result = Val_array[index]
⌋()
[SWS_Ifx_00084]⌈
If (Xin < X_array[0]) then,
Result = Val_array[0]
⌋()
[SWS_Ifx_00085]⌈
If (Xin > X_array[N-1]) then,
Result = Val_array[N-1]
⌋()
[SWS_Ifx_00086]⌈
The minimum value of N shall be 1
⌋()
⌋()
[SWS_Ifx_00090] ⌈
[SWS_Ifx_00091]⌈
X axis distribution points shall be calculated based on Offset and Interval values.
X_array [index] = offset + index * Interval
[SWS_Ifx_00092]⌈
If (X_array[0] < Xin < X_array[N -1]), then
index = lowest index for which (Xin < X_array[index + 1]).
Result = Val_array[index]
⌋()
[SWS_Ifx_00093]⌈
Input value matches with one of the distribution array value then result shall be re-
spective Y array element indicated by index.
If (Xin == X_array[index])
Result = Val_array[index]
⌋()
[SWS_Ifx_00094]⌈
If (Xin < X_array[0]) then,
Result = Val_array[0]
⌋()
[SWS_Ifx_00095]⌈
[SWS_Ifx_00096]⌈
The minimum value of N shall be 1
⌋()
[SWS_Ifx_00098] ⌈
[SWS_Ifx_00099]⌈
Index calculation :
indexX = minimum value of index if (X_array[indexX] < Xin < X_array[indexX+1])
43 of 71 Document ID 396: AUTOSAR_SWS_IFXLibrary
- AUTOSAR confidential -
Specification of Fixed Point Interpolation Routines
AUTOSAR Release 4.2.2
[SWS_Ifx_00100]⌈
Ratio 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])
⌋()
[SWS_Ifx_00101]⌈
LowerY = Val_array [BaseIndex]
UpperY = Val_array [BaseIndex + 1]
LowerX = LowerY + (UpperY - LowerY) * RatioY
[SWS_Ifx_00102]⌈
If (Xin == X_array[indexX]) and (Y_array[indexY] < Yin < Y_array[indexY+1])
Result = Val_array [BaseIndex] + (Val_array [BaseIndex+1] - Val_array[BaseIndex]) *
RatioY
⌋()
[SWS_Ifx_00103]⌈
If (Yin == Y_array[indexY]) and (X_array[indexX] < Xin < X_array[indexX+1])
Result = Val_array [BaseIndex] + (Val_array [BaseIndex+Ny] - Val_array[BaseIndex])
* RatioX
⌋()
[SWS_Ifx_00104]⌈
If (Xin == X_array[indexX]) and (Yin == Y_array[indexY])
Result = Val_array [BaseIndex]
⌋()
[SWS_Ifx_00105]⌈
If Xin < X_array[0], then
indexX = 0,
RatioX = 0
⌋()
[SWS_Ifx_00106]⌈
If Xin > X_array[Nx-1], then
indexX = Nx - 1,
RatioX = 0
44 of 71 Document ID 396: AUTOSAR_SWS_IFXLibrary
- AUTOSAR confidential -
Specification of Fixed Point Interpolation Routines
AUTOSAR Release 4.2.2
⌋()
[SWS_Ifx_00107]⌈
If Yin < Y_array[0], then
indexY = 0,
RatioY = 0
⌋()
[SWS_Ifx_00108]⌈
If Yin > Y_array[Ny-1], then
indexY = Ny - 1,
RatioY = 0
⌋()
[SWS_Ifx_00109]⌈
The minimum value of Nx and Ny shall be 1
⌋()
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 * )
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 * )
⌋()
[SWS_Ifx_00111] ⌈
<InType> Xin,
<InType> Yin,
<InType> Nx,
<InType> Ny,
const <InType>* X_array,
const <InType>* Y_array,
const <InType>* Val_array
)
Service ID[hex]: 0x08A to 0x08D
Sync/Async: Synchronous
Reentrancy: Reentrant
Xin Input value for X axis
Yin Input value for Y axis
Nx Number of X axis samples
Parameters (in): Ny Number of Y axis samples
X_array Pointer to the X axis distribution array
Y_array Pointer to the Y axis distribution array
Val_array Pointer to the result axis distribution array
Parameters (in- None
out):
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 posi-
tion Xin and Yin based on below equations.
⌋ ()
[SWS_Ifx_00112]⌈
Index 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 + indexY
⌋()
[SWS_Ifx_00113]⌈
Ratio 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 = 0
⌋()
[SWS_Ifx_00114]⌈
if(RatioX < 0.5 && RatioY < 0.5) then
Result = Val_array [BaseIndex]
[SWS_Ifx_00116]⌈
If (Xin == X_array[indexX]) and (Yin == Y_array[indexY])
Result = Val_array [BaseIndex]
⌋()
[SWS_Ifx_00117]⌈
If Xin < X_array[0], then
indexX = 0
⌋()
[SWS_Ifx_00118]⌈
If Xin > X_array[Nx-1], then
indexX = Nx - 1
⌋()
[SWS_Ifx_00119]⌈
If Yin < Y_array[0], then
indexY = 0
⌋()
[SWS_Ifx_00120]⌈
If Yin > Y_array[Ny-1], then
indexY = Ny - 1
⌋()
[SWS_Ifx_00121]⌈
The minimum value of Nx and Ny shall be 1
⌋()
[SWS_Ifx_00211] ⌈
[SWS_Ifx_00212]⌈
Index 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 + indexY
⌋()
[SWS_Ifx_00214]⌈
Return Value = Val_array [BaseIndex]
⌋()
[SWS_Ifx_00216]⌈
If (Xin == X_array[indexX]) and (Yin == Y_array[indexY])
Result = Val_array [BaseIndex]
⌋()
[SWS_Ifx_00217]⌈
If Xin < X_array[0], then
indexX = 0
49 of 71 Document ID 396: AUTOSAR_SWS_IFXLibrary
- AUTOSAR confidential -
Specification of Fixed Point Interpolation Routines
AUTOSAR Release 4.2.2
⌋()
[SWS_Ifx_00218]⌈
If Xin > X_array[Nx-1], then
indexX = Nx - 1
⌋()
[SWS_Ifx_00219]⌈
If Yin < Y_array[0], then
indexY = 0
⌋()
[SWS_Ifx_00220]⌈
If Yin > Y_array[Ny-1], then
indexY = Ny - 1
⌋()
[SWS_Ifx_00221]⌈
The minimum value of Nx and Ny shall be 1
⌋()
[SWS_Ifx_00123] ⌈
Reentrancy: Reentrant
Xin Input value for X axis
Yin Input value for Y axis
Nx Number to X axis samples
Ny Number to Y axis samples
Val_array Pointer to the result axis distribution array
Parameters (in): 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 (in- None
out):
Parameters (out): None
Return value: <OutType> Result of the Interpolation
Description: This routine calculates Interpolation of a map at position X and Y using below
equations.
⌋ ()
[SWS_Ifx_00124]⌈
X and Y axis distribution points shall be calculated based on Offset and Shift values.
[SWS_Ifx_00125]⌈
Index 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 + indexY
⌋()
[SWS_Ifx_00126]⌈
Ratio 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])
⌋()
[SWS_Ifx_00127]⌈
LowerY = Val_array [BaseIndex]
UpperY = Val_array [BaseIndex + 1]
LowerX = LowerY + (UpperY - LowerY) * RatioY
[SWS_Ifx_00128]⌈
If (Xin == X_array[indexX]) and (Y_array[indexY] < Yin < Y_array[indexY+1])
Result = Val_array [BaseIndex] + (Val_array [BaseIndex+1] - Val_array[BaseIndex]) *
RatioY
⌋()
[SWS_Ifx_00129]⌈
If (Yin == Y_array[indexY]) and (X_array[indexX] < Xin < X_array[indexX+1])
Result = Val_array [BaseIndex] + (Val_array [BaseIndex+Ny] - Val_array[BaseIndex])
* RatioX
⌋()
[SWS_Ifx_00130]⌈
If (Xin == X_array[indexX]) and (Yin == Y_array[indexY])
Result = Val_array [BaseIndex]
⌋()
[SWS_Ifx_00131]⌈
If Xin < X_array[0], then
indexX = 0,
RatioX = 0
⌋()
[SWS_Ifx_00132]⌈
If Xin > X_array[Nx-1], then
indexX = Nx - 1,
RatioX = 0
⌋()
[SWS_Ifx_00133]⌈
If Yin < Y_array[0], then
indexY = 0,
RatioY = 0
⌋()
[SWS_Ifx_00134]⌈
If Yin > Y_array[Ny-1], then
indexY = Ny - 1,
RatioY = 0
⌋()
[SWS_Ifx_00135]⌈
The minimum value of Nx and Ny shall be 1
⌋()
[SWS_Ifx_00136]⌈
Routine Routine prototype
ID[hex]
0x090 uint8 Ifx_IntIpoFixMap_u8u8_u8 ( uint8, uint8, uint8, uint8, const uint8 *, uint8, uint8,
uint8, uint8)
0x091 uint16 Ifx_IntIpoFixMap_u16u16_u16 ( uint16, uint16, uint16, uint16, const uint16 *,
uint16, uint16, uint16, uint16)
0x092 sint8 Ifx_IntIpoFixMap_s8s8_s8 ( sint8, sint8, sint8, sint8, const sint8 *, sint8, sint8,
sint8, sint8)
0x093 sint16 Ifx_IntIpoFixMap_s16s16_s16 ( sint16, sint16, sint16, sint16, const sint16 *,
sint16, sint16, sint16, sint16)
⌋()
[SWS_Ifx_00139] ⌈
[SWS_Ifx_00140]⌈
X and Y axis distribution points shall be calculated based on Offset and Shift values.
53 of 71 Document ID 396: AUTOSAR_SWS_IFXLibrary
- AUTOSAR confidential -
Specification of Fixed Point Interpolation Routines
AUTOSAR Release 4.2.2
[SWS_Ifx_00141]⌈
Index 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 + indexY
⌋()
[SWS_Ifx_00143]⌈
Ratio 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 = 0
⌋()
[SWS_Ifx_00144]⌈
if(RatioX < 0.5 && RatioY < 0.5) then
Result = Val_array [BaseIndex]
[SWS_Ifx_00145]⌈
If (Xin == X_array[indexX]) and (Yin == Y_array[indexY])
Result = Val_array [BaseIndex]
⌋()
[SWS_Ifx_00146]⌈
If Xin < X_array[0], then
indexX = 0
54 of 71 Document ID 396: AUTOSAR_SWS_IFXLibrary
- AUTOSAR confidential -
Specification of Fixed Point Interpolation Routines
AUTOSAR Release 4.2.2
⌋()
[SWS_Ifx_00147]⌈
If Xin > X_array[Nx-1], then
indexX = Nx - 1
⌋()
[SWS_Ifx_00148]⌈
If Yin < Y_array[0], then
indexY = 0
⌋()
[SWS_Ifx_00149]⌈
If Yin > Y_array[Ny-1], then
indexY = Ny - 1
⌋()
[SWS_Ifx_00150]⌈
The minimum value of Nx and Ny shall be 1
⌋()
[SWS_Ifx_00225] ⌈
Sync/Async: Synchronous
Reentrancy: Reentrant
Xin Input value for X axis
Yin Input value for Y axis
Nx Number to X axis samples
Ny Number to Y axis samples
Val_array Pointer to the result axis distribution array
Parameters (in): 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 (in- None
out):
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 posi-
tion Xin and Yin based on below equations.
⌋ ()
[SWS_Ifx_00226]⌈
X and Y axis distribution points shall be calculated based on Offset and Shift values.
[SWS_Ifx_00227]⌈
Index 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 + indexY
⌋()
[SWS_Ifx_00229]⌈
Return Value = Val_array [BaseIndex]
⌋()
[SWS_Ifx_00230]⌈
If (Xin == X_array[indexX]) and (Yin == Y_array[indexY])
Result = Val_array [BaseIndex]
⌋()
[SWS_Ifx_00231]⌈
If Xin < X_array[0], then
indexX = 0
56 of 71 Document ID 396: AUTOSAR_SWS_IFXLibrary
- AUTOSAR confidential -
Specification of Fixed Point Interpolation Routines
AUTOSAR Release 4.2.2
⌋()
[SWS_Ifx_00232]⌈
If Xin > X_array[Nx-1], then
indexX = Nx - 1
⌋()
[SWS_Ifx_00233]⌈
If Yin < Y_array[0], then
indexY = 0
⌋()
[SWS_Ifx_00234]⌈
If Yin > Y_array[Ny-1], then
indexY = Ny - 1
⌋()
[SWS_Ifx_00235]⌈
The minimum value of Nx and Ny shall be 1
⌋()
[SWS_Ifx_00153] ⌈
Sync/Async: Synchronous
Reentrancy: Reentrant
Xin Input value for X axis
Yin Input value for Y axis
Nx Number to X axis samples
Ny Number to Y axis samples
Parameters (in): Val_array Pointer to the result axis distribution array
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 (in- None
out):
Parameters (out): None
Return value: <OutType> Result of the Interpolation
Description: This routine calculates Interpolation of a map at position X and Y using below
equations.
⌋ ()
[SWS_Ifx_00154]⌈
X and Y axis distribution points shall be calculated based on Offset and Interval val-
ues.
[SWS_Ifx_00155]⌈
Index 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 + indexY
⌋()
[SWS_Ifx_00156]⌈
Ratio 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])
⌋()
[SWS_Ifx_00157]⌈
LowerY = Val_array [BaseIndex]
UpperY = Val_array [BaseIndex + 1]
LowerX = LowerY + (UpperY - LowerY) * RatioY
[SWS_Ifx_00158]⌈
If (Xin == X_array[indexX]) and (Y_array[indexY] < Yin < Y_array[indexY+1])
Result = Val_array [BaseIndex] + (Val_array [BaseIndex+1] - Val_array[BaseIndex]) *
RatioY
⌋()
[SWS_Ifx_00159]⌈
If (Yin == Y_array[indexY]) and (X_array[indexX] < Xin < X_array[indexX+1])
Result = Val_array [BaseIndex] + (Val_array [BaseIndex+Ny] - Val_array[BaseIndex])
* RatioX
⌋()
[SWS_Ifx_00160]⌈
If (Xin == X_array[indexX]) and (Yin == Y_array[indexY])
Result = Val_array [BaseIndex]
⌋()
[SWS_Ifx_00161]⌈
If Xin < X_array[0], then
indexX = 0,
RatioX = 0
⌋()
[SWS_Ifx_00162]⌈
If Xin > X_array[Nx-1], then
indexX = Nx - 1,
RatioX = 0
⌋()
[SWS_Ifx_00163]⌈
If Yin < Y_array[0], then
indexY = 0,
RatioY = 0
⌋()
[SWS_Ifx_00164]⌈
If Yin > Y_array[Ny-1], then
indexY = Ny - 1,
RatioY = 0
⌋()
[SWS_Ifx_00165]⌈
The minimum value of Nx and Ny shall be 1
⌋()
[SWS_Ifx_00166]⌈
Routine Routine prototype
ID[hex]
0x09A uint8 Ifx_IntIpoFixIMap_u8u8_u8 ( uint8, uint8, uint8, uint8, const uint8 *, uint8, uint8, uint8,
uint8)
0x09B uint16 Ifx_IntIpoFixIMap_u16u16_u16 ( uint16, uint16, uint16, uint16, const uint16 *, uint16,
uint16, uint16, uint16)
0x09C sint8 Ifx_IntIpoFixIMap_s8s8_s8 ( sint8, sint8, sint8, sint8, const sint8 *, sint8, sint8, sint8,
sint8)
0x09D sint16 Ifx_IntIpoFixIMap_s16s16_s16 ( sint16, sint16, sint16, sint16, const sint16 *, sint16,
sint16, sint16, sint16)
⌋()
[SWS_Ifx_00169] ⌈
[SWS_Ifx_00170]⌈
X and Y axis distribution points shall be calculated based on Offset and Interval val-
ues.
[SWS_Ifx_00171]⌈
Index 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 + indexY
⌋()
[SWS_Ifx_00173]⌈
Ratio 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 = 0
⌋()
[SWS_Ifx_00174]⌈
if(RatioX < 0.5 && RatioY < 0.5) then
Result = Val_array [BaseIndex]
[SWS_Ifx_00175]⌈
If (Xin == X_array[indexX]) and (Yin == Y_array[indexY])
Result = Val_array [BaseIndex]
⌋()
[SWS_Ifx_00176]⌈
If Xin < X_array[0], then
indexX = 0
⌋()
[SWS_Ifx_00177]⌈
If Xin > X_array[Nx-1], then
indexX = Nx - 1
⌋()
[SWS_Ifx_00178]⌈
If Yin < Y_array[0], then
indexY = 0
⌋()
[SWS_Ifx_00179]⌈
If Yin > Y_array[Ny-1], then
indexY = Ny - 1
⌋()
[SWS_Ifx_00180]⌈
The minimum value of Nx and Ny shall be 1
⌋()
[SWS_Ifx_00249] ⌈
Sync/Async: Synchronous
Reentrancy: Reentrant
Xin Input value for X axis
Yin Input value for Y axis
Nx Number to X axis samples
Ny Number to Y axis samples
Parameters (in): Val_array Pointer to the result axis distribution array
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 (in- None
out):
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 posi-
tion Xin and Yin based on below equations.
⌋()
[SWS_Ifx_00237]⌈
X and Y axis distribution points shall be calculated based on Offset and Interval val-
ues.
[SWS_Ifx_00238]⌈
Index 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 + indexY
⌋()
[SWS_Ifx_00240]⌈
Return Value = Val_array [BaseIndex]
⌋()
[SWS_Ifx_00241]⌈
If (Xin == X_array[indexX]) and (Yin == Y_array[indexY])
Result = Val_array [BaseIndex]
⌋()
[SWS_Ifx_00242]⌈
If Xin < X_array[0], then
indexX = 0
⌋()
[SWS_Ifx_00243]⌈
If Xin > X_array[Nx-1], then
indexX = Nx - 1
⌋()
[SWS_Ifx_00244]⌈
If Yin < Y_array[0], then
indexY = 0
⌋()
[SWS_Ifx_00245]⌈
If Yin > Y_array[Ny-1], then
indexY = Ny - 1
⌋()
[SWS_Ifx_00246]⌈
The minimum value of Nx and Ny shall be 1
⌋()
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 mul-
tiple instances of interpolation ParameterDataPrototype. Record layouts can be nest-
ed particular values refer to the particular property of the object. With different prop-
erties of record layouts it is possible to specify complex objects.
1. If the "X" and "Y" inputs are not swapped then, values "Val" of maps have to be in
COLUMN_DIR order.
2. If the "X" and "Y" inputs are swapped then, values "Val" of maps have to be in
ROW_DIR order.
64 of 71 Document ID 396: AUTOSAR_SWS_IFXLibrary
- AUTOSAR confidential -
Specification of Fixed Point Interpolation Routines
AUTOSAR Release 4.2.2
According to ASAM standard [ASAM MCD-2MC Version 1.5.1 and 1.6], COL-
UMN_DIR and ROW_DIR are formats of storing map values (Val[]) and more infor-
mation can be found in ASAM standard.
Below table specifies record layouts supported for integrated interpolation routines.
[SWS_Ifx_00186] ⌈
Record Layout
S.No Element1 Element2 Element3 Element4 Element5
Name
1 IntCur_u8_u8 uint8 N uint8 X[] uint8 Val[]
2 IntCur_u8_u16 uint8 N uint8 X[] uint16 Val[]
3 IntCur_u8_s8 uint8 N uint8 X[] sint8 Val[]
4 IntCur_u8_s16 uint8 N uint8 X[] sint16 Val[]
5 IntCur_u16_u8 uint16 N uint16 X[] uint8 Val[]
6 IntCur_u16_u16 uint16 N uint16 X[] uint16 Val[]
7 IntCur_u16_s8 uint16 N uint16 X[] sint8 Val[]
8 IntCur_u16_s16 uint16 N uint16 X[] sint16 Val[]
9 IntCur_s8_u8 sint8 N sint8 X[] uint8 Val[]
10 IntCur_s8_u16 sint8 N sint8 X[] uint16 Val[]
11 IntCur_s8_s8 sint8 N sint8 X[] sint8 Val[]
12 IntCur_s8_s16 sint8 N sint8 X[] sint16 Val[]
13 IntCur_s16_u8 sint16 N sint16 X[] uint8 Val[]
14 IntCur_s16_u16 sint16 N sint16 X[] uint16 Val[]
15 IntCur_s16_s8 sint16 N sint16 X[] sint8 Val[]
16 IntCur_s16_s16 sint16 N sint16 X[] sint16 Val[]
17 FixIntCur_u8_u8 uint8 N uint8 Val[]
18 FixIntCur_u16_u16 uint16 N uint16 Val[]
19 FixIntCur_s8_s8 sint8 N sint8 Val[]
20 FixIntCur_s16_s16 sint16 N sint16 Val[]
21 IntMap_u8u8_u8 uint8 Nx uint8 Ny uint8 X[] uint8 Y[] uint8 Val[]
22 IntMap_u8u8_u16 uint8 Nx uint8 Ny uint8 X[] uint8 Y[] uint16 Val[]
23 IntMap_u8u8_s8 uint8 Nx uint8 Ny uint8 X[] uint8 Y[] sint8 Val[]
65 of 71 Document ID 396: AUTOSAR_SWS_IFXLibrary
- AUTOSAR confidential -
Specification of Fixed Point Interpolation Routines
AUTOSAR Release 4.2.2
[SWS_Ifx_00815] ⌈
[SWS_Ifx_00816] ⌈
If source code for caller and callee of Ifx_GetVersionInfo is available, the Ifx library
should realize Ifx_GetVersionInfo as a macro defined in the module’s header file.⌋
(SRS_BSW_00407, SRS_BSW_00411)
8.8 Call-back notifications
None.
None
None
None
9 Sequence diagrams
Not applicable.
10 Configuration specification
[SWS_Ifx_00818] ⌈ The Ifx library shall not have any configuration options that may
affect the functional behavior of the routines. I.e. for a given set of input parameters,
the outputs shall be always the same. For example, the returned value in case of er-
ror shall not be configurable.⌋ (SRS_LIBS_00001)