首页 > > 详细

辅导data编程、讲解C/C++程序设计、program留学生程序辅导解析Java程序|辅导留学生 Statistics统计、回归、迭代

Specification of Extended Fixed Point Routines
AUTOSAR CP Release 4.4.0
1 of 112 Document ID 400: AUTOSAR_SWS_EFXLibrary
- AUTOSAR confidential -
Document Change History
Date Release Changed by Change Description
2018-10-31 4.4.0 AUTOSAR
Release
Management
Modified:
 Updated the range and resolution of
requirements
SWS_EFX_00220,SWS_EFX_0022
3,SWS_EFX_00226,SWS_EFX_00
229,SWS_EFX_00232,SWS_EFX_
00235,SWS_EFX_00240,SWS_EF
X_00243,SWS_EFX_00246,SWS_E
FX_00250,SWS_EFX_00253,SWS_
EFX_00256
2017-12-08 4.3.1 AUTOSAR
Release
Management
Added:
 A note has been added in Section
8.1 of EFX specification to provide
clarity in usage of mnemonic for
Boolean data types.
Modified:
 The data type for Boolean has been
updated in the UML of
SWS_Efx_00355.
 Inclusion of Pointer to Constant
(P2CONST) for SWS_Efx_00355,
SWS_Efx_00309, SWS_Efx_00307
& SWS_Efx_00193 and proper
categorization of Parameters as
InOut for SWS_Efx_00376.
Document Title Specification of Extended
Fixed Point Routines
Document Owner AUTOSAR
Document Responsibility AUTOSAR
Document Identification No 400
Document Status Final
Part of AUTOSAR Standard Classic Platform
Part of Standard Release 4.4.0
Specification of Extended Fixed Point Routines
AUTOSAR CP Release 4.4.0
2 of 112 Document ID 400: AUTOSAR_SWS_EFXLibrary
- AUTOSAR confidential -
Document Change History
Date Release Changed by Change Description
2016-11-30 4.3.0 AUTOSAR
Release
Management
Modified:
 Updated the correct reference to
SRS_BSW_General
(SRS_BSW_00437) &
(SRS_BSW_00448) for
SWS_Efx_00810 &
SWS_Efx_00822 requirements.
 Updated EFX document to support
MISRA 2012 standard. (Removed
redundant statements in
SWS_Efx_00809 which already
exist in SWS_BSW document and
SWS_SRS document)
 Updated SWS_Efx_00275 &
SWS_Efx_00276 to provide more
clarity on resolution of parameters.
 Updated SWS_Efx_00278 &
SWS_Efx_00279 to provide more
clarity on rounding and minimum
value of Param_cpcst-
>SlopeXXX_u32 * dT_s32. Provided
the correct IT number.
 Updated the section 8.5.3.1 for
Structure definitions for controller
routines.
Specification of Extended Fixed Point Routines
AUTOSAR CP Release 4.4.0
3 of 112 Document ID 400: AUTOSAR_SWS_EFXLibrary
- AUTOSAR confidential -
Document Change History
Date Release Changed by Change Description
 Updated SWS_Efx_00240,
SWS_Efx_00243, SWS_Efx_00246,
SWS_Efx_00250, SWS_Efx_00253
& SWS_Efx_00256 to correct the
case sensitivity for the function
name.
 Section 2 has been revisited to
update Default Error Tracer instead
of Development Error tracer.
Removed:
 Removal of Efx_ISetParam from
BSW uml model which is obsolete.
 Removed the duplicated trace
environments for SWS_Efx_00520
& SWS_Efx_00525.
 Removed the requirements that are
marked as Deprecated. (8.5.1.2
Second computation,
SWS_Efx_00009 -
SWS_Efx_00011, SWS_Efx_00041
- SWS_Efx_00043,
SWS_Efx_00295 -
SWS_Efx_00302, SWS_Efx_00347
- SWS_Efx_00354,
SWS_Efx_00345, SWS_Efx_00460,
SWS_Efx_00461 & 8.5.14
Efx_DeadTime)
2015-07-31 4.2.2 AUTOSAR
Release
Management
Modified:
 Updated the requirement ID for
SWS_Efx_00033 as per the
convention
 Updated requirement ID
SWS_Efx_00436 (UML) for
OutTypeMn as per the standard
convention
 Updated SWS_Efx_00001 for
naming convention under Section
5.1, File Structure
 Updated SWS_Efx_00365 to correct
the data type of input parameters
Specification of Extended Fixed Point Routines
AUTOSAR CP Release 4.4.0
4 of 112 Document ID 400: AUTOSAR_SWS_EFXLibrary
- AUTOSAR confidential -
Document Change History
Date Release Changed by Change Description
2014-10-31 4.2.1 AUTOSAR
Release
Management
Added:
 New Variants for SWS_Efx_00412
(0xE2 - 0xE9)
 Note has been added for
SWS_Efx_00053, SWS_Efx_00072
& Section 8.5.3.1.
 A statement has been added to
clarify the formula used for
Hypotenuse function just below the
section 8.5.9
 A statement has been added to
provide more clarity on the formula
mentioned in SWS_Efx_00451
Modified:
 Updated usage of const in a
consistent manner in EFX
document. (SWS_Efx_00050,
SWS_Efx_00067, SWS_Efx_00085,
SWS_Efx_00519, SWS_Efx_00107,
SWS_Efx_00122, SWS_Efx_00146,
SWS_Efx_00172, SWS_Efx_00205,
SWS_Efx_00379 &
SWS_Efx_00404)
 Formula for TeQ_ has been
corrected in section 8.5.3.1 and font
has been updated for
SWS_Efx_00071
 Condition check included for
SWS_Efx_00053, SWS_Efx_00072
& Section 8.5.3.1 and corrected for
SWS_Efx_00054, SWS_Efx_00073
& SWS_Efx_00504. Formula
updated for SWS_Efx_00073
 Updated rounding for
SWS_Efx_00071, SWS_Efx_00091,
SWS_Efx_00502, SWS_Efx_00151
& SWS_Efx_00156.
Specification of Extended Fixed Point Routines
AUTOSAR CP Release 4.4.0
5 of 112 Document ID 400: AUTOSAR_SWS_EFXLibrary
- AUTOSAR confidential -
Document Change History
Date Release Changed by Change Description
 Service ID[hex] for
SWS_Efx_00405, SWS_Efx_00410
& SWS_Efx_00412
 Input & Output range has been
modified for SWS_Efx_00187
 Statement on rounding was updated
for SWS_Efx_00441
 Comment for structure element “n”
has been updated for
SWS_Efx_00204 &
 SWS_Efx_00836. Data type of “n”
has been modified for
SWS_Efx_00204.
2014-03-31 4.1.3 AUTOSAR
Release
Management
 Modified: Rounding mechanism was
updated for HpFilter, Average,
Array_Average & MovingAverage
functions.
 Added: A note below
SWS_Efx_00307 for
Efx_RampGetSwitchPos function.
2013-10-31 4.1.2 AUTOSAR
Release
Management
 Deprecated: Efx_DeadTime function
 Removed: Requirements for
Efx_SlewRate, Efx_RampCalc and
Efx_RampCalcJump functions
 Added: SWS_Efx_00837 for
Efx_RampCalc function
 Modified:
 Descriptions of Efx_RampCalc and
Efx_RampSetParam
 Requirements for Efx_RampCalc
and Efx_RampCalcJump functions.
 Syntax for variants of
Efx_SlewRate, Efx_Div and
Efx_MovingAverage functions.
 Resolution of the in-parameter for
Efx_Arcsin and Efx_Arccos
functions.
 Name "underflow" to "negative
overflow" throughout the document
 Editorial changes
Specification of Extended Fixed Point Routines
AUTOSAR CP Release 4.4.0
6 of 112 Document ID 400: AUTOSAR_SWS_EFXLibrary
- AUTOSAR confidential -
Document Change History
Date Release Changed by Change Description
2013-03-15 4.1.1 AUTOSAR
Administration
 Added 8-bit and 16-bit variants for
Hysteresis functions
 Formulae modified for Hypotenuse
functions
 Second computation First-order lowpass
filter functions are deprecated
 Inequalities are corrected for
Efx_HystLeftRight,
Efx_HystDeltaRight,
Efx_HystCenterHalfDelta functions
 Description and requirements are
modified for Efx_Div,
Efx_Debounce, Efx_HystLeftDelta,
Efx_SortAscend, Efx_SortDescend,
Efx_EdgeBipol, Efx_Hysteresis,
Efx_MovingAverage functions
 Description of the in-parameter
corrected for
Efx_DebounceSetParam,
Efx_Debounce functions
 Physical range of ‘fac’ parameter is
modified in LpFilter First
computation
 Renamed RS_FlipFlop function for
removing the post-fixes
 Added SWS_Efx_00823 for Integral
promotion
 Modified syntax for Efx_Gt,
Efx_Debounce functions
 Corrected for
‘DependencyOnArtifact’
Specification of Extended Fixed Point Routines
AUTOSAR CP Release 4.4.0
7 of 112 Document ID 400: AUTOSAR_SWS_EFXLibrary
- AUTOSAR confidential -
Document Change History
Date Release Changed by Change Description
2011-12-22 4.0.3 AUTOSAR
Administration
 Initialization functionality introduced
for 'Counter Routines'
 Interface for Efx_CtrlSetLimit
corrected
 Efx_MovingAverage
routine interface corrected
 Efx_RampCalcSwitch routine
definition and requirements updated
for correct behavior
 Interface for Efx_Debounce_u8_u8
routine updated
 Updated parameter sequences for
DT1 and PI controller routines.
 Name revised for Efx_PCalc routine
 Description correct for
Efx_DebounceParam_Type and
Efx_DebounceState_Type
 Interface table corrected for
Efx_Div routine
 Interface table corrected for
Efx_MedianSort routine
 Error classification support and
definition removed as DET call not
supported by library
 Configuration parameter description
/ support removed for
XXX_GetVersionInfo routine.
 XXX_GetVersionInfo routine name
corrected.
2010-09-30 3.1.5 AUTOSAR
Administration
 Introduction of additional LIMITED
Functions for controllers
 Ramp functions optimised for
effective usage
 Separation of DT1 Type 1 and Type
2 Controller functions
 Introduction of additional
approximative function for
calculation of TeQ
Specification of Extended Fixed Point Routines
AUTOSAR CP Release 4.4.0
8 of 112 Document ID 400: AUTOSAR_SWS_EFXLibrary
- AUTOSAR confidential -
Document Change History
Date Release Changed by Change Description
2010-02-02 3.1.4 AUTOSAR
Administration
 Initial Release
Specification of Extended Fixed Point Routines
AUTOSAR CP Release 4.4.0
9 of 112 Document ID 400: AUTOSAR_SWS_EFXLibrary
- AUTOSAR confidential -
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
intellectual 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.
Specification of Extended Fixed Point Routines
AUTOSAR CP Release 4.4.0
10 of 112 Document ID 400: AUTOSAR_SWS_EFXLibrary
- AUTOSAR confidential -
Table of Contents
1 Introduction and functional overview ................................................................. 12
2 Acronyms and abbreviations ............................................................................. 14
3 Related documentation...................................................................................... 15
3.1 Input documents......................................................................................... 15
3.2 Related standards and norms .................................................................... 15
4 Constraints and assumptions ............................................................................ 16
4.1 Limitations .................................................................................................. 16
4.2 Applicability to car domains........................................................................ 16
5 Dependencies to other modules........................................................................ 17
5.1 File structure .............................................................................................. 17
6 Requirements traceability .................................................................................. 18
7 Functional specification ..................................................................................... 19
7.1 Error classification...................................................................................... 19
7.2 Error Detection ........................................................................................... 19
7.3 Error notification ......................................................................................... 19
7.4 Initialization and shutdown ......................................................................... 19
7.5 Using Library API ....................................................................................... 19
7.6 library implementation ................................................................................ 20
8 API specification................................................................................................ 21
8.1 Imported types............................................................................................ 21
8.2 Type definitions .......................................................................................... 21
8.3 Comment about rounding........................................................................... 21
8.4 Comment about routines optimized for target ............................................ 22
8.5 Mathematical functions definitions.............................................................. 22
8.5.1 First-order low-pass filter ........................................................................ 22
8.5.2 First-order High-pass filter ...................................................................... 25
8.5.3 Controller routines .................................................................................. 29
8.5.4 Square root............................................................................................. 64
8.5.5 Exponential............................................................................................. 66
8.5.6 Average .................................................................................................. 67
8.5.7 Array Average......................................................................................... 67
8.5.8 Moving Average...................................................................................... 68
8.5.9 Hypotenuse ............................................................................................ 69
8.5.10 Trigonometric functions .......................................................................... 72
8.5.11 Rate limiter ............................................................................................. 77
8.5.12 Ramp routines ........................................................................................ 79
8.5.13 Hysteresis routines ................................................................................. 86
8.5.14 Debounce routines.................................................................................. 91
8.5.15 Ascending Sort Routine .......................................................................... 94
8.5.16 Descending Sort Routine........................................................................ 94
8.5.17 Median sort routine................................................................................. 95
Specification of Extended Fixed Point Routines
AUTOSAR CP Release 4.4.0
11 of 112 Document ID 400: AUTOSAR_SWS_EFXLibrary
- AUTOSAR confidential -
8.5.18 Edge detection routines .......................................................................... 96
8.5.19 Interval routines ...................................................................................... 98
8.5.20 Counter routines ................................................................................... 101
8.5.21 Flip-Flop routine.................................................................................... 102
8.5.22 Limiter routines ..................................................................................... 103
8.5.23 64 bits functions.................................................................................... 104
8.6 Examples of use of functions ................................................................... 108
8.7 Version API .............................................................................................. 108
8.7.1 Efx_GetVersionInfo............................................................................... 108
8.8 Call-back notifications .............................................................................. 108
8.9 Scheduled functions................................................................................. 108
8.10 Expected Interfaces.................................................................................. 108
8.10.1 Mandatory Interfaces ............................................................................ 108
8.10.2 Optional Interfaces................................................................................ 109
8.10.3 Configurable interfaces......................................................................... 109
9 Sequence diagrams ........................................................................................ 110
10 Configuration specification........................................................................... 111
10.1 Published Information............................................................................... 111
10.2 Configuration option ................................................................................. 111
11 Not applicable requirements ........................................................................ 112
Specification of Extended Fixed Point Routines
AUTOSAR CP Release 4.4.0
12 of 112 Document ID 400: AUTOSAR_SWS_EFXLibrary
- AUTOSAR confidential -
1 Introduction and functional overview
AUTOSAR Library routines are the part of system services in AUTOSAR architecture
and below figure shows position of AUTOSAR library in layered architecture.
Figure : Layered architecture
This specification specifies the functionality, API and the configuration of the
AUTOSAR library dedicated to extended mathematical functions for fixed-point
values.
This extended mathematical library (Efx) contains the following routines:
 Moving average
 First order high pass filter
 First order low-pass filter
 Controller routines
 Square root
 Exponential
 Average
 Array Average
 Moving Average
 Hypotenuse
 Trigonometric functions
 Rate limiter functions
 Ramp routines
 Hysteresis function
 Dead Time
 Debounce
 Ascending Sort Routine
 Descending Sort Routine
 Median Sort
 Edge detection routines
 Interval routines
 Counter routines
Basic Software
Runtime Environment (RTE)
Application Layer
ECU Hardware
Specification of Extended Fixed Point Routines
AUTOSAR CP Release 4.4.0
13 of 112 Document ID 400: AUTOSAR_SWS_EFXLibrary
- AUTOSAR confidential -
 Flip-Flop routine
 Limiter routines
 64 bit functions
All routines are re-entrant and can be used by multiple runnables at the same time.
Specification of Extended Fixed Point Routines
AUTOSAR CP Release 4.4.0
14 of 112 Document ID 400: AUTOSAR_SWS_EFXLibrary
- AUTOSAR confidential -
2 Acronyms and abbreviations
Acronyms and abbreviations, which have a local scope and therefore are not
contained in the AUTOSAR glossary, must appear in a local glossary.
Abbreviation /
Acronym:
Description:
Arcsin Inverse Sine
Arccos Inverse Cosine
BSW Basic Software
Cos Cosine
DET Default Error Tracer
EFX Extended Mathematical library – Fixed point
Hypot Hypotenuse
HpFilter High pass filter
LpFilterFac1 Low pass filter with a factor of 1 (included in [0, 1])
LpFilter Low pass filter
Mn Mnemonic
Lib Library
Sqrt Square root
Sin Sine
SWS Software Specification
SRS Software Requirement Specification
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
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
s64 Mnemonic for the sint64, specified in AUTOSAR_SWS_PlatformTypes
u64 Mnemonic for the uint64, specified in AUTOSAR_SWS_PlatformTypes
Specification of Extended Fixed Point Routines
AUTOSAR CP Release 4.4.0
15 of 112 Document ID 400: AUTOSAR_SWS_EFXLibrary
- AUTOSAR confidential -
3 Related documentation
3.1 Input documents
[1] List of Basic Software Modules,
AUTOSAR_TR_BSWModuleList.pdf
[2] Layered Software Architecture,
AUTOSAR_EXP_LayeredSoftwareArchitecture.pdf
[3] General Requirements on Basic Software Modules,
AUTOSAR_SRS_BSWGeneral.pdf
[4] Specification of ECU Configuration,
AUTOSAR_TPS_ECUConfiguration.pdf
[5] Basic Software Module Description Template,
AUTOSAR_TPS_BSWModuleDescriptionTemplate.pdf
[6] Specification of Platform Types,
AUTOSAR_SWS_PlatformTypes.pdf
[7] Specification of Standard Types,
AUTOSAR_SWS_StandardTypes.pdf
[8] Requirement on Libraries,
AUTOSAR_SRS_Libraries.pdf
[9] Specification of Memory Mapping,
AUTOSAR_SWS_MemoryMapping.pdf
3.2 Related standards and norms
[10] ISO/IEC 9899:1990 Programming Language – C
Specification of Extended Fixed Point Routines
AUTOSAR CP Release 4.4.0
16 of 112 Document ID 400: AUTOSAR_SWS_EFXLibrary
- AUTOSAR confidential -
4 Constraints and assumptions
4.1 Limitations
No limitations.
4.2 Applicability to car domains
No restrictions.
Specification of Extended Fixed Point Routines
AUTOSAR CP Release 4.4.0
17 of 112 Document ID 400: AUTOSAR_SWS_EFXLibrary
- AUTOSAR confidential -
5 Dependencies to other modules
5.1 File structure
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 : can be function name providing one C file per function,
eg.: Efx_Pt1_s32.c etc.
Option 2 : can have common name of group of functions:
2.1 Group by object family:
eg.:Efx_Pt1.c, Efx_Dt1.c, Efx_Pid.c
2.2 Group by routine family:
eg.: Efx_Filter.c, Efx_Controller.c, Efx_Average.c etc.
2.3 Group by method family:
eg.: Efx_Sin.c, Efx_Exp.c, Efx_Arcsin.c, etc.
2.4 Group by architecture:
eg.: Efx_Slewrate16.c, Efx_Slewrate32.c
2.5 Group by other methods: (individual grouping allowed)
Option 3 : can be removed so that single C file shall contain all Efx
functions, eg.: Efx.c.
Using above options gives certain flexibility of choosing suitable granularity with
reduced number of C files. Linking only on-demand is also possible in case of some
options.
Specification of Extended Fixed Point Routines
AUTOSAR CP Release 4.4.0
18 of 112 Document ID 400: AUTOSAR_SWS_EFXLibrary
- AUTOSAR confidential -
6 Requirements traceability
Requirement Description Satisfied by
SRS_BSW_00003 All software modules shall provide version and
identification information
SWS_Efx_00815
SRS_BSW_00007 All Basic SW Modules written in C language shall
conform to the MISRA C 2012 Standard.
SWS_Efx_00809
SRS_BSW_00304 All AUTOSAR Basic Software Modules shall use the
following data types instead of native C data types
SWS_Efx_00812
SRS_BSW_00306 AUTOSAR Basic Software Modules shall be compiler
and platform independent
SWS_Efx_00813
SRS_BSW_00318 Each AUTOSAR Basic Software Module file shall
provide version numbers in the header file
SWS_Efx_00815
SRS_BSW_00321 The version numbers of AUTOSAR Basic Software
Modules shall be enumerated according specific rules
SWS_Efx_00815
SRS_BSW_00374 All Basic Software Modules shall provide a readable
module vendor identification
SWS_Efx_00814
SRS_BSW_00378 AUTOSAR shall provide a boolean type SWS_Efx_00812
SRS_BSW_00379 All software modules shall provide a module identifier in
the header file and in the module XML description file.
SWS_Efx_00814
SRS_BSW_00402 Each module shall provide version information SWS_Efx_00814
SRS_BSW_00407 Each BSW module shall provide a function to read out
the version information of a dedicated module
implementation
SWS_Efx_00815,
SWS_Efx_00816
SRS_BSW_00411 All AUTOSAR Basic Software Modules shall apply a
naming rule for enabling/disabling the existence of the
API
SWS_Efx_00816
SRS_BSW_00437 Memory mapping shall provide the possibility to define
RAM segments which are not to be initialized during
startup
SWS_Efx_00810
SRS_BSW_00448 Module SWS shall not contain requirements from Other
Modules
SWS_Efx_00822
SRS_LIBS_00001 The functional behavior of each library functions shall
not be configurable
SWS_Efx_00818
SRS_LIBS_00002 A library shall be operational before all BSW modules
and application SW-Cs
SWS_Efx_00800
SRS_LIBS_00003 A library shall be operational until the shutdown SWS_Efx_00801
SRS_LIBS_00013 The error cases, resulting in the check at runtime of the
value of input parameters, shall be listed in SWS
SWS_Efx_00817,
SWS_Efx_00819
SRS_LIBS_00015 It shall be possible to configure the microcontroller so
that the library code is shared between all callers
SWS_Efx_00806
SRS_LIBS_00017 Usage of macros should be avoided SWS_Efx_00807
SRS_LIBS_00018 A library function may only call library functions SWS_Efx_00808
Specification of Extended Fixed Point Routines
AUTOSAR CP Release 4.4.0
19 of 112 Document ID 400: AUTOSAR_SWS_EFXLibrary
- AUTOSAR confidential -
7 Functional specification
7.1 Error classification
[SWS_Efx_00821] ⌈No error classification definition as DET call not supported by
library
⌋ ()
7.2 Error Detection
[SWS_Efx_00819] ⌈Error detection: Function should check at runtime (both in
production 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.
E.g. If passed value > 32 for a bit-position or a negative number of samples of an
axis distribution is passed to a routine. ⌋ (SRS_LIBS_00013)
7.3 Error notification
[SWS_Efx_00817] ⌈The functions shall not call the DET for error notification. ⌋
(SRS_LIBS_00013)
7.4 Initialization and shutdown
[SWS_Efx_00800] ⌈Efx 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. ⌋ (SRS_LIBS_00002)
[SWS_Efx_00801] ⌈Efx library shall not require a shutdown operation phase. ⌋
(SRS_LIBS_00003)
7.5 Using Library API
Efx API can be directly called from BSW modules or SWC. No port definition is
required. It is a pure function call.
The statement ‘Efx.h’ shall be placed by the developer or an application code
generator but not by the RTE generator
Using a library should be documented. if a BSW module or a SWC uses a Library,
the developer should add an Implementation-DependencyOnArtifact in the
BSW/SWC template.
minVersion and maxVersion parameters correspond to the supplier version. In case
of AUTOSAR library, these parameters may be left empty because a SWC or BSW
module may rely on a library behaviour, not on a supplier implementation. However,
the SWC or BSW modules shall be compatible with the AUTOSAR platform where
they are integrated.
Specification of Extended Fixed Point Routines
AUTOSAR CP Release 4.4.0
20 of 112 Document ID 400: AUTOSAR_SWS_EFXLibrary
- AUTOSAR confidential -
7.6 library implementation
[SWS_Efx_00806] ⌈The Efx library shall be implemented in a way that the code can
be shared among callers in different memory partitions. ⌋ (SRS_LIBS_00015)
[SWS_Efx_00807] ⌈Usage of macros should be avoided. The function should be
declared as function or inline function. Macro #define should not be used. ⌋
(SRS_LIBS_00017)
[SWS_Efx_00808] ⌈A library function shall not call any BSW modules functions, e.g.
the DET. A library function can call other library functions. Because a library function
shall be re-entrant. But other BSW modules functions may not be re-entrant. ⌋
(SRS_LIBS_00018)
[SWS_Efx_00809] ⌈The library, written in C programming language, should conform
to the MISRA C Standard.
Please refer to SWS_BSW_00115 for more details.
⌋ (SRS_BSW_00007)
[SWS_Efx_00810] ⌈Each AUTOSAR library Module implementation *.c and
*.h shall map their code to memory sections using the AUTOSAR memory
mapping mechanism. ⌋ (SRS_BSW_00437)
[SWS_Efx_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_Efx_00813] ⌈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. ⌋ (SRS_BSW_00306)
[SWS_Efx_00823] ⌈Integral promotion has to be adhered to when implementing Efx
services. Thus, to obtain maximal precision, intermediate results shall not be limited.
⌋()
Specification of Extended Fixed Point Routines
AUTOSAR CP Release 4.4.0
21 of 112 Document ID 400: AUTOSAR_SWS_EFXLibrary
- AUTOSAR confidential -
8 API specification
8.1 Imported types
In this chapter, all types included from the following modules are listed:
Header file Imported Type
Std_Types.h boolean, sint8, uint8, sint16, uint16, sint32, uint32
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.
The following mnemonic are used in the library routine names.
Size Platform Type Mnemonic Range
unsigned 8-Bit boolean u8 [ TRUE, FALSE ]
signed 8-Bit sint8 s8 [ -128, 127 ]
signed 16-Bit sint16 s16 [ -32768, 32767 ]
signed 32-Bit sint32 s32 [ -2147483648, 2147483647 ]
signed 64-Bit sint64 s64 [-9223372036854775808,
9223372036854775807]
unsigned 8-Bit uint8 u8 [ 0, 255 ]
unsigned 16-Bit uint16 u16 [ 0, 65535 ]
unsigned 32-Bit uint32 u32 [ 0, 4294967295 ]
unsigned 64-Bit uint64 u64 [0, 18446744073709551615]
Table 1: Base Types
As a convention in the rest of the document:
 mnemonics will be used in the name of the routines (using that
means Type Mnemonic for Input 1)
 the real type will be used in the description of the prototypes of the routines
(using or ).
Note:
The naming convention for the api's with boolean return type/parameter type is given
as _u8 which shall be interpreted as _b. (Boolean)
If there is no boolean data type present in the return type/parameter type then _u8
shall be interpreted as _u8 only.
8.2 Type definitions
None
8.3 Comment about rounding
Two types of rounding can be applied:
Results are ‘rounded off’, it means:
 0 <= X < 0.5 rounded to 0
 0.5 <= X < 1 rounded to 1
 -0.5 < X <= 0 rounded to 0
 -1 < X <= -0.5 rounded to -1
Results are rounded towards zero.
 0 <= X < 1 rounded to 0
 -1 < X <= 0 rounded to 0
Specification of Extended Fixed Point Routin

联系我们
  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp
热点标签

联系我们 - QQ: 99515681 微信:codinghelp
程序辅导网!