MICROSAR VStdLib
Technical Reference
Generic implementation of the Vector Standard Library
Version 2.02.00
Author
visgaz
Status
Released
Technical Reference MICROSAR VStdLib
© 2021 Vector Informatik GmbH Version 2.02.00 2
Document Information
History
Author
Date
Version
Remarks
vistkr
2015-05-04
1.00.00
Creation
vistkr
2016-04-12
1.00.01
Update to new CI, no changes in content
visgaz
2021-01-18
2.00.00
Added bit search feature (CAN-1574)
Made formal adaptions
visgaz
2021-03-15
2.01.00
Added memory comparison (CAN-1579) and (de-)
serialization feature (CAN-1577)
visgaz
2021-04-12
2.02.00
Refactored description of memory comparison (CAN-2834)
and (de-)serialization feature (CAN-2831)
Added endian conversion feature (CAN-1576)
Reference Documents
No.
Source
Title
Version
[1]
AUTOSAR
List of Basic Software Modules
R4.2.1
[2]
AUTOSAR
Specification of Default Error Tracer
R4.2.1
Caution
We have configured the programs in accordance with your specifications in the
questionnaire. Whereas the programs do support other configurations than the one
specified in your questionnaire, Vector´s release of the programs delivered to your
company is expressly restricted to the configuration you have specified in the
questionnaire.
Technical Reference MICROSAR VStdLib
© 2021 Vector Informatik GmbH Version 2.02.00 3
Contents
1 Introduction................................................................................................................. 10
1.1 Architecture Overview ...................................................................................... 10
2 Functional Description ............................................................................................... 11
2.1 Features .......................................................................................................... 11
2.2 Initialization ...................................................................................................... 11
2.3 Main Function .................................................................................................. 11
2.4 Error Handling .................................................................................................. 11
2.4.1 Development Error Reporting ........................................................... 11
2.4.2 Production Code Error Reporting ..................................................... 13
3 Integration ................................................................................................................... 14
3.1 Embedded Implementation .............................................................................. 14
3.2 Include Structure .............................................................................................. 14
3.3 Critical Sections ............................................................................................... 15
3.4 Compiler Abstraction and Memory Mapping ..................................................... 15
3.5 Integration Notes.............................................................................................. 16
4 API Description ........................................................................................................... 17
4.1 Type Definitions ............................................................................................... 17
4.2 Services provided by VStdLib .......................................................................... 17
4.2.1 Version information .......................................................................... 17
4.2.1.1 VStdLib_GetVersionInfo ................................................. 17
4.2.2 Memory initialization ......................................................................... 18
4.2.2.1 VStdLib_MemClr ............................................................ 18
4.2.2.2 VStdLib_MemClrMacro .................................................. 19
4.2.2.3 VStdLib_MemSet ........................................................... 20
4.2.2.4 VStdLib_MemSetMacro ................................................. 21
4.2.3 Memory copy ................................................................................... 22
4.2.3.1 VStdLib_MemCpy .......................................................... 22
4.2.3.2 VStdLib_MemCpy16 ...................................................... 23
4.2.3.3 VStdLib_MemCpy32 ...................................................... 24
4.2.3.4 VStdLib_MemCpy_s ...................................................... 25
4.2.3.5 VStdLib_MemCpyMacro ................................................ 26
4.2.3.6 VStdLib_MemCpyMacro_s ............................................ 27
4.2.4 Memory comparison ......................................................................... 28
4.2.4.1 VStdLib_MemCmp ......................................................... 28
4.2.5 Bit search ......................................................................................... 29
4.2.5.1 VStdLib_GetHighestBitPosOne8.................................... 29
Technical Reference MICROSAR VStdLib
© 2021 Vector Informatik GmbH Version 2.02.00 4
4.2.5.2 VStdLib_GetHighestBitPosOne16 .................................. 29
4.2.5.3 VStdLib_GetHighestBitPosOne32 .................................. 30
4.2.5.4 VStdLib_GetHighestBitPosOne64 .................................. 30
4.2.5.5 VStdLib_GetHighestBitPosZero8 ................................... 31
4.2.5.6 VStdLib_GetHighestBitPosZero16 ................................. 31
4.2.5.7 VStdLib_GetHighestBitPosZero32 ................................. 32
4.2.5.8 VStdLib_GetHighestBitPosZero64 ................................. 32
4.2.5.9 VStdLib_GetLowestBitPosOne8 .................................... 33
4.2.5.10 VStdLib_GetLowestBitPosOne16 .................................. 33
4.2.5.11 VStdLib_GetLowestBitPosOne32 .................................. 34
4.2.5.12 VStdLib_GetLowestBitPosOne64 .................................. 34
4.2.5.13 VStdLib_GetLowestBitPosZero8 .................................... 35
4.2.5.14 VStdLib_GetLowestBitPosZero16 .................................. 35
4.2.5.15 VStdLib_GetLowestBitPosZero32 .................................. 36
4.2.5.16 VStdLib_GetLowestBitPosZero64 .................................. 36
4.2.5.17 VStdLib_GetCountLeadingOnes8 .................................. 37
4.2.5.18 VStdLib_GetCountLeadingOnes16 ................................ 37
4.2.5.19 VStdLib_GetCountLeadingOnes32 ................................ 38
4.2.5.20 VStdLib_GetCountLeadingOnes64 ................................ 38
4.2.5.21 VStdLib_GetCountLeadingZeros8 ................................. 39
4.2.5.22 VStdLib_GetCountLeadingZeros16 ............................... 39
4.2.5.23 VStdLib_GetCountLeadingZeros32 ............................... 40
4.2.5.24 VStdLib_GetCountLeadingZeros64 ............................... 40
4.2.5.25 VStdLib_GetCountTrailingOnes8 ................................... 41
4.2.5.26 VStdLib_GetCountTrailingOnes16 ................................. 41
4.2.5.27 VStdLib_GetCountTrailingOnes32 ................................. 42
4.2.5.28 VStdLib_GetCountTrailingOnes64 ................................. 42
4.2.5.29 VStdLib_GetCountTrailingZeros8................................... 43
4.2.5.30 VStdLib_GetCountTrailingZeros16................................. 43
4.2.5.31 VStdLib_GetCountTrailingZeros32................................. 44
4.2.5.32 VStdLib_GetCountTrailingZeros64................................. 44
4.2.6 Serialization ..................................................................................... 45
4.2.6.1 VStdLib_ConvertUint16ToUint8ArrayBigEndian ............. 45
4.2.6.2 VStdLib_ConvertSint16ToUint8ArrayBigEndian ............. 46
4.2.6.3 VStdLib_ConvertUint16ToUint8ArrayLittleEndian ........... 47
4.2.6.4 VStdLib_ConvertSint16ToUint8ArrayLittleEndian ........... 48
4.2.6.5 VStdLib_ConvertUint32ToUint8ArrayBigEndian ............. 49
4.2.6.6 VStdLib_ConvertSint32ToUint8ArrayBigEndian ............. 50
4.2.6.7 VStdLib_ConvertUint32ToUint8ArrayLittleEndian ........... 51
4.2.6.8 VStdLib_ConvertSint32ToUint8ArrayLittleEndian ........... 52
4.2.6.9 VStdLib_ConvertUint64ToUint8ArrayBigEndian ............. 53
Technical Reference MICROSAR VStdLib
© 2021 Vector Informatik GmbH Version 2.02.00 5
4.2.6.10 VStdLib_ConvertSint64ToUint8ArrayBigEndian ............. 54
4.2.6.11 VStdLib_ConvertUint64ToUint8ArrayLittleEndian ........... 55
4.2.6.12 VStdLib_ConvertSint64ToUint8ArrayLittleEndian ........... 56
4.2.7 Deserialization ................................................................................. 57
4.2.7.1 VStdLib_ConvertUint8ArrayToUint16BigEndian ............. 57
4.2.7.2 VStdLib_ConvertUint8ArrayToSint16BigEndian ............. 58
4.2.7.3 VStdLib_ConvertUint8ArrayToUint16LittleEndian ........... 59
4.2.7.4 VStdLib_ConvertUint8ArrayToSint16LittleEndian ........... 60
4.2.7.5 VStdLib_ConvertUint8ArrayToUint32BigEndian ............. 61
4.2.7.6 VStdLib_ConvertUint8ArrayToSint32BigEndian ............. 62
4.2.7.7 VStdLib_ConvertUint8ArrayToUint32LittleEndian ........... 63
4.2.7.8 VStdLib_ConvertUint8ArrayToSint32LittleEndian ........... 64
4.2.7.9 VStdLib_ConvertUint8ArrayToUint64BigEndian ............. 65
4.2.7.10 VStdLib_ConvertUint8ArrayToSint64BigEndian ............. 66
4.2.7.11 VStdLib_ConvertUint8ArrayToUint64LittleEndian ........... 67
4.2.7.12 VStdLib_ConvertUint8ArrayToSint64LittleEndian ........... 68
4.2.8 Endian swap .................................................................................... 69
4.2.8.1 VStdLib_SwapEndianUint16 .......................................... 69
4.2.8.2 VStdLib_SwapEndianSint16 .......................................... 69
4.2.8.3 VStdLib_SwapEndianUint32 .......................................... 70
4.2.8.4 VStdLib_SwapEndianSint32 .......................................... 70
4.2.8.5 VStdLib_SwapEndianUint64 .......................................... 71
4.2.8.6 VStdLib_SwapEndianSint64 .......................................... 71
4.2.9 Endian conversion............................................................................ 72
4.2.9.1 VStdLib_ConvertEndianPlatformToBigUint16................. 72
4.2.9.2 VStdLib_ConvertEndianPlatformToBigSint16 ................. 72
4.2.9.3 VStdLib_ConvertEndianPlatformToLittleUint16 .............. 73
4.2.9.4 VStdLib_ConvertEndianPlatformToLittleSint16 .............. 73
4.2.9.5 VStdLib_ConvertEndianBigToPlatformUint16................. 74
4.2.9.6 VStdLib_ConvertEndianBigToPlatformSint16 ................. 74
4.2.9.7 VStdLib_ConvertEndianLittleToPlatformUint16 .............. 75
4.2.9.8 VStdLib_ConvertEndianLittleToPlatformSint16 .............. 75
4.2.9.9 VStdLib_ConvertEndianPlatformToBigUint32................. 76
4.2.9.10 VStdLib_ConvertEndianPlatformToBigSint32 ................. 76
4.2.9.11 VStdLib_ConvertEndianPlatformToLittleUint32 .............. 77
4.2.9.12 VStdLib_ConvertEndianPlatformToLittleSint32 .............. 77
4.2.9.13 VStdLib_ConvertEndianBigToPlatformUint32................. 78
4.2.9.14 VStdLib_ConvertEndianBigToPlatformSint32 ................. 78
4.2.9.15 VStdLib_ConvertEndianLittleToPlatformUint32 .............. 79
4.2.9.16 VStdLib_ConvertEndianLittleToPlatformSint32 .............. 79
4.2.9.17 VStdLib_ConvertEndianPlatformToBigUint64................. 80