DEENESPTFRRUARHIKOZHNL

IFl Library (Ifl)

ModulIfl (IFl Library)
BSW-Modul-ID209
Standard-Header#include "Ifl.h"
SWS-SpezifikationAUTOSAR_CP_SWS_IFLLibrary.pdf, AUTOSAR_SWS_IFLLibrary.pdf
Umfang67 Records · 0 Snippets
ClusterAUTOSAR-Bibliotheken

IFl Library (Ifl)

AUTOSAR Classic Libraries-Modul IFl Library (Ifl, Spezifikation: AUTOSAR_CP_SWS_IFLLibrary.pdf, AUTOSAR_SWS_IFLLibrary.pdf).

Funktionen — Übersicht

Typen — Übersicht

Anforderungen — Übersicht

Funktionen & Typen — Detailansicht

функция Ifl_DPSearch_f32 [SWS_Ifl_00010] 📄 PDF

void Ifl_DPSearch_f32(Ifl_DPResultF32_Type* dpResult, float32 Xin, uint32 N, const float32* X_array);

This routine searches the position of input Xin within the given distribution array X_array, and returns index and ratio necessary for interpolation.

функция Ifl_IpoCur_f32 [SWS_Ifl_00021] 📄 PDF

float32 Ifl_IpoCur_f32(const Ifl_DPResultF32_Type* dpResult, const float32* Val_array);

Based on searched index and ratio information, this routine calculates and returns interpolation for curve.

функция Ifl_IpoMap_f32 [SWS_Ifl_00025] 📄 PDF

float32 Ifl_IpoMap_f32(const Ifl_DPResultF32_Type* dpResultX, const Ifl_DPResultF32_Type* dpResultY, uint32 num_value, const float32* Val_array);

Based on searched indices and ratios information using the Ifl_DPSearch_f32 routine, this routine calculates and returns the interpolation result for map.

функция Ifl_IpoCub_f32 [SWS_Ifl_91000] 📄 PDF

float32 Ifl_IpoCub_f32(const Ifl_DPResultF32_Type* dpResultX, const Ifl_DPResultF32_Type* dpResultY, const Ifl_DPResultF32_Type* dpResultZ, uint16 num_x, uint16 num_y, const float32* Val_array);

Based on searched indices and ratios information using the relevant Ifl_DPSearch_f32 routine, this routine calculates and returns the interpolation result for a 3D cuboid.

функция Ifl_IpoCur_<InTypeMn>_f32 [SWS_Ifl_91001] 📄 PDF

float32 Ifl_IpoCur_<InTypeMn>_f32(const Ifl_DPResultF32_Type* dpResult, const <InType>* Val_array);

Based on searched indices and ratios information using the relevant Ifl_DPSearch_f32 routine, this routine calculates and returns the interpolation result for a curve.

функция Ifl_IpoMap_<InTypeMn>_f32 [SWS_Ifl_91002] 📄 PDF

float32 Ifl_IpoMap_<InTypeMn>_f32(const Ifl_DPResultF32_Type* dpResultX, const Ifl_DPResultF32_Type* dpResultY, uint32 num_value, const <InType>* Val_array);

Based on searched indices and ratios information using the relevant Ifl_DPSearch_f32 routine, this routine calculates and returns the interpolation result for a map.

функция Ifl_IpoCub_<InTypeMn>_f32 [SWS_Ifl_91003] 📄 PDF

float32 Ifl_IpoCub_<InTypeMn>_f32(const Ifl_DPResultF32_Type* dpResultX, const Ifl_DPResultF32_Type* dpResultY, const Ifl_DPResultF32_Type* dpResultZ, uint16 num_x, uint16 num_y, const <InType>* Val_array);

Based on searched indices and ratios information using the relevant Ifl_DPSearch_f32 routine, this routine calculates and returns the interpolation result for a 3D cuboid.

requirement SWS_Ifl_00001 [SWS_Ifl_00001] 📄 PDF

The Ifl module shall provide the following files: • C files, Ifl_<name>.c used to implement the library. All C files shall be prefixed with 'Ifl_'. Implementation & grouping of routines with respect to C files is recommended as per below options and there is no restriction to follow the same. Option 1 : <Name> can be function name providing one C file per function, eg.: Ifl_IntIpoMap_f32f32_f32.c etc. Option 2 : <Name> can have common name of group of functions: • 2.1 Group by object family: eg.:Ifl_IpoCur.c, Ifl_DPSearch.c • 2.2 Group by routine family: eg.: Ifl_IpoMap.c • 2.3 Group by method family: eg.: Ifl_Ipo.c etc. • 2.4 Group by other methods: (individual grouping allowed) Option 3 : <Name> can be removed so that single C file shall contain all Ifl functions, eg.: Ifl.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.

requirement SWS_Ifl_00006 [SWS_Ifl_00006] 📄 PDF

Ifl_DPResultF32_Type structure shall not be read/write/modified by the user directly. Only Ifl routines shall have access to this structure.

requirement SWS_Ifl_00011 [SWS_Ifl_00011] 📄 PDF

Returned Index shall be the lowest index for which (X_array[index] < Xin < X_array[index + 1]). If (X_array[0] <=Xin <= X_array[N-1]), then returned Index shall be the lowest index. dpResult->Index=indexdpResult->Ratio=(Xin-X_array[index]) / (X_array[index + 1] - X_ array[index]) dpResult ->Index = index dpResult ->Ratio = (Xin - X_array[index]) / (X_array [index+1] - X_array [index])

requirement SWS_Ifl_00012 [SWS_Ifl_00012] 📄 PDF

If the input value matches with one of the distribution array values, then return respective index and ratio as 0.0. If Input Xin == X_array[index], then dpResult ->Index = index (Index of the set point) dpResult ->Ratio = 0.0

requirement SWS_Ifl_00013 [SWS_Ifl_00013] 📄 PDF

If (Xin < X_array[0]), then return first index of an array and ratio = 0.0 dpResult ->Index = 0 dpResult ->Ratio = 0.0

requirement SWS_Ifl_00014 [SWS_Ifl_00014] 📄 PDF

If (Xin > X_array[N-1]), then return last index of an array and ratio = 0.0 dpResult ->Index = N - 1 dpResult ->Ratio = 0.0

requirement SWS_Ifl_00016 [SWS_Ifl_00016] 📄 PDF

If X_array[Index+1] == X_array[Index], then the Ratio shall be zero. dpResult->Ratio = 0.0

requirement SWS_Ifl_00017 [SWS_Ifl_00017] 📄 PDF

This routine returns index and ratio through the structure of type Ifl_ DPResultF32_Type

requirement SWS_Ifl_00022 [SWS_Ifl_00022] 📄 PDF

index = dPResult->Index if dPResult->Ratio == 0.0 Result = Val_array[index] else Result = Val_array[index] + (Val_array[index+1] - Val_array[index]) * dpResult->Ratio

requirement SWS_Ifl_00026 [SWS_Ifl_00026] 📄 PDF

Based on searched indices and ratios information using the Ifl_ DPSearch_f32 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->Ratio

requirement SWS_Ifl_00036 [SWS_Ifl_00036] 📄 PDF

index = minimum value of integer index if (X_array[index] < 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

requirement SWS_Ifl_00037 [SWS_Ifl_00037] 📄 PDF

If the input value matches with one of the distribution array values, then result will be the respective Y array element indicated by the index. If (Xin == X_array[index]), Result = Val_array[index]

requirement SWS_Ifl_00042 [SWS_Ifl_00042] 📄 PDF

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]) RatioX = (Xin - X_array[indexX]) / (X_array [indexX+1] - X_array [indexX]) RatioY = (Yin - Y_array[indexY]) / (Y_array [indexY+1] - Y_array [indexY]) BaseIndex = IndexX * Ny + indexY LowerY = Val_array [BaseIndex] UpperY = Val_array [BaseIndex + 1] LowerX = LowerY + (UpperY - LowerY) * RatioY LowerY = Val_array [BaseIndex + Ny] UpperY = Val_array [BaseIndex + Ny + 1] UpperX = LowerY + (UpperY - LowerY) * RatioY Result = LowerX + (UpperX - LowerX) * RatioX

requirement SWS_Ifl_00043 [SWS_Ifl_00043] 📄 PDF

If (Xin == X_array[indexX]) and (Y_array[indexY] < Yin < Y_ar- ray[indexY+1]) Result = Val_array [BaseIndex] + (Val_array [BaseIndex+1] - Val_array[BaseIndex]) * RatioY

requirement SWS_Ifl_00044 [SWS_Ifl_00044] 📄 PDF

If (Yin == Y_array[indexY]) and (X_array[indexX] < Xin < X_ar- ray[indexX+1]) Result = Val_array [BaseIndex] + (Val_array [BaseIndex+Ny] - Val_array[BaseIndex]) * RatioX

requirement SWS_Ifl_00045 [SWS_Ifl_00045] 📄 PDF

If (Xin == X_array[indexX]) and (Yin == Y_array[indexY]) Result = Val_array [BaseIndex]

requirement SWS_Ifl_00170 [SWS_Ifl_00170] 📄 PDF

Record layout Name Element1 Element2 Element3 Element4 Element5 Distr_f32 uint32 N float32 X[] Curve_f32 float32 Val[] Map_f32 float32 Val[] Cub_f32 float32 Val[] IntCurve_f32_f32 uint32 N float32 X[] float32 Val[] IntMap_f32f32_ f32 uint32 Nx uint32 Ny float32 X[] float32 Y[] float32 Val[]

requirement SWS_Ifl_00180 [SWS_Ifl_00180] 📄 PDF

Do not call this routine until you have searched the axis using the Ifl_DPSearch routine. Only then it is ensured that the search result (Ifl_DPResultF32_ Type) contains valid data and is not used uninitialized.

requirement SWS_Ifl_00181 [SWS_Ifl_00181] 📄 PDF

Do not call this routine until you have searched the axis using the Ifl_DPSearch routine. Only then it is ensured that the search result (Ifl_DPResultF32_ Type) contains valid data and is not used uninitialized.

requirement SWS_Ifl_00200 [SWS_Ifl_00200] 📄 PDF

Ifl library shall not require initialization phase. A Library function 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.

requirement SWS_Ifl_00206 [SWS_Ifl_00206] 📄 PDF

The Ifl library shall be implemented in a way that the code can be shared among callers in different memory partitions.

requirement SWS_Ifl_00207 [SWS_Ifl_00207] 📄 PDF

Usage of macros should be avoided. The function should be de- clared as function or inline function. Macro #define should not be used.

requirement SWS_Ifl_00208 [SWS_Ifl_00208] 📄 PDF

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 func- tions, e.g. the DET.

requirement SWS_Ifl_00209 [SWS_Ifl_00209] 📄 PDF

The library, written in C programming language, should conform to the MISRA C Standard. Please refer to SWS_BSW_00115 for more details.

requirement SWS_Ifl_00210 [SWS_Ifl_00210] 📄 PDF

Each AUTOSAR library Module implementation <library>*.c and <library>*.h shall map their code to memory sections using the AUTOSAR memory mapping mechanism.

requirement SWS_Ifl_00211 [SWS_Ifl_00211] 📄 PDF

Each AUTOSAR library Module implementation <library>*.c, that uses AUTOSAR integer data types and/or the standard return, shall include the header file Std_Types.h.

requirement SWS_Ifl_00212 [SWS_Ifl_00212] 📄 PDF

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.

requirement SWS_Ifl_00213 [SWS_Ifl_00213] 📄 PDF

All 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.

requirement SWS_Ifl_00214 [SWS_Ifl_00214] 📄 PDF

The standardized common published parameters as required by SRS_BSW_00402 in the General Requirements on Basic Software Modules [REF] shall be published within the header file of this module and need to be provided in the BSW Module Description. The according module abbreviation can be found in the List of Basic Software Modules [REF].

requirement SWS_Ifl_00216 [SWS_Ifl_00216] 📄 PDF

If source code for caller and callee of Ifl_GetVersionInfo is avail- able, the Ifl library should realize Ifl_GetVersionInfo as a macro defined in the module's header file.

requirement SWS_Ifl_00218 [SWS_Ifl_00218] 📄 PDF

The Ifl library shall not have any configuration options that may af- fect 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 error shall not be configurable.

requirement SWS_Ifl_00219 [SWS_Ifl_00219] 📄 PDF

Error detection: Function should check at runtime (both in produc- tion and development code) the value of input parameters, especially cases where erroneous value can bring to fatal error or unpredictable result, if they have the values allowed by the function specification. All the error cases shall be listed in SWS and the function should return a specified value (in SWS) that is not configurable. This value is dependant of the function and the error case so it is determined case by case. If values passed to the routines are not valid and out of the function specification, then such error are not detected.

requirement SWS_Ifl_00220 [SWS_Ifl_00220] 📄 PDF

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.

requirement SWS_Ifl_00221 [SWS_Ifl_00221] 📄 PDF

Axis distribution passed to Ifx routines shall have normal monotony sequence.

requirement SWS_Ifl_00226 [SWS_Ifl_00226] 📄 PDF

[SWS_Ifl_00226] ⌈Based on searched indices and ratios information using the Ifl_ DPSearch_f32 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 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.0) Result=Ifl_IpoMap_f32 (dpResultX, dpResultY, num_y, Val_array[num_slice * dpResultZ->Index]) else LowerXY=Ifl_IpoMap_f32 (dpResultX, dpResultY, num_y, Val_array[num_slice * dpRe- sultZ ->Index]) UpperXY=Ifl_IpoMap_f32 (dpResultX, dpResultY, num_y, Val_array[num_slice * dpRe- sultZ ->Index + 1]) Result=Ifl_Interpolate_f32 (LowerXY, UpperXY, dpResultZ->Ratio)⌋

requirement SWS_Ifl_00228 [SWS_Ifl_00228] 📄 PDF

[SWS_Ifl_00228] ⌈index=dpResult->Index if dpResult->Ratio==0.0 Result=Val_array[index] else Result=Val_array[index] + (Val_array[index + 1]- Val_array[index]) * dpResult->Ratio⌋ Here is the list of implemented routines:

requirement SWS_Ifl_00229 [SWS_Ifl_00229] 📄 PDF

[SWS_Ifl_00229] ⌈ Routine ID[hex] Routine prototype 0x013 float32 Ifl_IpoCur_u8_f32 ( const Ifl_DPResultF32_Type* dpResult, const uint8* Val_array) 0x014 float32 Ifl_IpoCur_u16_f32 ( const Ifl_DPResultF32_Type* dpResult, const uint16* Val_array) 0x015 float32 Ifl_IpoCur_s8_f32 ( const Ifl_DPResultF32_Type* dpResult, const sint8* Val_array) 0x016 float32 Ifl_IpoCur_s16_f32 ( const Ifl_DPResultF32_Type* dpResult, const sint16* Val_array) ⌋

requirement SWS_Ifl_00231 [SWS_Ifl_00231] 📄 PDF

[SWS_Ifl_00231] ⌈Based on searched indices and ratios information using the Ifl_ DPSearch_f32 routine, this routine calculates and returns the interpolation result for map. BaseIndex = dpResultX->Index * num_value + dpResultY->Index if (dpResultX->Ratio == 0.0) if (dpResultY->Ratio == 0.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.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->Ratio⌋ Here is the list of implemented routines.

requirement SWS_Ifl_00232 [SWS_Ifl_00232] 📄 PDF

[SWS_Ifl_00232] ⌈ Routine ID[hex] Routine prototype 0x018 float32 Ifl_IpoMap_u8_f32 ( const Ifl_DPResultF32_Type* dpResultX, const Ifl_DPResultF32_Type* dpResultY, uint32 num_value, const uint8* Val_array) 0x019 float32 Ifl_IpoMap_u16_f32 ( const Ifl_DPResultF32_Type* dpResultX, const Ifl_DPResultF32_Type* dpResultY, uint32 num_value, const uint16* Val_array) 0x01A float32 Ifl_IpoMap_s8_f32 (const Ifl_DPResultF32_Type* dpResultX, const Ifl_DPResultF32_Type* dpResultY, uint32 num_value, const sint8* Val_array) 0x01B float32 Ifl_IpoMap_s16_f32 (const Ifl_DPResultF32_Type* dpResultX, const Ifl_DPResultF32_Type* dpResultY, uint32 num_value, const sint16* Val_array) ⌋

requirement SWS_Ifl_00234 [SWS_Ifl_00234] 📄 PDF

[SWS_Ifl_00234] ⌈Based on searched indices and ratios information using the Ifl_ DPSearch_f32 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 neighboring X/Y Maps. num_slice = num_x*num_y if (dpResultZ->Ratio == 0.0) Result = Ifl_IpoMap_<InTypeMn>_f32 (dpResultX, dpResultY, num_y, Val_array[num_ slice*dpResultZ->Index]) else LowerXY = Ifl_IpoMap_<InTypeMn>_f32 (dpResultX, dpResultY, num_y, Val_ar- ray[num_slice*dpResultZ->Index]) UpperXY = Ifl_IpoMap_<InTypeMn>_f32 (dpResultX, dpResultY, num_y, Val_ar- ray[num_slice*dpResultZ->Index + 1]) Result = Ifl_Interpolate_f32 (LowerXY, UpperXY, dpResultZ->Ratio)⌋ Here is the list of implemented routines.

requirement SWS_Ifl_00235 [SWS_Ifl_00235] 📄 PDF

[SWS_Ifl_00235] ⌈ Routine ID[hex] Routine prototype 0x01C float32 Ifl_IpoCub_u8_f32 ( const Ifl_DPResultF32_Type* dpResultX, const Ifl_DPResultF32_Type* dpResultY, const Ifl_DPResultF32_Type* dpResultZ, uint16 num_x, uint16 num_y, const uint8* Val_array) 0x01D float32 Ifl_IpoCub_u16_f32 ( const Ifl_DPResultF32_Type* dpResultX, const Ifl_DPResultF32_Type* dpResultY, const Ifl_DPResultF32_Type* dpResultZ, uint16 num_x, uint16 num_y, const uint16* Val_array) 0x01E float32 Ifl_IpoCub_s8_f32 (const Ifl_DPResultF32_Type* dpResultX, const Ifl_DPResultF32_Type* dpResultY, const Ifl_DPResultF32_Type* dpResultZ, uint16 num_x, uint16 num_y, const sint8* Val_array) 0x01F float32 Ifl_IpoCub_s16_f32 (const Ifl_DPResultF32_Type* dpResultX, const Ifl_DPResultF32_Type* dpResultY, const Ifl_DPResultF32_Type* dpResultZ, uint16 num_x, uint16 num_y, const sint16* Val_array) ⌋

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/CP_MOD_Ifl
Status
unspecified
Version
AUTOSAR/AP/record/CP_MOD_Ifl@rel:R20-11#b39abbdb
Content hash
b39abbdb
Source
https://www.autosar.org/fileadmin/standards/R20-11/CP/AUTOSAR_SWS_IFLLibrary.pdf#nameddest=SWS_Ifl_00010

Инициализация и состояние

Ifl_GetVersionInfo функция

Returns the version information of this library.

void Ifl_GetVersionInfo(Std_VersionInfoType* versioninfo);

Сервисы

Ifl_DPSearch_f32 функция

This routine searches the position of input Xin within the given distribution array X_array, and returns index and ratio necessary for interpolation.

void Ifl_DPSearch_f32(Ifl_DPResultF32_Type* dpResult, float32 Xin, uint32 N, const float32* X_array);
Ifl_Interpolate_f32 функция

Returns the result of the linear interpolation (Result), determined according to the following equation.

float32 Ifl_Interpolate_f32(float32 Value1, float32 Value2, float32 Coef);
Ifl_IntIpoCur_f32_f32 функция

This routine calculates interpolation of a curve at position Xin using below equa-tion.

float32 Ifl_IntIpoCur_f32_f32(float32 X_in, uint32 N, const float32* X_array, const float32* Val_array);

This routine calculates Interpolation of a map at position X and Y using below equations.

float32 Ifl_IntIpoMap_f32f32_f32(float32 Xin, float32 Yin, uint32 Nx, uint32 Ny, const float32* X_array, const float32* Y_array, const float32* Val_array);
Ifl_IpoCub_f32 функция

Based on searched indices and ratios information using the relevant Ifl_DPSearch_f32 routine, this routine calculates and returns the interpolation result for a 3D cuboid.

float32 Ifl_IpoCub_f32(const Ifl_DPResultF32_Type* dpResultX, const Ifl_DPResultF32_Type* dpResultY, const Ifl_DPResultF32_Type* dpResultZ, uint16 num_x, uint16 num_y, const float32* Val_array);

Based on searched indices and ratios information using the relevant Ifl_DPSearch_f32 routine, this routine calculates and returns the interpolation result for a 3D cuboid.

float32 Ifl_IpoCub_<InTypeMn>_f32(const Ifl_DPResultF32_Type* dpResultX, const Ifl_DPResultF32_Type* dpResultY, const Ifl_DPResultF32_Type* dpResultZ, uint16 num_x, uint16 num_y, const <InType>* Val_array);
Ifl_IpoCur_f32 функция

Based on searched index and ratio information, this routine calculates and returns interpolation for curve.

float32 Ifl_IpoCur_f32(const Ifl_DPResultF32_Type* dpResult, const float32* Val_array);

Based on searched indices and ratios information using the relevant Ifl_DPSearch_f32 routine, this routine calculates and returns the interpolation result for a curve.

float32 Ifl_IpoCur_<InTypeMn>_f32(const Ifl_DPResultF32_Type* dpResult, const <InType>* Val_array);
Ifl_IpoMap_f32 функция

Based on searched indices and ratios information using the Ifl_DPSearch_f32 routine, this routine calculates and returns the interpolation result for map.

float32 Ifl_IpoMap_f32(const Ifl_DPResultF32_Type* dpResultX, const Ifl_DPResultF32_Type* dpResultY, uint32 num_value, const float32* Val_array);

Based on searched indices and ratios information using the relevant Ifl_DPSearch_f32 routine, this routine calculates and returns the interpolation result for a map.

float32 Ifl_IpoMap_<InTypeMn>_f32(const Ifl_DPResultF32_Type* dpResultX, const Ifl_DPResultF32_Type* dpResultY, uint32 num_value, const <InType>* Val_array);

Типы

Structure used for data point search for index and ratio

Требования

SWS_Ifl_00001 requirement

The Ifl module shall provide the following files: • C files, Ifl_<name>.c used to implement the library. All C files shall be prefixed with 'Ifl_'. Implementation & grouping of routines with respect to C files is recommended as per below options and there is no restriction to follow the same. Option 1 : <Name> can be function name providing one C file per function, eg.: Ifl_IntIpoMap_f32f32_f32.c etc. Option 2 : <Name> can have common name of group of functions: • 2.1 Group by object family: eg.:Ifl_IpoCur.c, Ifl_DPSearch.c • 2.2 Group by routine family: eg.: Ifl_IpoMap.c • 2.3 Group by method family: eg.: Ifl_Ipo.c etc. • 2.4 Group by other methods: (individual grouping allowed) Option 3 : <Name> can be removed so that single C file shall contain all Ifl functions, eg.: Ifl.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.

SWS_Ifl_00006 requirement

Ifl_DPResultF32_Type structure shall not be read/write/modified by the user directly. Only Ifl routines shall have access to this structure.

SWS_Ifl_00011 requirement

Returned Index shall be the lowest index for which (X_array[index] < Xin < X_array[index + 1]). If (X_array[0] <=Xin <= X_array[N-1]), then returned Index shall be the lowest index. dpResult->Index=indexdpResult->Ratio=(Xin-X_array[index]) / (X_array[index + 1] - X_ array[index]) dpResult ->Index = index dpResult ->Ratio = (Xin - X_array[index]) / (X_array [index+1] - X_array [index])

SWS_Ifl_00012 requirement

If the input value matches with one of the distribution array values, then return respective index and ratio as 0.0. If Input Xin == X_array[index], then dpResult ->Index = index (Index of the set point) dpResult ->Ratio = 0.0

SWS_Ifl_00013 requirement

If (Xin < X_array[0]), then return first index of an array and ratio = 0.0 dpResult ->Index = 0 dpResult ->Ratio = 0.0

SWS_Ifl_00014 requirement

If (Xin > X_array[N-1]), then return last index of an array and ratio = 0.0 dpResult ->Index = N - 1 dpResult ->Ratio = 0.0

SWS_Ifl_00015 requirement

The minimum value of N shall be 1

SWS_Ifl_00016 requirement

If X_array[Index+1] == X_array[Index], then the Ratio shall be zero. dpResult->Ratio = 0.0

SWS_Ifl_00017 requirement

This routine returns index and ratio through the structure of type Ifl_ DPResultF32_Type

SWS_Ifl_00022 requirement

index = dPResult->Index if dPResult->Ratio == 0.0 Result = Val_array[index] else Result = Val_array[index] + (Val_array[index+1] - Val_array[index]) * dpResult->Ratio

SWS_Ifl_00026 requirement

Based on searched indices and ratios information using the Ifl_ DPSearch_f32 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->Ratio

SWS_Ifl_00031 requirement

Result = Value1 + (Coef * (Value2 - Value1))

SWS_Ifl_00036 requirement

index = minimum value of integer index if (X_array[index] < 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_Ifl_00037 requirement

If the input value matches with one of the distribution array values, then result will be the respective Y array element indicated by the index. If (Xin == X_array[index]), Result = Val_array[index]

SWS_Ifl_00038 requirement

If Xin < X_array[0], then Result = Val_array[0]

SWS_Ifl_00039 requirement

If Xin > X_array[N-1], then Result = Val_array[N-1]

SWS_Ifl_00040 requirement

The minimum value of N shall be 1

SWS_Ifl_00042 requirement

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]) RatioX = (Xin - X_array[indexX]) / (X_array [indexX+1] - X_array [indexX]) RatioY = (Yin - Y_array[indexY]) / (Y_array [indexY+1] - Y_array [indexY]) BaseIndex = IndexX * Ny + indexY LowerY = Val_array [BaseIndex] UpperY = Val_array [BaseIndex + 1] LowerX = LowerY + (UpperY - LowerY) * RatioY LowerY = Val_array [BaseIndex + Ny] UpperY = Val_array [BaseIndex + Ny + 1] UpperX = LowerY + (UpperY - LowerY) * RatioY Result = LowerX + (UpperX - LowerX) * RatioX

SWS_Ifl_00043 requirement

If (Xin == X_array[indexX]) and (Y_array[indexY] < Yin < Y_ar- ray[indexY+1]) Result = Val_array [BaseIndex] + (Val_array [BaseIndex+1] - Val_array[BaseIndex]) * RatioY

SWS_Ifl_00044 requirement

If (Yin == Y_array[indexY]) and (X_array[indexX] < Xin < X_ar- ray[indexX+1]) Result = Val_array [BaseIndex] + (Val_array [BaseIndex+Ny] - Val_array[BaseIndex]) * RatioX

SWS_Ifl_00045 requirement

If (Xin == X_array[indexX]) and (Yin == Y_array[indexY]) Result = Val_array [BaseIndex]

SWS_Ifl_00046 requirement

If Xin < X_array[0], then indexX = 0, RatioX = 0.0

SWS_Ifl_00047 requirement

If Xin > X_array[Nx-1], then indexX = Nx - 1, RatioX = 0.0

SWS_Ifl_00048 requirement

If Yin < Y_array[0], then indexY = 0, RatioY = 0.0

SWS_Ifl_00049 requirement

If Yin > Y_array[Ny-1], then indexY = Ny - 1, RatioY = 0.0

SWS_Ifl_00050 requirement

The minimum value of N shall be 1

SWS_Ifl_00170 requirement

Record layout Name Element1 Element2 Element3 Element4 Element5 Distr_f32 uint32 N float32 X[] Curve_f32 float32 Val[] Map_f32 float32 Val[] Cub_f32 float32 Val[] IntCurve_f32_f32 uint32 N float32 X[] float32 Val[] IntMap_f32f32_ f32 uint32 Nx uint32 Ny float32 X[] float32 Y[] float32 Val[]

SWS_Ifl_00180 requirement

Do not call this routine until you have searched the axis using the Ifl_DPSearch routine. Only then it is ensured that the search result (Ifl_DPResultF32_ Type) contains valid data and is not used uninitialized.

SWS_Ifl_00181 requirement

Do not call this routine until you have searched the axis using the Ifl_DPSearch routine. Only then it is ensured that the search result (Ifl_DPResultF32_ Type) contains valid data and is not used uninitialized.

SWS_Ifl_00200 requirement

Ifl library shall not require initialization phase. A Library function 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.

SWS_Ifl_00201 requirement

Ifl library shall not require a shutdown operation phase.

SWS_Ifl_00206 requirement

The Ifl library shall be implemented in a way that the code can be shared among callers in different memory partitions.

SWS_Ifl_00207 requirement

Usage of macros should be avoided. The function should be de- clared as function or inline function. Macro #define should not be used.

SWS_Ifl_00208 requirement

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 func- tions, e.g. the DET.

SWS_Ifl_00209 requirement

The library, written in C programming language, should conform to the MISRA C Standard. Please refer to SWS_BSW_00115 for more details.

SWS_Ifl_00210 requirement

Each AUTOSAR library Module implementation <library>*.c and <library>*.h shall map their code to memory sections using the AUTOSAR memory mapping mechanism.

SWS_Ifl_00211 requirement

Each AUTOSAR library Module implementation <library>*.c, that uses AUTOSAR integer data types and/or the standard return, shall include the header file Std_Types.h.

SWS_Ifl_00212 requirement

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.

SWS_Ifl_00213 requirement

All 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.

SWS_Ifl_00214 requirement

The standardized common published parameters as required by SRS_BSW_00402 in the General Requirements on Basic Software Modules [REF] shall be published within the header file of this module and need to be provided in the BSW Module Description. The according module abbreviation can be found in the List of Basic Software Modules [REF].

SWS_Ifl_00216 requirement

If source code for caller and callee of Ifl_GetVersionInfo is avail- able, the Ifl library should realize Ifl_GetVersionInfo as a macro defined in the module's header file.

SWS_Ifl_00217 requirement

The functions shall not call the DET for error notification.

SWS_Ifl_00218 requirement

The Ifl library shall not have any configuration options that may af- fect 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 error shall not be configurable.

SWS_Ifl_00219 requirement

Error detection: Function should check at runtime (both in produc- tion and development code) the value of input parameters, especially cases where erroneous value can bring to fatal error or unpredictable result, if they have the values allowed by the function specification. All the error cases shall be listed in SWS and the function should return a specified value (in SWS) that is not configurable. This value is dependant of the function and the error case so it is determined case by case. If values passed to the routines are not valid and out of the function specification, then such error are not detected.

SWS_Ifl_00220 requirement

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_Ifl_00221 requirement

Axis distribution passed to Ifx routines shall have normal monotony sequence.

SWS_Ifl_00223 requirement

Spezifikationsanforderung SWS_Ifl_00223.

SWS_Ifl_00224 requirement

These requirements are not applicable to this specification.

SWS_Ifl_00226 requirement

[SWS_Ifl_00226] ⌈Based on searched indices and ratios information using the Ifl_ DPSearch_f32 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 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.0) Result=Ifl_IpoMap_f32 (dpResultX, dpResultY, num_y, Val_array[num_slice * dpResultZ->Index]) else LowerXY=Ifl_IpoMap_f32 (dpResultX, dpResultY, num_y, Val_array[num_slice * dpRe- sultZ ->Index]) UpperXY=Ifl_IpoMap_f32 (dpResultX, dpResultY, num_y, Val_array[num_slice * dpRe- sultZ ->Index + 1]) Result=Ifl_Interpolate_f32 (LowerXY, UpperXY, dpResultZ->Ratio)⌋

SWS_Ifl_00228 requirement

[SWS_Ifl_00228] ⌈index=dpResult->Index if dpResult->Ratio==0.0 Result=Val_array[index] else Result=Val_array[index] + (Val_array[index + 1]- Val_array[index]) * dpResult->Ratio⌋ Here is the list of implemented routines:

SWS_Ifl_00229 requirement

[SWS_Ifl_00229] ⌈ Routine ID[hex] Routine prototype 0x013 float32 Ifl_IpoCur_u8_f32 ( const Ifl_DPResultF32_Type* dpResult, const uint8* Val_array) 0x014 float32 Ifl_IpoCur_u16_f32 ( const Ifl_DPResultF32_Type* dpResult, const uint16* Val_array) 0x015 float32 Ifl_IpoCur_s8_f32 ( const Ifl_DPResultF32_Type* dpResult, const sint8* Val_array) 0x016 float32 Ifl_IpoCur_s16_f32 ( const Ifl_DPResultF32_Type* dpResult, const sint16* Val_array) ⌋

SWS_Ifl_00231 requirement

[SWS_Ifl_00231] ⌈Based on searched indices and ratios information using the Ifl_ DPSearch_f32 routine, this routine calculates and returns the interpolation result for map. BaseIndex = dpResultX->Index * num_value + dpResultY->Index if (dpResultX->Ratio == 0.0) if (dpResultY->Ratio == 0.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.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->Ratio⌋ Here is the list of implemented routines.

SWS_Ifl_00232 requirement

[SWS_Ifl_00232] ⌈ Routine ID[hex] Routine prototype 0x018 float32 Ifl_IpoMap_u8_f32 ( const Ifl_DPResultF32_Type* dpResultX, const Ifl_DPResultF32_Type* dpResultY, uint32 num_value, const uint8* Val_array) 0x019 float32 Ifl_IpoMap_u16_f32 ( const Ifl_DPResultF32_Type* dpResultX, const Ifl_DPResultF32_Type* dpResultY, uint32 num_value, const uint16* Val_array) 0x01A float32 Ifl_IpoMap_s8_f32 (const Ifl_DPResultF32_Type* dpResultX, const Ifl_DPResultF32_Type* dpResultY, uint32 num_value, const sint8* Val_array) 0x01B float32 Ifl_IpoMap_s16_f32 (const Ifl_DPResultF32_Type* dpResultX, const Ifl_DPResultF32_Type* dpResultY, uint32 num_value, const sint16* Val_array) ⌋

SWS_Ifl_00234 requirement

[SWS_Ifl_00234] ⌈Based on searched indices and ratios information using the Ifl_ DPSearch_f32 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 neighboring X/Y Maps. num_slice = num_x*num_y if (dpResultZ->Ratio == 0.0) Result = Ifl_IpoMap_<InTypeMn>_f32 (dpResultX, dpResultY, num_y, Val_array[num_ slice*dpResultZ->Index]) else LowerXY = Ifl_IpoMap_<InTypeMn>_f32 (dpResultX, dpResultY, num_y, Val_ar- ray[num_slice*dpResultZ->Index]) UpperXY = Ifl_IpoMap_<InTypeMn>_f32 (dpResultX, dpResultY, num_y, Val_ar- ray[num_slice*dpResultZ->Index + 1]) Result = Ifl_Interpolate_f32 (LowerXY, UpperXY, dpResultZ->Ratio)⌋ Here is the list of implemented routines.

SWS_Ifl_00235 requirement

[SWS_Ifl_00235] ⌈ Routine ID[hex] Routine prototype 0x01C float32 Ifl_IpoCub_u8_f32 ( const Ifl_DPResultF32_Type* dpResultX, const Ifl_DPResultF32_Type* dpResultY, const Ifl_DPResultF32_Type* dpResultZ, uint16 num_x, uint16 num_y, const uint8* Val_array) 0x01D float32 Ifl_IpoCub_u16_f32 ( const Ifl_DPResultF32_Type* dpResultX, const Ifl_DPResultF32_Type* dpResultY, const Ifl_DPResultF32_Type* dpResultZ, uint16 num_x, uint16 num_y, const uint16* Val_array) 0x01E float32 Ifl_IpoCub_s8_f32 (const Ifl_DPResultF32_Type* dpResultX, const Ifl_DPResultF32_Type* dpResultY, const Ifl_DPResultF32_Type* dpResultZ, uint16 num_x, uint16 num_y, const sint8* Val_array) 0x01F float32 Ifl_IpoCub_s16_f32 (const Ifl_DPResultF32_Type* dpResultX, const Ifl_DPResultF32_Type* dpResultY, const Ifl_DPResultF32_Type* dpResultZ, uint16 num_x, uint16 num_y, const sint16* Val_array) ⌋