2 * @brief System Pmu Header File
7 * - Pmu Interface Functions
9 * which are relevant for the performance monitor unit driver.
12 /* (c) Texas Instruments 2009-2012, All rights reserved. */
19 /* USER CODE BEGIN (0) */
23 * @brief pmu event counter 0
25 * Alias for pmu event counter 0
27 #define pmuCOUNTER0 0x00000001U
30 * @brief pmu event counter 1
32 * Alias for pmu event counter 1
34 #define pmuCOUNTER1 0x00000002U
37 * @brief pmu event counter 2
39 * Alias for pmu event counter 2
41 #define pmuCOUNTER2 0x00000004U
43 /** @def pmuCYCLE_COUNTER
44 * @brief pmu cycle counter
46 * Alias for pmu event counter
48 #define pmuCYCLE_COUNTER 0x80000000U
53 * Alias for pmu event counter increment source
57 PMU_INST_CACHE_MISS = 0x01,
58 PMU_DATA_CACHE_MISS = 0x03,
59 PMU_DATA_CACHE_ACCESS = 0x04,
60 PMU_DATA_READ_ARCH_EXECUTED = 0x06,
61 PMU_DATA_WRITE_ARCH_EXECUTED = 0x07,
62 PMU_INST_ARCH_EXECUTED = 0x08,
63 PMU_EXCEPTION_TAKEN = 0x09,
64 PMU_EXCEPTION_RETURN_ARCH_EXECUTED = 0x0A,
65 PMU_CHANGE_TO_CONTEXT_ID_EXECUTED = 0x0B,
66 PMU_SW_CHANGE_OF_PC_ARCH_EXECUTED = 0x0C,
67 PMU_BRANCH_IMM_INST_ARCH_EXECUTED = 0x0D,
68 PMU_PROC_RETURN_ARCH_EXECUTED = 0x0E,
69 PMU_UNALIGNED_ACCESS_ARCH_EXECUTED = 0x0F,
70 PMU_BRANCH_MISSPREDICTED = 0x10,
71 PMU_CYCLE_COUNT = 0x11,
72 PMU_PREDICTABLE_BRANCHES = 0x12,
73 PMU_INST_BUFFER_STALL = 0x40,
74 PMU_DATA_DEPENDENCY_INST_STALL = 0x41,
75 PMU_DATA_CACHE_WRITE_BACK = 0x42,
76 PMU_EXT_MEMORY_REQUEST = 0x43,
77 PMU_LSU_BUSY_STALL = 0x44,
78 PMU_FORCED_DRAIN_OFSTORE_BUFFER = 0x45,
79 PMU_FIQ_DISABLED_CYCLE_COUNT = 0x46,
80 PMU_IRQ_DISABLED_CYCLE_COUNT = 0x47,
81 PMU_ETMEXTOUT_0 = 0x48,
82 PMU_ETMEXTOUT_1 = 0x49,
83 PMU_INST_CACHE_TAG_ECC_ERROR = 0x4A,
84 PMU_INST_CACHE_DATA_ECC_ERROR = 0x4B,
85 PMU_DATA_CACHE_TAG_ECC_ERROR = 0x4C,
86 PMU_DATA_CACHE_DATA_ECC_ERROR = 0x4D,
87 PMU_TCM_FATAL_ECC_ERROR_PREFETCH = 0x4E,
88 PMU_TCM_FATAL_ECC_ERROR_LOAD_STORE = 0x4F,
89 PMU_STORE_BUFFER_MERGE = 0x50,
90 PMU_LSU_STALL_STORE_BUFFER_FULL = 0x51,
91 PMU_LSU_STALL_STORE_QUEUE_FULL = 0x52,
92 PMU_INTEGER_DIV_EXECUTED = 0x53,
93 PMU_STALL_INTEGER_DIV = 0x54,
94 PMU_PLD_INST_LINE_FILL = 0x55,
95 PMU_PLD_INST_NO_LINE_FILL = 0x56,
96 PMU_NON_CACHEABLE_ACCESS_AXI_MASTER = 0x57,
97 PMU_INST_CACHE_ACCESS = 0x58,
98 PMU_DOUBLE_DATA_CACHE_ISSUE = 0x59,
99 PMU_DUAL_ISSUE_CASE_A = 0x5A,
100 PMU_DUAL_ISSUE_CASE_B1_B2_F2_F2D = 0x5B,
101 PMU_DUAL_ISSUE_OTHER = 0x5C,
102 PMU_DP_FLOAT_INST_EXCECUTED = 0x5D,
103 PMU_DUAL_ISSUED_PAIR_INST_ARCH_EXECUTED = 0x5E,
104 PMU_DATA_CACHE_DATA_FATAL_ECC_ERROR = 0x60,
105 PMU_DATA_CACHE_TAG_FATAL_ECC_ERROR = 0x61,
106 PMU_PROCESSOR_LIVE_LOCK = 0x62,
107 PMU_ATCM_MULTI_BIT_ECC_ERROR = 0x64,
108 PMU_B0TCM_MULTI_BIT_ECC_ERROR = 0x65,
109 PMU_B1TCM_MULTI_BIT_ECC_ERROR = 0x66,
110 PMU_ATCM_SINGLE_BIT_ECC_ERROR = 0x67,
111 PMU_B0TCM_SINGLE_BIT_ECC_ERROR = 0x68,
112 PMU_B1TCM_SINGLE_BIT_ECC_ERROR = 0x69,
113 PMU_TCM_COR_ECC_ERROR_LOAD_STORE = 0x6A,
114 PMU_TCM_COR_ECC_ERROR_PREFETCH = 0x6B,
115 PMU_TCM_FATAL_ECC_ERROR_AXI_SLAVE = 0x6C,
116 PMU_TCM_COR_ECC_ERROR_AXI_SLAVE = 0x6D
119 /** @fn void _pmuInit_(void)
120 * @brief Initialize Perfprmance Monitor Unit
122 void _pmuInit_(void);
124 /** @fn void _pmuEnableCountersGlobal_(void)
125 * @brief Enable and reset cycle counter and all 3 event counters
127 void _pmuEnableCountersGlobal_(void);
129 /** @fn void _pmuDisableCountersGlobal_(void)
130 * @brief Disable cycle counter and all 3 event counters
132 void _pmuDisableCountersGlobal_(void);
134 /** @fn void _pmuResetCycleCounter_(void)
135 * @brief Reset cycle counter
137 void _pmuResetCycleCounter_(void);
139 /** @fn void _pmuResetEventCounters_(void)
140 * @brief Reset event counters 0-2
142 void _pmuResetEventCounters_(void);
144 /** @fn void _pmuResetCounters_(void)
145 * @brief Reset cycle counter and event counters 0-2
147 void _pmuResetCounters_(void);
149 /** @fn void _pmuStartCounters_(uint32_t counters)
150 * @brief Starts selected counters
151 * @param[in] counters - Counter mask
153 void _pmuStartCounters_(uint32_t counters);
155 /** @fn void _pmuStopCounters_(uint32_t counters)
156 * @brief Stops selected counters
157 * @param[in] counters - Counter mask
159 void _pmuStopCounters_(uint32_t counters);
161 /** @fn void _pmuSetCountEvent_(uint32_t counter, uint32_t event)
162 * @brief Set event counter count event
163 * @param[in] counter - Counter select 0..2
164 * @param[in] event - Count event
166 void _pmuSetCountEvent_(uint32_t counter, uint32_t event);
168 /** @fn uint32_t _pmuGetCycleCount_(void)
169 * @brief Returns current cycle counter value
171 * @return cycle count.
173 uint32_t _pmuGetCycleCount_(void);
175 /** @fn uint32_t _pmuGetEventCount_(uint32_t counter)
176 * @brief Returns current event counter value
177 * @param[in] counter - Counter select 0..2
179 * @return event counter count.
181 uint32_t _pmuGetEventCount_(uint32_t counter);
183 /** @fn uint32_t _pmuGetOverflow_(void)
184 * @brief Returns current overflow register and clear flags
186 * @return overflow flags.
188 uint32_t _pmuGetOverflow_(void);