This is the multi-page printable view of this section. Click here to print.
Component Implementation
1 - requirements
| FDD | ID | Source | Function | Line(s) | Status | Comment | 
|---|---|---|---|---|---|---|
| .SwFileName | .SwFuncName | .SwLines | .SwStatus | .SwComment | ||
| CM475A | 15 | CDD_TSG31CfgAndUse.c | TSG31CfgAndUsePer2 | 475-523,674-692,711-719 | I | |
| CM475A | 58 | CDD_TSG31CfgAndUse.c | TSG31CfgAndUseInit1 | 220,221 | I | |
| CM475A | 67 | CDD_TSG31CfgAndUse.c | TSG31CfgAndUsePer2 | 480-528,679-697 | I | |
| CM475A | 71 | CDD_TSG31CfgAndUse.c | TSG31CfgAndUsePer2 | 476-524,675-693 | I | |
| CM475A | 70 | CDD_TSG31CfgAndUse.c | TSG31CfgAndUsePer2 | 477-525,676-694 | I | |
| CM475A | 68 | CDD_TSG31CfgAndUse.c | TSG31CfgAndUsePer2 | 479-527,678-696 | I | |
| CM475A | 69 | CDD_TSG31CfgAndUse.c | TSG31CfgAndUsePer2 | 478-526,677-695 | I | |
| CM475A | 80 | CDD_TSG31CfgAndUse.c | TSG31CfgAndUseInit1 | 225 | I | |
| CM475A | 86 | CDD_TSG31CfgAndUse.c | TSG31CfgAndUsePer2 | 472 | I | 
2 - TSG31CfgAndUse Integration Manual
TSG31CfgAndUse
Integration Manual
VERSION: 1.0
DATE: 28-Apr-2015
Revision History
| Sl. No. | Description | Author | Version | Date | 
| 1 | Initial version | K Creager | 1.0 | 28-Apr-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 | 
| FDD | Functional 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 | Software Process Release 03.06.00 | 
| <2> | Software Naming Conventions | Software Process Release 03.06.00 | 
| <3> | Design and Coding Standards | Software Process Release 03.06.00 | 
| <4> | FDD: CM475A_TSG31CfgAndUse_Design | See Synergy subproject version | 
Dependencies
SWCs
| Module | Required Feature | 
| <Name of SWC> | <Addition of global data, function>*. | 
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
See FDD – CM475A_TSG31CfgAndUse_DataDict.m file
Configuration REQUIREMeNTS
Build Time Config
| Modules | Notes | |
| None | 
Configuration Files to be provided by Integration Project
<Configuration file that will generated from this components that will require Da Vinci Config generation or manual generation. Describe each parameter >
Da Vinci Parameter Configuration Changes
| Parameter | Notes | SWC | 
| <Configurator Changes for parameters> | 
DaVinci Interrupt Configuration Changes
| ISR Name | VIM # | Priority Dependency | Notes | 
| <Configurator Changes for Interrupts> | 
Manual Configuration Changes
| Constant | Notes | SWC | 
| <Additional configuration changes> | 
Integration DATAFLOW REQUIREMENTS
Required Global Data Inputs
See FDD – CM475A_TSG31CfgAndUse_DataDict.m file
Required Global Data Outputs
See FDD – CM475A_TSG31CfgAndUse_DataDict.m file
Specific Include Path present
Yes
Runnable Scheduling
This section specifies the required runnable scheduling.
| Init | Scheduling Requirements | Trigger | 
| TSG31CfgAndUseInit1 | None | RTE/ Init | 
| Runnable | Scheduling Requirements | Trigger | 
| TSG31CfgAndUsePer1 | None | Motor control runnable | 
| TSG31CfgAndUsePer2 | None | RTE/2 ms | 
.
Memory Map REQUIREMENTS
Mapping
| Memory Section | Contents | Notes | 
| MotCtrl_START_SEC_CODE | Motor Control runnables | |
* 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
Non RTE NvM Blocks
| Block Name | 
| <NVM block used Non RTE functions > | 
Note : Size of the NVM block if configured in developer
RTE NvM Blocks
| Block Name | 
| <NVM block used in RTE functions > | 
Note : Size of the NVM block if configured in developer
Compiler Settings
Preprocessor MACRO
<Define all the preprocessor Macros needed and conditions when needed>.
Optimization Settings
<Define Optimization levels that are needed and conditions when needed>.
Appendix
<This section is for appendix>
3 - TSG31CfgAndUse_MDD
TSG31 Timer Subsystem Configuration and Use
Module Design Document
VERSION: 2.0
DATE: 20-Jun-2015
Revision History
| Description | Author | Version | Date | 
| Initial Version | K. Creager | 1.0 | 28-Apr-2015 | 
| Remove CnvNanoSecToHalfTmrCnt() function and add masking constant for changes in FDD ver 1.3.0 | K. Creager | 2.0 | 20-Jun-2015 | 
Table of Contents
3 TSG31CfgAndUse High-Level Description 7
3.1 Design details of software module 7
3.2 Graphical representation of CDD_TSG31CfgAndUse 7
4.1 User defined typedef definition/declaration 9
4.2 Variable definition for enumerated types 9
5.1 Program(fixed) Constants 10
5.1.2 Module specific Lookup Tables Constants 10
6 Software Module Implementation 11
6.1.1 Motor Control Periodic: TSG31CfgAndUsePer1 11
6.2 Initialization Functions 11
6.2.1 Init: TSG31CfgAndUseInit1 11
6.3.1 Per: TSG31CfgAndUsePer2 11
6.3.1.2 Store Module Inputs to Local copies 11
6.3.1.3 (Processing of function)……… 11
6.3.1.4 Store Local copy of outputs into Module Outputs 11
6.5 Serial Communication Functions 12
6.6 Local Function/Macro Definitions 12
6.7 GLObAL Function/Macro Definitions 14
7 Known Limitations With Design 15
Abbrevations And Acronyms
| Abbreviation | Description | 
| DFD | Design functional diagram | 
| MDD | Module design Document | 
| FDD | Functional 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 | Software Process Release 04.00.00 | 
| <2> | Software Naming Conventions | Software Process Release 04.00.00 | 
| <3> | Design and Coding standards | Software Process Release 04.00.00 | 
| <4> | FDD: CM475A_TSG31CfgAndUse_Design | See Synergy subproject version | 
TSG31CfgAndUse High-Level Description
The CDD_TSG31CfgAndUse component is the complex driver for the TSG31 timer subsystem. The timer subsystem is used to trigger DMA transfers and SPI transfers, and to set the GPIO pins for the three phase PWM outputs. The component contains two .c source files, both described in this MDD: CDD_TSG31CfgAndUse.c contains the RTE runnables; CDD_TSG31CfgAndUse_MotCtrl.c contains the motor control runnable.
Design details of software module
See FDD.
Graphical representation of CDD_TSG31CfgAndUse

Data Flow Diagram
See FDD.
Module level DFD
See FDD.
Sub-Module level DFD
See FDD.
COMPONENT FLOW DIAGRAM
See FDD.
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) | 
| <(Name given for the user defined typdef of type struct/union) (Variable name as qualified Refer[2])> | <(Variable name qualified Refer[2])> | <(Variable name qualified Refer[2> | <Min range allowed for the element in the Typedef > | <Max range allowed for the element in the Typedef> | 
Variable definition for enumerated types
| Enum Name | Element Name | Value | 
| SysSt1 | SYSST_DI SYSST_OFF SYSST_ENA SYSST_WRMININ | 0 1 2 3 | 
| MotCurrEolCalSt2 | MCECS_OFFSCMDSTRT MCECS_OFFSCMDHI MCECS_OFFSCMDLO MCECS_OFFSCMDZERO MCECS_OFFSCMDEND MCECS_GAINCMDAD MCECS_GAINCMDBE MCECS_GAINCMDCF MCECS_CMDSAFEST | 0 1 2 3 4 5 6 7 8 | 
Constant Data Dictionary
Program(fixed) Constants
Embedded Constants
< All program specific constants will be defined in detail >
Local
| Constant Name | Resolution | Units | Value | 
| ROUNDGTERM_CNT_U13P19 | P19 | Cnt | 262144 counts = 0.5 p19 | 
| PWMTMRPERDIVSSCAG_CNT_U16 | 1 | Cnt | 19 | 
| CLRBIT0MASK_CNT_U32 | 1 | Cnt | 0xFFFFFFFE | 
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 | 
| 
 | 
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 | 
| <Refer Constant name qualified in [2]> | <Refer MDD guidelines [1]> | <Refer MDD guidelines [1]> | <Refer MDD guidelines [1]> | 
Software Module Implementation
Note: All the non RTE signals defined in m file are implemented as global varibles managed by motor control manager. RTE can not manage motor control runnables inputs and outputs.
Sub-Module Functions
Motor Control Periodic: TSG31CfgAndUsePer1
See FDD TSG31CfgAndUsePer1 model block.
Design Rationale
The truth table in the TSG31CfgAndUsePer1 model block is just selecting between four sets of statements based on the value of a single variable. This was implemented as an if/else if. For run-time efficiency, since this is a motor control runnable, the “normal operation” case was checked first; since the normal operation and default cases are the same, the statements in this row of the truth table action table are repeated in the trailing else of the if/else.
Initialization Functions
Init: TSG31CfgAndUseInit1
Design Rationale
All register initialization that is allowed at the register level (see FieldNames tab of the CM475A_TSG31RegisterConfiguration.xlms spreadsheet in the FDD) is done at the register level to save execution time as compared to the read/modify/writes that would be needed to initialize at the field level. Field level initialization done only where required by the spreadsheet.
Module Outputs
See FDD: TSG31CfgAndUseInit1 model block and the FieldNames tab of the CM475A_TSG31RegisterConfiguration.xlms spreadsheet.
Module Internal
See FDD: TSG31CfgAndUseInit1 model block for Per Instance Memory initialization.
PERIODIC FUNCTIONS
Per: TSG31CfgAndUsePer2
Design Rationale
Each action block of the switch/case was implemented as a local function. To minimize complexity, the “Out1” truth table output and the switch case block were combined in the implementation with nested “if”s which directly call the switch/case action functions
Store Module Inputs to Local copies
See FDD: TSG31CfgAndUsePer2 model block.
(Processing of function)………
See FDD: TSG31CfgAndUsePer2 model block.
Store Local copy of outputs into Module Outputs
See FDD: TSG31CfgAndUsePer2 model block
Interrupt Functions
None
Serial Communication Functions
None
Local Function/Macro Definitions
Local Function #1
| Function Name | NoTranSysStIsEn | Type | Min | Max | 
| Arguments Passed | MotCurrEolCalSt_Cnt_T_enum | MotCurrEolCalSt2 | 0 | 8 | 
| Return Value | N/A | 
Description
See FDD model block: CM475A_TSG31CfgAndUse/TSG31CfgAndUse/TSG31CfgAndUsePer2/No Transition SysState = Enable
Local Function #2
| Function Name | TranFromEn | Type | Min | Max | 
| Arguments Passed | None | |||
| Return Value | N/A | 
Description
See FDD model block: CM475A_TSG31CfgAndUse/TSG31CfgAndUse/TSG31CfgAndUsePer2/Transition from Enable
Local Function #3
| Function Name | TranToEn | Type | Min | Max | 
| Arguments Passed | None | |||
| Return Value | N/A | 
Description
See FDD model block: CM475A_TSG31CfgAndUse/TSG31CfgAndUse/TSG31CfgAndUsePer2/Transition to Enable
Local Function #4
| Function Name | NoTranSysStNotEn | Type | Min | Max | 
| Arguments Passed | None | |||
| Return Value | N/A | 
Description
See FDD model block: CM475A_TSG31CfgAndUse/TSG31CfgAndUse/TSG31CfgAndUsePer2/No Transition SysState != Enable
Local Function #5
| Function Name | MapFetCtrlSigToGpioAndSetLow | Type | Min | Max | 
| Arguments Passed | None | |||
| Return Value | N/A | 
Description
See FDD model block: CM475A_TSG31CfgAndUse/TSG31CfgAndUse/TSG31CfgAndUsePer2/Transition from Enable/Map FET Ctrl Signals to GPIO and Set Low (also same block name in other model layers)
Local Function #6
| Function Name | MapPinsToGpio | Type | Min | Max | 
| Arguments Passed | None | |||
| Return Value | N/A | 
Description
See FDD model block: CM475A_TSG31CfgAndUse/TSG31CfgAndUse/TSG31CfgAndUsePer2/Transition from Enable/Map FET Ctrl Signals to GPIO and Set Low/Map Pins to GPIO (also same block name in other model layers)
Local Function #7
| Function Name | CnvNanoSecToTmrCnt | Type | Min | Max | 
| Arguments Passed | Ti_NanoSec_T_u32 | uint32 | 0 | 100000 | 
| Return Value | Timer counts corresponding to the input time | uint32 | 0 | 8000 | 
Description
See FDD model block: CM475A_TSG31CfgAndUse_ModelLibrary_Rev001/RawTime_NanoSec to RawTimerCount_Cnt Conversion Block
Design Rationale
Because this function is called by a motor control runnable, it is coded as an inline function to maximize the chance that the compiler will inline it, in order to improve runtime efficiency of the motor control loop.
GLObAL Function/Macro Definitions
None
TRANSIENT FUNCTIONS
None
Known Limitations With Design
- Expected input ranges of the nanosecond to timer count conversion functions are based on FDD assumptions about the minimum PWM period that may ever be used, as stated in comments in the FDD model. 
UNIT TEST CONSIDERATION
None
Appendix
<This section is for appendix>
4 - TSG31CfgAndUse_Peer_Review
Overview
Summary SheetSynergy Project
Sheet 1: Summary Sheet



