This is the multi-page printable view of this section. Click here to print.
Component Implementation
1 - CM800A_SycnCrc_MDD
Module Design Document
For
SyncCrc
July 5, 2017
Prepared For:
Software Engineering
Nexteer Automotive,
Saginaw, MI, USA
Prepared By:
Kevin Smith,
Nexteer Automotive,
Saginaw, MI, USA
Change History
| Description | Author | Version | Date | Approved By |
| Initial Version | K. Smith | 1 | 07-Oct-15 | |
| Updates to meet the Rev1 of the FDD | K. Smith | 2 | 11-Jan-16 | |
| Updates to support OS version and hardware differences | K. Smith | 3 | 14-Jun-17 | |
| Updates for anomaly EA4#13207 | K. Smith | 4 | 05-Jul-17 |
Table of Contents
2 SyncCrc & High-Level Description 6
3 Design details of software module 7
3.1 Graphical representation of SyncCrc 7
4.1 Program (fixed) Constants 8
4.2 Variable Data Dictionary 8
4.2.1 User Defined Typedef Definition/Declaration 8
4.2.2 User Defined Enumerated Types 9
5 Software Component Implementation 10
5.2.1.2 (Processing of function)……… 11
5.2.2 CRC API Server Runnables 14
5.2.2.1 API Design Rationale 14
5.4 Module Internal (Local) Functions 17
5.4.2 NONTRUSTED_NtWrapS_SyncCrc_RelsCrcHwUnit 18
5.4.4 NONTRUSTED_NtWrapS_SyncCrc_GetAvlCrcHwUnit 20
5.5 GLOBAL Function/Macro Definitions 23
6 Known Limitations with Design 24
Appendix A Abbreviations and Acronyms 26
Introduction
Purpose
This MDD aids in documenting the implementation of CM800A for the synchronous CRC API with the EA4 hardware CRC units.
Scope
The following definitions are used throughout this document:
Shall: indicates a mandatory requirement without exception in compliance.
Should: indicates a mandatory requirement; exceptions allowed only with documented justification.
May: indicates an optional action.
SyncCrc & High-Level Description
Provides an API interface for other BSW and application level software components to calculate a synchronous CRC calculation using the EA4 hardware peripherals.
Design details of software module
Graphical representation of SyncCrc

Data Flow Diagram
Component level DFD
Function level DFD
Constant Data Dictionary
Program (fixed) Constants
Embedded Constants
Local Constants
Values between the brackets [] are the ranges that the configurable constants could be defined as for a given integration. These values are generated by Configurator before the software build.
| Constant Name | Resolution | Units | Value |
|---|---|---|---|
| CRCININVAL8BIT_CNT_U08 | Uint8 | Cnt | 0xFF |
| CRCININVAL16BIT_CNT_U16 | Uint16 | Cnt | 0xFFFF |
| CRCININVAL32BIT_CNT_U32 | Uint32 | Cnt | 0xFFFFFFFF |
| CRCERRVAL_CNT_U08 | Uint8 | Cnt | 0 |
| CRCHWRESVCFGRNG_CNT_U08 | Uint8 | Cnt | 7 |
| INVLDTASKID_CNT_U16 | Uint16 | Cnt | 0xFFFF |
| NROFCRCHWUNIT_CNT_U08 | Uint8 | Cnt | [0 – 8]* |
| NROFACTVCRCHWUNIT_CNT_U08 | Uint8 | Cnt | [0 – 8]† |
| ARWRPRENAD_CNT_U08 | Uint8 | Cnt | [STD_OFF – STD_ON]** |
| CRCOSREF_CNT_U08 | Uint8 | Cnt | [0-255]*** |
| MAXNROFCRCHWUNIT_CNT_U08 | Uint8 | Cnt | 8 |
* Based on the value of “Device Type” as defined in Configurator.
** Based on the value of “Autosar Wrapper Enable” as defined in Configurator.
***Based on the value of “Crc Os Application Reference” as defined in Configurator.
† The number is calculated by NROFCRCHWUNIT_CNT_U08 – “Reserved CRC Hardware Units” as defined in Configurator.
Variable Data Dictionary
The following type definitions are found in the private header of this component.
User Defined Typedef Definition/Declaration
| Typedef Name | Element Name | User Defined Type | Legal Range (min) | Legal Range (max) |
|---|---|---|---|---|
| NtCrcIdRec | CrcHwIdx | Uint8 | 0 | 255 |
| NtResvCallRec | ResvCall | Boolean | FALSE | TRUE |
User Defined Enumerated Types
| Enum Name | Element Name | Value |
|---|---|---|
| CrcDataAcsWidth1 | CRCDATAACSWIDTH_32BIT | 0 |
| CRCDATAACSWIDTH_16BIT | 1 | |
| CRCDATAACSWIDTH_8BIT | 2 | |
| CrcAlg1 | CRCALG_32BITETH | 0 |
| CRCALG_16BIT | 1 | |
| CRCALG_8BIT | 2 | |
| CRCALG_8BITH2F | 3 |
Software Component Implementation
Sub-Module Functions
Init: SyncCrcInit0
Design Rationale
This function initializes the PIM with the proper status for the CRC hardware units for use by the application components. This function is defined in the CDD_SyncCrcNonRte.c file as it shall be called prior to the RTE Init functions.
Processing
Module Outputs
None
Init: SyncCrcInit1
Design Rationale
Stub function for mapping the server runnable functions within a memory region.
Processing
None
Module Outputs
None
Server Runnables
ResvCrcHwUnit
Design Rationale
This function allows the caller to reserve a single CRC hardware unit until it is released. This will allow features such as the DMA to perform a CRC calculation over a large portion of data and does not need to permanently reserve a CRC hardware unit. This function can be called from within or outside a task. This server runnables must be defined with “can be invoked concurrently” enabled in Developer.
(Processing of function)………
Top Level Logic
Reserve CRC
Release CRC
Module Outputs
None
CRC API Server Runnables
API Design Rationale
The following flow chart is applicable to all CRC API functions in this document. However, the highlighted green squares vary by the API. These differences will be pointed out in each sub-function section. All API client calls must be called from within a task. These server runnables must be defined with “can be invoked concurrently” enabled in Developer.
API Processing
Calc8BitCrc_Oper
CRCREG_REC[CrcHwIdx_Cnt_T_u08].Reg_rec->Ctrl_rec.Bit_b08.ISZ = CRCDATAACSWIDTH_8BIT;
CRCREG_REC[CrcHwIdx_Cnt_T_u08].Reg_rec->Ctrl_rec.Bit_b08.POL = CRCALG_8BIT;
CRCREG_REC[CrcHwIdx_Cnt_T_u08].Reg_rec->Outp_u32 = CRCININVAL8BIT_CNT_U16;
Calc8BitCrc0X2F_Oper
CRCREG_REC[CrcHwIdx_Cnt_T_u08].Reg_rec->Ctrl_rec.Bit_b08.ISZ = CRCDATAACSWIDTH_8BIT;
CRCREG_REC[CrcHwIdx_Cnt_T_u08].Reg_rec->Ctrl_rec.Bit_b08.POL = CRCALG_8BITH2F;
CRCREG_REC[CrcHwIdx_Cnt_T_u08].Reg_rec->Outp_u32 = CRCININVAL8BIT_CNT_U16;
Calc16BitCrc_u08_Oper
CRCREG_REC[CrcHwIdx_Cnt_T_u08].Reg_rec->Ctrl_rec.Bit_b08.ISZ = CRCDATAACSWIDTH;
CRCREG_REC[CrcHwIdx_Cnt_T_u08].Reg_rec->Ctrl_rec.Bit_b08.POL = CRCALG_16BIT;
CRCREG_REC[CrcHwIdx_Cnt_T_u08].Reg_rec->Outp_u32 = CRCININVAL16BIT_CNT_U16;
Calc16BitCrc_u16_Oper
CRCREG_REC[CrcHwIdx_Cnt_T_u08].Reg_rec->Ctrl_rec.Bit_b08.ISZ = CRCDATAACSWIDTH_16BIT;
CRCREG_REC[CrcHwIdx_Cnt_T_u08].Reg_rec->Ctrl_rec.Bit_b08.POL = CRCALG_16BIT;
CRCREG_REC[CrcHwIdx_Cnt_T_u08].Reg_rec->Outp_u32 = CRCININVAL16BIT_CNT_U16;
Calc32BitCrc_u08_Oper
CRCREG_REC[CrcHwIdx_Cnt_T_u08].Reg_rec->Ctrl_rec.Bit_b08.ISZ = CRCDATAACSWIDTH;
CRCREG_REC[CrcHwIdx_Cnt_T_u08].Reg_rec->Ctrl_rec.Bit_b08.POL = CRCALG_32BITETH;
CRCREG_REC[CrcHwIdx_Cnt_T_u08].Reg_rec->Outp_u32 = CRCININVAL32BIT_CNT_U16;
Calc32BitCrc_u16_Oper
CRCREG_REC[CrcHwIdx_Cnt_T_u08].Reg_rec->Ctrl_rec.Bit_b08.ISZ = CRCDATAACSWIDTH_16BIT;
CRCREG_REC[CrcHwIdx_Cnt_T_u08].Reg_rec->Ctrl_rec.Bit_b08.POL = CRCALG_32BITETH;
CRCREG_REC[CrcHwIdx_Cnt_T_u08].Reg_rec->Outp_u32 = CRCININVAL32BIT_CNT_U16;
Calc32BitCrc_u32_Oper
CRCREG_REC[CrcHwIdx_Cnt_T_u08].Reg_rec->Ctrl_rec.Bit_b08.ISZ = CRCDATAACSWIDTH_32BIT;
CRCREG_REC[CrcHwIdx_Cnt_T_u08].Reg_rec->Ctrl_rec.Bit_b08.POL = CRCALG_32BITETH;
CRCREG_REC[CrcHwIdx_Cnt_T_u08].Reg_rec->Outp_u32 = CRCININVAL32BIT_CNT_U16;
Interrupt Functions
None
Module Internal (Local) Functions
RelsCrcHwUnit
| Function Name | RelsCrcHwUnit | Type | Min | Max |
| Arguments Passed | CrcHwIdx_Cnt_T_u08 | Uint8 | 0 | 8 |
| Return Value | N/A |
Design Rationale
To minimize time in Exclusive areas, the Enter and Exit calls were placed within this function. All API server runnables that use this function are defined in Developer to have access to the exclusive area.
Processing
NONTRUSTED_NtWrapS_SyncCrc_RelsCrcHwUnit
| Function Name | NONTRUSTED_NtWrapS_SyncCrc_RelsCrcHwUnit | Type | Min | Max |
| Arguments Passed | FunctionIndex | Uint16 | 0 | 65535 |
| FunctionParams | Void* | 0 | 2^32-1 | |
| Return Value | N/A |
Design Rationale
Function is required to prevent MPU violations when the API modifies the per-instance-memory used by all API functions.
Processing
GetAvlCrcHwUnit
| Function Name | GetAvlCrcHwUnit | Type | Min | Max |
| Arguments Passed | N/A | |||
| Return Value | N/A |
Design Rationale
Processing
NONTRUSTED_NtWrapS_SyncCrc_GetAvlCrcHwUnit
| Function Name | NONTRUSTED_NtWrapS_SyncCrc_GetAvlCrcHwUnit | Type | Min | Max |
| Arguments Passed | FunctionIndex | Uint16 | 0 | 65535 |
| FunctionParams | Void* | 0 | 2^32-1 | |
| Return Value | N/A |
Design Rationale
Function is required to prevent MPU violations when the API modifies the per-instance-memory used by all API functions.
Processing
CrcRegCfg
| Function Name | CrcRegCfg | Type | Min | Max |
| Arguments Passed | CrcHwIdx_Arg | Uint8 | 0 | 255 |
| CrcCfg_Arg | CrcHwResvCfg1 | 0 | 6 | |
| StrtVal_Arg | Uint32 | 0 | 4294967295 | |
| Return Value | N/A |
Design Rationale
Function created to reduce the complexity of the ResvCrcHwUnit_Oper function.
Processing
GLOBAL Function/Macro Definitions
None
Known Limitations with Design
API client calls, except ResvCrcHwUnit, must be called from within a task.
To meet design and coding standards, ‘For’ loops called out by the FDD were implemented with ‘While’ loops to break out of the loops without using the ‘break’ keyword.
The GetTaskID function call provided by the OS between different versions have different arguments. One version, the argument is a uint16, where another is a pointer to an enumerated type. The design simply casts the function call to a uint16. There are no expectations that there are going to be more than 65,535 tasks, so the uint16 width should provide adequate room for growth.
In the function ResvCrcHwUnit, the else condition in the main logic path is considered dead code by Polyspace. This is because it is limiting the function to the bounds of the input of the Mod and configuration argument. However, the code is present to provide error handling in the event of an invalid input being passed into the function.
UNIT TEST CONSIDERATION
The constants NROFACTVCRCHWUNIT_CNT_U08, ARWRPRENAD_CNT_U08, and CRCOSREF_CNT_U08, and NROFCRCHWUNIT_CNT_U08 shall be tested to their full range as defined in the constant section.
Abbreviations and Acronyms
| Abbreviation or Acronym | Description |
|---|---|
Glossary
Note: Terms and definitions from the source “Nexteer Automotive” take precedence over all other definitions of the same term. Terms and definitions from the source “Nexteer Automotive” are formulated from multiple sources, including the following:
ISO 9000
ISO/IEC 12207
ISO/IEC 15504
Automotive SPICE® Process Reference Model (PRM)
Automotive SPICE® Process Assessment Model (PAM)
ISO/IEC 15288
ISO 26262
IEEE Standards
SWEBOK
PMBOK
Existing Nexteer Automotive documentation
| Term | Definition | Source |
|---|---|---|
| MDD | Module Design Document | |
| DFD | Data Flow Diagram |
References
| Ref. # | Title | Version |
|---|---|---|
| 1 | AUTOSAR Specification of Memory Mapping (Link:AUTOSAR_SWS_MemoryMapping.pdf) | v1.3.0 R4.0 Rev 2 |
| 2 | MDD Guideline | EA4 01.00.01 |
| 3 | Software Naming Conventions.doc | 1.0 |
| 4 | Software Design and Coding Standards.doc | 2.1 |
2 - CM800A_SyncCrc_Integration_Manual
Integration Manual
For
CM800A SyncCrc
VERSION: 3.0
DATE: 19-May-2017
Prepared By:
Kevin Smith
Nexteer Automotive,
Saginaw, MI, USA
Location: The official version of this document is stored in the Nexteer Configuration Management System.
Revision History
| Sl. No. | Description | Author | Version | Date | Approved By |
| 1 | Initial version | K. Smith | 1.0 | 05-Oct-15 | - |
| 2 | Added exclusive area details and updates for version 1.0.0 of the component design. | K. Smith | 2.0 | 11-Jan-16 | - |
| 3 | Updated configuration parameters | K. Smith | 3.0 | 19-May-17 | - |
Table of Contents
3.2 Global Functions(Non RTE) to be provided to Integration Project 6
4 Configuration REQUIREMeNTS 7
4.2 Configuration Files to be provided by Integration Project 7
4.3 Da Vinci Parameter Configuration Changes 7
4.4 DaVinci Interrupt Configuration Changes 7
4.5 Manual Configuration Changes 7
5 Integration DATAFLOW REQUIREMENTS 8
5.1 Required Global Data Inputs 8
5.2 Required Global Data Outputs 8
5.3 Specific Include Path present 8
Abbrevations And Acronyms
| Abbreviation | Description |
| DFD | Design functional diagram |
| MDD | Module design Document |
References
This section lists the title & version of all the documents that are referred for development of this document
| Sr. No. | Title | Version |
| 1 | MDD Guidelines | Process 04.04.02 |
| 2 | Software Naming Conventions | Process 04.04.02 |
| 3 | Coding standards | Process 04.04.02 |
| 4 | CM800A_SyncCrc_Design | See Synergy subproject version |
Dependencies
SWCs
| Module | Required Feature |
| None |
Note : Referencing the external components should be avoided in most cases. Only in unavoidable circumstance external components should be referred. Developer should track the references.
Global Functions(Non RTE) to be provided to Integration Project
SyncCrcInit0*
Calc16BitCrc_u16_Oper
Calc16BitCrc_u08_Oper
Calc32BitCrc_u16_Oper
Calc32BitCrc_u32_Oper
Calc32BitCrc_u08_Oper
Calc8BitCrc0X2F_Oper
Calc8BitCrc_Oper
ResvCrcHwUnit_Oper*
The following functions are available if the Autosar Wrapper is enabled
Crc_CalculateCRC8
Crc_CalculateCRC8H2F
Crc_CalculateCRC16
Crc_CalculateCRC32
*All functions except marked must be called from within a task.
Configuration REQUIREMeNTS
Build Time Config
| Modules | Notes | |
| None |
Configuration Files to be provided by Integration Project
CDD_SyncCrc_Cfg_private.h
Da Vinci Parameter Configuration Changes
| Parameter | Notes | SWC |
| /Nexteer/EcucDefs_SyncCrc/SyncCrc/SyncCrcCommon/AutosarWrapperEnable | Enables the AUTOSAR API Wrapper functions. This should only be enabled if the Crc BSW is not to be used in a project | SyncCrc |
| /Nexteer/EcucDefs_SyncCrc/SyncCrc/SyncCrcCommon/ReservedCRCHardwareUnits | Defines the number of CRC hardware units reserved for dedicated use outside of the the application. Zero (0) shall be used as a default value unless there is a specific need to reserve one or more units for other software components. | SyncCrc |
| /Nexteer/EcucDefs_SyncCrc/SyncCrc/SyncCrcCommon/CrcOsApplicationReference | Value shall be the application in which the SyncCrc is integrated. Due to the nature of CRC usage, an ASIL D application should be selected unless the program is directed otherwise. | SyncCrc |
| /Nexteer/EcucDefs_SyncCrc/SyncCrc/SyncCrcCommon/DeviceType | Selects the physical device type of the RH850. This value will configure the SyncCrc component with how many CRC hardware units are available. | SyncCrc |
DaVinci Interrupt Configuration Changes
| ISR Name | VIM # | Priority Dependency | Notes |
| None |
Manual Configuration Changes
| Constant | Notes | SWC |
| None |
Exclusive Area Changes
| Name | Notes | SWC |
| SyncCrcExclusiveArea | The exclusive area defined in this component is used by all API functions. The area is used to prevent interruption when searching for an available CRC hardware unit. Presently MtrCtrl function design should not be performing CRC calculations. As a result, the area shall be configured to block all OS related interrupts. | SyncCrc |
Integration DATAFLOW REQUIREMENTS
Required Global Data Inputs
Required Global Data Outputs
Specific Include Path present
Yes
Runnable Scheduling
This section specifies the required runnable scheduling.
| Init | Scheduling Requirements | Trigger |
| CDD_SyncCrcInit1 | RTE Init | |
| CDD_SyncCrcInit0 | Shall be scheduled outside of the RTE before any components use the SyncCrc API | Non-RTE Init |
| Runnable | Scheduling Requirements | Trigger |
| None | None | N/A |
.
Memory Map REQUIREMENTS
Mapping
| Memory Section | Contents | Notes |
| None |
* Each …START_SEC… constant is terminated by a …STOP_SEC… constant as specified in the AUTOSAR Memory Mapping requirements.
Usage
| Feature | RAM | ROM |
| None |
Table 1: ARM Cortex R4 Memory Usage
NvM Blocks
*See DataDict.m
Compiler Settings
Preprocessor MACRO
None
Optimization Settings
None
Appendix
<This section is for appendix>
3 - SyncCrc Review
Overview
Summary SheetSynergy Project
Source Code
PolySpace
Sheet 1: Summary Sheet
Sheet 2: Synergy Project
| Rev 2.00 | 29-Nov-17 | |||||||||||||||||||||||
| Peer Review Meeting Log (Component Synergy Project Review) | ||||||||||||||||||||||||
| Quality Check Items: | ||||||||||||||||||||||||
| Rationale is required for all answers of No | ||||||||||||||||||||||||
| New baseline version name from Summary Sheet follows | Yes | Comments: | ||||||||||||||||||||||
| naming convention | ||||||||||||||||||||||||
| Project contains necessary subprojects | Yes | Comments: | ||||||||||||||||||||||
| Project contains the correct version of subprojects | Yes | Comments: | ||||||||||||||||||||||
| Design subproject is correct version | Yes | Comments: | ||||||||||||||||||||||
| .gpj file in tools folder matches .gpj generated by TL109 script | Yes | Comments: | ||||||||||||||||||||||
| File/folder structure is correct per documentation in | Yes | Comments: | ||||||||||||||||||||||
| TL109A_SwcSuprt | ||||||||||||||||||||||||
| General Notes / Comments: | ||||||||||||||||||||||||
| Review Board: | ||||||||||||||||||||||||
| Change Owner: | Kevin Smith | Review Date : | 01/30/18 | |||||||||||||||||||||
| Lead Peer Reviewer: | Avinash James | Approved by Reviewer(s): | Yes | |||||||||||||||||||||
| Other Reviewer(s): | ||||||||||||||||||||||||
| Rationale/justification for items marked "No" approved by: | ||||||||||||||||||||||||