2 * @file IxPerfProfAcc.h
4 * @brief Header file for the IXP400 Perf Prof component (IxPerfProfAcc)
8 * IXP400 SW Release version 2.0
10 * -- Copyright Notice --
13 * Copyright 2001-2005, Intel Corporation.
14 * All rights reserved.
17 * SPDX-License-Identifier: BSD-3-Clause
19 * -- End of Copyright Notice --
23 * @defgroup IxPerfProfAcc IXP400 Performance Profiling (IxPerfProfAcc) API
25 * @brief IXP400 Performance Profiling Utility component Public API.
26 * @li NOTE: Xcycle measurement is not supported in Linux.
31 #ifndef IXPERFPROFACC_H
32 #define IXPERFPROFACC_H
37 #include <linux/proc_fs.h>
44 * @ingroup IxPerfProfAcc
46 * @def IX_PERFPROF_ACC_XSCALE_PMU_MAX_PROFILE_SAMPLES
48 * @brief This is the maximum number of profiling samples allowed, which can be
49 * modified according to the user's discretion
51 #define IX_PERFPROF_ACC_XSCALE_PMU_MAX_PROFILE_SAMPLES 0xFFFF
54 * @ingroup IxPerfProfAcc
56 * @def IX_PERFPROF_ACC_BUS_PMU_MAX_PECS
58 * @brief This is the maximum number of Programmable Event Counters available.
59 * This is a hardware specific and fixed value. Do not change.
62 #define IX_PERFPROF_ACC_BUS_PMU_MAX_PECS 7
65 * @ingroup IxPerfProfAcc
67 * @def IX_PERFPROF_ACC_XCYCLE_MAX_NUM_OF_MEASUREMENTS
69 * @brief Max number of measurement allowed. This constant is used when
70 * creating storage array for Xcycle. When run in continuous mode,
71 * Xcycle will wrap around and re-use buffer.
73 #define IX_PERFPROF_ACC_XCYCLE_MAX_NUM_OF_MEASUREMENTS 600
77 * @ingroup IxPerfProfAcc
79 * @def IX_PERFPROF_ACC_XSCALE_PMU_SYMBOL_ACCURACY
81 * @brief Level of accuracy required for matching the PC Address to
82 * symbol address. This is used when the XScale PMU time/event
83 * sampling functions get the PC address and search for the
84 * corresponding symbol address.
86 #define IX_PERFPROF_ACC_XSCALE_PMU_SYMBOL_ACCURACY 0xffff
91 * @ingroup IxPerfProfAcc
93 * @def IX_PERFPROF_ACC_LOG
95 * @brief Mechanism for logging a formatted message for the PerfProfAcc component
97 * @param level UINT32 [in] - trace level
98 * @param device UINT32 [in] - output device
99 * @param str char* [in] - format string, similar to printf().
100 * @param a UINT32 [in] - first argument to display
101 * @param b UINT32 [in] - second argument to display
102 * @param c UINT32 [in] - third argument to display
103 * @param d UINT32 [in] - fourth argument to display
104 * @param e UINT32 [in] - fifth argument to display
105 * @param f UINT32 [in] - sixth argument to display
110 #define IX_PERFPROF_ACC_LOG(level, device, str, a, b, c, d, e, f)\
111 (ixOsalLog (level, device, str, a, b, c, d, e, f))
113 #define IX_PERFPROF_ACC_LOG(level, device, str, a, b, c, d, e, f)
114 #endif /*ifdef NDEBUG */
121 * @brief contains summary of samples taken
123 * Structure contains all details of each program counter value - frequency
128 UINT32 programCounter; /**<the program counter value of the sample*/
129 UINT32 freq; /**<the frequency of the occurence of the sample*/
130 } IxPerfProfAccXscalePmuSamplePcProfile;
133 * @brief contains results of a counter
135 * Structure contains the results of a counter, which are split into the lower
136 * and upper 32 bits of the final count
140 UINT32 lower32BitsEventCount; /**<lower 32bits value of the event counter*/
141 UINT32 upper32BitsEventCount; /**<upper 32bits value of the event counter*/
142 } IxPerfProfAccXscalePmuEvtCnt;
145 * @brief contains results of counters and their overflow
147 * Structure contains all values of counters and associated overflows. The
148 * specific event and clock counters are determined by the user
152 UINT32 clk_value; /**<current value of clock counter*/
153 UINT32 clk_samples; /**<number of clock counter overflows*/
154 UINT32 event1_value; /**<current value of event 1 counter*/
155 UINT32 event1_samples; /**<number of event 1 counter overflows*/
156 UINT32 event2_value; /**<current value of event 2 counter*/
157 UINT32 event2_samples; /**<number of event 2 counter overflows*/
158 UINT32 event3_value; /**<current value of event 3 counter*/
159 UINT32 event3_samples; /**<number of event 3 counter overflows*/
160 UINT32 event4_value; /**<current value of event 4 counter*/
161 UINT32 event4_samples; /**<number of event 4 counter overflows*/
162 } IxPerfProfAccXscalePmuResults;
166 * @brief Results obtained from Xcycle run
170 float maxIdlePercentage; /**<maximum percentage of Idle cycles*/
171 float minIdlePercentage; /**<minimum percentage of Idle cycles*/
172 float aveIdlePercentage; /**<average percentage of Idle cycles*/
173 UINT32 totalMeasurements; /**<total number of measurement made */
174 } IxPerfProfAccXcycleResults;
178 * @brief Results obtained from running the Bus Pmu component. The results
179 * are obtained when the get functions is called.
184 UINT32 statsToGetLower27Bit[IX_PERFPROF_ACC_BUS_PMU_MAX_PECS]; /**<Lower 27 Bit of counter value */
185 UINT32 statsToGetUpper32Bit[IX_PERFPROF_ACC_BUS_PMU_MAX_PECS]; /**<Upper 32 Bit of counter value */
186 } IxPerfProfAccBusPmuResults;
193 * @ingroup IxPerfProfAcc
195 * @enum IxPerfProfAccBusPmuEventCounters1
197 * @brief Type of bus pmu events supported on PEC 1.
199 * Lists all bus pmu events.
203 IX_PERFPROF_ACC_BUS_PMU_PEC1_NORTH_NPEA_GRANT_SELECT = 1, /**< Select North NPEA grant on PEC1*/
204 IX_PERFPROF_ACC_BUS_PMU_PEC1_NORTH_NPEB_GRANT_SELECT, /**< Select North NPEB grant on PEC1*/
205 IX_PERFPROF_ACC_BUS_PMU_PEC1_NORTH_NPEC_GRANT_SELECT, /**< Select North NPEC grant on PEC1*/
206 IX_PERFPROF_ACC_BUS_PMU_PEC1_NORTH_BUS_IDLE_SELECT, /**< Select North bus idle on PEC1*/
207 IX_PERFPROF_ACC_BUS_PMU_PEC1_NORTH_NPEA_REQ_SELECT, /**< Select North NPEA req on PEC1*/
208 IX_PERFPROF_ACC_BUS_PMU_PEC1_NORTH_NPEB_REQ_SELECT, /**< Select North NPEB req on PEC1*/
209 IX_PERFPROF_ACC_BUS_PMU_PEC1_NORTH_NPEC_REQ_SELECT, /**< Select North NPEC req on PEC1*/
211 IX_PERFPROF_ACC_BUS_PMU_PEC1_SOUTH_GSKT_GRANT_SELECT, /**< Select south gasket grant on PEC1*/
212 IX_PERFPROF_ACC_BUS_PMU_PEC1_SOUTH_ABB_GRANT_SELECT, /**< Select south abb grant on PEC1*/
213 IX_PERFPROF_ACC_BUS_PMU_PEC1_SOUTH_PCI_GRANT_SELECT, /**< Select south pci grant on PEC1*/
214 IX_PERFPROF_ACC_BUS_PMU_PEC1_SOUTH_APB_GRANT_SELECT, /**< Select south apb grant on PEC1*/
215 IX_PERFPROF_ACC_BUS_PMU_PEC1_SOUTH_GSKT_REQ_SELECT, /**< Select south gasket request on PEC1*/
216 IX_PERFPROF_ACC_BUS_PMU_PEC1_SOUTH_ABB_REQ_SELECT, /**< Select south abb request on PEC1*/
217 IX_PERFPROF_ACC_BUS_PMU_PEC1_SOUTH_PCI_REQ_SELECT, /**< Select south pci request on PEC1*/
218 IX_PERFPROF_ACC_BUS_PMU_PEC1_SOUTH_APB_REQ_SELECT, /**< Select south apb request on PEC1*/
220 IX_PERFPROF_ACC_BUS_PMU_PEC1_SDR_0_HIT_SELECT, /**< Select sdram0 hit on PEC1*/
221 IX_PERFPROF_ACC_BUS_PMU_PEC1_SDR_1_HIT_SELECT, /**< Select sdram1 hit on PEC1*/
222 IX_PERFPROF_ACC_BUS_PMU_PEC1_SDR_2_HIT_SELECT, /**< Select sdram2 hit on PEC1*/
223 IX_PERFPROF_ACC_BUS_PMU_PEC1_SDR_3_HIT_SELECT, /**< Select sdram3 hit on PEC1*/
224 IX_PERFPROF_ACC_BUS_PMU_PEC1_SDR_4_MISS_SELECT, /**< Select sdram4 miss on PEC1*/
225 IX_PERFPROF_ACC_BUS_PMU_PEC1_SDR_5_MISS_SELECT, /**< Select sdram5 miss on PEC1*/
226 IX_PERFPROF_ACC_BUS_PMU_PEC1_SDR_6_MISS_SELECT, /**< Select sdram6 miss on PEC1*/
227 IX_PERFPROF_ACC_BUS_PMU_PEC1_SDR_7_MISS_SELECT /**< Select sdram7 miss on PEC1*/
228 } IxPerfProfAccBusPmuEventCounters1;
231 * @ingroup IxPerfProfAcc
233 * @enum IxPerfProfAccBusPmuEventCounters2
235 * @brief Type of bus pmu events supported on PEC 2.
237 * Lists all bus pmu events.
241 IX_PERFPROF_ACC_BUS_PMU_PEC2_NORTH_NPEA_XFER_SELECT = 24, /**< Select North NPEA transfer on PEC2*/
242 IX_PERFPROF_ACC_BUS_PMU_PEC2_NORTH_NPEB_XFER_SELECT, /**< Select North NPEB transfer on PEC2*/
243 IX_PERFPROF_ACC_BUS_PMU_PEC2_NORTH_NPEC_XFER_SELECT, /**< Select North NPEC transfer on PEC2*/
244 IX_PERFPROF_ACC_BUS_PMU_PEC2_NORTH_BUS_WRITE_SELECT, /**< Select North bus write on PEC2*/
245 IX_PERFPROF_ACC_BUS_PMU_PEC2_NORTH_NPEA_OWN_SELECT, /**< Select North NPEA own on PEC2*/
246 IX_PERFPROF_ACC_BUS_PMU_PEC2_NORTH_NPEB_OWN_SELECT, /**< Select North NPEB own on PEC2*/
247 IX_PERFPROF_ACC_BUS_PMU_PEC2_NORTH_NPEC_OWN_SELECT, /**< Select North NPEC own on PEC2*/
249 IX_PERFPROF_ACC_BUS_PMU_PEC2_SOUTH_GSKT_XFER_SELECT, /**< Select South gasket transfer on PEC2*/
250 IX_PERFPROF_ACC_BUS_PMU_PEC2_SOUTH_ABB_XFER_SELECT, /**< Select South abb transfer on PEC2*/
251 IX_PERFPROF_ACC_BUS_PMU_PEC2_SOUTH_PCI_XFER_SELECT, /**< Select South pci transfer on PEC2*/
252 IX_PERFPROF_ACC_BUS_PMU_PEC2_SOUTH_APB_XFER_SELECT, /**< Select South apb transfer on PEC2*/
253 IX_PERFPROF_ACC_BUS_PMU_PEC2_SOUTH_GSKT_OWN_SELECT, /**< Select South gasket own on PEC2*/
254 IX_PERFPROF_ACC_BUS_PMU_PEC2_SOUTH_ABB_OWN_SELECT, /**< Select South abb own on PEC2*/
255 IX_PERFPROF_ACC_BUS_PMU_PEC2_SOUTH_PCI_OWN_SELECT, /**< Select South pci own on PEC2*/
256 IX_PERFPROF_ACC_BUS_PMU_PEC2_SOUTH_APB_OWN_SELECT, /**< Select South apb own transfer on PEC2*/
258 IX_PERFPROF_ACC_BUS_PMU_PEC2_SDR_1_HIT_SELECT, /**< Select sdram1 hit on PEC2*/
259 IX_PERFPROF_ACC_BUS_PMU_PEC2_SDR_2_HIT_SELECT, /**< Select sdram2 hit on PEC2*/
260 IX_PERFPROF_ACC_BUS_PMU_PEC2_SDR_3_HIT_SELECT, /**< Select sdram3 hit on PEC2*/
261 IX_PERFPROF_ACC_BUS_PMU_PEC2_SDR_4_HIT_SELECT, /**< Select sdram4 hit on PEC2*/
262 IX_PERFPROF_ACC_BUS_PMU_PEC2_SDR_5_MISS_SELECT, /**< Select sdram5 miss on PEC2*/
263 IX_PERFPROF_ACC_BUS_PMU_PEC2_SDR_6_MISS_SELECT, /**< Select sdram6 miss on PEC2*/
264 IX_PERFPROF_ACC_BUS_PMU_PEC2_SDR_7_MISS_SELECT, /**< Select sdram7 miss on PEC2*/
265 IX_PERFPROF_ACC_BUS_PMU_PEC2_SDR_0_MISS_SELECT /**< Select sdram0 miss on PEC2*/
266 } IxPerfProfAccBusPmuEventCounters2;
269 * @ingroup IxPerfProfAcc
271 * @enum IxPerfProfAccBusPmuEventCounters3
273 * @brief Type of bus pmu events supported on PEC 3.
275 * Lists all bus pmu events.
279 IX_PERFPROF_ACC_BUS_PMU_PEC3_NORTH_NPEA_RETRY_SELECT = 47, /**< Select north NPEA retry on PEC3*/
280 IX_PERFPROF_ACC_BUS_PMU_PEC3_NORTH_NPEB_RETRY_SELECT, /**< Select north NPEB retry on PEC3*/
281 IX_PERFPROF_ACC_BUS_PMU_PEC3_NORTH_NPEC_RETRY_SELECT, /**< Select north NPEC retry on PEC3*/
282 IX_PERFPROF_ACC_BUS_PMU_PEC3_NORTH_BUS_READ_SELECT, /**< Select north bus read on PEC3*/
283 IX_PERFPROF_ACC_BUS_PMU_PEC3_NORTH_NPEA_WRITE_SELECT, /**< Select north NPEA write on PEC3*/
284 IX_PERFPROF_ACC_BUS_PMU_PEC3_NORTH_NPEB_WRITE_SELECT, /**< Select north NPEB write on PEC3*/
285 IX_PERFPROF_ACC_BUS_PMU_PEC3_NORTH_NPEC_WRITE_SELECT, /**< Select north NPEC wirte on PEC3*/
287 IX_PERFPROF_ACC_BUS_PMU_PEC3_SOUTH_GSKT_RETRY_SELECT, /**< Select south gasket retry on PEC3*/
288 IX_PERFPROF_ACC_BUS_PMU_PEC3_SOUTH_ABB_RETRY_SELECT, /**< Select south abb retry on PEC3*/
289 IX_PERFPROF_ACC_BUS_PMU_PEC3_SOUTH_PCI_RETRY_SELECT, /**< Select south pci retry on PEC3*/
290 IX_PERFPROF_ACC_BUS_PMU_PEC3_SOUTH_APB_RETRY_SELECT, /**< Select south apb retry on PEC3*/
291 IX_PERFPROF_ACC_BUS_PMU_PEC3_SOUTH_GSKT_WRITE_SELECT, /**< Select south gasket write on PEC3*/
292 IX_PERFPROF_ACC_BUS_PMU_PEC3_SOUTH_ABB_WRITE_SELECT, /**< Select south abb write on PEC3*/
293 IX_PERFPROF_ACC_BUS_PMU_PEC3_SOUTH_PCI_WRITE_SELECT, /**< Select south pci write on PEC3*/
294 IX_PERFPROF_ACC_BUS_PMU_PEC3_SOUTH_APB_WRITE_SELECT, /**< Select south apb write on PEC3*/
296 IX_PERFPROF_ACC_BUS_PMU_PEC3_SDR_2_HIT_SELECT, /**< Select sdram2 hit on PEC3*/
297 IX_PERFPROF_ACC_BUS_PMU_PEC3_SDR_3_HIT_SELECT, /**< Select sdram3 hit on PEC3*/
298 IX_PERFPROF_ACC_BUS_PMU_PEC3_SDR_4_HIT_SELECT, /**< Select sdram4 hit on PEC3*/
299 IX_PERFPROF_ACC_BUS_PMU_PEC3_SDR_5_HIT_SELECT, /**< Select sdram5 hit on PEC3*/
300 IX_PERFPROF_ACC_BUS_PMU_PEC3_SDR_6_MISS_SELECT, /**< Select sdram6 miss on PEC3*/
301 IX_PERFPROF_ACC_BUS_PMU_PEC3_SDR_7_MISS_SELECT, /**< Select sdram7 miss on PEC3*/
302 IX_PERFPROF_ACC_BUS_PMU_PEC3_SDR_0_MISS_SELECT, /**< Select sdram0 miss on PEC3*/
303 IX_PERFPROF_ACC_BUS_PMU_PEC3_SDR_1_MISS_SELECT /**< Select sdram1 miss on PEC3*/
304 } IxPerfProfAccBusPmuEventCounters3;
307 * @ingroup IxPerfProfAcc
309 * @enum IxPerfProfAccBusPmuEventCounters4
311 * @brief Type of bus pmu events supported on PEC 4.
313 * Lists all bus pmu events.
317 IX_PERFPROF_ACC_BUS_PMU_PEC4_SOUTH_PCI_SPLIT_SELECT = 70, /**< Select south pci split on PEC4*/
318 IX_PERFPROF_ACC_BUS_PMU_PEC4_SOUTH_EXP_SPLIT_SELECT, /**< Select south expansion split on PEC4*/
319 IX_PERFPROF_ACC_BUS_PMU_PEC4_SOUTH_APB_GRANT_SELECT, /**< Select south apb grant on PEC4*/
320 IX_PERFPROF_ACC_BUS_PMU_PEC4_SOUTH_APB_XFER_SELECT, /**< Select south apb transfer on PEC4*/
321 IX_PERFPROF_ACC_BUS_PMU_PEC4_SOUTH_GSKT_READ_SELECT, /**< Select south gasket read on PEC4*/
322 IX_PERFPROF_ACC_BUS_PMU_PEC4_SOUTH_ABB_READ_SELECT, /**< Select south abb read on PEC4*/
323 IX_PERFPROF_ACC_BUS_PMU_PEC4_SOUTH_PCI_READ_SELECT, /**< Select south pci read on PEC4*/
324 IX_PERFPROF_ACC_BUS_PMU_PEC4_SOUTH_APB_READ_SELECT, /**< Select south apb read on PEC4*/
326 IX_PERFPROF_ACC_BUS_PMU_PEC4_NORTH_ABB_SPLIT_SELECT, /**< Select north abb split on PEC4*/
327 IX_PERFPROF_ACC_BUS_PMU_PEC4_NORTH_NPEA_REQ_SELECT, /**< Select north NPEA req on PEC4*/
328 IX_PERFPROF_ACC_BUS_PMU_PEC4_NORTH_NPEA_READ_SELECT, /**< Select north NPEA read on PEC4*/
329 IX_PERFPROF_ACC_BUS_PMU_PEC4_NORTH_NPEB_READ_SELECT, /**< Select north NPEB read on PEC4*/
330 IX_PERFPROF_ACC_BUS_PMU_PEC4_NORTH_NPEC_READ_SELECT, /**< Select north NPEC read on PEC4*/
332 IX_PERFPROF_ACC_BUS_PMU_PEC4_SDR_3_HIT_SELECT, /**< Select sdram3 hit on PEC4*/
333 IX_PERFPROF_ACC_BUS_PMU_PEC4_SDR_4_HIT_SELECT, /**< Select sdram4 hit on PEC4*/
334 IX_PERFPROF_ACC_BUS_PMU_PEC4_SDR_5_HIT_SELECT, /**< Select sdram5 hit on PEC4*/
335 IX_PERFPROF_ACC_BUS_PMU_PEC4_SDR_6_HIT_SELECT, /**< Select sdram6 hit on PEC4*/
336 IX_PERFPROF_ACC_BUS_PMU_PEC4_SDR_7_MISS_SELECT, /**< Select sdram7 miss on PEC4*/
337 IX_PERFPROF_ACC_BUS_PMU_PEC4_SDR_0_MISS_SELECT, /**< Select sdram0 miss on PEC4*/
338 IX_PERFPROF_ACC_BUS_PMU_PEC4_SDR_1_MISS_SELECT, /**< Select sdram1 miss on PEC4*/
339 IX_PERFPROF_ACC_BUS_PMU_PEC4_SDR_2_MISS_SELECT /**< Select sdram2 miss on PEC4*/
340 } IxPerfProfAccBusPmuEventCounters4;
343 * @ingroup IxPerfProfAcc
345 * @enum IxPerfProfAccBusPmuEventCounters5
347 * @brief Type of bus pmu events supported on PEC 5.
349 * Lists all bus pmu events.
353 IX_PERFPROF_ACC_BUS_PMU_PEC5_SOUTH_ABB_GRANT_SELECT = 91, /**< Select south abb grant on PEC5*/
354 IX_PERFPROF_ACC_BUS_PMU_PEC5_SOUTH_ABB_XFER_SELECT, /**< Select south abb transfer on PEC5*/
355 IX_PERFPROF_ACC_BUS_PMU_PEC5_SOUTH_ABB_RETRY_SELECT, /**< Select south abb retry on PEC5*/
356 IX_PERFPROF_ACC_BUS_PMU_PEC5_SOUTH_EXP_SPLIT_SELECT, /**< Select south expansion split on PEC5*/
357 IX_PERFPROF_ACC_BUS_PMU_PEC5_SOUTH_ABB_REQ_SELECT, /**< Select south abb request on PEC5*/
358 IX_PERFPROF_ACC_BUS_PMU_PEC5_SOUTH_ABB_OWN_SELECT, /**< Select south abb own on PEC5*/
359 IX_PERFPROF_ACC_BUS_PMU_PEC5_SOUTH_BUS_IDLE_SELECT, /**< Select south bus idle on PEC5*/
361 IX_PERFPROF_ACC_BUS_PMU_PEC5_NORTH_NPEB_GRANT_SELECT, /**< Select north NPEB grant on PEC5*/
362 IX_PERFPROF_ACC_BUS_PMU_PEC5_NORTH_NPEB_XFER_SELECT, /**< Select north NPEB transfer on PEC5*/
363 IX_PERFPROF_ACC_BUS_PMU_PEC5_NORTH_NPEB_RETRY_SELECT, /**< Select north NPEB retry on PEC5*/
364 IX_PERFPROF_ACC_BUS_PMU_PEC5_NORTH_NPEB_REQ_SELECT, /**< Select north NPEB request on PEC5*/
365 IX_PERFPROF_ACC_BUS_PMU_PEC5_NORTH_NPEB_OWN_SELECT, /**< Select north NPEB own on PEC5*/
366 IX_PERFPROF_ACC_BUS_PMU_PEC5_NORTH_NPEB_WRITE_SELECT, /**< Select north NPEB write on PEC5*/
367 IX_PERFPROF_ACC_BUS_PMU_PEC5_NORTH_NPEB_READ_SELECT, /**< Select north NPEB read on PEC5*/
369 IX_PERFPROF_ACC_BUS_PMU_PEC5_SDR_4_HIT_SELECT, /**< Select north sdram4 hit on PEC5*/
370 IX_PERFPROF_ACC_BUS_PMU_PEC5_SDR_5_HIT_SELECT, /**< Select north sdram5 hit on PEC5*/
371 IX_PERFPROF_ACC_BUS_PMU_PEC5_SDR_6_HIT_SELECT, /**< Select north sdram6 hit on PEC5*/
372 IX_PERFPROF_ACC_BUS_PMU_PEC5_SDR_7_HIT_SELECT, /**< Select north sdram7 hit on PEC5*/
373 IX_PERFPROF_ACC_BUS_PMU_PEC5_SDR_0_MISS_SELECT, /**< Select north sdram0 miss on PEC5*/
374 IX_PERFPROF_ACC_BUS_PMU_PEC5_SDR_1_MISS_SELECT, /**< Select north sdram1 miss on PEC5*/
375 IX_PERFPROF_ACC_BUS_PMU_PEC5_SDR_2_MISS_SELECT, /**< Select north sdram2 miss on PEC5*/
376 IX_PERFPROF_ACC_BUS_PMU_PEC5_SDR_3_MISS_SELECT /**< Select north sdram3 miss on PEC5*/
377 } IxPerfProfAccBusPmuEventCounters5;
380 * @ingroup IxPerfProfAcc
382 * @enum IxPerfProfAccBusPmuEventCounters6
384 * @brief Type of bus pmu events supported on PEC 6.
386 * Lists all bus pmu events.
390 IX_PERFPROF_ACC_BUS_PMU_PEC6_SOUTH_PCI_GRANT_SELECT = 113, /**< Select south pci grant on PEC6*/
391 IX_PERFPROF_ACC_BUS_PMU_PEC6_SOUTH_PCI_XFER_SELECT, /**< Select south pci transfer on PEC6*/
392 IX_PERFPROF_ACC_BUS_PMU_PEC6_SOUTH_PCI_RETRY_SELECT, /**< Select south pci retry on PEC6*/
393 IX_PERFPROF_ACC_BUS_PMU_PEC6_SOUTH_PCI_SPLIT_SELECT, /**< Select south pci split on PEC6*/
394 IX_PERFPROF_ACC_BUS_PMU_PEC6_SOUTH_PCI_REQ_SELECT, /**< Select south pci request on PEC6*/
395 IX_PERFPROF_ACC_BUS_PMU_PEC6_SOUTH_PCI_OWN_SELECT, /**< Select south pci own on PEC6*/
396 IX_PERFPROF_ACC_BUS_PMU_PEC6_SOUTH_BUS_WRITE_SELECT, /**< Select south pci write on PEC6*/
398 IX_PERFPROF_ACC_BUS_PMU_PEC6_NORTH_NPEC_GRANT_SELECT, /**< Select north NPEC grant on PEC6*/
399 IX_PERFPROF_ACC_BUS_PMU_PEC6_NORTH_NPEC_XFER_SELECT, /**< Select north NPEC transfer on PEC6*/
400 IX_PERFPROF_ACC_BUS_PMU_PEC6_NORTH_NPEC_RETRY_SELECT, /**< Select north NPEC retry on PEC6*/
401 IX_PERFPROF_ACC_BUS_PMU_PEC6_NORTH_NPEC_REQ_SELECT, /**< Select north NPEC request on PEC6*/
402 IX_PERFPROF_ACC_BUS_PMU_PEC6_NORTH_NPEC_OWN_SELECT, /**< Select north NPEC own on PEC6*/
403 IX_PERFPROF_ACC_BUS_PMU_PEC6_NORTH_NPEB_WRITE_SELECT, /**< Select north NPEB write on PEC6*/
404 IX_PERFPROF_ACC_BUS_PMU_PEC6_NORTH_NPEC_READ_SELECT, /**< Select north NPEC read on PEC6*/
406 IX_PERFPROF_ACC_BUS_PMU_PEC6_SDR_5_HIT_SELECT, /**< Select sdram5 hit on PEC6*/
407 IX_PERFPROF_ACC_BUS_PMU_PEC6_SDR_6_HIT_SELECT, /**< Select sdram6 hit on PEC6*/
408 IX_PERFPROF_ACC_BUS_PMU_PEC6_SDR_7_HIT_SELECT, /**< Select sdram7 hit on PEC6*/
409 IX_PERFPROF_ACC_BUS_PMU_PEC6_SDR_0_HIT_SELECT, /**< Select sdram0 hit on PEC6*/
410 IX_PERFPROF_ACC_BUS_PMU_PEC6_SDR_1_MISS_SELECT, /**< Select sdram1 miss on PEC6*/
411 IX_PERFPROF_ACC_BUS_PMU_PEC6_SDR_2_MISS_SELECT, /**< Select sdram2 miss on PEC6*/
412 IX_PERFPROF_ACC_BUS_PMU_PEC6_SDR_3_MISS_SELECT, /**< Select sdram3 miss on PEC6*/
413 IX_PERFPROF_ACC_BUS_PMU_PEC6_SDR_4_MISS_SELECT /**< Select sdram4 miss on PEC6*/
414 } IxPerfProfAccBusPmuEventCounters6;
417 * @ingroup IxPerfProfAcc
419 * @enum IxPerfProfAccBusPmuEventCounters7
421 * @brief Type of bus pmu events supported on PEC 7.
423 * Lists all bus pmu events.
427 IX_PERFPROF_ACC_BUS_PMU_PEC7_SOUTH_APB_RETRY_SELECT = 135, /**< Select south apb retry on PEC7*/
428 IX_PERFPROF_ACC_BUS_PMU_PEC7_SOUTH_APB_REQ_SELECT, /**< Select south apb request on PEC7*/
429 IX_PERFPROF_ACC_BUS_PMU_PEC7_SOUTH_APB_OWN_SELECT, /**< Select south apb own on PEC7*/
430 IX_PERFPROF_ACC_BUS_PMU_PEC7_SOUTH_BUS_READ_SELECT, /**< Select south bus read on PEC7*/
431 IX_PERFPROF_ACC_BUS_PMU_PEC7_CYCLE_COUNT_SELECT /**< Select cycle count on PEC7*/
432 } IxPerfProfAccBusPmuEventCounters7;
435 * @ingroup IxPerfProfAcc
437 * @enum IxPerfProfAccXscalePmuEvent
439 * @brief Type of xscale pmu events supported
441 * Lists all xscale pmu events. The maximum is a default value that the user
446 IX_PERFPROF_ACC_XSCALE_PMU_EVENT_CACHE_MISS=0, /**< cache miss*/
447 IX_PERFPROF_ACC_XSCALE_PMU_EVENT_CACHE_INSTRUCTION,/**< cache instruction*/
448 IX_PERFPROF_ACC_XSCALE_PMU_EVENT_STALL, /**< event stall*/
449 IX_PERFPROF_ACC_XSCALE_PMU_EVENT_INST_TLB_MISS, /**< instruction tlb miss*/
450 IX_PERFPROF_ACC_XSCALE_PMU_EVENT_DATA_TLB_MISS, /**< data tlb miss*/
451 IX_PERFPROF_ACC_XSCALE_PMU_EVENT_BRANCH_EXEC, /**< branch executed*/
452 IX_PERFPROF_ACC_XSCALE_PMU_EVENT_BRANCH_MISPREDICT, /**<branch mispredict*/
453 IX_PERFPROF_ACC_XSCALE_PMU_EVENT_INST_EXEC, /**< instruction executed*/
454 IX_PERFPROF_ACC_XSCALE_PMU_EVENT_FULL_EVERYCYCLE, /**<
461 IX_PERFPROF_ACC_XSCALE_PMU_EVENT_ONCE, /**<
462 *Stall - data cache buffers are
463 *full.This event occurs once
464 *for each contiguous sequence
466 IX_PERFPROF_ACC_XSCALE_PMU_EVENT_DATA_CACHE_ACCESS, /**< data cache access*/
467 IX_PERFPROF_ACC_XSCALE_PMU_EVENT_DATA_CACHE_MISS, /**< data cache miss*/
468 IX_PERFPROF_ACC_XSCALE_PMU_EVENT_DATA_CACHE_WRITEBACK, /**<data cache
471 IX_PERFPROF_ACC_XSCALE_PMU_EVENT_SW_CHANGE_PC, /**< sw change pc*/
472 IX_PERFPROF_ACC_XSCALE_PMU_EVENT_MAX /**< max value*/
473 } IxPerfProfAccXscalePmuEvent;
476 * @ingroup IxPerfProfAcc
478 * @enum IxPerfProfAccStatus
480 * @brief Invalid Status Definitions
482 * These status will be used by the APIs to return to the user.
486 IX_PERFPROF_ACC_STATUS_SUCCESS = IX_SUCCESS, /**< success*/
487 IX_PERFPROF_ACC_STATUS_FAIL = IX_FAIL, /**< fail*/
488 IX_PERFPROF_ACC_STATUS_ANOTHER_UTIL_IN_PROGRESS,/**<another utility in
491 IX_PERFPROF_ACC_STATUS_XCYCLE_MEASUREMENT_IN_PROGRESS, /**<measurement in
494 IX_PERFPROF_ACC_STATUS_XCYCLE_NO_BASELINE, /**<no baseline yet*/
495 IX_PERFPROF_ACC_STATUS_XCYCLE_MEASUREMENT_REQUEST_OUT_OF_RANGE, /**<
499 IX_PERFPROF_ACC_STATUS_XCYCLE_PRIORITY_SET_FAIL, /**<
503 IX_PERFPROF_ACC_STATUS_XCYCLE_THREAD_CREATE_FAIL, /**<
506 IX_PERFPROF_ACC_STATUS_XCYCLE_PRIORITY_RESTORE_FAIL, /**<
510 IX_PERFPROF_ACC_STATUS_XCYCLE_MEASUREMENT_NOT_RUNNING, /**< xcycle not running*/
511 IX_PERFPROF_ACC_STATUS_XSCALE_PMU_NUM_INVALID, /**< invalid number
514 IX_PERFPROF_ACC_STATUS_XSCALE_PMU_EVENT_INVALID, /**< invalid pmu event*/
515 IX_PERFPROF_ACC_STATUS_XSCALE_PMU_START_NOT_CALLED, /**<a start process
521 IX_PERFPROF_ACC_STATUS_BUS_PMU_MODE_ERROR, /**< invalid mode*/
522 IX_PERFPROF_ACC_STATUS_BUS_PMU_PEC1_ERROR, /**< invalid pec1 entered*/
523 IX_PERFPROF_ACC_STATUS_BUS_PMU_PEC2_ERROR, /**< invalid pec2 entered*/
524 IX_PERFPROF_ACC_STATUS_BUS_PMU_PEC3_ERROR, /**< invalid pec3 entered*/
525 IX_PERFPROF_ACC_STATUS_BUS_PMU_PEC4_ERROR, /**< invalid pec4 entered*/
526 IX_PERFPROF_ACC_STATUS_BUS_PMU_PEC5_ERROR, /**< invalid pec5 entered*/
527 IX_PERFPROF_ACC_STATUS_BUS_PMU_PEC6_ERROR, /**< invalid pec6 entered*/
528 IX_PERFPROF_ACC_STATUS_BUS_PMU_PEC7_ERROR, /**< invalid pec7 entered*/
529 IX_PERFPROF_ACC_STATUS_BUS_PMU_START_NOT_CALLED, /**<a start process
534 IX_PERFPROF_ACC_STATUS_COMPONENT_NOT_SUPPORTED /**<Device or OS does not support component*/
535 } IxPerfProfAccStatus;
538 * @ingroup IxPerfProfAcc
540 * @enum IxPerfProfAccBusPmuMode
542 * @brief State selection of counters.
544 * These states will be used to determine the counters whose values are to be
549 IX_PERFPROF_ACC_BUS_PMU_MODE_HALT=0, /**< halt state*/
550 IX_PERFPROF_ACC_BUS_PMU_MODE_SOUTH, /**< south state*/
551 IX_PERFPROF_ACC_BUS_PMU_MODE_NORTH, /**< north state*/
552 IX_PERFPROF_ACC_BUS_PMU_MODE_SDRAM /**< SDRAM state*/
553 } IxPerfProfAccBusPmuMode;
556 * Section for prototypes interface functions
560 * @ingroup IxPerfProfAcc
562 * @fn ixPerfProfAccXscalePmuEventCountStart(
565 IxPerfProfAccXscalePmuEvent pmuEvent1,
566 IxPerfProfAccXscalePmuEvent pmuEvent2,
567 IxPerfProfAccXscalePmuEvent pmuEvent3,
568 IxPerfProfAccXscalePmuEvent pmuEvent4 )
570 * @brief This API will start the clock and event counting
572 * @param clkCntDiv BOOL [in] - enables/disables the clock divider. When
573 * true, the divider is enabled and the clock count will be incremented
574 * by one at each 64th processor clock cycle. When false, the divider
575 * is disabled and the clock count will be incremented at every
576 * processor clock cycle.
577 * @param numEvents UINT32 [in] - the number of PMU events that are to be
578 * monitored as specified by the user. For clock counting only, this
580 * @param pmuEvent1 @ref IxPerfProfAccXscalePmuEvent [in] - the specific PMU
581 * event to be monitored by counter 1
582 * @param pmuEvent2 @ref IxPerfProfAccXscalePmuEvent [in] - the specific PMU
583 * event to be monitored by counter 2
584 * @param pmuEvent3 @ref IxPerfProfAccXscalePmuEvent [in] - the specific PMU
585 * event to be monitored by counter 3
586 * @param pmuEvent4 @ref IxPerfProfAccXscalePmuEvent [in] - the specific PMU
587 * event to be monitored by counter 4
589 * This API will start the clock and xscale PMU event counting. Up to
590 * 4 events can be monitored simultaneously. This API has to be called before
591 * ixPerfProfAccXscalePmuEventCountStop can be called.
594 * - IX_PERFPROF_ACC_STATUS_SUCCESS if clock and events counting are
595 * started successfully
596 * - IX_PERFPROF_ACC_STATUS_FAIL if unable to start the counting
597 * - IX_PERFPROF_ACC_STATUS_XSCALE_PMU_NUM_INVALID if the number of events
598 * specified is out of the valid range
599 * - IX_PERFPROF_ACC_STATUS_XSCALE_PMU_EVENT_INVALID if the value of the PMU
600 * event specified does not exist
601 * - IX_PERFPROF_ACC_STATUS_ANOTHER_UTIL_IN_PROGRESS - another utility is
605 * @li ISR Callable : no
608 PUBLIC IxPerfProfAccStatus
609 ixPerfProfAccXscalePmuEventCountStart(
612 IxPerfProfAccXscalePmuEvent pmuEvent1,
613 IxPerfProfAccXscalePmuEvent pmuEvent2,
614 IxPerfProfAccXscalePmuEvent pmuEvent3,
615 IxPerfProfAccXscalePmuEvent pmuEvent4 );
618 * @ingroup IxPerfProfAcc
620 * @fn ixPerfProfAccXscalePmuEventCountStop (
621 IxPerfProfAccXscalePmuResults *eventCountStopResults)
623 * @brief This API will stop the clock and event counting
625 * @param *eventCountStopResults @ref IxPerfProfAccXscalePmuResults [out] - pointer
626 * to struct containing results of counters and their overflow. It is the
627 * users's responsibility to allocate the memory for this pointer.
629 * This API will stop the clock and xscale PMU events that are being counted.
630 * The results of the clock and events count will be stored in the pointer
631 * allocated by the user. It can only be called once
632 * IxPerfProfAccEventCountStart has been called.
635 * - IX_PERFPROF_ACC_STATUS_SUCCESS if clock and events counting are
636 * stopped successfully
637 * - IX_PERFPROF_ACC_STATUS_XSCALE_PMU_START_NOT_CALLED if
638 * ixPerfProfAccXscalePmuEventCountStart is not called first.
641 * @li ISR Callable : no
645 PUBLIC IxPerfProfAccStatus
646 ixPerfProfAccXscalePmuEventCountStop(
647 IxPerfProfAccXscalePmuResults *eventCountStopResults);
650 * @ingroup IxPerfProfAcc
652 * @fn ixPerfProfAccXscalePmuTimeSampStart(
656 * @brief Starts the time based sampling
658 * @param samplingRate UINT32 [in] - sampling rate is the number of
659 * clock counts before a counter overflow interrupt is generated,
660 * at which, a sample is taken; the rate specified cannot be greater
661 * than the counter size of 32bits or set to zero.
662 * @param clkCntDiv BOOL [in] - enables/disables the clock divider. When
663 * true, the divider is enabled and the clock count will be incremented
664 * by one at each 64th processor clock cycle. When false, the divider
665 * is disabled and the clock count will be incremented at every
666 * processor clock cycle.
668 * This API starts the time based sampling to determine the frequency with
669 * which lines of code are being executed. Sampling is done at the rate
670 * specified by the user. At each sample,the value of the program counter
671 * is determined. Each of these occurrences are recorded to determine the
672 * frequency with which the Xscale code is being executed. This API has to be
673 * called before ixPerfProfAccXscalePmuTimeSampStop can be called.
676 * - IX_PERFPROF_ACC_STATUS_SUCCESS if time based sampling is started
678 * - IX_PERFPROF_ACC_STATUS_FAIL if unable to start the sampling
679 * - IX_PERFPROF_ACC_STATUS_ANOTHER_UTIL_IN_PROGRESS - another utility is
683 * @li ISR Callable : no
686 PUBLIC IxPerfProfAccStatus
687 ixPerfProfAccXscalePmuTimeSampStart(
692 * @ingroup IxPerfProfAcc
694 * @fn ixPerfProfAccXscalePmuTimeSampStop(
695 IxPerfProfAccXscalePmuEvtCnt *clkCount,
696 IxPerfProfAccXscalePmuSamplePcProfile *timeProfile)
698 * @brief Stops the time based sampling
700 * @param *clkCount @ref IxPerfProfAccXscalePmuEvtCnt [out] - pointer to the
701 * struct containing the final clock count and its overflow. It is the
702 * user's responsibility to allocate the memory for this pointer.
703 * @param *timeProfile @ref IxPerfProfAccXscalePmuSamplePcProfile [out] -
704 * pointer to the array of profiles for each program counter value;
705 * the user should set the size of the array to
706 * IX_PERFPROF_ACC_XSCALE_PMU_MAX_PROFILE_SAMPLES. It is the user's
707 * responsibility to allocate the memory for this pointer.
709 * This API stops the time based sampling. The results are stored in the
710 * pointers allocated by the user. It can only be called once
711 * ixPerfProfAccXscalePmuTimeSampStart has been called.
714 * - IX_PERFPROF_ACC_STATUS_SUCCESS if time based sampling is stopped
716 * - IX_PERFPROF_ACC_STATUS_XSCALE_PMU_START_NOT_CALLED if
717 * ixPerfProfAccXscalePmuTimeSampStart not called first
720 * @li ISR Callable : no
723 PUBLIC IxPerfProfAccStatus
724 ixPerfProfAccXscalePmuTimeSampStop(
725 IxPerfProfAccXscalePmuEvtCnt *clkCount,
726 IxPerfProfAccXscalePmuSamplePcProfile *timeProfile);
729 * @ingroup IxPerfProfAcc
731 * @fn ixPerfProfAccXscalePmuEventSampStart(
733 IxPerfProfAccXscalePmuEvent pmuEvent1,
735 IxPerfProfAccXscalePmuEvent pmuEvent2,
737 IxPerfProfAccXscalePmuEvent pmuEvent3,
739 IxPerfProfAccXscalePmuEvent pmuEvent4,
742 * @brief Starts the event based sampling
744 * @param numEvents UINT32 [in] - the number of PMU events that are
745 * to be monitored as specified by the user. The value should be
746 * between 1-4 events at a time.
747 * @param pmuEvent1 @ref IxPerfProfAccXscalePmuEvent [in] - the specific PMU
748 * event to be monitored by counter 1
749 * @param eventRate1 UINT32 [in] - sampling rate of counter 1. The rate is
750 * the number of events before a sample taken. If 0 is specified, the
751 * the full counter value (0xFFFFFFFF) is used. The rate must not be
752 * greater than the full counter value.
753 * @param pmuEvent2 @ref IxPerfProfAccXscalePmuEvent [in] - the specific PMU
754 * event to be monitored by counter 2
755 * @param eventRate2 UINT32 [in] - sampling rate of counter 2. The rate is
756 * the number of events before a sample taken. If 0 is specified, the
757 * full counter value (0xFFFFFFFF) is used. The rate must not be
758 * greater than the full counter value.
759 * @param pmuEvent3 @ref IxPerfProfAccXscalePmuEvent [in] - the specific PMU
760 * event to be monitored by counter 3
761 * @param eventRate3 UINT32 [in] - sampling rate of counter 3. The rate is
762 * the number of events before a sample taken. If 0 is specified, the
763 * full counter value (0xFFFFFFFF) is used. The rate must not be
764 * greater than the full counter value.
765 * @param pmuEvent4 @ref IxPerfProfAccXscalePmuEvent [in] - the specific PMU
766 * event to be monitored by counter 4
767 * @param eventRate4 UINT32 [in] - sampling rate of counter 4. The rate is
768 * the number of events before a sample taken. If 0 is specified, the
769 * full counter value (0xFFFFFFFF) is used. The rate must not be
770 * greater than the full counter value.
772 * Starts the event based sampling to determine the frequency with
773 * which events are being executed. The sampling rate is the number of events,
774 * as specified by the user, before a counter overflow interrupt is
775 * generated. A sample is taken at each counter overflow interrupt. At each
776 * sample,the value of the program counter determines the corresponding
777 * location in the code. Each of these occurrences are recorded to determine
778 * the frequency with which the Xscale code in each event is executed. This API
779 * has to be called before ixPerfProfAccXscalePmuEventSampStop can be called.
782 * - IX_PERFPROF_ACC_STATUS_SUCCESS if event based sampling is started
784 * - IX_PERFPROF_ACC_STATUS_FAIL if unable to start the sampling
785 * - IX_PERFPROF_ACC_STATUS_XSCALE_PMU_NUM_INVALID if the number of events
786 * specified is out of the valid range
787 * - IX_PERFPROF_ACC_STATUS_XSCALE_PMU_EVENT_INVALID if the value of the
788 * PMU event specified does not exist
789 * - IX_PERFPROF_ACC_STATUS_ANOTHER_UTIL_IN_PROGRESS - another utility is
793 * @li ISR Callable : no
796 PUBLIC IxPerfProfAccStatus
797 ixPerfProfAccXscalePmuEventSampStart(
799 IxPerfProfAccXscalePmuEvent pmuEvent1,
801 IxPerfProfAccXscalePmuEvent pmuEvent2,
803 IxPerfProfAccXscalePmuEvent pmuEvent3,
805 IxPerfProfAccXscalePmuEvent pmuEvent4,
809 * @ingroup IxPerfProfAcc
811 * @fn ixPerfProfAccXscalePmuEventSampStop(
812 IxPerfProfAccXscalePmuSamplePcProfile *eventProfile1,
813 IxPerfProfAccXscalePmuSamplePcProfile *eventProfile2,
814 IxPerfProfAccXscalePmuSamplePcProfile *eventProfile3,
815 IxPerfProfAccXscalePmuSamplePcProfile *eventProfile4)
817 * @brief Stops the event based sampling
819 * @param *eventProfile1 @ref IxPerfProfAccXscalePmuSamplePcProfile [out] -
820 * pointer to the array of profiles for each program counter value;
821 * the user should set the size of the array to
822 * IX_PERFPROF_ACC_XSCALE_PMU_MAX_PROFILE_SAMPLES. It is the
823 * users's responsibility to allocate memory for this pointer.
824 * @param *eventProfile2 @ref IxPerfProfAccXscalePmuSamplePcProfile [out] -
825 * pointer to the array of profiles for each program counter value;
826 * the user should set the size of the array to
827 * IX_PERFPROF_ACC_XSCALE_PMU_MAX_PROFILE_SAMPLES. It is the
828 * users's responsibility to allocate memory for this pointer.
829 * @param *eventProfile3 @ref IxPerfProfAccXscalePmuSamplePcProfile [out] -
830 * pointer to the array of profiles for each program counter value;
831 * the user should set the size of the array to
832 * IX_PERFPROF_ACC_XSCALE_PMU_MAX_PROFILE_SAMPLES. It is the
833 * users's responsibility to allocate memory for this pointer.
834 * @param *eventProfile4 @ref IxPerfProfAccXscalePmuSamplePcProfile [out] -
835 * pointer to the array of profiles for each program counter value;
836 * the user should set the size of the array to
837 * IX_PERFPROF_ACC_XSCALE_PMU_MAX_PROFILE_SAMPLES. It is the
838 * users's responsibility to allocate memory for this pointer.
840 * This API stops the event based sampling. The results are stored in the
841 * pointers allocated by the user. It can only be called once
842 * ixPerfProfAccEventSampStart has been called.
845 * - IX_PERFPROF_ACC_STATUS_SUCCESS if event based sampling is stopped
847 * - IX_PERFPROF_ACC_STATUS_XSCALE_PMU_START_NOT_CALLED if
848 * ixPerfProfAccEventSampStart not called first.
851 * @li ISR Callable : no
854 PUBLIC IxPerfProfAccStatus
855 ixPerfProfAccXscalePmuEventSampStop(
856 IxPerfProfAccXscalePmuSamplePcProfile *eventProfile1,
857 IxPerfProfAccXscalePmuSamplePcProfile *eventProfile2,
858 IxPerfProfAccXscalePmuSamplePcProfile *eventProfile3,
859 IxPerfProfAccXscalePmuSamplePcProfile *eventProfile4);
862 * @ingroup IxPerfProfAcc
864 * @fn ixPerfProfAccXscalePmuResultsGet(IxPerfProfAccXscalePmuResults *results)
866 * @brief Reads the current value of the counters and their overflow
868 * @param *results @ref IxPerfProfAccXscalePmuResults [out] - pointer to the
869 results struct. It is the user's responsibility to allocate memory
872 * This API reads the value of all four event counters and the clock counter,
873 * and the associated overflows. It does not give results associated with
874 * sampling, i.e. PC and their frequencies. This API can be called at any time
875 * once a process has been started. If it is called before a process has started
876 * the user should be aware that the values it contains are default values and
877 * might be meaningless. The values of the counters are stored in the pointer
878 * allocated by the client.
883 * @li ISR Callable : no
887 ixPerfProfAccXscalePmuResultsGet(IxPerfProfAccXscalePmuResults *results);
890 * @ingroup IxPerfProfAcc
892 * @fn ixPerfProfAccBusPmuStart(
893 IxPerfProfAccBusPmuMode mode,
894 IxPerfProfAccBusPmuEventCounters1 pecEvent1,
895 IxPerfProfAccBusPmuEventCounters2 pecEvent2,
896 IxPerfProfAccBusPmuEventCounters3 pecEvent3,
897 IxPerfProfAccBusPmuEventCounters4 pecEvent4,
898 IxPerfProfAccBusPmuEventCounters5 pecEvent5,
899 IxPerfProfAccBusPmuEventCounters6 pecEvent6,
900 IxPerfProfAccBusPmuEventCounters7 pecEvent7)
901 * @brief Initializes all the counters and selects events to be monitored.
903 * Function initializes all the counters and assigns the events associated
904 * with the counters. Users send in the mode and events they want to count.
905 * This API verifies if the combination chosen is appropriate
906 * and sets all the registers accordingly. Selecting HALT mode will result
907 * in an error. User should use ixPerfProfAccBusPmuStop() to HALT.
910 * @param mode @ref IxPerfProfAccStateBusPmuMode [in] - Mode selection.
911 * @param pecEvent1 @ref IxPerfProfAccBusPmuEventCounters1 [in] - Event for PEC1.
912 * @param pecEvent2 @ref IxPerfProfAccBusPmuEventCounters2 [in] - Event for PEC2.
913 * @param pecEvent3 @ref IxPerfProfAccBusPmuEventCounters3 [in] - Event for PEC3.
914 * @param pecEvent4 @ref IxPerfProfAccBusPmuEventCounters4 [in] - Event for PEC4.
915 * @param pecEvent5 @ref IxPerfProfAccBusPmuEventCounters5 [in] - Event for PEC5.
916 * @param pecEvent6 @ref IxPerfProfAccBusPmuEventCounters6 [in] - Event for PEC6.
917 * @param pecEvent7 @ref IxPerfProfAccBusPmuEventCounters7 [in] - Event for PEC7.
920 * - IX_PERFPROF_ACC_STATUS_SUCCESS - Initialization executed
922 * - IX_PERFPROF_ACC_STATUS_BUS_PMU_MODE_ERROR - Error in selection of
923 * mode. Only NORTH, SOUTH and SDRAM modes are allowed.
924 * - IX_PERFPROF_ACC_STATUS_BUS_PMU_PEC1_ERROR - Error in selection of
926 * - IX_PERFPROF_ACC_STATUS_BUS_PMU_PEC2_ERROR - Error in selection of
928 * - IX_PERFPROF_ACC_STATUS_BUS_PMU_PEC3_ERROR - Error in selection of
930 * - IX_PERFPROF_ACC_STATUS_BUS_PMU_PEC4_ERROR - Error in selection of
932 * - IX_PERFPROF_ACC_STATUS_BUS_PMU_PEC5_ERROR - Error in selection of
934 * - IX_PERFPROF_ACC_STATUS_BUS_PMU_PEC6_ERROR - Error in selection of
936 * - IX_PERFPROF_ACC_STATUS_BUS_PMU_PEC7_ERROR - Error in selection of
938 * - IX_PERFPROF_ACC_STATUS_ANOTHER_UTIL_IN_PROGRESS - another utility
940 * - IX_PERFPROF_ACC_STATUS_FAIL - Failed to start because interrupt
941 * service routine fails to bind.
944 * @li ISR Callable : no
948 IxPerfProfAccStatus ixPerfProfAccBusPmuStart (
949 IxPerfProfAccBusPmuMode mode,
950 IxPerfProfAccBusPmuEventCounters1 pecEvent1,
951 IxPerfProfAccBusPmuEventCounters2 pecEvent2,
952 IxPerfProfAccBusPmuEventCounters3 pecEvent3,
953 IxPerfProfAccBusPmuEventCounters4 pecEvent4,
954 IxPerfProfAccBusPmuEventCounters5 pecEvent5,
955 IxPerfProfAccBusPmuEventCounters6 pecEvent6,
956 IxPerfProfAccBusPmuEventCounters7 pecEvent7);
959 * @ingroup IxPerfProfAcc
961 * @fn ixPerfProfAccBusPmuStop(void)
962 * @brief Stops all counters.
964 * This function stops all the PECs by setting the halt bit in the ESR.
968 * - IX_PERFPROF_ACC_STATUS_SUCCESS - Counters successfully halted.
969 * - IX_PERFPROF_ACC_STATUS_FAIL - Counters could'nt be halted.
970 * - IX_PERFPROF_ACC_STATUS_BUS_PMU_START_NOT_CALLED - the
971 * ixPerfProfAccBusPmuStart() function is not called.
974 * @li ISR Callable : no
977 PUBLIC IxPerfProfAccStatus
978 ixPerfProfAccBusPmuStop (void);
981 * @ingroup IxPerfProfAcc
983 * @fn ixPerfProfAccBusPmuResultsGet (
984 IxPerfProfAccBusPmuResults *busPmuResults)
985 * @brief Gets values of all counters
987 * This function is responsible for getting all the counter values from the
988 * lower API and putting it into an array for the user.
990 * @param *busPmuResults @ref IxPerfProfAccBusPmuResults [out]
991 * - Pointer to a structure of arrays to store all counter values.
996 * @li ISR Callable : no
1000 ixPerfProfAccBusPmuResultsGet (IxPerfProfAccBusPmuResults *BusPmuResults);
1003 * @ingroup IxPerfProfAcc
1005 * @fn ixPerfProfAccBusPmuPMSRGet (
1007 * @brief Get values of PMSR
1009 * This API gets the Previous Master Slave Register
1010 * value and returns it to the calling function. This value indicates
1011 * which master or slave accessed the north, south bus or sdram last.
1012 * The value returned by this function is a 32 bit value and is read
1013 * from location of an offset 0x0024 of the base value.
1015 * The PMSR value returned indicate the following:
1018 * *************************************************************************************
1019 * * Bit * Name * Description *
1021 * *************************************************************************************
1022 * * [31:18] *Reserved* *
1023 * *************************************************************************************
1024 * * [17:12] * PSS * Indicates which of the slaves on *
1025 * * * * ARBS was previously *
1026 * * * * accessed by the AHBS. *
1027 * * * * [000001] Expansion Bus *
1028 * * * * [000010] SDRAM Controller *
1029 * * * * [000100] PCI *
1030 * * * * [001000] Queue Manager *
1031 * * * * [010000] AHB-APB Bridge *
1032 * * * * [100000] Reserved *
1033 * *************************************************************************************
1034 * * [11:8] * PSN * Indicates which of the Slaves on *
1035 * * * * ARBN was previously *
1036 * * * * accessed the AHBN. *
1037 * * * * [0001] SDRAM Controller *
1038 * * * * [0010] AHB-AHB Bridge *
1039 * * * * [0100] Reserved *
1040 * * * * [1000] Reserved *
1041 * *************************************************************************************
1042 * * [7:4] * PMS * Indicates which of the Masters on *
1043 * * * * ARBS was previously *
1044 * * * * accessing the AHBS. *
1045 * * * * [0001] Gasket *
1046 * * * * [0010] AHB-AHB Bridge *
1047 * * * * [0100] PCI *
1048 * * * * [1000] APB *
1049 * *************************************************************************************
1050 * * [3:0] * PMN * Indicates which of the Masters on *
1051 * * * * ARBN was previously *
1052 * * * * accessing the AHBN. *
1053 * * * * [0001] NPEA *
1054 * * * * [0010] NPEB *
1055 * * * * [0100] NPEC *
1056 * * * * [1000] Reserved *
1057 * *************************************************************************************
1060 * @param *pmsrValue UINT32 [out] - Pointer to return PMSR value. Users need to
1061 * allocate storage for psmrValue.
1065 * @li Reentrant : no
1066 * @li ISR Callable : no
1070 ixPerfProfAccBusPmuPMSRGet (
1075 * The APIs below are specifically used for Xcycle module.
1079 * @ingroup IxPerfProfAcc
1081 * @fn ixPerfProfAccXcycleBaselineRun (
1082 UINT32 *numBaselineCycle)
1084 * @brief Perform baseline for Xcycle
1086 * @param *numBaselineCycle UINT32 [out] - pointer to baseline value after
1087 * calibration. Calling function are responsible for
1088 * allocating memory space for this pointer.
1093 * This function MUST be run before the Xcycle tool can be used. This
1094 * function must be run immediately when the OS boots up with no other
1095 * addition programs running.
1096 * Addition note : This API will measure the time needed to perform
1097 * a fix amount of CPU instructions (~ 1 second worth of loops) as a
1098 * highest priority task and with interrupt disabled. The time measured
1099 * is known as the baseline - interpreted as the shortest time
1100 * needed to complete the amount of CPU instructions. The baseline is
1101 * returned as unit of time in 66Mhz clock tick.
1104 * - IX_PERFPROF_ACC_STATUS_SUCCESS - successful run, result is returned
1105 * - IX_PERFPROF_ACC_STATUS_XCYCLE_PRIORITY_SET_FAIL - failed to change
1107 * - IX_PERFPROF_ACC_STATUS_XCYCLE_PRIORITY_RESTORE_FAIL - failed to
1108 * restore task priority
1109 * - IX_PERFPROF_ACC_STATUS_ANOTHER_UTIL_IN_PROGRESS - another utility
1111 * - IX_PERFPROF_ACC_STATUS_XCYCLE_MEASUREMENT_IN_PROGRESS - Xcycle
1112 * tool has already started
1114 * @li Reentrant : no
1115 * @li ISR Callable : no
1118 PUBLIC IxPerfProfAccStatus
1119 ixPerfProfAccXcycleBaselineRun(
1120 UINT32 *numBaselineCycle);
1123 * @ingroup IxPerfProfAcc
1125 * @fn ixPerfProfAccXcycleStart(
1126 UINT32 numMeasurementsRequested);
1128 * @brief Start the measurement
1130 * @param numMeasurementsRequested UINT32 [in] - number of measurements
1131 * to perform. Value can be 0 to
1132 * IX_PERFPROF_ACC_XCYCLE_MAX_NUM_OF_MEASUREMENTS.
1133 * 0 indicate continuous measurement.
1139 * Start the measurements immediately.
1140 * numMeasurementsRequested specifies number of measurements to run.
1141 * If numMeasurementsRequested is set to 0, the measurement will
1142 * be performed continuously until IxPerfProfAccXcycleStop()
1144 * It is estimated that 1 measurement takes approximately 1 second during
1145 * low CPU utilization, therefore 128 measurement takes approximately 128 sec.
1146 * When CPU utilization is high, the measurement will take longer.
1147 * This function spawn a task the perform the measurement and returns.
1148 * The measurement may continue even if this function returns.
1150 * IMPORTANT: Under heavy CPU utilization, the task spawn by this
1151 * function may starve and fail to respond to stop command. User
1152 * may need to kill the task manually in this case.
1154 * There are only IX_PERFPROF_ACC_XCYCLE_MAX_NUM_OF_MEASUREMENTS
1155 * storage available so storing is wrapped around if measurements are
1156 * more than IX_PERFPROF_ACC_XCYCLE_MAX_NUM_OF_MEASUREMENTS.
1160 * - IX_PERFPROF_ACC_STATUS_SUCCESS - successful start, a thread is created
1161 * in the background to perform measurement.
1162 * - IX_PERFPROF_ACC_STATUS_XCYCLE_PRIORITY_SET_FAIL - failed to set
1164 * - IX_PERFPROF_ACC_STATUS_XCYCLE_THREAD_CREATE_FAIL - failed to create
1165 * thread to perform measurement.
1166 * - IX_PERFPROF_ACC_STATUS_XCYCLE_NO_BASELINE - baseline is not available
1167 * - IX_PERFPROF_ACC_STATUS_XCYCLE_MEASUREMENT_REQUEST_OUT_OF_RANGE -
1168 * value is larger than IX_PERFPROF_ACC_XCYCLE_MAX_NUM_OF_MEASUREMENTS
1169 * - IX_PERFPROF_ACC_STATUS_XCYCLE_MEASUREMENT_IN_PROGRESS - Xcycle tool
1170 * has already started
1171 * - IX_PERFPROF_ACC_STATUS_ANOTHER_UTIL_IN_PROGRESS - another utility is
1174 * @li Reentrant : no
1175 * @li ISR Callable : no
1178 PUBLIC IxPerfProfAccStatus
1179 ixPerfProfAccXcycleStart (
1180 UINT32 numMeasurementsRequested);
1183 * @ingroup IxPerfProfAcc
1185 * @fn ixPerfProfAccXcycleStop(void);
1187 * @brief Stop the Xcycle measurement
1194 * Stop Xcycle measurements immediately. If the measurements have stopped
1195 * or not started, return IX_PERFPROF_STATUS_XCYCLE_MEASUREMENT_NOT_RUNNING.
1196 * Note: This function does not stop measurement cold. The measurement thread
1197 * may need a few seconds to complete the last measurement. User needs to use
1198 * ixPerfProfAccXcycleInProgress() to determine if measurement is indeed
1202 * - IX_PERFPROF_ACC_STATUS_SUCCESS - successful measurement is stopped
1203 * - IX_PERFPROF_STATUS_XCYCLE_MEASUREMENT_NOT_RUNNING - no measurement running
1205 * @li Reentrant : no
1206 * @li ISR Callable : no
1209 PUBLIC IxPerfProfAccStatus
1210 ixPerfProfAccXcycleStop(void);
1213 * @ingroup IxPerfProfAcc
1215 * @fn ixPerfProfAccXcycleResultsGet(
1216 IxPerfProfAccXcycleResults *xcycleResult )
1218 * @brief Get the results of Xcycle measurement
1220 * @param *xcycleResult @ref IxPerfProfAccXcycleResults [out] - Pointer to
1221 * results of last measurements. Calling function are
1222 * responsible for allocating memory space for this pointer.
1227 * Retrieve the results of last measurement. User should use
1228 * ixPerfProfAccXcycleInProgress() to check if measurement is completed
1229 * before getting the results.
1232 * - IX_PERFPROF_ACC_STATUS_SUCCESS - successful
1233 * - IX_PERFPROF_ACC_STATUS_FAIL - result is not complete.
1234 * - IX_PERFPROF_ACC_STATUS_XCYCLE_NO_BASELINE - baseline is performed
1235 * - IX_PERFPROF_ACC_STATUS_XCYCLE_MEASUREMENT_IN_PROGRESS - Xcycle
1236 * tool is still running
1238 * @li Reentrant : no
1239 * @li ISR Callable : no
1242 PUBLIC IxPerfProfAccStatus
1243 ixPerfProfAccXcycleResultsGet (
1244 IxPerfProfAccXcycleResults *xcycleResult);
1247 * @ingroup IxPerfProfAcc
1249 * @fn ixPerfProfAccXcycleInProgress (void)
1251 * @brief Check if Xcycle is running
1257 * Check if Xcycle measuring task is running.
1260 * - true - Xcycle is running
1261 * - false - Xcycle is not running
1263 * @li Reentrant : no
1264 * @li ISR Callable : no
1268 ixPerfProfAccXcycleInProgress(void);
1272 * @ingroup IxPerfProfAcc
1274 * @fn ixPerfProfAccXscalePmuTimeSampCreateProcFile
1276 * @brief Enables proc file to call module function
1283 * This function is declared globally to enable /proc directory system to call
1284 * and execute the function when the registered file is called. This function is not meant to
1285 * be called by the user.
1288 * - Length of data written to file.
1290 * @li Reentrant : no
1291 * @li ISR Callable : no
1295 ixPerfProfAccXscalePmuTimeSampCreateProcFile (char *buf, char **start, off_t offset,
1296 int count, int *eof, void *data);
1299 * @ingroup IxPerfProfAcc
1301 * @fn ixPerfProfAccXscalePmuEventSampCreateProcFile
1303 * @brief Enables proc file to call module function
1310 * This function is declared globally to enable /proc directory system to call
1311 * and execute the function when the registered file is called. This function is not meant to
1312 * be called by the user.
1315 * - Length of data written to file.
1317 * @li Reentrant : no
1318 * @li ISR Callable : no
1322 ixPerfProfAccXscalePmuEventSampCreateProcFile (char *buf, char **start, off_t offset,
1323 int count, int *eof, void *data);
1326 #endif /* ifdef __linux */
1328 #endif /* ndef IXPERFPROFACC_H */
1331 *@} defgroup IxPerfProfAcc