This is the multi-page printable view of this section. Click here to print.
Component Implementation
1 - DutyCycThermProtn_DesignReview
Overview
Summary SheetSynergy Project
Davinci Files
Source Code
MDD
PolySpace
Sheet 1: Summary Sheet

Sheet 2: Synergy Project
Sheet 3: Davinci Files
Sheet 4: Source Code
Rev 1.2 | 8-Jun-15 | |||||||||||||||||||||||
Peer Review Meeting Log (Source Code Review) | ||||||||||||||||||||||||
Source File Name: | DutyCycThermProtn.c | Source File Revision: | 7 | |||||||||||||||||||||
Header File Name: | Header File Revision: | |||||||||||||||||||||||
MDD Name: | DutyCycThermProtn_MDD.docx | Revision: | 4 | |||||||||||||||||||||
FDD/SCIR/DSR/FDR/CM Name: | SF009A_DutyCycThermProtn_Design | Revision: | 3.0.0 | |||||||||||||||||||||
Quality Check Items: | ||||||||||||||||||||||||
Rationale is required for all answers of No | ||||||||||||||||||||||||
Working EA4 Software Naming Convention followed: | ||||||||||||||||||||||||
for variable names | Yes | Comments: | ||||||||||||||||||||||
for constant names | Yes | Comments: | ||||||||||||||||||||||
for function names | Yes | Comments: | ||||||||||||||||||||||
for other names (component, memory | N/A | Comments: | ||||||||||||||||||||||
mapping handles, typedefs, etc.) | ||||||||||||||||||||||||
All paths assign a value to outputs, ensuring | Yes | Comments: | ||||||||||||||||||||||
all outputs are initialized prior to being written | ||||||||||||||||||||||||
Requirements Tracability tags in code match the requirements tracability in the FDD | N/A | Comments: | ||||||||||||||||||||||
requirements tracability in the FDD | ||||||||||||||||||||||||
All variables are declared at the function level. | Yes | Comments: | ||||||||||||||||||||||
Synergy version matches change history | Yes | Comments: | ||||||||||||||||||||||
and Version Control version in file comment block | ||||||||||||||||||||||||
Change log contains detailed description of changes | Yes | Comments: | ||||||||||||||||||||||
and Work CR number | ||||||||||||||||||||||||
Code accurately implements FDD (Document or Model) | Yes | Comments: | ||||||||||||||||||||||
Optimizations are noted in MDD | ||||||||||||||||||||||||
Verified no Compiler Errors or Warnings | Yes | Comments: | ||||||||||||||||||||||
Component.h is included | N/A | Comments: | ||||||||||||||||||||||
All other includes are actually needed. (System includes | Yes | Comments: | ||||||||||||||||||||||
only allowed in Nexteer library components) | ||||||||||||||||||||||||
Software Design and Coding Standards followed: | Version: 2.1 | |||||||||||||||||||||||
Code comments are clear, correct, and adequate | Yes | Comments: | ||||||||||||||||||||||
and have been updated for the change: [N40] and | ||||||||||||||||||||||||
all other rules in the same section as rule [N40], | ||||||||||||||||||||||||
plus [N75], [N12], [N23], [N33], [N37], [N38], | ||||||||||||||||||||||||
[N48], [N54], [N77], [N79], [N72] | ||||||||||||||||||||||||
Source file (.c and .h) comment blocks are per | Yes | Comments: | ||||||||||||||||||||||
standards and contain correct information: [N41], [N42] | ||||||||||||||||||||||||
Function comment blocks are per standards and | Yes | Comments: | ||||||||||||||||||||||
contain correct information: [N43] | ||||||||||||||||||||||||
Code formatting (indentation, placement of | Yes | Comments: | ||||||||||||||||||||||
braces, etc.) is per standards: [N5], [N55], [N56], | ||||||||||||||||||||||||
[N57], [N58], [N59] | ||||||||||||||||||||||||
Embedded constants used per standards; no | Yes | Comments: | ||||||||||||||||||||||
"magic numbers": [N12] | ||||||||||||||||||||||||
Memory mapping for non-RTE code | N/A | Comments: | ||||||||||||||||||||||
is per standard | ||||||||||||||||||||||||
All execution-order-dependent code can be | Yes | Comments: | ||||||||||||||||||||||
recognized by the compiler: [N80] | ||||||||||||||||||||||||
All loops have termination conditions that ensure | N/A | Comments: | ||||||||||||||||||||||
finite loop iterations: [N63] | ||||||||||||||||||||||||
All divides protect against divide by zero | Yes | Comments: | ||||||||||||||||||||||
if needed: [N65] | ||||||||||||||||||||||||
All integer division and modulus operations | N/A | Comments: | ||||||||||||||||||||||
handle negative numbers correctly: [N76] | ||||||||||||||||||||||||
All typecasting and fixed point arithmetic, | Yes | Comments: | ||||||||||||||||||||||
including all use of fixed point macros and | ||||||||||||||||||||||||
timer functions, is correct and has no possibility | ||||||||||||||||||||||||
of unintended overflow or underflow: [N66] | ||||||||||||||||||||||||
All float-to-unsiged conversions ensure the. | N/A | Comments: | ||||||||||||||||||||||
float value is non-negative: [N67] | ||||||||||||||||||||||||
All conversions between signed and unsigned | N/A | Comments: | ||||||||||||||||||||||
types handle msb==1 as intended: [N78] | ||||||||||||||||||||||||
All pointer dereferencing protects against | N/A | Comments: | ||||||||||||||||||||||
null pointer if needed: [N70] | ||||||||||||||||||||||||
Component outputs are limited to the legal range | Yes | Comments: | ||||||||||||||||||||||
defined in the FDD DataDict.m file : [N53] | ||||||||||||||||||||||||
All code is mapped with FDD (all FDD | Yes | Comments: | ||||||||||||||||||||||
subfunctions and/or model blocks identified | ||||||||||||||||||||||||
with code comments; all code corresponds to | ||||||||||||||||||||||||
some FDD subfunction and/or model block): [N40] | ||||||||||||||||||||||||
Review did not identify violations of other | Yes | Comments: | ||||||||||||||||||||||
coding standard rules | ||||||||||||||||||||||||
Anomaly or Design Work CR created | N/A | Comments: List Anomaly or CR numbers | ||||||||||||||||||||||
for any FDD corrections needed | ||||||||||||||||||||||||
General Notes / Comments: | ||||||||||||||||||||||||
Change Owner: | Shruthi Raghavan | Review Date : | 12/16/16 | |||||||||||||||||||||
Lead Peer Reviewer: | Avinash James | Approved by Reviewer(s): | Yes | |||||||||||||||||||||
Other Reviewer(s): | ||||||||||||||||||||||||
Sheet 5: MDD
Sheet 6: PolySpace
2 - DutyCycThermProtn_Integration Manual
Integration Manual
For
SF009A_DutyCycThermProtn
VERSION: 1.0
DATE: 02-Oct-2015
Prepared By:
Sarika Natu,
KPIT Technologies,
India
Revision History
Description | Author | Version | Date |
Initial version | Sarika Natu | 1.0 | 02-Oct-2015 |
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
Sr. No. | Title | Version |
1 | MDD Guidelines | Software Process Release 04.02.00 |
2 | Software Naming Conventions | Software Process Release 04.02.00 |
3 | Design and Coding standards | Software Process Release 04.02.00 |
4 | FDD – SF009A_DutyCycThermProtn_Design | See Synergy sub project version |
Dependencies
SWCs
Module | Required Feature |
None |
Global Functions(Non RTE) to be provided to Integration Project
None
Configuration REQUIREMeNTS
Build Time Config
Modules | Notes | |
None |
Configuration Files to be provided by Integration Project
None
Da Vinci Parameter Configuration Changes
Parameter | Notes | SWC |
None |
DaVinci Interrupt Configuration Changes
ISR Name | VIM # | Priority Dependency | Notes |
None |
Manual Configuration Changes
Constant | Notes | SWC |
None |
Integration DATAFLOW REQUIREMENTS
Required Global Data Inputs
Refer DataDict.m file in the FDD
Required Global Data Outputs
Refer DataDict.m file in the FDD
Specific Include Path present
No
Runnable Scheduling
This section specifies the required runnable scheduling.
Init | Scheduling Requirements | Trigger |
DutyCycThermProtnInit1 | None | RTE(Init) |
Runnable | Scheduling Requirements | Trigger |
DutyCycThermProtnPer1 | None | RTE(100ms) |
Memory Map REQUIREMENTS
Mapping
Memory Section | Contents | Notes |
DutyCycThermProtn_START_SEC_CODE | ||
* Each …START_SEC… constant is terminated by a …STOP_SEC… constant as specified in the AUTOSAR Memory Mapping requirements.
Usage
Feature | RAM | ROM |
<Memmap usuage info> |
Table 1: ARM Cortex R4 Memory Usage
NvM Blocks
See DataDict.m
Compiler Settings
Preprocessor MACRO
None
Optimization Settings
None
Appendix
None
3 - DutyCycThermProtn_MDD
Module Design Document
For
DutyCycThermProtn
Dec 14, 2016
Prepared By:
Shruthi Raghavan
Software Engineering
Nexteer Automotive,
Saginaw, MI, USA
Change History
Description | Author | Version | Date |
Initial Version | Sarika Natu(KPIT Technologies) | 1.0 | 02-Oct-2015 |
Updated to version 2.0.0 of FDD | Krishna Anne | 2.0 | 07-Apr-2016 |
Fix for anomaly EA4# 7558 | Krishna Anne | 3.0 | 29-Sep-2016 |
Updated to FDD v3.0.0 | Shruthi Raghavan | 4.0 | 14-Dec-2016 |
Table of Contents
1 DutyCycThermProtn & High-Level Description 5
2 Design details of software module 6
2.1 Graphical representation of DutyCycThermProtn 6
2.2 Data Flow Diagram 7
2.2.1 Component level DFD 7
2.2.2 Function level DFD 7
3 Constant Data Dictionary 8
3.1 Program (fixed) Constants 8
3.1.1 Embedded Constants 8
4 Software Component Implementation 9
4.1 Sub-Module Functions 9
4.1.1 Init: DutyCycThermProtn_Init1 9
4.1.1.1 Design Rationale 9
4.1.1.2 Module Outputs 9
4.1.2 Per: DutyCycThermProtn_Per1 9
4.1.2.1 Design Rationale 9
4.1.2.2 Store Module Inputs to Local copies 9
4.1.2.3 (Processing of function)……… 9
4.1.2.4 Store Local copy of outputs into Module Outputs 9
4.2 Server Runables 9
4.3 Interrupt Functions 9
4.4 Module Internal (Local) Functions 9
4.4.1 Local Function #1 9
4.4.1.1 Design Rationale 9
4.4.1.2 Processing 10
4.4.2 Local Function #2 10
4.4.2.1 Design Rationale 10
4.4.2.2 Processing 10
4.4.3 Local Function #3 10
4.4.3.1 Design Rationale 10
4.4.3.2 Processing 10
4.4.4 Local Function #4 10
4.4.4.1 Design Rationale 11
4.4.4.2 Processing 11
4.4.5 Local Function #5 11
4.4.5.1 Design Rationale 11
4.4.5.2 Processing 11
4.4.6 Local Function #6 11
4.4.6.1 Design Rationale 11
4.4.7 Local Function #7 11
4.4.7.1 Design Rationale 12
4.4.8 Local Function #8 12
4.4.8.1 Design Rationale 12
4.4.8.2 Processing 12
4.5 GLOBAL Function/Macro Definitions 12
5 Known Limitations with Design 13
6 UNIT TEST CONSIDERATION 14
Appendix A Abbreviations and Acronyms 15
Appendix B Glossary 16
Appendix C References 17
DutyCycThermProtn & High-Level Description
The purpose of the Thermal Duty Cycle Protection is to limit and protect the system from excessive use, based on motor rotational velocity and system temperature. It also provides protection status information for use by other functions.
Design details of software module
Graphical representation of DutyCycThermProtn
Data Flow Diagram
See FDD
Component level DFD
See FDD
Function level DFD
See FDD
Constant Data Dictionary
Program (fixed) Constants
Embedded Constants
Local Constants
Refer .m file
Constant Name | Value |
---|---|
THERMLOADLIMSIZE_CNT_U08 | 8 |
MULTFILTERSIZE_CNT_U08 | 6 |
Software Component Implementation
Sub-Module Functions
Init: DutyCycThermProtn_Init1
Design Rationale
Refer FDD
Module Outputs
Refer FDD
Per: DutyCycThermProtn_Per1
Design Rationale
DutyCycThermProtn_Per1 function is divided into various functions to reduce the cyclomatic complexity.
The subsystems ‘Multiplier’ and ‘FilterPercMax’ are clubbed into ‘MultiFilterPercMax’ local function.
Store Module Inputs to Local copies
Refer FDD
(Processing of function)………
Refer FDD
Store Local copy of outputs into Module Outputs
Refer FDD
Server Runables
None
Interrupt Functions
None
Module Internal (Local) Functions
Local Function #1
Function Name | FiltSVReinit | Type | Min | Max |
Arguments Passed | IgnTiOff_Cnt_T_u32 | uint32 | 0 | 1720000 |
VehTiVld_Cnt_T_Logl | Boolean | 0 | 1 | |
Return Value | None |
Design Rationale
Name of local function matches with subsystem name from FDD
Processing
Local Function #2
Function Name | TemperatureSelection | Type | Min | Max |
Arguments Passed | DiagcStsLimdTPrfmnc_Cnt_T_Logl | boolean | 0 | 1 |
EcuTFild_DegCgrd_T_f32 | float32 | -50 | 150 | |
MotFetT_DegCgrd_T_f32 | float32 | -50 | 200 | |
MotMagT_DegCgrd_T_f32 | float32 | -50 | 150 | |
MotWidgT_DegCgrd_T_f32 | float32 | -50 | 300 | |
*Mult12Temp_DegCgrd_T_ s15p0 | Sint16 | -50 | 200 | |
*Mult36Temp_DegCgrd_T_s15p0 | Sint16 | -50 | 300 | |
Return Value | SlcTemp_DegCgrd_T_s15p0 | sint16 | -50 | 300 |
Design Rationale
Name of local function matches with subsystem name from FDD
Note: The outputs of the function are Mult12Temp_DegCgrd_T_s15p0, Mult36Temp_DegCgrd_T_s15p0 and SlcTemp_DegCgrd_T_f32.
Processing
None
Local Function #3
Function Name | TemperatureLimiting | Type | Min | Max |
Arguments Passed | EcuTFild_DegCgrd_T_f32 | float32 | -50 | 150 |
MotWidgT_DegCgrd_T_f32 | float32 | -50 | 300 | |
Return Value | AbsTempLimitSlew_MotNwtMtr_T_f32 | float32 | 0 | 8.79 |
Design Rationale
Name of local function matches with subsystem name from FDD
Processing
None
Local Function #4
Function Name | MultiFilterPercMax | Type | Min | Max |
Arguments Passed | Mult12Temp_DegCgrd_T_s15p0 | sint16 | -50 | 200 |
Mult36Temp_DegCgrd_T_s15p0 | sint16 | -50 | 300 | |
DutyCycThermProtnDi_Cnt_T_Logl | boolean | 0 | 1 | |
MotVelCrf_MotRadPerSec_T_f32 | float32 | -1350 | 1350 | |
MotCurrPeakEstimd_AmprSqd_T_f32 | float32 | 0 | 62500 | |
MotCurrPeakEstimdFild_AmprSqd_T_f32 | float32 | 0 | 62500 | |
*MaxOut_Uls_T_u16p0 | uint16 | 0 | 200 | |
Return Value | ThermLimSlowFilMax_Uls_T_f32 | float32 | 0 | 200 |
Design Rationale
The subsystems ‘Multiplier’ and ‘FilterPercMax’ are clubbed into ‘MultiFilterPercMax’ local function.
Note: The outputs of the function are MaxOut_Uls_T_u16p0 and ThermLimSlowFilMax_Uls_T_f32.
Processing
None
Local Function #5
Function Name | ThermalLoadLimit | Type | Min | Max |
Arguments Passed | MotVelCrf_MotRadPerSec_T_f32 | float32 | -1350 | 1350 |
SlcTemp_DegCgrd_T_s15p0 | sint16 | -50 | 300 | |
MaxOut_Uls_T_u16p0 | uint16 | 0 | 200 | |
Return Value | ThermalLoadLmt_MotNwtMtr_T_f32 | float32 | 0 | 8.8 |
Design Rationale
Name of local function matches with subsystem name from FDD
Processing
None
Local Function #6
Function Name | ThermalLimitStatus | Type | Min | Max |
Arguments Passed | DutyCycThermProtnDi_Cnt_T_Logl | Boolean | 0 | 1 |
MaxOut_Uls_T_u16p0 | uint16 | 0 | 200 | |
ThermMotTqLim_MotNwtMtr_T_f32 | float32 | 0 | 8.8 | |
Return Value | ThermRednFac_Uls_T_f32 | float32 | 0 | 1 |
Design Rationale
Name of local function matches with subsystem name from FDD. Initializing ThermRednFac_Uls_T_f32 to 0.0 helps to avoid writing another statement in the if-conditional (optimized compared to FDD)
Local Function #7
Function Name | TherrmalLimitScaling | Type | Min | Max |
Arguments Passed | DualEcuFltMtgtnEna_Cnt_T_logl | Boolean | 0 | 1 |
IvtrLoaMtgtnEna_Cnt_T_logl | Boolean | 0 | 1 | |
AbsTempLimitSlew_MotNwtMtr_T_f32 | float32 | 0 | 8.79 | |
DutyCycThermProtnDi_Cnt_T_Logl | Boolean | 0 | 1 | |
ThermalLoadLmt_MotNwtMtr_T_f32 | float32 | 0 | 8.8 | |
* ThermLoadDptLim_MotNwtMtr_T_f32 | Float32 | 0 | 8.8 | |
* ThermTempDptLim_MotNwtMtr_T_f32 | Float32 | 0 | 8.8 | |
Return Value | ThermMotTqLim_MotNwtMtr_T_f32 | float32 | 0 | 8.8 |
Design Rationale
Name of local function matches with subsystem name from FDD
The if-action subsystem blocks for calculation of LoadDptLim and TempDptLim are clubbed together and optimized since the condition for the subsystem execution was same.
Local Function #8
Function Name | UseInpLowr | Type | Min | Max |
Arguments Passed | *TableX_Cnt_T_s16 | sint16 | FULL | FULL |
*TableY_Cnt_T_u16 | uint16 | FULL | FULL | |
Size_Cnt_T_u16 | uint16 | 1 | 20 | |
Input_Cnt_T_s16 | sint16 | FULL | FULL | |
Return Value | TableY_Cnt_T_u16[Idx_Cnt_T_u08] | uint16 | FULL | FULL |
Design Rationale
None.
Processing
None
GLOBAL Function/Macro Definitions
None
Known Limitations with Design
None
UNIT TEST CONSIDERATION
Function UseInpLowr to be tested only as called by the component; input and output ranges will not be reached.
Function UseInpLowr’s TableX must have strictly increasing elements.
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 02.00.00 |
3 | Software Naming Conventions.doc | 1.0 |
4 | Software Design and Coding Standards.doc | 2.1 |
5 | FDD – SF009A_DutyCycThermProtn_Design | See Synergy sub project version |