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.DescriptionAuthorVersionDate
1Initial VersionSB1.023-Apr-2015
2Added to Design Limitations sectionKMC2.003-Jun-2015
3ES101A_DiagcMgr_Design version 2 implementationSB3.011-Mar-2016
4ES101A_DiagcMgr_Design version 3 implementationSB4.019-Apr-2016
5ES101A_DiagcMgr_Design version 4 implementationSB5.022-Jun-2016
6Added DETs to “SetNtcStsCore_Oper” server runnablesSB6.026-Sep-2016

Table of Contents

1 Abbrevations And Acronyms 6

2 References 7

3 DiagcMgr & High-Level Description 8

4 Design details of software module 9

4.1 Graphical representation of Diagcmgr 9

4.2 Data Flow Diagram 9

4.2.1 Module level DFD 9

4.2.2 Sub-Module level DFD 9

4.3 COMPONENT FLOW DIAGRAM 10

5 Variable Data Dictionary 11

5.1 User defined typedef definition/declaration 11

5.2 Variable definition for enumerated types 11

6 Constant Data Dictionary 12

6.1 Program(fixed) Constants 12

6.1.1 Embedded Constants 12

6.1.1.1 Local 12

6.1.1.2 Global 12

6.1.2 Module specific Lookup Tables Constants 12

7 Software Module Implementation 13

7.1 Sub-Module Functions 13

7.1.1 Initialization Functions 13

7.1.2 PERIODIC FUNCTIONS 13

7.1.2.1 Per: diagcmgrPer1 13

7.1.2.1.1 Design Rationale 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 Per: diagcmgrPer2 13

7.1.2.2.1 Design Rationale 14

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.3 Interrupt Functions 15

7.1.4 Server Runnable Functions 16

7.1.4.1 ClrAllDiagc_Oper 16

7.1.4.2 ClrSnpshtData_Oper 16

7.1.4.3 DiagcMgrIninCore_Oper 16

7.1.4.4 DiagcMgrPwrDwN 17

7.1.4.4.1 Design Rationale 18

7.1.4.5 UpdDtcEnaCdn 18

7.1.4.5.1 Design Rationale 18

7.1.4.6 GetNtcActvCORE_Oper 19

7.1.4.7 GetNtcQlfrStsCORE_Oper 19

7.1.4.8 GetNtcStsCORE_Oper 19

7.1.4.9 ReadNtcFltAry_Oper 19

7.1.4.9.1 Design Rationale 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.5.1 Local Function #1 20

7.1.5.2 Description 20

7.1.5.3 Local Function #2 20

7.1.5.4 Description 20

7.1.6 GLObAL Function/Macro Definitions 20

7.1.6.1 GLObAL Function #1 20

7.1.6.1.1 Description 21

7.1.6.2 GLObAL Function #2 21

7.1.6.2.1 Description 21

7.1.6.3 GLObAL Function #3 21

7.1.6.3.1 Description 21

7.1.6.4 GLObAL Function #4 21

7.1.6.5 Description 21

7.1.6.6 GLObAL Function #5 21

7.1.6.7 Description 22

7.1.6.8 GLObAL Function #6 22

7.1.6.9 Description 22

7.1.6.10 GLObAL Function #7 22

7.1.6.11 Description 22

7.1.6.12 GLObAL Function #8 22

7.1.6.13 Description 22

7.1.7 TRANSIENT FUNCTIONS 22

8 Known Limitations With Design 23

9 UNIT TEST CONSIDERATION 24

10 Appendix 25

Abbrevations And Acronyms

AbbreviationDescription
DFDDesign functional diagram
MDDModule 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.TitleVersion
<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 ManagerSee 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 NameElement NameUser Defined Type

Legal Range

(min)

Legal Range

(max)

NtcMapRec1ApplIdxUint8010
NtcInfoIdxuint80255
NtcInfoRec4NtcStInfoUint8
StsUint8
AgiCntrUint8
Ary1D_NtcInfoRec4NtcInfoRec4[]1
Ary1D_NtcInfoRec4_DiagcMgrProxyApplX3NtcInfoRec4[]1
Ary1D_s16_DiagcMgrProxyApplX3Sint16[]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 NameElement NameValue
See DataDict.m file

Constant Data Dictionary

Program(fixed) Constants

Embedded Constants

< All program specific constants will be defined in detail >

Local

Constant NameResolutionUnitsValue
See DataDict.m file
IMDTSHTDWNFLT_CNT_U321Counts13
CTRLDSHTDWNFLT_CNT_U321Counts14
INFOONLYFLT_CNT_U321Counts15
TOTNROFDTC_CNT_U0841CountsConfigured

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 NameResolutionValueSoftware Segment
DiagcMgrNtcMap_Cnt_rec[512]NtcMapRec1ConfiguredDiagcMgr_START_SEC_CODE
NtcNrAryApplX_Cnt_u16[Configured]51ConfiguredDiagcMgr_START_SEC_CODE
DtcEnaMask[Configured]61ConfiguredDiagcMgr_START_SEC_CODE
DemDtcEveIdMap[Configured]61ConfiguredDiagcMgr_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 NameProcRampRespTypeMinMax
Arguments PassedNtcNr_Cnt_T_u16uint160511
DiagcData_T_recDiagcDataRec1065535
ProxySetNtcData_T_recDiagcDataRec1065535
Return ValueN/A

Description

Refer ‘ProcessRampResponse and DiagcSts’ block in Simulink model

This function exists in “DiagcMgr.c” file.

Local Function #2

Function NameUpdSnpshtDataTypeMinMax
Arguments PassedRegInBRAMDAT1_Cnt_T_u32uint3204294967295
HwTq_Cnt_T_s5p10sint16-1010
MotTqCmdMrfScad_Cnt_T_s5p10sint16-8.88.8
IgnCntr_Cnt_T_u32uint3204294967295
BrdgVltg_Cnt_T_u6p10uint16626.5
EcuTFild_Cnt_T_s8p7sint16-50150
NtcNr_Cnt_T_u16NtcNr1NTCNR_0X001NTCNR_0X1FF
NtcStInfo_Cnt_T_u08uint80255
SysSt_Cnt_T_enumSysSt1SYSST_DISYSST_WRMININ
VehSpd_Cnt_T_u9p7Uint160511
Return ValueN/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 NameProcessDiagStsTypeMinMax
Arguments PassedFltRsp_Cnt_T_u32uint3204294967295
DiagStsX_Cnt_T_u16uint16065535
Return ValueN/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 NameProcProxyRampRespTypeMinMax
Arguments PassedNtcNr_Cnt_T_u16uint160511
ProxyDiagcData_T_recDiagcDataRec1065535
Return ValueN/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 NameDiagcMgrSetBits_u16TypeMinMax
Arguments PassedDatauint160511
BitMaskUint160511
Return ValueDataUint160511

Description

This function will set bits based on the passed BitMask for a uint16 datatype.

GLObAL Function #4

Function NameDiagcMgrSetBits_u08TypeMinMax
Arguments PassedDataUint80255
BitMaskUint80255
Return ValueDataUint80255

Description

This function will set bits based on the passed BitMask for a uint8 datatype

GLObAL Function #5

Function NameDiagcMgrClrBits_u08TypeMinMax
Arguments PassedDataUint80255
BitMaskUint80255
Return ValueDataUint80255

Description

This function will clear bits based on the passed BitMask for a uint8 datatype

GLObAL Function #6

Function NameDiagcMgrReadBit_u08TypeMinMax
Arguments PassedDataUint80255
BitMaskUint80255
Return ValueDataUint80255

Description

This function will return TRUE if any bits are set based on the passed BitMask for a uint8 datatype

GLObAL Function #7

Function NameDiagcMgrReadBit_u16TypeMinMax
Arguments PassedDatauint160511
BitMaskUint160511
Return ValueDataUint160511

Description

This function will return TRUE if any bits are set based on the passed BitMask for a uint16 datatype

GLObAL Function #8

Function NameDiagcMgrReadBit_u32TypeMinMax
Arguments PassedDatauint160511
BitMaskUint16065535
Return ValueDataUint160

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

  1. Per the FDD author, safety critical data is protected in an exclusive area but there is a possibility of corruption of non critical data.

  2. Refer to Design Rationale section on the top level of DiagcMgr Simulink model.

UNIT TEST CONSIDERATION

  1. 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

Last modified October 12, 2025: Initial commit (1fadfc4)