ERAD Module

C2000 MCU’s have an IP called Embedded Real Time Analysis And Diagnostics (ERAD) that provides unique hardware capabilities for real time analysis, monitoring and diagnostics of the systems. The ERAD module is accessible both by the debugger and the application software, which significantly increases the debug capabilities of many real-time systems, especially in situations where the debugger is not connected The ERAD driver includes high level APIs for various use cases like profiling functions, detecting stack overflow, counting memory accesses etc.

group erad_api

Defines

ERAD_HWBP_CNTL_STOP_S 0x05U
ERAD_HWBP_CNTL_RTOSINT_S 0x06U
ERAD_CTM_CNTL_EVENT_MODE_S 0x03U
ERAD_CTM_CNTL_RST_ON_MATCH_S 0x04U
ERAD_CTM_CNTL_STOP_S 0x06U
ERAD_CTM_CNTL_RTOSINT_S 0x07U
ERAD_getBusCompInstance(base) (1UL << ((base >> 3U) & 0x7U))
ERAD_getCounterInstance(base) ((1UL << ((base >> 4U) & 0x3U)) << 8U)
ERAD_getCRCInstance(base) (1U << (((base >> 4U) & 0xFU) - 1U))
ERAD_BUSCOMP_BASE_TO_EVENT(base) ((base >> 3U) & 0x07U)
ERAD_INST_BUSCOMP1 0x00000001UL

Instance for bus comparator 1.

Values that can be passed to ERAD_enableModules() or ERAD_disableModules() as instances parameter.

ERAD_INST_BUSCOMP2 0x00000002UL

Instance for bus comparator 2.

ERAD_INST_BUSCOMP3 0x00000004UL

Instance for bus comparator 3.

ERAD_INST_BUSCOMP4 0x00000008UL

Instance for bus comparator 4.

ERAD_INST_BUSCOMP5 0x00000010UL

Instance for bus comparator 5.

ERAD_INST_BUSCOMP6 0x00000020UL

Instance for bus comparator 6.

ERAD_INST_BUSCOMP7 0x00000040UL

Instance for bus comparator 7.

ERAD_INST_BUSCOMP8 0x00000080UL

Instance for bus comparator 8.

ERAD_INST_COUNTER1 0x00000100UL

Instance for counter 1.

ERAD_INST_COUNTER2 0x00000200UL

Instance for counter 2.

ERAD_INST_COUNTER3 0x00000400UL

Instance for counter 3.

ERAD_INST_COUNTER4 0x00000800UL

Instance for counter 4.

ERAD_INST_CRC1 0x00000001UL

Instance for CRC unit 1.

ERAD_INST_CRC2 0x00000002UL

Instance for CRC unit 2.

ERAD_INST_CRC3 0x00000004UL

Instance for CRC unit 3.

ERAD_INST_CRC4 0x00000008UL

Instance for CRC unit 4.

ERAD_INST_CRC5 0x00000010UL

Instance for CRC unit 5.

ERAD_INST_CRC6 0x00000020UL

Instance for CRC unit 6.

ERAD_INST_CRC7 0x00000040UL

Instance for CRC unit 7.

ERAD_INST_CRC8 0x00000080UL

Instance for CRC unit 8.

ERAD_INPUT_INVERT_DISABLE 0x00U

Do not invert the input.

Values that can be passed to ERAD_setCounterInputConditioning() as options parameter.

ERAD_INPUT_INVERT_ENABLE 0x01U

Invert the input.

ERAD_INPUT_SYNC_DISABLE 0x00U

Disable 2-stage synchronizer.

ERAD_INPUT_SYNC_ENABLE 0x02U

Enable 2-stage synchronizer.

Enums

enum ERAD_Owner

Values that can be passed to ERAD_initModule() as owner parameter to set owner of ERAD.

Values:

enumerator ERAD_OWNER_NOOWNER = 0

No owner.

enumerator ERAD_OWNER_APPLICATION = 1

Application owned.

enumerator ERAD_OWNER_DEBUGGER = 2

Debugger owned.

enum ERAD_Status

Values that can are returned by ERAD_getBusCompStatus() and ERAD_getCounterStatus() to indicate the state of the respective module.

Values:

enumerator ERAD_STATE_IDLE = 0

Module is idle.

enumerator ERAD_STATE_ENABLED = 2

Module is enabled.

enumerator ERAD_STATE_COMPLETED = 3

Module was enabled and an event occurred.

enum ERAD_BusComp_Bus_Select

Values that can be passed to ERAD_configBusComp() and ERAD_profile() as config_params.bus_sel parameter to choose which CPU bus to monitor.

Values:

enumerator ERAD_BUSCOMP_BUS_PAB = 0

Use the Program Address Bus.

enumerator ERAD_BUSCOMP_BUS_VPC = 1

Use the Virtual Program Counter.

enumerator ERAD_BUSCOMP_BUS_DWAB = 2

Use the Data Write Address Bus.

enumerator ERAD_BUSCOMP_BUS_DRAB = 3

Use the Data Read Address Bus.

enumerator ERAD_BUSCOMP_BUS_DWDB = 4

Use the Data Write Data Bus.

enumerator ERAD_BUSCOMP_BUS_DRDB = 5

Use the Data Read Data Bus.

enumerator ERAD_BUSCOMP_BUS_VPC_I_ALIGNED = 6

Use VPC Instruction aligned match.

enumerator ERAD_BUSCOMP_BUS_VPC_R1_ALIGNED = 7

Use VPC R1 aligned match.

enumerator ERAD_BUSCOMP_BUS_VPC_R2_ALIGNED = 8

Use VPC R2 aligned match.

enumerator ERAD_BUSCOMP_BUS_VPC_W_ALIGNED = 9

Use VPC Word aligned match.

enum ERAD_BusComp_Comp_Mode

Values that can be passed to ERAD_configBusComp() and ERAD_profile() as config_params.comp_mode to indicate what kind of comparison to use for the bus comparators.

Values:

enumerator ERAD_BUSCOMP_COMPMODE_GT = 4

Check for greater than.

enumerator ERAD_BUSCOMP_COMPMODE_GE = 5

Check for greater than equal to.

enumerator ERAD_BUSCOMP_COMPMODE_LT = 6

Check for lesser than.

enumerator ERAD_BUSCOMP_COMPMODE_LE = 7

Check for lesser than equal to.

enumerator ERAD_BUSCOMP_COMPMODE_EQ = 0

Check for only equality.

enum ERAD_Counter_Event_Mode

Values that can be passed to ERAD_configCounterInStartStopMode() and ERAD_configCounterInCountingMode() as config_params.event_mode to indicate whether to count rising edges or the number of CPU clock cycles an is active.

Values:

enumerator ERAD_COUNTER_MODE_ACTIVE = 0

Count number of CPU Cycles event is active for

enumerator ERAD_COUNTER_MODE_RISING_EDGE = 1

Count number of Rising Edges of event

enum ERAD_Counter_Input_Event

Values that can be passed to ERAD_configCounterInStartStopMode() and ERAD_configCounterInCountingMode() as config_params.event to indicate what event to consider as input. Also may be passed to ERAD_configCounterInStartStopMode() as start_event and stop_event to indicate start and stop events for the counter.

Values:

enumerator ERAD_EVENT_HWBP1 = 0
enumerator ERAD_EVENT_HWBP2 = 1
enumerator ERAD_EVENT_HWBP3 = 2
enumerator ERAD_EVENT_HWBP4 = 3
enumerator ERAD_EVENT_HWBP5 = 4
enumerator ERAD_EVENT_HWBP6 = 5
enumerator ERAD_EVENT_HWBP7 = 6
enumerator ERAD_EVENT_HWBP8 = 7
enumerator ERAD_EVENT_COUNTER1_EVENT = 8
enumerator ERAD_EVENT_COUNTER2_EVENT = 9
enumerator ERAD_EVENT_COUNTER3_EVENT = 10
enumerator ERAD_EVENT_COUNTER4_EVENT = 11
enumerator ERAD_EVENT_ERAD_OR_MASK0 = 12
enumerator ERAD_EVENT_ERAD_OR_MASK1 = 13
enumerator ERAD_EVENT_ERAD_OR_MASK2 = 14
enumerator ERAD_EVENT_ERAD_OR_MASK3 = 15
enumerator ERAD_EVENT_ERAD_AND_MASK0 = 16
enumerator ERAD_EVENT_ERAD_AND_MASK1 = 17
enumerator ERAD_EVENT_ERAD_AND_MASK2 = 18
enumerator ERAD_EVENT_ERAD_AND_MASK3 = 19
enumerator ERAD_EVENT_PIE_INT1 = 20
enumerator ERAD_EVENT_PIE_INT2 = 21
enumerator ERAD_EVENT_PIE_INT3 = 22
enumerator ERAD_EVENT_PIE_INT4 = 23
enumerator ERAD_EVENT_PIE_INT5 = 24
enumerator ERAD_EVENT_PIE_INT6 = 25
enumerator ERAD_EVENT_PIE_INT7 = 26
enumerator ERAD_EVENT_PIE_INT8 = 27
enumerator ERAD_EVENT_PIE_INT9 = 28
enumerator ERAD_EVENT_PIE_INT10 = 29
enumerator ERAD_EVENT_PIE_INT11 = 30
enumerator ERAD_EVENT_PIE_INT12 = 31
enumerator ERAD_EVENT_TIMER0_TINT0 = 32
enumerator ERAD_EVENT_TIMER1_TINT1 = 33
enumerator ERAD_EVENT_TIMER2_TINT2 = 34
enumerator ERAD_EVENT_DMACH1INT = 35
enumerator ERAD_EVENT_DMACH2INT = 36
enumerator ERAD_EVENT_DMACH3INT = 37
enumerator ERAD_EVENT_DMACH4INT = 38
enumerator ERAD_EVENT_DMACH5INT = 39
enumerator ERAD_EVENT_DMACH6INT = 40
enumerator ERAD_EVENT_FSIA_DATA_PKT_RCVD = 41
enumerator ERAD_EVENT_FSIA_ERROR_PKT_RCVD = 42
enumerator ERAD_EVENT_FSIA_PING_PKT_RCVD = 43
enumerator ERAD_EVENT_FSIA_PING_FRAME_TAG_MATCH = 44
enumerator ERAD_EVENT_FSIA_DATA_FRAME_TAG_MATCH = 45
enumerator ERAD_EVENT_FSIA_ERROR_FRAME_TAG_MATCH = 46
enumerator ERAD_EVENT_FSIA_FRAME_DONE = 47
enumerator ERAD_EVENT_ADCAEVTINT = 48
enumerator ERAD_EVENT_ADCBEVTINT = 49
enumerator ERAD_EVENT_MCANA_EVT0 = 50
enumerator ERAD_EVENT_MCANA_EVT1 = 51
enumerator ERAD_EVENT_MCANA_EVT2 = 52
enumerator ERAD_EVENT_ADCSOCA = 53
enumerator ERAD_EVENT_ADCSOCB = 54
enumerator ERAD_EVENT_CLATASKRUN1 = 55
enumerator ERAD_EVENT_CLATASKRUN2 = 56
enumerator ERAD_EVENT_CLATASKRUN3 = 57
enumerator ERAD_EVENT_CLATASKRUN4 = 58
enumerator ERAD_EVENT_CLATASKRUN5 = 59
enumerator ERAD_EVENT_CLATASKRUN6 = 60
enumerator ERAD_EVENT_CLATASKRUN7 = 61
enumerator ERAD_EVENT_CLATASKRUN8 = 62
enumerator ERAD_EVENT_EPWMXBAR_OUT1 = 63
enumerator ERAD_EVENT_EPWMXBAR_OUT2 = 64
enumerator ERAD_EVENT_EPWMXBAR_OUT3 = 65
enumerator ERAD_EVENT_EPWMXBAR_OUT4 = 66
enumerator ERAD_EVENT_EPWMXBAR_OUT5 = 67
enumerator ERAD_EVENT_EPWMXBAR_OUT6 = 68
enumerator ERAD_EVENT_EPWMXBAR_OUT7 = 69
enumerator ERAD_EVENT_EPWMXBAR_OUT8 = 70
enumerator ERAD_EVENT_INPUTXBAR0 = 71
enumerator ERAD_EVENT_INPUTXBAR1 = 72
enumerator ERAD_EVENT_INPUTXBAR2 = 73
enumerator ERAD_EVENT_INPUTXBAR3 = 74
enumerator ERAD_EVENT_INPUTXBAR4 = 75
enumerator ERAD_EVENT_INPUTXBAR5 = 76
enumerator ERAD_EVENT_INPUTXBAR6 = 77
enumerator ERAD_EVENT_INPUTXBAR7 = 78
enumerator ERAD_EVENT_INPUTXBAR8 = 79
enumerator ERAD_EVENT_INPUTXBAR9 = 80
enumerator ERAD_EVENT_INPUTXBAR10 = 81
enumerator ERAD_EVENT_INPUTXBAR11 = 82
enumerator ERAD_EVENT_INPUTXBAR12 = 83
enumerator ERAD_EVENT_INPUTXBAR13 = 84
enumerator ERAD_EVENT_INPUTXBAR14 = 85
enumerator ERAD_EVENT_INPUTXBAR15 = 86
enumerator ERAD_EVENT_CPUx_CPUSTAT = 87
enumerator ERAD_EVENT_CPUx_DBGACK = 88
enumerator ERAD_EVENT_CPUx_NMI = 89
enumerator ERAD_EVENT_CMPSS1_CTRIPH_OR_CTRIPL = 90
enumerator ERAD_EVENT_CMPSS2_CTRIPH_OR_CTRIPL = 91
enumerator ERAD_EVENT_CMPSS3_CTRIPH_OR_CTRIPL = 92
enumerator ERAD_EVENT_CMPSS4_CTRIPH_OR_CTRIPL = 93
enumerator ERAD_EVENT_CMPSS5_CTRIPH_OR_CTRIPL = 94
enumerator ERAD_EVENT_CMPSS6_CTRIPH_OR_CTRIPL = 95
enumerator ERAD_EVENT_CMPSS7_CTRIPH_OR_CTRIPL = 96
enumerator ERAD_EVENT_CMPSS8_CTRIPH_OR_CTRIPL = 97
enumerator ERAD_EVENT_SD1FLT1_COMPH_OR_COMPL = 98
enumerator ERAD_EVENT_SD1FLT2_COMPH_OR_COMPL = 99
enumerator ERAD_EVENT_SD1FLT3_COMPH_OR_COMPL = 100
enumerator ERAD_EVENT_SD1FLT4_COMPH_OR_COMPL = 101
enumerator ERAD_EVENT_SD2FLT1_COMPH_OR_COMPL = 102
enumerator ERAD_EVENT_SD2FLT2_COMPH_OR_COMPL = 103
enumerator ERAD_EVENT_SD2FLT3_COMPH_OR_COMPL = 104
enumerator ERAD_EVENT_SD2FLT4_COMPH_OR_COMPL = 105
enumerator ERAD_EVENT_ADCAINT1 = 106
enumerator ERAD_EVENT_ADCAINT2 = 107
enumerator ERAD_EVENT_ADCAINT3 = 108
enumerator ERAD_EVENT_ADCAINT4 = 109
enumerator ERAD_EVENT_ADCBINT1 = 110
enumerator ERAD_EVENT_ADCBINT2 = 111
enumerator ERAD_EVENT_ADCBINT3 = 112
enumerator ERAD_EVENT_ADCBINT4 = 113
enumerator ERAD_EVENT_ADCCINT1 = 114
enumerator ERAD_EVENT_ADCCINT2 = 115
enumerator ERAD_EVENT_ADCCINT3 = 116
enumerator ERAD_EVENT_ADCCINT4 = 117
enumerator ERAD_EVENT_ADCCEVTINT = 123
enumerator ERAD_EVENT_MCANB_EVT0 = 125
enumerator ERAD_EVENT_MCANB_EVT1 = 126
enumerator ERAD_EVENT_MCANB_EVT2 = 127
enumerator ERAD_EVENT_CLA_INTERRUPT1 = 128
enumerator ERAD_EVENT_CLA_INTERRUPT2 = 129
enumerator ERAD_EVENT_CLA_INTERRUPT3 = 130
enumerator ERAD_EVENT_CLA_INTERRUPT4 = 131
enumerator ERAD_EVENT_CLA_INTERRUPT5 = 132
enumerator ERAD_EVENT_CLA_INTERRUPT6 = 133
enumerator ERAD_EVENT_CLA_INTERRUPT7 = 134
enumerator ERAD_EVENT_CLA_INTERRUPT8 = 135
enumerator ERAD_EVENT_ECAT_PDI_SOF = 136
enumerator ERAD_EVENT_ECAT_PDI_EOF = 137
enumerator ERAD_EVENT_ECAT_PCI_WD_TRIGGER = 138
enumerator ERAD_EVENT_ECAT_PDI_UC_IRQ = 139
enumerator ERAD_EVENT_ECAT_SYNC_OUT0 = 140
enumerator ERAD_EVENT_ECAT_SYNC_OUT1 = 141
enumerator ERAD_EVENT_ECAT_DRAM_PARITY_ERROR = 142
enumerator ERAD_EVENT_CLBINPUTXBAR0 = 143
enumerator ERAD_EVENT_CLBINPUTXBAR1 = 144
enumerator ERAD_EVENT_CLBINPUTXBAR2 = 145
enumerator ERAD_EVENT_CLBINPUTXBAR3 = 146
enumerator ERAD_EVENT_CLBINPUTXBAR4 = 147
enumerator ERAD_EVENT_CLBINPUTXBAR5 = 148
enumerator ERAD_EVENT_CLBINPUTXBAR6 = 149
enumerator ERAD_EVENT_CLBINPUTXBAR7 = 150
enumerator ERAD_EVENT_CLBINPUTXBAR8 = 151
enumerator ERAD_EVENT_CLBINPUTXBAR9 = 152
enumerator ERAD_EVENT_CLBINPUTXBAR10 = 153
enumerator ERAD_EVENT_CLBINPUTXBAR11 = 154
enumerator ERAD_EVENT_CLBINPUTXBAR12 = 155
enumerator ERAD_EVENT_CLBINPUTXBAR13 = 156
enumerator ERAD_EVENT_CLBINPUTXBAR14 = 157
enumerator ERAD_EVENT_CLBINPUTXBAR15 = 158
enumerator ERAD_EVENT_SD3FLT1_COMPH_OR_COMPL = 159
enumerator ERAD_EVENT_SD3FLT2_COMPH_OR_COMPL = 160
enumerator ERAD_EVENT_SD3FLT3_COMPH_OR_COMPL = 161
enumerator ERAD_EVENT_SD3FLT4_COMPH_OR_COMPL = 162
enumerator ERAD_EVENT_SD4FLT1_COMPH_OR_COMPL = 163
enumerator ERAD_EVENT_SD4FLT2_COMPH_OR_COMPL = 164
enumerator ERAD_EVENT_SD4FLT3_COMPH_OR_COMPL = 165
enumerator ERAD_EVENT_SD4FLT4_COMPH_OR_COMPL = 166
enumerator ERAD_EVENT_FSIB_DATA_PKT_RCVD = 167
enumerator ERAD_EVENT_FSIB_ERROR_PKT_RCVD = 168
enumerator ERAD_EVENT_FSIB_PING_PKT_RCVD = 169
enumerator ERAD_EVENT_FSIB_PING_FRAME_TAG_MATCH = 170
enumerator ERAD_EVENT_FSIB_DATA_FRAME_TAG_MATCH = 171
enumerator ERAD_EVENT_FSIB_ERROR_FRAME_TAG_MATCH = 172
enumerator ERAD_EVENT_FSIB_FRAME_DONE = 173
enumerator ERAD_EVENT_FSIC_DATA_PKT_RCVD = 174
enumerator ERAD_EVENT_FSIC_ERROR_PKT_RCVD = 175
enumerator ERAD_EVENT_FSIC_PING_PKT_RCVD = 176
enumerator ERAD_EVENT_FSIC_PING_FRAME_TAG_MATCH = 177
enumerator ERAD_EVENT_FSIC_DATA_FRAME_TAG_MATCH = 178
enumerator ERAD_EVENT_FSIC_ERROR_FRAME_TAG_MATCH = 179
enumerator ERAD_EVENT_FSIC_FRAME_DONE = 180
enumerator ERAD_EVENT_FSID_DATA_PKT_RCVD = 181
enumerator ERAD_EVENT_FSID_ERROR_PKT_RCVD = 182
enumerator ERAD_EVENT_FSID_PING_PKT_RCVD = 183
enumerator ERAD_EVENT_FSID_PING_FRAME_TAG_MATCH = 184
enumerator ERAD_EVENT_FSID_DATA_FRAME_TAG_MATCH = 185
enumerator ERAD_EVENT_FSID_ERROR_FRAME_TAG_MATCH = 186
enumerator ERAD_EVENT_FSID_FRAME_DONE = 187
enumerator ERAD_EVENT_CMPSS9_CTRIPH_OR_CTRIPL = 188
enumerator ERAD_EVENT_CMPSS10_CTRIPH_OR_CTRIPL = 189
enumerator ERAD_EVENT_CMPSS11_CTRIPH_OR_CTRIPL = 190
enumerator ERAD_EVENT_TRACE_HIT_EVENT = 191
enumerator ERAD_EVENT_CPU2_LCMCMP_ERR = 192
enumerator ERAD_EVENT_DMA_LCMCMP_ERR = 193
enumerator ERAD_EVENT_NO_EVENT = 256
enum ERAD_Mask

Values:

enumerator ERAD_AND_MASK1 = 0
enumerator ERAD_AND_MASK2 = 1
enumerator ERAD_AND_MASK3 = 2
enumerator ERAD_AND_MASK4 = 3
enumerator ERAD_OR_MASK1 = 4
enumerator ERAD_OR_MASK2 = 5
enumerator ERAD_OR_MASK3 = 6
enumerator ERAD_OR_MASK4 = 7
enum ERAD_CRC_Qualifiers

Values that can be passed to ERAD_setCRCQualifier() as the qualifier paramter to specify which events to set as the qualifier for the CRC unit.

Values:

enumerator ERAD_CRC_QUAL_NONE = 0

Use every valid event as qualifier for CRC computation

enumerator ERAD_CRC_QUAL_HWBP1 = 1

CRC Compute Qualified by HWBP_EVENT1.

enumerator ERAD_CRC_QUAL_HWBP2 = 2

CRC Compute Qualified by HWBP_EVENT2.

enumerator ERAD_CRC_QUAL_HWBP3 = 3

CRC Compute Qualified by HWBP_EVENT3.

enumerator ERAD_CRC_QUAL_HWBP4 = 4

CRC Compute Qualified by HWBP_EVENT4.

enumerator ERAD_CRC_QUAL_HWBP5 = 5

CRC Compute Qualified by HWBP_EVENT5.

enumerator ERAD_CRC_QUAL_HWBP6 = 6

CRC Compute Qualified by HWBP_EVENT6.

enumerator ERAD_CRC_QUAL_HWBP7 = 7

CRC Compute Qualified by HWBP_EVENT7.

enumerator ERAD_CRC_QUAL_HWBP8 = 8

CRC Compute Qualified by HWBP_EVENT8.

enumerator ERAD_CRC_QUAL_HWBP_OR1 = 9

CRC Compute Qualified by HWBP_EVENT_OR1.

enumerator ERAD_CRC_QUAL_HWBP_OR2 = 10

CRC Compute Qualified by HWBP_EVENT_OR1.

enumerator ERAD_CRC_QUAL_HWBP_OR3 = 11

CRC Compute Qualified by HWBP_EVENT_OR1.

enumerator ERAD_CRC_QUAL_HWBP_OR4 = 12

CRC Compute Qualified by HWBP_EVENT_OR1.

enumerator ERAD_CRC_QUAL_HWBP_AND1 = 13

CRC Compute Qualified by HWBP_EVENT_AND2.

enumerator ERAD_CRC_QUAL_HWBP_AND2 = 14

CRC Compute Qualified by HWBP_EVENT_AND2.

enumerator ERAD_CRC_QUAL_HWBP_AND3 = 15

CRC Compute Qualified by HWBP_EVENT_AND2.

enumerator ERAD_CRC_QUAL_HWBP_AND4 = 16

CRC Compute Qualified by HWBP_EVENT_AND2.

enum ERAD_Counter_Input_Type

Values that can be passed to ERAD_setCounterInputConditioning() as input_type parameter. To specify which input to condition.

Values:

enumerator ERAD_COUNTER_COUNT_INPUT = 0
enumerator ERAD_COUNTER_START_INPUT = 1
enumerator ERAD_COUNTER_STOP_INPUT = 2
enumerator ERAD_COUNTER_RESET_INPUT = 3
enum ERAD_PCTrace_Windowed_Qualifier

Values that can be passed to ERAD_setPCTraceMode_Windowed() as qualifier parameter

Values:

enumerator ERAD_PCTRACE_WINDOWED_QUAL_HWBP1 = 1
enumerator ERAD_PCTRACE_WINDOWED_QUAL_HWBP2 = 2
enumerator ERAD_PCTRACE_WINDOWED_QUAL_HWBP3 = 3
enumerator ERAD_PCTRACE_WINDOWED_QUAL_HWBP4 = 4
enumerator ERAD_PCTRACE_WINDOWED_QUAL_HWBP5 = 5
enumerator ERAD_PCTRACE_WINDOWED_QUAL_HWBP6 = 6
enumerator ERAD_PCTRACE_WINDOWED_QUAL_HWBP7 = 7
enumerator ERAD_PCTRACE_WINDOWED_QUAL_HWBP8 = 8
enumerator ERAD_PCTRACE_WINDOWED_QUAL_HWBP_OR1 = 9
enumerator ERAD_PCTRACE_WINDOWED_QUAL_HWBP_OR2 = 10
enumerator ERAD_PCTRACE_WINDOWED_QUAL_HWBP_OR3 = 11
enumerator ERAD_PCTRACE_WINDOWED_QUAL_HWBP_OR4 = 12
enumerator ERAD_PCTRACE_WINDOWED_QUAL_HWBP_AND1 = 13
enumerator ERAD_PCTRACE_WINDOWED_QUAL_HWBP_AND2 = 14
enumerator ERAD_PCTRACE_WINDOWED_QUAL_HWBP_AND3 = 15
enumerator ERAD_PCTRACE_WINDOWED_QUAL_HWBP_AND4 = 16

Functions

ERAD_Owner ERAD_getOwnership(void)

Gets the current owner of ERAD.

Return

Owner of ERAD.

Parameters
  • None.: This function returns the current owner of ERAD.

void ERAD_setOwnership(ERAD_Owner owner)

Sets the current owner of ERAD.

This function sets the current owner of ERAD.

Parameters
  • owner: is the Owner of ERAD that is to be set

Return

None.

void ERAD_resetCounter(uint16_t instances)

Resets the counter using the global registers.

This function resets the selected counters using the global registers.

Parameters
  • instances: is the OR’d value of counter instances to be reset. Following macros can be used:

    • ERAD_INST_COUNTER1

    • ERAD_INST_COUNTER2

    • ERAD_INST_COUNTER3

    • ERAD_INST_COUNTER4

Return

None.

void ERAD_enableModules(uint16_t instances)

Enables counters and bus comparators.

This function enables bus comparators and counters whose instances are passed.

Parameters
  • instances: is the OR’d value of instances of the counters and bus comparators. Following macros can be used:

    • ERAD_INST_BUSCOMP1

    • ERAD_INST_BUSCOMP2

    • ERAD_INST_BUSCOMP3

    • ERAD_INST_BUSCOMP4

    • ERAD_INST_BUSCOMP5

    • ERAD_INST_BUSCOMP6

    • ERAD_INST_BUSCOMP7

    • ERAD_INST_BUSCOMP8

    • ERAD_INST_COUNTER1

    • ERAD_INST_COUNTER2

    • ERAD_INST_COUNTER3

    • ERAD_INST_COUNTER4

Return

None.

void ERAD_disableModules(uint16_t instances)

Disables counters and bus comparators.

This function disables bus comparators and counters whose instances are passed.

Parameters
  • instances: is the OR’d value of instances of the counters and bus comparators. Following macros can be used:

    • ERAD_INST_BUSCOMP1

    • ERAD_INST_BUSCOMP2

    • ERAD_INST_BUSCOMP3

    • ERAD_INST_BUSCOMP4

    • ERAD_INST_BUSCOMP5

    • ERAD_INST_BUSCOMP6

    • ERAD_INST_BUSCOMP7

    • ERAD_INST_BUSCOMP8

    • ERAD_INST_COUNTER1

    • ERAD_INST_COUNTER2

    • ERAD_INST_COUNTER3

    • ERAD_INST_COUNTER4

Return

None.

void ERAD_initModule(ERAD_Owner owner)

Initialises ERAD.

This function resets all the counters and disables all bus comparators and counters. Also sets the owner of the ERAD to the required owner.

Parameters
  • owner: is the owner of ERAD that is to be set.

Return

None.

uint16_t ERAD_getHaltStatus(void)

Returns the completed status of any of the modules.

Return

Completed status of all the modules as stored in the global register.

Parameters
  • None.: This function returns the completed status of the counters and bus comparators as stored in the global registers. This allows us to read just one register and see if any of the modules are in a completed state.

uint16_t ERAD_getEventStatus(void)

Returns the event fired status of any of the modules.

Return

Event fired status of all the modules as stored in the global register.

Parameters
  • None.: This function returns the event fired status of the counters and bus comparators as stored in the global registers. This allows us to read just one register and see if any of the modules have fired.

void ERAD_enableNMI(uint16_t instances)

Enables an NMI for the specified modules.

This function enables an NMI to be generated whenever any of the specified counters or bus comparator units generate and event.

Parameters
  • instances: is the OR’d value of the instances of the counters and bus comparator units that need to have an NMI enabled. Following macros can be used:

    • ERAD_INST_BUSCOMP1

    • ERAD_INST_BUSCOMP2

    • ERAD_INST_BUSCOMP3

    • ERAD_INST_BUSCOMP4

    • ERAD_INST_BUSCOMP5

    • ERAD_INST_BUSCOMP6

    • ERAD_INST_BUSCOMP7

    • ERAD_INST_BUSCOMP8

    • ERAD_INST_COUNTER1

    • ERAD_INST_COUNTER2

    • ERAD_INST_COUNTER3

    • ERAD_INST_COUNTER4

Return

None.

void ERAD_disableNMI(uint16_t instances)

Disables an NMI for the specified modules.

This function disables the NMI for the specified counters and bus comparator units.

Parameters
  • instances: is the OR’d value of the instances of the counters and bus comparator units that need to have an NMI disabled. Following macros can be used:

    • ERAD_INST_BUSCOMP1

    • ERAD_INST_BUSCOMP2

    • ERAD_INST_BUSCOMP3

    • ERAD_INST_BUSCOMP4

    • ERAD_INST_BUSCOMP5

    • ERAD_INST_BUSCOMP6

    • ERAD_INST_BUSCOMP7

    • ERAD_INST_BUSCOMP8

    • ERAD_INST_COUNTER1

    • ERAD_INST_COUNTER2

    • ERAD_INST_COUNTER3

    • ERAD_INST_COUNTER4

Return

None.

ERAD_Status ERAD_getBusCompStatus(uint32_t base)

Returns the status of a bus comparator.

This function returns the status of the bus comparator whose base was passed. It may be either

ERAD_STATE_IDLE, ERAD_STATE_ENABLED or ERAD_STATE_COMPLETED.
Parameters
  • base: is the base of the bus comparator.

Return

Status of bus comparator.

void ERAD_clearBusCompEvent(uint32_t base)

Clears the event fired status of any of the modules.

This function clears the event fired status of the bus comparator and brings the module and brings the module back to

ERAD_STATE_IDLE .
Parameters
  • base: is the base of the bus comparator.

Return

None

ERAD_Status ERAD_getCounterStatus(uint32_t base)

Returns the status of a counter.

This function returns the status of the counter whose base was passed. It may be either

ERAD_STATE_IDLE, ERAD_STATE_ENABLED or ERAD_STATE_COMPLETED.
Parameters
  • base: is the base of the counter.

Return

Status of counter.

void ERAD_configBusComp(uint32_t base, ERAD_BusComp_Config config_params)

Configures the bus comparators.

This function configures the bus comparator with the given parameters.

Parameters
  • base: is the base of the bus comparator to be configured.

  • config_params: are the configuration parameters to be used to configure the bus comparator.

Return

None.

void ERAD_configCounterInCountingMode(uint32_t base, ERAD_Counter_Config config_params)

Configures the counter in Counting mode.

This function configures the counter with the given parameters. The counter is setup in Counting mode, which means counting begins as soon as the counter is enabled. NOTE: This function does not enable the counter. The counter must be enabled using the

ERAD_enableModules method to begin counting.
Parameters
  • base: is the base of the counter to be configured.

  • config_params: are the configuration parameters to be used to configure the counter.

Return

None.

void ERAD_configCounterInStartStopMode(uint32_t base, ERAD_Counter_Config config_params, ERAD_Counter_Input_Event start_event, ERAD_Counter_Input_Event stop_event)

Configures the counter in Start-Stop mode.

This function configures the counter with the given parameters. The counter is setup in Start-Stop mode, which means counting will happen only between two specified events. The event that will be counted can be any of the

ERAD_Counter_Input_Event and not only CPU cycles. NOTE: ERAD_EVENT_NO_EVENT causes the counter to use the CPU cycles. NOTE: This function does not enable the counter. The counter must be enabled using the ERAD_enableModules method to begin counting.
Parameters
  • base: is the base of the counter to be configured.

  • config_params: are the configuration parameters to be used to configure the counter.

  • start_event: is the event that starts the counter

  • stop_event: is the event which stops that counter

Return

None.

void ERAD_configCounterInCumulativeMode(uint32_t base, ERAD_Counter_Config config_params, ERAD_Counter_Input_Event start_event, ERAD_Counter_Input_Event stop_event)

Configures the counter in Start-Stop Cumulative mode.

This function configures the counter with the given parameters. The counter is setup in Cumulative mode, which means counting will happen only between two specified events and the counter will not reset on

stop_event. The event that will be counted can be any of the ERAD_Counter_Input_Event and not only CPU cycles. NOTE: ERAD_EVENT_NO_EVENT causes the counter to use the CPU cycles. NOTE: This function does not enable the counter. The counter must be enabled using the ERAD_enableModules method to begin counting.
Parameters
  • base: is the base of the counter to be configured.

  • config_params: are the configuration parameters to be used to configure the counter.

  • start_event: is the event that starts the counter

  • stop_event: is the event which stops that counter

Return

None.

void ERAD_configMask(ERAD_Mask mask, uint32_t instances, bool enable_int)

Configures the AND and OR masks

This function enables the event generated from the specified bus comparator units to be used for the specified Mask. It also configures the interrupt generation when the mask event occurs.

Parameters
  • mask: is the Mask to be used.

  • instances: is the OR’d value of the instances of the bus comparator units whose events need to be used for the mask. Following macros can be used:

    • ERAD_INST_BUSCOMP1

    • ERAD_INST_BUSCOMP2

    • ERAD_INST_BUSCOMP3

    • ERAD_INST_BUSCOMP4

    • ERAD_INST_BUSCOMP5

    • ERAD_INST_BUSCOMP6

    • ERAD_INST_BUSCOMP7

    • ERAD_INST_BUSCOMP8

    • ERAD_INST_COUNTER1

    • ERAD_INST_COUNTER2

    • ERAD_INST_COUNTER3

    • ERAD_INST_COUNTER4

  • enable_int: True if interrupt needs to be enabled, False if not

Return

None.

void ERAD_enableCounterResetInput(uint32_t base, ERAD_Counter_Input_Event reset_event)

Configures the reset event of the counter.

This function sets the event upon which the counter must reset and enables reset upon such an event.

Parameters
  • base: is the base of the counter to be configured.

  • reset_event: is the event upon which the counter must be reset.

Return

None.

void ERAD_disableCounterResetInput(uint32_t base)

Disables the reset event of the counter.

This function disables the reset event that may have been set earlier

Parameters
  • base: is the base of the counter.

Return

None.

void ERAD_clearCounterEvent(uint32_t base)

Clears an event that may have fired in the counter upon match.

This function clears a counter event that may have fired when the counter hit a match.

Parameters
  • base: is the base of the counter.

Return

None.

void ERAD_clearCounterOverflow(uint32_t base)

Clears an overflow that may have occured in the counter.

This function clears the overflow bit that may have got set when the counter may have crossed 0xFFFFFFFF.

Parameters
  • base: is the base of the counter.

Return

None.

uint32_t ERAD_getCurrentCount(uint32_t base)

Gets the current count of a counter.

This function returns the current count of the counter which was configured earlier.

Parameters
  • base: is the base of the counter.

Return

Returns the value of the current count of the counter.

void ERAD_setCurrentCount(uint32_t base, uint32_t value)

Sets the current count of a counter.

This function sets the current count of the counter which was configured earlier. This can be used to reset the counter or start at a value other than 0.

Parameters
  • base: is the base of the counter.

  • value: is the value to be written as the current count.

Return

None.

uint32_t ERAD_getMaxCount(uint32_t base)

Gets the maximum count of a counter.

This function returns the current maximum count of the counter which was configured earlier.

Parameters
  • base: is the base of the counter.

Return

Returns the value of the current maximum count of the counter.

void ERAD_setMaxCount(uint32_t base, uint32_t value)

Sets the maximum count of a counter.

This function sets the current maximum count of the counter which was configured earlier.

Parameters
  • base: is the base of the counter.

  • value: is the value to be written as the maximum count.

Return

None.

void ERAD_setCounterInputConditioning(uint32_t base, ERAD_Counter_Input_Type input_type, uint16_t options)

Sets conditioning on the inputs to the counter.

This function conditions the inputs to the counter specified. This includes inverting the input and enabling a 2-stage synchronizer for any 4 of the inputs:

reset, stop, start, count_input.
Parameters
  • base: is the base value of the counter to be configured

  • input_type: defines which input needs to be conditioned

  • options: is the kind of conditioning that needs to applied. This will be an OR’d value of ERAD_INVERT_ENABLE, ERAD_INVERT_DISABLE, ERAD_SYNC_ENABLE or ERAD_SYNC_DISABLE.

Return

None.

void ERAD_initCRC(uint16_t instances)

Initialises the CRC unit.

This function initialises the specified CRC units.

Parameters
  • instances: is the OR’d value of CRC instances. Following macros can be used:

    • ERAD_INST_CRC1

    • ERAD_INST_CRC2

    • ERAD_INST_CRC3

    • ERAD_INST_CRC4

    • ERAD_INST_CRC5

    • ERAD_INST_CRC6

    • ERAD_INST_CRC7

    • ERAD_INST_CRC8

Return

None.

void ERAD_enableCRC(uint16_t instances)

Enables the CRC unit.

This function enables the specified CRC units.

Parameters
  • instances: is the OR’d value of CRC instances. Following macros can be used:

    • ERAD_INST_CRC1

    • ERAD_INST_CRC2

    • ERAD_INST_CRC3

    • ERAD_INST_CRC4

    • ERAD_INST_CRC5

    • ERAD_INST_CRC6

    • ERAD_INST_CRC7

    • ERAD_INST_CRC8

Return

None.

void ERAD_disableCRC(uint16_t instances)

Disables the CRC unit.

This function disables the specified CRC units.

Parameters
  • instances: is the OR’d value of CRC instances. Following macros can be used:

    • ERAD_INST_CRC1

    • ERAD_INST_CRC2

    • ERAD_INST_CRC3

    • ERAD_INST_CRC4

    • ERAD_INST_CRC5

    • ERAD_INST_CRC6

    • ERAD_INST_CRC7

    • ERAD_INST_CRC8

Return

None.

uint32_t ERAD_getCurrentCRC(uint32_t base)

Gets the current value of the CRC unit.

This function returns the current value of te specified CRC unit.

Parameters
  • base: is the base value of CRC unit

Return

Current CRC value.

void ERAD_setSeed(uint32_t base, uint32_t seed)

Sets the seed value of the CRC unit

This function sets a seed value of the CRC unit. Note: The corresponding CRC unit must be disabled before setting the seed value.

Parameters
  • base: is the base value of the CRC unit

  • seed: is the value of seed to be set

Return

None.

void ERAD_setCRCQualifier(uint32_t base, ERAD_CRC_Qualifiers qualifier)

Sets the qualifier event of the CRC unit

This function sets a qualifier to decide which events require a CRC computation. Note: The corresponding CRC unit must be disabled before setting the qualifier.

Parameters
  • base: is the base value of the CRC unit

  • qualifier: is the type of qualifier to be set

Return

None.

void ERAD_enablePCTrace(void)

Enable PC Trace

This function enables PC Trace

Return

None.

void ERAD_disablePCTrace(void)

Disable PC Trace

This function disables PC Trace

Return

None.

void ERAD_initPCTraceBuffer(void)

Initialize PC Trace Buffer

This function initilizes the Trace module for a fresh trace start with buffer pointer reset and overflow flags cleared along with SOFT_START_PC and SOFT_STOP_PC

Return

None.

void ERAD_setPCTraceMode_NoQualifiers(void)

Configures the PC Trace submodule to trace without hardware qaulifiers

Return

None.

void ERAD_setPCTraceMode_Windowed(ERAD_PCTrace_Windowed_Qualifier qualifier, uint32_t inputConditioning)

Configures the PC Trace submodule to trace using windowed mode

Return

None.

Parameters
  • qualifier: Qualifier input to enable tracing

  • inputConditioning: is the kind of conditioning that needs to applied for the trace input. This will be an OR’d value of ERAD_INPUT_INVERT_ENABLE or ERAD_INPUT_INVERT_DISABLE and ERAD_INPUT_SYNC_ENABLE or ERAD_INPUT_SYNC_DISABLE.

void ERAD_setPCTraceMode_StartSop(ERAD_Counter_Input_Event startInput, uint32_t startInputConditioning, ERAD_Counter_Input_Event stopInput, uint32_t stopInputConditioning)

Configures the PC Trace submodule to trace using start stop mode

Return

None.

Parameters
  • startInput: Start Event for the Trace

  • stopInput: Stop Event for the Trace

  • startInputConditioning: is the kind of conditioning that needs to applied for the start input. This will be an OR’d value of ERAD_INPUT_INVERT_ENABLE or ERAD_INPUT_INVERT_DISABLE and ERAD_INPUT_SYNC_ENABLE or ERAD_INPUT_SYNC_DISABLE.

  • stopInputConditioning: is the kind of conditioning that needs to applied for the start input. This will be an OR’d value of ERAD_INPUT_INVERT_ENABLE or ERAD_INPUT_INVERT_DISABLE and ERAD_INPUT_SYNC_ENABLE or ERAD_INPUT_SYNC_DISABLE.

void ERAD_profile(ERAD_Profile_Params config_params)

Configures the ERAD to profile a certain piece of code

This function configures 2 bus comparators and 1 counter to profile a certain piece of code. The base address of the bus comparators and the counter to be used are specified in

config_params. Note: Use ERAD_getMaxCount to get the latest profiled value. The maximum count of the counter being used must be reset to 0x0 to get the correct value everytime.
Parameters
  • config_params: are the parameters that will be used to configure ERAD

Return

None.

void ERAD_enableInterruptOnAddressHit(ERAD_AddressHit_Params config_params, uint32_t busComp_base)

Enables an RTOS interrupt at a specified address.

This function enables an RTOS interrupt to be generated when an address in memory or instruction is hit.

Parameters
  • config_params: contrains the bus to be monitored and the address

  • busComp_base: is the base of the bus compoarator to be used

If the selected bus is ERAD_BUSCOMP_BUS_PAB, then the ERAD will be configured to trigger an interrupt when there is instruction fetch happening at the specified address. Similary, if ERAD_BUSCOMP_BUS_DWAB is selected, the ERAD will be configured to trigger an interrupt when there write access to the specified address, and so on.

Use

Return

None.

void ERAD_countAddressHits(ERAD_AddressHit_Params config_params, uint32_t busComp_base, uint32_t counter_base)

Configures the ERAD to count the number of times a the specified address is hit

This function configures 1 bus comparator and 1 counter to count how many times a the specified address is hit.

Parameters
  • config_params: are the parameters that will be used to configure ERAD

  • busComp_base: is the base of the bus compoarator to be used

  • counter_base: is the base of the counter to be used

If the selected bus is ERAD_BUSCOMP_BUS_PAB, then the ERAD will be configured to count the number of times an instruction fetch happens at the specified address. Similary, if ERAD_BUSCOMP_BUS_DWAB is selected, the ERAD will be configured to count the number of times there is a write access to the specified address, and so on.

Return

None.

struct ERAD_BusComp_Config
#include <erad.h>

Structure that is passed to ERAD_configBusComp() as config_params to configure a bus comparator.

struct ERAD_Profile_Params
#include <erad.h>

Structure that is passed to ERAD_profile() as config_params to setup the required modules appropriately for each use case.

struct ERAD_Counter_Config
#include <erad.h>

Structure that is passed to ERAD_configCounterInStartStopMode() and ERA_configCounterInCountingMode() as config_params to setup a counter appropriately.

struct ERAD_AddressHit_Params
#include <erad.h>

Structure that is passed to ERAD_enableInterruptOnAddressHit() and ERAD_countAddressHits() as config_params to select the bus and the address to compare. bus_Sel can be one of the following: ERAD_BUSCOMP_BUS_PAB : for instruction fetch at the address ERAD_BUSCOMP_BUS_DWAB : for data write access to the address ERAD_BUSCOMP_BUS_DRAB : for data read access to the address

The code for this module is contained in driverlib/erad.c, with driverlib/erad.h containing the API declarations for use by applications.