DiagcMgr_MDD
Module Design Document
For
Diagnostic Manager
VERSION: 5.0
DATE: 26-SEP-2016
Prepared By:
Spandana Balani
Location: The official version of this document is stored in the Nexteer Configuration Management System.
Revision History
Sl. No. | Description | Author | Version | Date |
1 | Initial Version | SB | 1.0 | 23-Apr-2015 |
2 | Added to Design Limitations section | KMC | 2.0 | 03-Jun-2015 |
3 | ES101A_DiagcMgr_Design version 2 implementation | SB | 3.0 | 11-Mar-2016 |
4 | ES101A_DiagcMgr_Design version 3 implementation | SB | 4.0 | 19-Apr-2016 |
5 | ES101A_DiagcMgr_Design version 4 implementation | SB | 5.0 | 22-Jun-2016 |
6 | Added DETs to “SetNtcStsCore_Oper” server runnables | SB | 6.0 | 26-Sep-2016 |
Table of Contents
3 DiagcMgr & High-Level Description 8
4 Design details of software module 9
4.1 Graphical representation of Diagcmgr 9
5.1 User defined typedef definition/declaration 11
5.2 Variable definition for enumerated types 11
6.1 Program(fixed) Constants 12
6.1.2 Module specific Lookup Tables Constants 12
7 Software Module Implementation 13
7.1.1 Initialization Functions 13
7.1.2.1.2 Store Module Inputs to Local copies 13
7.1.2.1.3 (Processing of function)……… 13
7.1.2.1.4 Store Local copy of outputs into Module Outputs 13
7.1.2.2.2 Store Module Inputs to Local copies 15
7.1.2.2.3 (Processing of function)……… 15
7.1.2.2.4 Store Local copy of outputs into Module Outputs 15
7.1.4 Server Runnable Functions 16
7.1.4.3 DiagcMgrIninCore_Oper 16
7.1.4.6 GetNtcActvCORE_Oper 19
7.1.4.7 GetNtcQlfrStsCORE_Oper 19
7.1.4.10 ReadNtcInfoAndDebCntr_Oper 19
7.1.4.10.1 Design Rationale 19
7.1.4.11 ReadSnpshtData_Oper 19
7.1.4.12 SetNtcStsCORE_Oper 19
7.1.4.13 RestoreNtcFltAryDft 19
7.1.4.14 RestoreSnpshtAryDft 20
7.1.5 Local Function/Macro Definitions 20
7.1.6 GLObAL Function/Macro Definitions 20
7.1.6.10 GLObAL Function #7 22
7.1.6.12 GLObAL Function #8 22
8 Known Limitations With Design 23
Abbrevations And Acronyms
Abbreviation | Description |
DFD | Design functional diagram |
MDD | Module design Document |
<ADD more to the table if applicable> | |
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.02.01 |
<2> | <Software Naming Conventions> | Process 04.02.01 |
<3> | <Coding standards> | Process 04.02.01 |
<4> | FDD – ES101A Diagnostic Manager | See Synergy Subproject version |
<Add if more available> |
DiagcMgr & High-Level Description
Design details of software module
Graphical representation of Diagcmgr
Data Flow Diagram
Module level DFD
N/A
Sub-Module level DFD
N/A
COMPONENT FLOW DIAGRAM
N/A
Variable Data Dictionary
User defined typedef definition/declaration
<This section documents any user types uniquely used for the module.>
Typedef Name | Element Name | User Defined Type | Legal Range (min) | Legal Range (max) |
NtcMapRec1 | ApplIdx | Uint8 | 0 | 10 |
NtcInfoIdx | uint8 | 0 | 255 | |
NtcInfoRec4 | NtcStInfo | Uint8 | ||
Sts | Uint8 | |||
AgiCntr | Uint8 | |||
Ary1D_NtcInfoRec4 | NtcInfoRec4[]1 | |||
Ary1D_NtcInfoRec4_DiagcMgrProxyApplX3 | NtcInfoRec4[]1 | |||
Ary1D_s16_DiagcMgrProxyApplX3 | Sint16[]2 |
1 – Array of NtcInfoRec4
2 – Array of sint16
3 – One for each Application configured with NTCs
For example – Application 6 and 10 have NTCs then - Ary1D_NtcInfoRec4_DiagcMgrProxyAppl6, Ary1D_NtcInfoRec4_DiagcMgrProxyAppl10, Ary1D_s16_DiagcMgrProxyAppl6, Ary1D_s16_DiagcMgrProxyAppl10 would exist with configured sizes.
Variable definition for enumerated types
Enum Name | Element Name | Value |
See DataDict.m file |
Constant Data Dictionary
Program(fixed) Constants
Embedded Constants
< All program specific constants will be defined in detail >
Local
Constant Name | Resolution | Units | Value |
See DataDict.m file | |||
IMDTSHTDWNFLT_CNT_U32 | 1 | Counts | 13 |
CTRLDSHTDWNFLT_CNT_U32 | 1 | Counts | 14 |
INFOONLYFLT_CNT_U32 | 1 | Counts | 15 |
TOTNROFDTC_CNT_U084 | 1 | Counts | Configured |
4 - Number of DTCs for that program.
Global
<This section lists the global constants used by the module. For details on global constants, refer to the Data Dictionary for the application>
Constant Name |
See DataDict.m file |
Module specific Lookup Tables Constants
<(This is for lookup tables (arrays) with fixed values, same name as other tables)>
Constant Name | Resolution | Value | Software Segment |
DiagcMgrNtcMap_Cnt_rec[512] | NtcMapRec1 | Configured | DiagcMgr_START_SEC_CODE |
NtcNrAryApplX_Cnt_u16[Configured]5 | 1 | Configured | DiagcMgr_START_SEC_CODE |
DtcEnaMask[Configured]6 | 1 | Configured | DiagcMgr_START_SEC_CODE |
DemDtcEveIdMap[Configured]6 | 1 | Configured | DiagcMgr_START_SEC_CODE |
FltRespRampTbl_Uls_f32[13] | Single Precision Float | {0.1F,0.125F,0.1428F,0.1667F,0.2F,0.25F,0.333F,0.5F,1.0F,2.0F,3.333F,10.0F,500.0F} | DiagcMgr_START_SEC_CODE |
5 - One for each Application configured with NTCs.
6 - Variable Length (TOTNROFDTC_CNT_U08 + 1) for each build/program depending on the Number of DTCs
for that program.
Software Module Implementation
Sub-Module Functions
None
Initialization Functions
None
PERIODIC FUNCTIONS
(Note: For multiple periodic functions, insert new headers at the “Header 2” level – subset of “7.1.2 Periodic Functions” and follow the same sub-section design shown below). If none required, place the text “None”)>
Per: diagcmgrPer1
This function exists in “DiagcMgr.c” file.
Design Rationale
“Rte_Call_GetDiagcDataApplX_Oper” for each application(X) is called based on conditional compile using constants generated in DiagcMgr_Cfg_private.h
Store Module Inputs to Local copies
Refer to FDD
(Processing of function)………
Refer to FDD
Store Local copy of outputs into Module Outputs
Refer to FDD
Per: diagcmgrPer2
This function exists in “DiagcMgr.c” file.
Design Rationale
“Rte_Call_GetDiagcDataApplX_Oper” for each application(X) is called based on conditional compile using constants generated in DiagcMgr_Cfg_private.h
Store Module Inputs to Local copies
Refer to FDD
(Processing of function)………
Refer to FDD
Store Local copy of outputs into Module Outputs
Refer to FDD
Interrupt Functions
None
Server Runnable Functions
(Note: For multiple periodic functions, insert new headers at the “Header 2” level – subset of “7.1.2 Periodic Functions” and follow the same sub-section design shown below). If none required, place the text “None”)>
ClrAllDiagc_Oper
See DataDict.m file and model
This function exists in “DiagcMgr.c” file.
ClrSnpshtData_Oper
See DataDict.m file and model
This function exists in “DiagcMgr.c” file.
DiagcMgrIninCore_Oper
See DataDict.m file and modelThis function exists in “DiagcMgr.c” file.
DiagcMgrPwrDwN
See DataDict.m file and model
This function exists in “DiagcMgrNonRte.c” file.
Design Rationale
“GetNtcInfoApplX_Oper” for each application(X) is called based on conditional compile using constants generated in DiagcMgr_Cfg_private.h.
“NvMConf_NvMBlockDescriptor_Rte_NvmBlock_DiagcMgr_DiagcMgrNtcFltAry” is used instead of BlockID Number in “NvMProxy_SetRamBlockStatus” call so that the Integrator doesn’t have to configure the DiagcMgr to know about the Nvm block Ids.
UpdDtcEnaCdn
See DataDict.m file and model
This function exists in “DiagcMgrNonRte.c” file.
Design Rationale
“GetNtcInfoApplX_Oper” for each application(X) is called based on conditional compile using constants generated in DiagcMgr_Cfg_private.h.
GetNtcActvCORE_Oper
See DataDict.m file and model
This function exists in “DiagcMgr.c” file.
GetNtcQlfrStsCORE_Oper
See DataDict.m file and model
This function exists in “DiagcMgr.c” file.
GetNtcStsCORE_Oper
See DataDict.m file and model
This function exists in “DiagcMgr.c” file.
ReadNtcFltAry_Oper
See DataDict.m file and model
This function exists in “DiagcMgr.c” file.
Design Rationale
“GetNtcInfoApplX_Oper” for each application(X) is called based on conditional compile using constants generated in DiagcMgr_Cfg_private.h
ReadNtcInfoAndDebCntr_Oper
See DataDict.m file and model
This function exists in “DiagcMgr.c” file.
Design Rationale
“GetNtcDebCntrApplX” and “GetNtcInfoApplX_Oper” for each application(X) is called based on conditional compile using constants generated in DiagcMgr_Cfg_private.h
ReadSnpshtData_Oper
See DataDict.m file and model
This function exists in “DiagcMgr.c” file.
SetNtcStsCORE_Oper
See DataDict.m file and model
This function exists in “DiagcMgr.c” file.
RestoreNtcFltAryDft
See DataDict.m file and model
This function exists in “DiagcMgrNonRte.c” file.
RestoreSnpshtAryDft
See DataDict.m file and model
This function exists in “DiagcMgrNonRte.c” file.
Local Function/Macro Definitions
<If these are numerous and defined in a separate source file then reference the source file only.>
Local Function #1
Function Name | ProcRampResp | Type | Min | Max |
Arguments Passed | NtcNr_Cnt_T_u16 | uint16 | 0 | 511 |
DiagcData_T_rec | DiagcDataRec1 | 0 | 65535 | |
ProxySetNtcData_T_rec | DiagcDataRec1 | 0 | 65535 | |
Return Value | N/A |
Description
Refer ‘ProcessRampResponse and DiagcSts’ block in Simulink model
This function exists in “DiagcMgr.c” file.
Local Function #2
Function Name | UpdSnpshtData | Type | Min | Max |
Arguments Passed | RegInBRAMDAT1_Cnt_T_u32 | uint32 | 0 | 4294967295 |
HwTq_Cnt_T_s5p10 | sint16 | -10 | 10 | |
MotTqCmdMrfScad_Cnt_T_s5p10 | sint16 | -8.8 | 8.8 | |
IgnCntr_Cnt_T_u32 | uint32 | 0 | 4294967295 | |
BrdgVltg_Cnt_T_u6p10 | uint16 | 6 | 26.5 | |
EcuTFild_Cnt_T_s8p7 | sint16 | -50 | 150 | |
NtcNr_Cnt_T_u16 | NtcNr1 | NTCNR_0X001 | NTCNR_0X1FF | |
NtcStInfo_Cnt_T_u08 | uint8 | 0 | 255 | |
SysSt_Cnt_T_enum | SysSt1 | SYSST_DI | SYSST_WRMININ | |
VehSpd_Cnt_T_u9p7 | Uint16 | 0 | 511 | |
Return Value | N/A |
Description
Refer ‘UpdSnpshtData’ block in Simulink model
This function exists in “DiagcMgr.c” file
GLObAL Function/Macro Definitions
:All the global functions described below are declared in DiagcMgr_private.h and are intended to be used only by DiagcMgr and the DiagcMgrProxyApplX components.These functions exist in “DiagcMgr_private.c” file.
GLObAL Function #1
Function Name | ProcessDiagSts | Type | Min | Max |
Arguments Passed | FltRsp_Cnt_T_u32 | uint32 | 0 | 4294967295 |
DiagStsX_Cnt_T_u16 | uint16 | 0 | 65535 | |
Return Value | N/A |
Description
Refer to “ES101A_DiagcMgr/DiagcMgr/SetNtcStsCore/NtcNr is Valid/Diagnostics Not Inhibited/NtcEnabled/NTCSTS_PREFAILD/Update NtcInfoSts, DebCntr and Process RampRate/DebCntr = MAXDEBCNTRVAL_CNT_S16/ProcessRampResponse and DiagcSts/ControlledShutdown Fault/ProcessDiagcSts” Simulink path in the FDD.
GLObAL Function #2
Function Name | ProcProxyRampResp | Type | Min | Max |
Arguments Passed | NtcNr_Cnt_T_u16 | uint16 | 0 | 511 |
ProxyDiagcData_T_rec | DiagcDataRec1 | 0 | 65535 | |
Return Value | N/A |
Description
Refer ‘ProcessRampResponse and DiagcSts’ block in Simulink path ” ES101A_DiagcMgrProxyX/DiagcMgrProxyApplX/DiagcMgrProxyApplXPer1/Update the DiagcSts/For Number of NTCs/Update DiagcSts and Ramp Response/Update Latest Values/ProcessRampResponse”
GLObAL Function #3
Function Name | DiagcMgrSetBits_u16 | Type | Min | Max |
Arguments Passed | Data | uint16 | 0 | 511 |
BitMask | Uint16 | 0 | 511 | |
Return Value | Data | Uint16 | 0 | 511 |
Description
This function will set bits based on the passed BitMask for a uint16 datatype.
GLObAL Function #4
Function Name | DiagcMgrSetBits_u08 | Type | Min | Max |
Arguments Passed | Data | Uint8 | 0 | 255 |
BitMask | Uint8 | 0 | 255 | |
Return Value | Data | Uint8 | 0 | 255 |
Description
This function will set bits based on the passed BitMask for a uint8 datatype
GLObAL Function #5
Function Name | DiagcMgrClrBits_u08 | Type | Min | Max |
Arguments Passed | Data | Uint8 | 0 | 255 |
BitMask | Uint8 | 0 | 255 | |
Return Value | Data | Uint8 | 0 | 255 |
Description
This function will clear bits based on the passed BitMask for a uint8 datatype
GLObAL Function #6
Function Name | DiagcMgrReadBit_u08 | Type | Min | Max |
Arguments Passed | Data | Uint8 | 0 | 255 |
BitMask | Uint8 | 0 | 255 | |
Return Value | Data | Uint8 | 0 | 255 |
Description
This function will return TRUE if any bits are set based on the passed BitMask for a uint8 datatype
GLObAL Function #7
Function Name | DiagcMgrReadBit_u16 | Type | Min | Max |
Arguments Passed | Data | uint16 | 0 | 511 |
BitMask | Uint16 | 0 | 511 | |
Return Value | Data | Uint16 | 0 | 511 |
Description
This function will return TRUE if any bits are set based on the passed BitMask for a uint16 datatype
GLObAL Function #8
Function Name | DiagcMgrReadBit_u32 | Type | Min | Max |
Arguments Passed | Data | uint16 | 0 | 511 |
BitMask | Uint16 | 0 | 65535 | |
Return Value | Data | Uint16 | 0 |
Description
This function will return TRUE if any bits are set based on the passed BitMask for a uint32 datatype
TRANSIENT FUNCTIONS
None
Known Limitations With Design
Per the FDD author, safety critical data is protected in an exclusive area but there is a possibility of corruption of non critical data.
Refer to Design Rationale section on the top level of DiagcMgr Simulink model.
UNIT TEST CONSIDERATION
Config files in the contract folder are for a test project with sample configurations using Application 6 and Application 10. Therefore with this configuration, the following files cannot be tested – DiagcMgrProxyAppl0, DiagcMgrProxyAppl1, DiagcMgrProxyAppl2, DiagcMgrProxyAppl3, DiagcMgrProxyAppl4, DiagcMgrProxyAppl5, DiagcMgrProxyAppl7, DiagcMgrProxyAppl8, DiagcMgrProxyAppl9.
Appendix
None