1 - Data Dictionary


Overview

Change Log
Variable Dictionary
Calibration Dictionary
Global Constants
Template
Help


Sheet 1: Change Log

Metrics - Rev 2<- Global Program / Module Name


RevisionAuthorDateChange Description

Data Dictionary Type:Component
1JJW1-Feb-12Initial version



2BWL1-Jul-12Modified variables changed with PMU integration, and filled out existing information.




















































































































































































































































































































































Sheet 2: Variable Dictionary

Metrics - Rev 2

IOMDN
Variable Information

YN










Range










Software Variable NameStandard Reference NameFDD ReferenceDescription[I]nput [O]uput [M]oduleInternal [D]isplay [N]onVolatileMemory UsageOEM1X, 1Y, 1Z, 1I, 1BS 2X, 2Y, 2Z, 2I, 2BS etc Graph SettingsInitalization ValueMinMaxResolutionUnit Test Tolerance (+/-)UnitsType






Variables



















CDD_MetricsTraceIdx_Cnt_G_u16NoneNoneFirst unused index in MetricsTrace array.MN
00D_MAXTRACEEVT_CNT_U16


uint16






CDD_MetricsTraceOffset_uS_G_u32NoneNoneTime taken for system to reach GPT init.MN
D_HWSTARTUP_US_U160


uSuint32






CDD_MetricsTrace_Cnt_G_Str[D_MAXTRACEEVT_CNT_U16]NoneNoneList of time to reach trace points.MN
00



MetricTrace_Str[]






Metrics_CpuUse_Pct_M_f32NoneNoneOverall CPU utilization.DN
1000100

%float32






Metrics_StackUse_Cnt_M_u16[osdNumberOfAllTasks]NoneNoneMax used stack space.DN
0065536

Bytesuint16






Metrics_StackSize_Cnt_M_u16[osdNumberOfAllTasks]NoneNoneSize of each task stackDN
0065536

Bytesuint16






Metrics_ActiveTask_Cnt_M_u16NoneNoneCurrently executing task.MN
Task_Bkgnd0d_NumberofTasks_Cnt_u16


uint16






Metrics_ActiveRunnable_Cnt_M_u16NoneNoneRunnable currently exectuing in active task.MN
d_NumberofRunnables_Cnt_u160d_NumberofRunnables_Cnt_u16


uint16






Metrics_TaskTimes_Str[d_NumberofTasks_Cnt_u16]NoneNoneArray structure containing task metrics.DN
0




TaskMetric_Type*






Metrics_RunnableTimes_Str[d_NumberofTasks_Cnt_u16]NoneNoneArray structure containing runnable metrics.DN
0




RunnableMetric_Type*






Metrics_BkgndLoopTimeMax_Cnt_M_u32NoneNoneLongest period of time spent in the background.DN
004294967296


uint32






Metrics_LastStackUseCalc_uS_M_u32NoneNoneTime of last stack use calculation.MN
004294967296


uint32


































































































































































































































































































































Sheet 3: Calibration Dictionary

Metrics - Rev 2


N
Calibration Information

Achieved in Software Design


Y








Range




P
Software Calibration NameStandard Reference NameFDD ReferenceDescriptionTuning SetOEM1X, 1Y, 1Z, 1I, 1BS 2X, 2Y, 2Z, 2I, 2BS etc Graph SettingsDefault ValueMinMaxUnitsType



Calibrations














k_CpuUseUpdateInterval_uS_u32NoneNoneTime between normalized metrics calculation.NN
1000000026843545uSuint32



k_StackUseUpdateInterval_uS_u32NoneNoneTime between stack use check.NN
1000000026843545uSuint32



k_CpuUseProcessMask_Cnt_b32[d_NumberofTasks_Cnt_u16/32+1]NoneNoneEnable/Disable normalized time calculation for a task.NN
0xFFFFFFFF

Cntuint32



k_MetricsTestEnable_Cnt_lgcNoneNone
NN
FALSE

lgcboolean



k_TaskTimeFilterK_Uls_f32[d_NumberofTasks_Cnt_u16]NoneNone
NN
0

Ulsfloat32




Sheet 4: Global Constants

Metrics - Rev 2








































































Variable Information (Global Variables Only)

Achieved in Software DesignUsed in Module List





Layer 2Layer 3Layer 4Layer 5
Constant NameDescriptionUintsTypeEngineering ValueADCADC DiagnosticsData Memory VerificationDC Link Power ControlDSP Computational IntegrityDSP SPI driverEvent Manager DriverExternal Memory DriverFlash Programming ExecGPIOIllegal OpCode HandlerInterrupt HandlerMotor Current DriverMotor Driver DiagnosticsMotor Position DriverPhase Feedback CapturePowerdown ControlPrimary Shutdown ControlProgram FlowProgram Memory DiagnosticPWM Duty CycleRedundant Memory CheckRedundant Rapid ShutdownSchedulerStack MonitorState Dependent Task ListSystem Boot & StartupSystem ControlTemperature Sensor DiagnosticUnused Interrupt HandlerUtilization MonitorWatchdog DirverSmithBattery VoltageBattery Voltage DiagnosticsDiagnostic CTC ManagerDiagnostic ManagerDiagnostics Application ServicesEOL TorqueTestFlash Boot LoaderFlight RecorderHandwheel PositionHandwheel TorqueMotor Control Output ConversionMotor Position DiagnosticsMotor Position InitializationMotor VelocityMotor Velocity TachometerSerial Communications I/OSerial Communications ServicesStates and ModesTuning SelectVehicle Power ModeVehicle SpeedController PolarityCurrent EstimationHandwheel VelocityInverse Motor ModelMotor Temperature EstimationMotor Torque LimitOutput Reasonableness DianosticParameter EstimationQuadrant and rate DetectionActive Pull CompensationAssistDampingDuty CycleKinematic Integrity DiagnosticLong Term Vehicle Speed DiagnosticMax Assist LimitReturnState Output ControlTorque Output























































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































Sheet 5: Template

2.2aData File:












Header:extern <TYPE><TAB><NAME>;









Source:#pragma DATA_SECTION(<ROOTNAME>, "<SEGMENT>");
<TYPE> <NAME>;










EOL Constants:












Header:extern <TYPE><TAB><NAME>;









Source:#pragma DATA_SECTION(<ROOTNAME>, "<SEGMENT>");
<TYPE> <NAME>;










Global (Embedded) Constants:












Header:#define <NAME><COL40><VALUE>









A2L Name












Measurement:rte_<SWC>_<NAME>









Calibration Constants:












Tuning ID:



















Tuning:NIndex Range:










Header:extern CONST(<AUTOSAR_TYPE>, CAL_CONST) <NAME>;









Source:#pragma DATA_SECTION(<ROOTNAME>, ".<SEGMENT>");
CONST(<AUTOSAR_TYPE>, CAL_CONST) <NAME> = <VALUE>;










eCal:<NAME>























Tuning:YIndex Range:










Header:<NONCRITICAL>
#define <ROOTNAME><TAB>k_N_CalNC_Cnt_Str.<ROOTNAME>
<NONCRITICAL>
<SAFETYCRITICAL>
#define <ROOTNAME><TAB>k_S_CalSC_Cnt_Str.<ROOTNAME>
<SAFETYCRITICAL>










Source:










eCal:<NONCRITICAL>
k_N_CalNC_Cnt_Str.<ROOTNAME>
<NONCRITICAL>
<SAFETYCRITICAL>
k_S_CalSC_Cnt_Str.<ROOTNAME>
<SAFETYCRITICAL>
























Tuning:PIndex Range:










Header:<NONCRITICAL>
#define <ROOTNAME><TAB>k_N_CalNC_Cnt_Str.Personality[L3_S_CalPersSelect_Cnt_G_u16].<ROOTNAME>
<NONCRITICAL>
<SAFETYCRITICAL>
#define <ROOTNAME><TAB>k_S_CalSC_Cnt_Str.SC_Personality[L3_S_CalPersSelect_Cnt_G_u16].<ROOTNAME>
<SAFETYCRITICAL>










Source:










eCal:<NONCRITICAL>
k_N_CalNC_Cnt_Str.Personality[L3_S_CalPersSelect_Cnt_G_u16].<ROOTNAME>
<NONCRITICAL>
<SAFETYCRITICAL>
k_S_CalSC_Cnt_Str.SC_Personality[L3_S_CalPersSelect_Cnt_G_u16].<ROOTNAME>
<SAFETYCRITICAL>

















Sheet 6: Help

Short cutMacroSescription
Ctrl-qClearDataDictFilterWill clear all autofilters on the Global Data Dictionary




DFD_CreateCreates a Series of Data Flow Worksheet Pages from the information in the data dictionary. If Data Flow Worksheet pages already exist, they will be deleted first.

DFD_DeleteWill clear all Data Flow Diagram pages from the Data Dictionary. This will make the file smaller for archiving.

DFD_PrintFormate and prepares to print the Data Flow Worksheet pages.

2 - Metrics_Integration_Manual

Contents

1 Dependencies 1

2 Configuration 1

2.1 Build Time Config 1

2.2 Generator Config 2

3 Memory Mapping 2

3.1 Mapping 2

3.2 Usage 2

Dependencies

ModuleRequired Feature
Rte

Rte_Task_Dispatch() hooks

VFB Trace hooks

DioDio_WriteChannel()
PortPort_SetPinDirection()
NxtrLib

DtrmnElapsedTime_uS_u32()

GetSystemTime_uS_u32()

Os

osdNumberOfAllTasks constant value

osGetStackUsage

oskTcbStackTop

oskTcbStackBottom

Configuration

Build Time Config

ConstantNotesSWC
BC_METRICS_TASKCPUUSEMASKSTD_ON enables build of the task use masking functionality to excluded a user defined set of task CPU use times from the CPU use calculation.
BC_METRICS_STACKUSESTD_ON enables build of the Stack Use monitoringMetrics
BC_METRICS_CPUUSEDIOSTD_ON enables build of the CPU Use digital output based monitoringMetrics
BC_METRICS_CPUUSETMRSTD_ON enables build of the CPU Use timer based monitoringMetrics
ENABLE_CPUUSE_DIOIf defined then CPU usage is output via a DIO where the DIO is high while the CPU is not in the background task.Metrics
RTE_VFB_TRACE=1Enable Rte’s VFB trace functionality to support Rte_Task_Dispatch() hooksRte
Rte_Task_DispatchEnable Rte’s Rte_Task_Dispatch() hooksRte

Generator Config

ConstantNotesSWC
Dio Channel Name: “Metrics”Required when ENABLE_CPUUSE_DIO is definedDio
RTE VFB Trace Hooks
  1. Enable the option “Enable VFB Tracing” under Generation Parameters.

  2. Define/Import task wait event, and wait event return hooks. Insert task start into the wait event return hook, and task end into wait the wait event hook.

  3. Define/Import all desired runnable Start and Return hooks in the “Trace function“ dialog.

Caveats:

  • The runnable runtime metrics methodology requires all preemption entry and exit points are instrumented with Metrics_TaskStart/End to provide the ability to measure and subsequently account for preemption time in the preempted entity.

    • Basic Tasks do not provide an Rte Exit hook, therefore the Metrics_TaskEnd( Id ) must be integrated in the return hook of the last runnable in the Task list.

    • Extended Tasks do provide start and end hooks and therefore do not require the integrator to place the Metrics_TaskEnd( Id ) in any runnable end hook.

  • Tracking all runnables is likely to impact task run times significantly. It may make more sense to enable runnable trace hooks only as necessary.

MPU Global Read AccessGetSystemTime and Dio_WriteChannel Metrics Channel accessed registers must be readable across all application and ISR contexts.Os
MPU Global Read/Write Access

Metrics data structures must be R/W across all application and ISR contexts.

ATTENTION! The metrics data structures are very large, so ensure that adequate memory is allocated to the Global Shared region

OS

Integration Project Changes

  1. Modify the required BSW Irq source functions to place the Metrics_TaskStart and Metrics_TaskEnd hooks around the ISR’s. The recommended practice is to make a copy of the delivered source file renamed to *_NxtrMetrics.c and conditionaly build the altered file in place of the delivered file for Metrics builds.

  2. Modify SchM.c to place the Metrics_TaskStart hook and Metrics_TaskEnd calls appropriately at around the tasks. Note that it might be necessary to place the hooks at a point in the task that will be overwritten when the SchM.c is generated. Diligence will need to used after generation to ensure that the hooks are not inadvertently removed.

  3. Modify ApplCallbacks.c to place Metrics_TaskStart and Metrics_TaskEnd calls appropriately around tasks. Dilligence will be required to ensure the hooks are not removed.

Memory Mapping

Mapping

ConstantNotes
METRICS_START_SEC_VAR_CLEARED_UNSPECIFIEDWritable across all applications

* Each …START_SEC… constant is terminated by a …STOP_SEC… constant as specified in the AUTOSAR Memory Mapping requirements.

Usage

: ARM Cortex R4 Memory Usage
Revision Control Log

FeatureRAMROM
Software task time stamping of task execution
Stack usage monitoring
Item #Rev #Change DescriptionDateAuthor Initials
1

3 - Metrics_MDD

Module --

(Above name of the module is a “Field” that can be updated. It should be set by going to File Properties – Custom and then modifying the Document name, this name will be the same one used for the filename also, refer design guidelines document, Once name modified, do a select all – and update entire document, so that this field will be updated everywhere it is used in the template, Remove this comment in the actual document)

High-Level Description

(Description must be within 8-10 lines.)

Figures

Diagram – Function Data Sharing

This diagram shows all data that is shared between functions within the module.

(Note – If no data is shared between functions, the Text “No Shared Data” can be used in place of a graphic. Also note that init functions need not be shown unless they compute non-zero data to be used by other functions in the module).

Diagram – Function (Name)

This diagram describes the functional characteristics and data flow of a given function.

(Note – This is not mandatory, only used where a graphical representation helps explain the function. It is left to the author’s discretion. New headers of this level (Level 3) should be created for each function.


Variable Data Dictionary

For details on module input / output variable, refer to the Data Dictionary for the application. Input / output variable names are listed here for reference.

(Note: Full variable names required in table.)

(Note: All global variables including End Of Line data used should be shown here)

Module InputsModule Outputs
<VarName_Units_Type><VarName_Units_Type>

Module Internal Variables

This section identifies the name, range and resolutions for module specific data created by this module. If there are no range restrictions on the variable, the term “FULL” is placed into the table for legal range.

Variable NameResolution

Legal Range

(min)

Legal Range

(max)

Software Segment
<None>

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)

(Name given for the user defined typdef of type struct/union)

(Variable name qualified similar to all other variables)

(Variable name qualified similar to all other variables)as other variables
(Variable name qualified similar to all other variables)

Constant Data Dictionary

Calibration Constants

This section lists the calibrations used by the module. For details on calibration constants, refer to the Data Dictionary for the application.

Constant Name
<None>

Program(fixed) Constants

Embedded Constants

All embedded constants whose values are provided in Eng units will be evaluated to the equivalent counts by using the FPM_InitFixedPoint_m() macro within the #define statement.

Local

Constant NameResolutionUnitsValue
<None>

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
<None>

Module specific Lookup Tables Constants

(This is for lookup tables (arrays) with fixed values, same name as other tables)

Constant NameResolutionValueSoftware Segment
None


Functions/Macros used by the Sub-Modules

Library Functions / Macros

The library and functions / Macros that are called by the various sub modules are identified below,

  1. <None>

Data Hiding Functions

  1. <None>

Global Functions/Macros Defined by this Module

Global Function #1

Function Name(Exact name used)TypeMinMaxUTP Tol.
Arguments Passed(if none, write None)
(Insert more rows for additional passed arguments)
Return Value(if no value returned, write N/A)

Description

(Place flowchart/design for local function)

Local Functions/Macros Used by this MDD only

Local Function #1

Function Name(Exact name used)TypeMinMaxUTP Tol.
Arguments Passed(if none, write None)
(Insert more rows for additional passed arguments)
Return Value(if no value returned, write N/A)

Description

(Place flowchart/design for local function)

Software Module Implementation

Runtime Environment (RTE) Initial Values

This section lists the initial values of data written by this module but controlled by the RTE. After RTE initialization, the data in this table will contain these values.

DataValue
<None>

Initialization Functions

(Note: For multiple init functions, insert new headers at the “Header 2” level – subset of “5.1 Initialization Functions” and follow the same sub-section design shown below)

Init: _L_Init(n)

Design Rationale

(Add design rationale specifically related to this FUNCTION. If none required, place the text “None”)

Module Outputs

(Initialize all module outputs in this section)

Module Internal

(Initialize all module internal variables in this section)


Periodic Functions

(Note: For multiple periodic functions, insert new headers at the “Header 2” level – subset of “5.2 Periodic Functions” and follow the same sub-section design shown below)

Per: _L_Per(n)

Design Rationale

(Add design rationale specifically related to this FUNCTION. If none required, place the text “None”)

Program Flow Start

(If program flow is required by the module, the function to store the unique identifier to a temporary variable is done here – start of the function)

Store Module Inputs to Local copies

(If not required based on design, insert text “None”)

(Processing of function)………

(Breakdown the function into smaller sections to add clarity to the design).

Store Local copy of outputs into Module Outputs

(If not required based on design, insert text “None”)

Program Flow End

(If program flow is required by the module, the function to add the temporary variable to the global accumulator is done here)


Fault Recovery Functions

(Note: For multiple functions, insert new headers at the “Header 2” level – subset of “5.3 Fault Recovery Functions” and follow the same sub-section design shown below)

FaultRec: _L_FaultRec(n)

Design Rationale

(Add design rationale specifically related to this FUNCTION. If none required, place the text “None”)

Program Flow Start

(If program flow is required by the module, the function to store the unique identifier to a temporary variable is done here – start of the function)

Store Module Inputs to Local copies

(If not required based on design, insert text “None”)

(Processing of function)………

(Breakdown the function into smaller sections to add clarity to the design).

Store Local copy of outputs into Module Outputs

(If not required based on design, insert text “None”)

Program Flow End

(If program flow is required by the module, the function to add the temporary variable to the global accumulator is done here)


Shutdown Functions

(Note: For multiple functions, insert new headers at the “Header 2” level – subset of “5.4 Shutdown Functions” and follow the same sub-section design shown below)

Shtdn: _L_Shtdn(n)

Design Rationale

(Add design rationale specifically related to this FUNCTION. If none required, place the text “None”)

Program Flow Start

(If program flow is required by the module, the function to store the unique identifier to a temporary variable is done here – start of the function)

Store Module Inputs to Local copies

(If not required based on design, insert text “None”)

(Processing of function)………

(Breakdown the function into smaller sections to add clarity to the design).

Store Local copy of outputs into Module Outputs

(If not required based on design, insert text “None”)

Program Flow End

(If program flow is required by the module, the function to add the temporary variable to the global accumulator is done here)


Interrupt Functions

(Note: For multiple functions, insert new headers at the “Header 2” level – subset of “5.5 Interrupt Functions” and follow the same sub-section design shown below)

Isr: _L_Isr(n)

Design Rationale

(Add design rationale specifically related to this FUNCTION. If none required, place the text “None”)

(Processing of the ISR function)…..

(Note: Multiple headings can be used to break apart the functionality)


Serial Communication Functions

(Note: For multiple functions, insert new headers at the “Header 2” level – subset of “5.6 Serial Communication Functions” and follow the same sub-section design shown below)

SComm: _L_SComm(n)

Design Rationale

(Add design rationale specifically related to this FUNCTION. If none required, place the text “None”)

Program Flow Start

(If program flow is required by the module, the function to store the unique identifier to a temporary variable is done here – start of the function)

Store Module Inputs to Local copies

(If not required based on design, insert text “None”)

(Processing of function)………

(Breakdown the function into smaller sections to add clarity to the design).

Store Local copy of outputs into Module Outputs

(If not required based on design, insert text “None”)

Program Flow End

(If program flow is required by the module, the function to add the temporary variable to the global accumulator is done here)


Execution Requirements

Execution Sequence of the Module

(Describe in words relevant details about the execution sequence of the different sub modules.)

Execution Rates for sub-modules called by the Scheduler

This table serves as reference for the Scheduler design

Function NameCalling FrequencySystem State(s) in which the function is called
<None>

Execution Requirements for Serial Communication Functions

Function NameSub-Module called by (Serial Comm Function Name)
<None>


Memory Map Definition Requirements

Sub Modules (Functions)

This table identifies the software segments for functions identified in this module.

Name of Sub ModuleSoftware Segment

Local Functions

This table identifies the software segments for local functions identified in this module.

Name of Sub ModuleSoftware Segment


Known Issues / Limitations With Design

  1. (Item #1)


Revision Control Log

Item #Rev #Change DescriptionDateAuthor Initials
1