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 * Redistribution and use in source and binary forms, with or without
18 * modification, are permitted provided that the following conditions
20 * 1. Redistributions of source code must retain the above copyright
21 * notice, this list of conditions and the following disclaimer.
22 * 2. Redistributions in binary form must reproduce the above copyright
23 * notice, this list of conditions and the following disclaimer in the
24 * documentation and/or other materials provided with the distribution.
25 * 3. Neither the name of the Intel Corporation nor the names of its contributors
26 * may be used to endorse or promote products derived from this software
27 * without specific prior written permission.
30 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
31 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
32 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
33 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
34 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
35 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
36 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
37 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
38 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
39 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
43 * -- End of Copyright Notice --
47 * @defgroup IxPerfProfAcc IXP400 Performance Profiling (IxPerfProfAcc) API
49 * @brief IXP400 Performance Profiling Utility component Public API.
50 * @li NOTE: Xcycle measurement is not supported in Linux.
55 #ifndef IXPERFPROFACC_H
56 #define IXPERFPROFACC_H
61 #include <linux/proc_fs.h>
68 * @ingroup IxPerfProfAcc
70 * @def IX_PERFPROF_ACC_XSCALE_PMU_MAX_PROFILE_SAMPLES
72 * @brief This is the maximum number of profiling samples allowed, which can be
73 * modified according to the user's discretion
75 #define IX_PERFPROF_ACC_XSCALE_PMU_MAX_PROFILE_SAMPLES 0xFFFF
78 * @ingroup IxPerfProfAcc
80 * @def IX_PERFPROF_ACC_BUS_PMU_MAX_PECS
82 * @brief This is the maximum number of Programmable Event Counters available.
83 * This is a hardware specific and fixed value. Do not change.
86 #define IX_PERFPROF_ACC_BUS_PMU_MAX_PECS 7
89 * @ingroup IxPerfProfAcc
91 * @def IX_PERFPROF_ACC_XCYCLE_MAX_NUM_OF_MEASUREMENTS
93 * @brief Max number of measurement allowed. This constant is used when
94 * creating storage array for Xcycle. When run in continuous mode,
95 * Xcycle will wrap around and re-use buffer.
97 #define IX_PERFPROF_ACC_XCYCLE_MAX_NUM_OF_MEASUREMENTS 600
101 * @ingroup IxPerfProfAcc
103 * @def IX_PERFPROF_ACC_XSCALE_PMU_SYMBOL_ACCURACY
105 * @brief Level of accuracy required for matching the PC Address to
106 * symbol address. This is used when the XScale PMU time/event
107 * sampling functions get the PC address and search for the
108 * corresponding symbol address.
110 #define IX_PERFPROF_ACC_XSCALE_PMU_SYMBOL_ACCURACY 0xffff
115 * @ingroup IxPerfProfAcc
117 * @def IX_PERFPROF_ACC_LOG
119 * @brief Mechanism for logging a formatted message for the PerfProfAcc component
121 * @param level UINT32 [in] - trace level
122 * @param device UINT32 [in] - output device
123 * @param str char* [in] - format string, similar to printf().
124 * @param a UINT32 [in] - first argument to display
125 * @param b UINT32 [in] - second argument to display
126 * @param c UINT32 [in] - third argument to display
127 * @param d UINT32 [in] - fourth argument to display
128 * @param e UINT32 [in] - fifth argument to display
129 * @param f UINT32 [in] - sixth argument to display
134 #define IX_PERFPROF_ACC_LOG(level, device, str, a, b, c, d, e, f)\
135 (ixOsalLog (level, device, str, a, b, c, d, e, f))
137 #define IX_PERFPROF_ACC_LOG(level, device, str, a, b, c, d, e, f)
138 #endif /*ifdef NDEBUG */
145 * @brief contains summary of samples taken
147 * Structure contains all details of each program counter value - frequency
152 UINT32 programCounter; /**<the program counter value of the sample*/
153 UINT32 freq; /**<the frequency of the occurence of the sample*/
154 } IxPerfProfAccXscalePmuSamplePcProfile;
157 * @brief contains results of a counter
159 * Structure contains the results of a counter, which are split into the lower
160 * and upper 32 bits of the final count
164 UINT32 lower32BitsEventCount; /**<lower 32bits value of the event counter*/
165 UINT32 upper32BitsEventCount; /**<upper 32bits value of the event counter*/
166 } IxPerfProfAccXscalePmuEvtCnt;
169 * @brief contains results of counters and their overflow
171 * Structure contains all values of counters and associated overflows. The
172 * specific event and clock counters are determined by the user
176 UINT32 clk_value; /**<current value of clock counter*/
177 UINT32 clk_samples; /**<number of clock counter overflows*/
178 UINT32 event1_value; /**<current value of event 1 counter*/
179 UINT32 event1_samples; /**<number of event 1 counter overflows*/
180 UINT32 event2_value; /**<current value of event 2 counter*/
181 UINT32 event2_samples; /**<number of event 2 counter overflows*/
182 UINT32 event3_value; /**<current value of event 3 counter*/
183 UINT32 event3_samples; /**<number of event 3 counter overflows*/
184 UINT32 event4_value; /**<current value of event 4 counter*/
185 UINT32 event4_samples; /**<number of event 4 counter overflows*/
186 } IxPerfProfAccXscalePmuResults;
190 * @brief Results obtained from Xcycle run
194 float maxIdlePercentage; /**<maximum percentage of Idle cycles*/
195 float minIdlePercentage; /**<minimum percentage of Idle cycles*/
196 float aveIdlePercentage; /**<average percentage of Idle cycles*/
197 UINT32 totalMeasurements; /**<total number of measurement made */
198 } IxPerfProfAccXcycleResults;
202 * @brief Results obtained from running the Bus Pmu component. The results
203 * are obtained when the get functions is called.
208 UINT32 statsToGetLower27Bit[IX_PERFPROF_ACC_BUS_PMU_MAX_PECS]; /**<Lower 27 Bit of counter value */
209 UINT32 statsToGetUpper32Bit[IX_PERFPROF_ACC_BUS_PMU_MAX_PECS]; /**<Upper 32 Bit of counter value */
210 } IxPerfProfAccBusPmuResults;
217 * @ingroup IxPerfProfAcc
219 * @enum IxPerfProfAccBusPmuEventCounters1
221 * @brief Type of bus pmu events supported on PEC 1.
223 * Lists all bus pmu events.
227 IX_PERFPROF_ACC_BUS_PMU_PEC1_NORTH_NPEA_GRANT_SELECT = 1, /**< Select North NPEA grant on PEC1*/
228 IX_PERFPROF_ACC_BUS_PMU_PEC1_NORTH_NPEB_GRANT_SELECT, /**< Select North NPEB grant on PEC1*/
229 IX_PERFPROF_ACC_BUS_PMU_PEC1_NORTH_NPEC_GRANT_SELECT, /**< Select North NPEC grant on PEC1*/
230 IX_PERFPROF_ACC_BUS_PMU_PEC1_NORTH_BUS_IDLE_SELECT, /**< Select North bus idle on PEC1*/
231 IX_PERFPROF_ACC_BUS_PMU_PEC1_NORTH_NPEA_REQ_SELECT, /**< Select North NPEA req on PEC1*/
232 IX_PERFPROF_ACC_BUS_PMU_PEC1_NORTH_NPEB_REQ_SELECT, /**< Select North NPEB req on PEC1*/
233 IX_PERFPROF_ACC_BUS_PMU_PEC1_NORTH_NPEC_REQ_SELECT, /**< Select North NPEC req on PEC1*/
235 IX_PERFPROF_ACC_BUS_PMU_PEC1_SOUTH_GSKT_GRANT_SELECT, /**< Select south gasket grant on PEC1*/
236 IX_PERFPROF_ACC_BUS_PMU_PEC1_SOUTH_ABB_GRANT_SELECT, /**< Select south abb grant on PEC1*/
237 IX_PERFPROF_ACC_BUS_PMU_PEC1_SOUTH_PCI_GRANT_SELECT, /**< Select south pci grant on PEC1*/
238 IX_PERFPROF_ACC_BUS_PMU_PEC1_SOUTH_APB_GRANT_SELECT, /**< Select south apb grant on PEC1*/
239 IX_PERFPROF_ACC_BUS_PMU_PEC1_SOUTH_GSKT_REQ_SELECT, /**< Select south gasket request on PEC1*/
240 IX_PERFPROF_ACC_BUS_PMU_PEC1_SOUTH_ABB_REQ_SELECT, /**< Select south abb request on PEC1*/
241 IX_PERFPROF_ACC_BUS_PMU_PEC1_SOUTH_PCI_REQ_SELECT, /**< Select south pci request on PEC1*/
242 IX_PERFPROF_ACC_BUS_PMU_PEC1_SOUTH_APB_REQ_SELECT, /**< Select south apb request on PEC1*/
244 IX_PERFPROF_ACC_BUS_PMU_PEC1_SDR_0_HIT_SELECT, /**< Select sdram0 hit on PEC1*/
245 IX_PERFPROF_ACC_BUS_PMU_PEC1_SDR_1_HIT_SELECT, /**< Select sdram1 hit on PEC1*/
246 IX_PERFPROF_ACC_BUS_PMU_PEC1_SDR_2_HIT_SELECT, /**< Select sdram2 hit on PEC1*/
247 IX_PERFPROF_ACC_BUS_PMU_PEC1_SDR_3_HIT_SELECT, /**< Select sdram3 hit on PEC1*/
248 IX_PERFPROF_ACC_BUS_PMU_PEC1_SDR_4_MISS_SELECT, /**< Select sdram4 miss on PEC1*/
249 IX_PERFPROF_ACC_BUS_PMU_PEC1_SDR_5_MISS_SELECT, /**< Select sdram5 miss on PEC1*/
250 IX_PERFPROF_ACC_BUS_PMU_PEC1_SDR_6_MISS_SELECT, /**< Select sdram6 miss on PEC1*/
251 IX_PERFPROF_ACC_BUS_PMU_PEC1_SDR_7_MISS_SELECT /**< Select sdram7 miss on PEC1*/
252 } IxPerfProfAccBusPmuEventCounters1;
255 * @ingroup IxPerfProfAcc
257 * @enum IxPerfProfAccBusPmuEventCounters2
259 * @brief Type of bus pmu events supported on PEC 2.
261 * Lists all bus pmu events.
265 IX_PERFPROF_ACC_BUS_PMU_PEC2_NORTH_NPEA_XFER_SELECT = 24, /**< Select North NPEA transfer on PEC2*/
266 IX_PERFPROF_ACC_BUS_PMU_PEC2_NORTH_NPEB_XFER_SELECT, /**< Select North NPEB transfer on PEC2*/
267 IX_PERFPROF_ACC_BUS_PMU_PEC2_NORTH_NPEC_XFER_SELECT, /**< Select North NPEC transfer on PEC2*/
268 IX_PERFPROF_ACC_BUS_PMU_PEC2_NORTH_BUS_WRITE_SELECT, /**< Select North bus write on PEC2*/
269 IX_PERFPROF_ACC_BUS_PMU_PEC2_NORTH_NPEA_OWN_SELECT, /**< Select North NPEA own on PEC2*/
270 IX_PERFPROF_ACC_BUS_PMU_PEC2_NORTH_NPEB_OWN_SELECT, /**< Select North NPEB own on PEC2*/
271 IX_PERFPROF_ACC_BUS_PMU_PEC2_NORTH_NPEC_OWN_SELECT, /**< Select North NPEC own on PEC2*/
273 IX_PERFPROF_ACC_BUS_PMU_PEC2_SOUTH_GSKT_XFER_SELECT, /**< Select South gasket transfer on PEC2*/
274 IX_PERFPROF_ACC_BUS_PMU_PEC2_SOUTH_ABB_XFER_SELECT, /**< Select South abb transfer on PEC2*/
275 IX_PERFPROF_ACC_BUS_PMU_PEC2_SOUTH_PCI_XFER_SELECT, /**< Select South pci transfer on PEC2*/
276 IX_PERFPROF_ACC_BUS_PMU_PEC2_SOUTH_APB_XFER_SELECT, /**< Select South apb transfer on PEC2*/
277 IX_PERFPROF_ACC_BUS_PMU_PEC2_SOUTH_GSKT_OWN_SELECT, /**< Select South gasket own on PEC2*/
278 IX_PERFPROF_ACC_BUS_PMU_PEC2_SOUTH_ABB_OWN_SELECT, /**< Select South abb own on PEC2*/
279 IX_PERFPROF_ACC_BUS_PMU_PEC2_SOUTH_PCI_OWN_SELECT, /**< Select South pci own on PEC2*/
280 IX_PERFPROF_ACC_BUS_PMU_PEC2_SOUTH_APB_OWN_SELECT, /**< Select South apb own transfer on PEC2*/
282 IX_PERFPROF_ACC_BUS_PMU_PEC2_SDR_1_HIT_SELECT, /**< Select sdram1 hit on PEC2*/
283 IX_PERFPROF_ACC_BUS_PMU_PEC2_SDR_2_HIT_SELECT, /**< Select sdram2 hit on PEC2*/
284 IX_PERFPROF_ACC_BUS_PMU_PEC2_SDR_3_HIT_SELECT, /**< Select sdram3 hit on PEC2*/
285 IX_PERFPROF_ACC_BUS_PMU_PEC2_SDR_4_HIT_SELECT, /**< Select sdram4 hit on PEC2*/
286 IX_PERFPROF_ACC_BUS_PMU_PEC2_SDR_5_MISS_SELECT, /**< Select sdram5 miss on PEC2*/
287 IX_PERFPROF_ACC_BUS_PMU_PEC2_SDR_6_MISS_SELECT, /**< Select sdram6 miss on PEC2*/
288 IX_PERFPROF_ACC_BUS_PMU_PEC2_SDR_7_MISS_SELECT, /**< Select sdram7 miss on PEC2*/
289 IX_PERFPROF_ACC_BUS_PMU_PEC2_SDR_0_MISS_SELECT /**< Select sdram0 miss on PEC2*/
290 } IxPerfProfAccBusPmuEventCounters2;
293 * @ingroup IxPerfProfAcc
295 * @enum IxPerfProfAccBusPmuEventCounters3
297 * @brief Type of bus pmu events supported on PEC 3.
299 * Lists all bus pmu events.
303 IX_PERFPROF_ACC_BUS_PMU_PEC3_NORTH_NPEA_RETRY_SELECT = 47, /**< Select north NPEA retry on PEC3*/
304 IX_PERFPROF_ACC_BUS_PMU_PEC3_NORTH_NPEB_RETRY_SELECT, /**< Select north NPEB retry on PEC3*/
305 IX_PERFPROF_ACC_BUS_PMU_PEC3_NORTH_NPEC_RETRY_SELECT, /**< Select north NPEC retry on PEC3*/
306 IX_PERFPROF_ACC_BUS_PMU_PEC3_NORTH_BUS_READ_SELECT, /**< Select north bus read on PEC3*/
307 IX_PERFPROF_ACC_BUS_PMU_PEC3_NORTH_NPEA_WRITE_SELECT, /**< Select north NPEA write on PEC3*/
308 IX_PERFPROF_ACC_BUS_PMU_PEC3_NORTH_NPEB_WRITE_SELECT, /**< Select north NPEB write on PEC3*/
309 IX_PERFPROF_ACC_BUS_PMU_PEC3_NORTH_NPEC_WRITE_SELECT, /**< Select north NPEC wirte on PEC3*/
311 IX_PERFPROF_ACC_BUS_PMU_PEC3_SOUTH_GSKT_RETRY_SELECT, /**< Select south gasket retry on PEC3*/
312 IX_PERFPROF_ACC_BUS_PMU_PEC3_SOUTH_ABB_RETRY_SELECT, /**< Select south abb retry on PEC3*/
313 IX_PERFPROF_ACC_BUS_PMU_PEC3_SOUTH_PCI_RETRY_SELECT, /**< Select south pci retry on PEC3*/
314 IX_PERFPROF_ACC_BUS_PMU_PEC3_SOUTH_APB_RETRY_SELECT, /**< Select south apb retry on PEC3*/
315 IX_PERFPROF_ACC_BUS_PMU_PEC3_SOUTH_GSKT_WRITE_SELECT, /**< Select south gasket write on PEC3*/
316 IX_PERFPROF_ACC_BUS_PMU_PEC3_SOUTH_ABB_WRITE_SELECT, /**< Select south abb write on PEC3*/
317 IX_PERFPROF_ACC_BUS_PMU_PEC3_SOUTH_PCI_WRITE_SELECT, /**< Select south pci write on PEC3*/
318 IX_PERFPROF_ACC_BUS_PMU_PEC3_SOUTH_APB_WRITE_SELECT, /**< Select south apb write on PEC3*/
320 IX_PERFPROF_ACC_BUS_PMU_PEC3_SDR_2_HIT_SELECT, /**< Select sdram2 hit on PEC3*/
321 IX_PERFPROF_ACC_BUS_PMU_PEC3_SDR_3_HIT_SELECT, /**< Select sdram3 hit on PEC3*/
322 IX_PERFPROF_ACC_BUS_PMU_PEC3_SDR_4_HIT_SELECT, /**< Select sdram4 hit on PEC3*/
323 IX_PERFPROF_ACC_BUS_PMU_PEC3_SDR_5_HIT_SELECT, /**< Select sdram5 hit on PEC3*/
324 IX_PERFPROF_ACC_BUS_PMU_PEC3_SDR_6_MISS_SELECT, /**< Select sdram6 miss on PEC3*/
325 IX_PERFPROF_ACC_BUS_PMU_PEC3_SDR_7_MISS_SELECT, /**< Select sdram7 miss on PEC3*/
326 IX_PERFPROF_ACC_BUS_PMU_PEC3_SDR_0_MISS_SELECT, /**< Select sdram0 miss on PEC3*/
327 IX_PERFPROF_ACC_BUS_PMU_PEC3_SDR_1_MISS_SELECT /**< Select sdram1 miss on PEC3*/
328 } IxPerfProfAccBusPmuEventCounters3;
331 * @ingroup IxPerfProfAcc
333 * @enum IxPerfProfAccBusPmuEventCounters4
335 * @brief Type of bus pmu events supported on PEC 4.
337 * Lists all bus pmu events.
341 IX_PERFPROF_ACC_BUS_PMU_PEC4_SOUTH_PCI_SPLIT_SELECT = 70, /**< Select south pci split on PEC4*/
342 IX_PERFPROF_ACC_BUS_PMU_PEC4_SOUTH_EXP_SPLIT_SELECT, /**< Select south expansion split on PEC4*/
343 IX_PERFPROF_ACC_BUS_PMU_PEC4_SOUTH_APB_GRANT_SELECT, /**< Select south apb grant on PEC4*/
344 IX_PERFPROF_ACC_BUS_PMU_PEC4_SOUTH_APB_XFER_SELECT, /**< Select south apb transfer on PEC4*/
345 IX_PERFPROF_ACC_BUS_PMU_PEC4_SOUTH_GSKT_READ_SELECT, /**< Select south gasket read on PEC4*/
346 IX_PERFPROF_ACC_BUS_PMU_PEC4_SOUTH_ABB_READ_SELECT, /**< Select south abb read on PEC4*/
347 IX_PERFPROF_ACC_BUS_PMU_PEC4_SOUTH_PCI_READ_SELECT, /**< Select south pci read on PEC4*/
348 IX_PERFPROF_ACC_BUS_PMU_PEC4_SOUTH_APB_READ_SELECT, /**< Select south apb read on PEC4*/
350 IX_PERFPROF_ACC_BUS_PMU_PEC4_NORTH_ABB_SPLIT_SELECT, /**< Select north abb split on PEC4*/
351 IX_PERFPROF_ACC_BUS_PMU_PEC4_NORTH_NPEA_REQ_SELECT, /**< Select north NPEA req on PEC4*/
352 IX_PERFPROF_ACC_BUS_PMU_PEC4_NORTH_NPEA_READ_SELECT, /**< Select north NPEA read on PEC4*/
353 IX_PERFPROF_ACC_BUS_PMU_PEC4_NORTH_NPEB_READ_SELECT, /**< Select north NPEB read on PEC4*/
354 IX_PERFPROF_ACC_BUS_PMU_PEC4_NORTH_NPEC_READ_SELECT, /**< Select north NPEC read on PEC4*/
356 IX_PERFPROF_ACC_BUS_PMU_PEC4_SDR_3_HIT_SELECT, /**< Select sdram3 hit on PEC4*/
357 IX_PERFPROF_ACC_BUS_PMU_PEC4_SDR_4_HIT_SELECT, /**< Select sdram4 hit on PEC4*/
358 IX_PERFPROF_ACC_BUS_PMU_PEC4_SDR_5_HIT_SELECT, /**< Select sdram5 hit on PEC4*/
359 IX_PERFPROF_ACC_BUS_PMU_PEC4_SDR_6_HIT_SELECT, /**< Select sdram6 hit on PEC4*/
360 IX_PERFPROF_ACC_BUS_PMU_PEC4_SDR_7_MISS_SELECT, /**< Select sdram7 miss on PEC4*/
361 IX_PERFPROF_ACC_BUS_PMU_PEC4_SDR_0_MISS_SELECT, /**< Select sdram0 miss on PEC4*/
362 IX_PERFPROF_ACC_BUS_PMU_PEC4_SDR_1_MISS_SELECT, /**< Select sdram1 miss on PEC4*/
363 IX_PERFPROF_ACC_BUS_PMU_PEC4_SDR_2_MISS_SELECT /**< Select sdram2 miss on PEC4*/
364 } IxPerfProfAccBusPmuEventCounters4;
367 * @ingroup IxPerfProfAcc
369 * @enum IxPerfProfAccBusPmuEventCounters5
371 * @brief Type of bus pmu events supported on PEC 5.
373 * Lists all bus pmu events.
377 IX_PERFPROF_ACC_BUS_PMU_PEC5_SOUTH_ABB_GRANT_SELECT = 91, /**< Select south abb grant on PEC5*/
378 IX_PERFPROF_ACC_BUS_PMU_PEC5_SOUTH_ABB_XFER_SELECT, /**< Select south abb transfer on PEC5*/
379 IX_PERFPROF_ACC_BUS_PMU_PEC5_SOUTH_ABB_RETRY_SELECT, /**< Select south abb retry on PEC5*/
380 IX_PERFPROF_ACC_BUS_PMU_PEC5_SOUTH_EXP_SPLIT_SELECT, /**< Select south expansion split on PEC5*/
381 IX_PERFPROF_ACC_BUS_PMU_PEC5_SOUTH_ABB_REQ_SELECT, /**< Select south abb request on PEC5*/
382 IX_PERFPROF_ACC_BUS_PMU_PEC5_SOUTH_ABB_OWN_SELECT, /**< Select south abb own on PEC5*/
383 IX_PERFPROF_ACC_BUS_PMU_PEC5_SOUTH_BUS_IDLE_SELECT, /**< Select south bus idle on PEC5*/
385 IX_PERFPROF_ACC_BUS_PMU_PEC5_NORTH_NPEB_GRANT_SELECT, /**< Select north NPEB grant on PEC5*/
386 IX_PERFPROF_ACC_BUS_PMU_PEC5_NORTH_NPEB_XFER_SELECT, /**< Select north NPEB transfer on PEC5*/
387 IX_PERFPROF_ACC_BUS_PMU_PEC5_NORTH_NPEB_RETRY_SELECT, /**< Select north NPEB retry on PEC5*/
388 IX_PERFPROF_ACC_BUS_PMU_PEC5_NORTH_NPEB_REQ_SELECT, /**< Select north NPEB request on PEC5*/
389 IX_PERFPROF_ACC_BUS_PMU_PEC5_NORTH_NPEB_OWN_SELECT, /**< Select north NPEB own on PEC5*/
390 IX_PERFPROF_ACC_BUS_PMU_PEC5_NORTH_NPEB_WRITE_SELECT, /**< Select north NPEB write on PEC5*/
391 IX_PERFPROF_ACC_BUS_PMU_PEC5_NORTH_NPEB_READ_SELECT, /**< Select north NPEB read on PEC5*/
393 IX_PERFPROF_ACC_BUS_PMU_PEC5_SDR_4_HIT_SELECT, /**< Select north sdram4 hit on PEC5*/
394 IX_PERFPROF_ACC_BUS_PMU_PEC5_SDR_5_HIT_SELECT, /**< Select north sdram5 hit on PEC5*/
395 IX_PERFPROF_ACC_BUS_PMU_PEC5_SDR_6_HIT_SELECT, /**< Select north sdram6 hit on PEC5*/
396 IX_PERFPROF_ACC_BUS_PMU_PEC5_SDR_7_HIT_SELECT, /**< Select north sdram7 hit on PEC5*/
397 IX_PERFPROF_ACC_BUS_PMU_PEC5_SDR_0_MISS_SELECT, /**< Select north sdram0 miss on PEC5*/
398 IX_PERFPROF_ACC_BUS_PMU_PEC5_SDR_1_MISS_SELECT, /**< Select north sdram1 miss on PEC5*/
399 IX_PERFPROF_ACC_BUS_PMU_PEC5_SDR_2_MISS_SELECT, /**< Select north sdram2 miss on PEC5*/
400 IX_PERFPROF_ACC_BUS_PMU_PEC5_SDR_3_MISS_SELECT /**< Select north sdram3 miss on PEC5*/
401 } IxPerfProfAccBusPmuEventCounters5;
404 * @ingroup IxPerfProfAcc
406 * @enum IxPerfProfAccBusPmuEventCounters6
408 * @brief Type of bus pmu events supported on PEC 6.
410 * Lists all bus pmu events.
414 IX_PERFPROF_ACC_BUS_PMU_PEC6_SOUTH_PCI_GRANT_SELECT = 113, /**< Select south pci grant on PEC6*/
415 IX_PERFPROF_ACC_BUS_PMU_PEC6_SOUTH_PCI_XFER_SELECT, /**< Select south pci transfer on PEC6*/
416 IX_PERFPROF_ACC_BUS_PMU_PEC6_SOUTH_PCI_RETRY_SELECT, /**< Select south pci retry on PEC6*/
417 IX_PERFPROF_ACC_BUS_PMU_PEC6_SOUTH_PCI_SPLIT_SELECT, /**< Select south pci split on PEC6*/
418 IX_PERFPROF_ACC_BUS_PMU_PEC6_SOUTH_PCI_REQ_SELECT, /**< Select south pci request on PEC6*/
419 IX_PERFPROF_ACC_BUS_PMU_PEC6_SOUTH_PCI_OWN_SELECT, /**< Select south pci own on PEC6*/
420 IX_PERFPROF_ACC_BUS_PMU_PEC6_SOUTH_BUS_WRITE_SELECT, /**< Select south pci write on PEC6*/
422 IX_PERFPROF_ACC_BUS_PMU_PEC6_NORTH_NPEC_GRANT_SELECT, /**< Select north NPEC grant on PEC6*/
423 IX_PERFPROF_ACC_BUS_PMU_PEC6_NORTH_NPEC_XFER_SELECT, /**< Select north NPEC transfer on PEC6*/
424 IX_PERFPROF_ACC_BUS_PMU_PEC6_NORTH_NPEC_RETRY_SELECT, /**< Select north NPEC retry on PEC6*/
425 IX_PERFPROF_ACC_BUS_PMU_PEC6_NORTH_NPEC_REQ_SELECT, /**< Select north NPEC request on PEC6*/
426 IX_PERFPROF_ACC_BUS_PMU_PEC6_NORTH_NPEC_OWN_SELECT, /**< Select north NPEC own on PEC6*/
427 IX_PERFPROF_ACC_BUS_PMU_PEC6_NORTH_NPEB_WRITE_SELECT, /**< Select north NPEB write on PEC6*/
428 IX_PERFPROF_ACC_BUS_PMU_PEC6_NORTH_NPEC_READ_SELECT, /**< Select north NPEC read on PEC6*/
430 IX_PERFPROF_ACC_BUS_PMU_PEC6_SDR_5_HIT_SELECT, /**< Select sdram5 hit on PEC6*/
431 IX_PERFPROF_ACC_BUS_PMU_PEC6_SDR_6_HIT_SELECT, /**< Select sdram6 hit on PEC6*/
432 IX_PERFPROF_ACC_BUS_PMU_PEC6_SDR_7_HIT_SELECT, /**< Select sdram7 hit on PEC6*/
433 IX_PERFPROF_ACC_BUS_PMU_PEC6_SDR_0_HIT_SELECT, /**< Select sdram0 hit on PEC6*/
434 IX_PERFPROF_ACC_BUS_PMU_PEC6_SDR_1_MISS_SELECT, /**< Select sdram1 miss on PEC6*/
435 IX_PERFPROF_ACC_BUS_PMU_PEC6_SDR_2_MISS_SELECT, /**< Select sdram2 miss on PEC6*/
436 IX_PERFPROF_ACC_BUS_PMU_PEC6_SDR_3_MISS_SELECT, /**< Select sdram3 miss on PEC6*/
437 IX_PERFPROF_ACC_BUS_PMU_PEC6_SDR_4_MISS_SELECT /**< Select sdram4 miss on PEC6*/
438 } IxPerfProfAccBusPmuEventCounters6;
441 * @ingroup IxPerfProfAcc
443 * @enum IxPerfProfAccBusPmuEventCounters7
445 * @brief Type of bus pmu events supported on PEC 7.
447 * Lists all bus pmu events.
451 IX_PERFPROF_ACC_BUS_PMU_PEC7_SOUTH_APB_RETRY_SELECT = 135, /**< Select south apb retry on PEC7*/
452 IX_PERFPROF_ACC_BUS_PMU_PEC7_SOUTH_APB_REQ_SELECT, /**< Select south apb request on PEC7*/
453 IX_PERFPROF_ACC_BUS_PMU_PEC7_SOUTH_APB_OWN_SELECT, /**< Select south apb own on PEC7*/
454 IX_PERFPROF_ACC_BUS_PMU_PEC7_SOUTH_BUS_READ_SELECT, /**< Select south bus read on PEC7*/
455 IX_PERFPROF_ACC_BUS_PMU_PEC7_CYCLE_COUNT_SELECT /**< Select cycle count on PEC7*/
456 } IxPerfProfAccBusPmuEventCounters7;
459 * @ingroup IxPerfProfAcc
461 * @enum IxPerfProfAccXscalePmuEvent
463 * @brief Type of xscale pmu events supported
465 * Lists all xscale pmu events. The maximum is a default value that the user
470 IX_PERFPROF_ACC_XSCALE_PMU_EVENT_CACHE_MISS=0, /**< cache miss*/
471 IX_PERFPROF_ACC_XSCALE_PMU_EVENT_CACHE_INSTRUCTION,/**< cache instruction*/
472 IX_PERFPROF_ACC_XSCALE_PMU_EVENT_STALL, /**< event stall*/
473 IX_PERFPROF_ACC_XSCALE_PMU_EVENT_INST_TLB_MISS, /**< instruction tlb miss*/
474 IX_PERFPROF_ACC_XSCALE_PMU_EVENT_DATA_TLB_MISS, /**< data tlb miss*/
475 IX_PERFPROF_ACC_XSCALE_PMU_EVENT_BRANCH_EXEC, /**< branch executed*/
476 IX_PERFPROF_ACC_XSCALE_PMU_EVENT_BRANCH_MISPREDICT, /**<branch mispredict*/
477 IX_PERFPROF_ACC_XSCALE_PMU_EVENT_INST_EXEC, /**< instruction executed*/
478 IX_PERFPROF_ACC_XSCALE_PMU_EVENT_FULL_EVERYCYCLE, /**<
485 IX_PERFPROF_ACC_XSCALE_PMU_EVENT_ONCE, /**<
486 *Stall - data cache buffers are
487 *full.This event occurs once
488 *for each contiguous sequence
490 IX_PERFPROF_ACC_XSCALE_PMU_EVENT_DATA_CACHE_ACCESS, /**< data cache access*/
491 IX_PERFPROF_ACC_XSCALE_PMU_EVENT_DATA_CACHE_MISS, /**< data cache miss*/
492 IX_PERFPROF_ACC_XSCALE_PMU_EVENT_DATA_CACHE_WRITEBACK, /**<data cache
495 IX_PERFPROF_ACC_XSCALE_PMU_EVENT_SW_CHANGE_PC, /**< sw change pc*/
496 IX_PERFPROF_ACC_XSCALE_PMU_EVENT_MAX /**< max value*/
497 } IxPerfProfAccXscalePmuEvent;
500 * @ingroup IxPerfProfAcc
502 * @enum IxPerfProfAccStatus
504 * @brief Invalid Status Definitions
506 * These status will be used by the APIs to return to the user.
510 IX_PERFPROF_ACC_STATUS_SUCCESS = IX_SUCCESS, /**< success*/
511 IX_PERFPROF_ACC_STATUS_FAIL = IX_FAIL, /**< fail*/
512 IX_PERFPROF_ACC_STATUS_ANOTHER_UTIL_IN_PROGRESS,/**<another utility in
515 IX_PERFPROF_ACC_STATUS_XCYCLE_MEASUREMENT_IN_PROGRESS, /**<measurement in
518 IX_PERFPROF_ACC_STATUS_XCYCLE_NO_BASELINE, /**<no baseline yet*/
519 IX_PERFPROF_ACC_STATUS_XCYCLE_MEASUREMENT_REQUEST_OUT_OF_RANGE, /**<
523 IX_PERFPROF_ACC_STATUS_XCYCLE_PRIORITY_SET_FAIL, /**<
527 IX_PERFPROF_ACC_STATUS_XCYCLE_THREAD_CREATE_FAIL, /**<
530 IX_PERFPROF_ACC_STATUS_XCYCLE_PRIORITY_RESTORE_FAIL, /**<
534 IX_PERFPROF_ACC_STATUS_XCYCLE_MEASUREMENT_NOT_RUNNING, /**< xcycle not running*/
535 IX_PERFPROF_ACC_STATUS_XSCALE_PMU_NUM_INVALID, /**< invalid number
538 IX_PERFPROF_ACC_STATUS_XSCALE_PMU_EVENT_INVALID, /**< invalid pmu event*/
539 IX_PERFPROF_ACC_STATUS_XSCALE_PMU_START_NOT_CALLED, /**<a start process
545 IX_PERFPROF_ACC_STATUS_BUS_PMU_MODE_ERROR, /**< invalid mode*/
546 IX_PERFPROF_ACC_STATUS_BUS_PMU_PEC1_ERROR, /**< invalid pec1 entered*/
547 IX_PERFPROF_ACC_STATUS_BUS_PMU_PEC2_ERROR, /**< invalid pec2 entered*/
548 IX_PERFPROF_ACC_STATUS_BUS_PMU_PEC3_ERROR, /**< invalid pec3 entered*/
549 IX_PERFPROF_ACC_STATUS_BUS_PMU_PEC4_ERROR, /**< invalid pec4 entered*/
550 IX_PERFPROF_ACC_STATUS_BUS_PMU_PEC5_ERROR, /**< invalid pec5 entered*/
551 IX_PERFPROF_ACC_STATUS_BUS_PMU_PEC6_ERROR, /**< invalid pec6 entered*/
552 IX_PERFPROF_ACC_STATUS_BUS_PMU_PEC7_ERROR, /**< invalid pec7 entered*/
553 IX_PERFPROF_ACC_STATUS_BUS_PMU_START_NOT_CALLED, /**<a start process
558 IX_PERFPROF_ACC_STATUS_COMPONENT_NOT_SUPPORTED /**<Device or OS does not support component*/
559 } IxPerfProfAccStatus;
562 * @ingroup IxPerfProfAcc
564 * @enum IxPerfProfAccBusPmuMode
566 * @brief State selection of counters.
568 * These states will be used to determine the counters whose values are to be
573 IX_PERFPROF_ACC_BUS_PMU_MODE_HALT=0, /**< halt state*/
574 IX_PERFPROF_ACC_BUS_PMU_MODE_SOUTH, /**< south state*/
575 IX_PERFPROF_ACC_BUS_PMU_MODE_NORTH, /**< north state*/
576 IX_PERFPROF_ACC_BUS_PMU_MODE_SDRAM /**< SDRAM state*/
577 } IxPerfProfAccBusPmuMode;
580 * Section for prototypes interface functions
584 * @ingroup IxPerfProfAcc
586 * @fn ixPerfProfAccXscalePmuEventCountStart(
589 IxPerfProfAccXscalePmuEvent pmuEvent1,
590 IxPerfProfAccXscalePmuEvent pmuEvent2,
591 IxPerfProfAccXscalePmuEvent pmuEvent3,
592 IxPerfProfAccXscalePmuEvent pmuEvent4 )
594 * @brief This API will start the clock and event counting
596 * @param clkCntDiv BOOL [in] - enables/disables the clock divider. When
597 * true, the divider is enabled and the clock count will be incremented
598 * by one at each 64th processor clock cycle. When false, the divider
599 * is disabled and the clock count will be incremented at every
600 * processor clock cycle.
601 * @param numEvents UINT32 [in] - the number of PMU events that are to be
602 * monitored as specified by the user. For clock counting only, this
604 * @param pmuEvent1 @ref IxPerfProfAccXscalePmuEvent [in] - the specific PMU
605 * event to be monitored by counter 1
606 * @param pmuEvent2 @ref IxPerfProfAccXscalePmuEvent [in] - the specific PMU
607 * event to be monitored by counter 2
608 * @param pmuEvent3 @ref IxPerfProfAccXscalePmuEvent [in] - the specific PMU
609 * event to be monitored by counter 3
610 * @param pmuEvent4 @ref IxPerfProfAccXscalePmuEvent [in] - the specific PMU
611 * event to be monitored by counter 4
613 * This API will start the clock and xscale PMU event counting. Up to
614 * 4 events can be monitored simultaneously. This API has to be called before
615 * ixPerfProfAccXscalePmuEventCountStop can be called.
618 * - IX_PERFPROF_ACC_STATUS_SUCCESS if clock and events counting are
619 * started successfully
620 * - IX_PERFPROF_ACC_STATUS_FAIL if unable to start the counting
621 * - IX_PERFPROF_ACC_STATUS_XSCALE_PMU_NUM_INVALID if the number of events
622 * specified is out of the valid range
623 * - IX_PERFPROF_ACC_STATUS_XSCALE_PMU_EVENT_INVALID if the value of the PMU
624 * event specified does not exist
625 * - IX_PERFPROF_ACC_STATUS_ANOTHER_UTIL_IN_PROGRESS - another utility is
629 * @li ISR Callable : no
632 PUBLIC IxPerfProfAccStatus
633 ixPerfProfAccXscalePmuEventCountStart(
636 IxPerfProfAccXscalePmuEvent pmuEvent1,
637 IxPerfProfAccXscalePmuEvent pmuEvent2,
638 IxPerfProfAccXscalePmuEvent pmuEvent3,
639 IxPerfProfAccXscalePmuEvent pmuEvent4 );
642 * @ingroup IxPerfProfAcc
644 * @fn ixPerfProfAccXscalePmuEventCountStop (
645 IxPerfProfAccXscalePmuResults *eventCountStopResults)
647 * @brief This API will stop the clock and event counting
649 * @param *eventCountStopResults @ref IxPerfProfAccXscalePmuResults [out] - pointer
650 * to struct containing results of counters and their overflow. It is the
651 * users's responsibility to allocate the memory for this pointer.
653 * This API will stop the clock and xscale PMU events that are being counted.
654 * The results of the clock and events count will be stored in the pointer
655 * allocated by the user. It can only be called once
656 * IxPerfProfAccEventCountStart has been called.
659 * - IX_PERFPROF_ACC_STATUS_SUCCESS if clock and events counting are
660 * stopped successfully
661 * - IX_PERFPROF_ACC_STATUS_XSCALE_PMU_START_NOT_CALLED if
662 * ixPerfProfAccXscalePmuEventCountStart is not called first.
665 * @li ISR Callable : no
669 PUBLIC IxPerfProfAccStatus
670 ixPerfProfAccXscalePmuEventCountStop(
671 IxPerfProfAccXscalePmuResults *eventCountStopResults);
674 * @ingroup IxPerfProfAcc
676 * @fn ixPerfProfAccXscalePmuTimeSampStart(
680 * @brief Starts the time based sampling
682 * @param samplingRate UINT32 [in] - sampling rate is the number of
683 * clock counts before a counter overflow interrupt is generated,
684 * at which, a sample is taken; the rate specified cannot be greater
685 * than the counter size of 32bits or set to zero.
686 * @param clkCntDiv BOOL [in] - enables/disables the clock divider. When
687 * true, the divider is enabled and the clock count will be incremented
688 * by one at each 64th processor clock cycle. When false, the divider
689 * is disabled and the clock count will be incremented at every
690 * processor clock cycle.
692 * This API starts the time based sampling to determine the frequency with
693 * which lines of code are being executed. Sampling is done at the rate
694 * specified by the user. At each sample,the value of the program counter
695 * is determined. Each of these occurrences are recorded to determine the
696 * frequency with which the Xscale code is being executed. This API has to be
697 * called before ixPerfProfAccXscalePmuTimeSampStop can be called.
700 * - IX_PERFPROF_ACC_STATUS_SUCCESS if time based sampling is started
702 * - IX_PERFPROF_ACC_STATUS_FAIL if unable to start the sampling
703 * - IX_PERFPROF_ACC_STATUS_ANOTHER_UTIL_IN_PROGRESS - another utility is
707 * @li ISR Callable : no
710 PUBLIC IxPerfProfAccStatus
711 ixPerfProfAccXscalePmuTimeSampStart(
716 * @ingroup IxPerfProfAcc
718 * @fn ixPerfProfAccXscalePmuTimeSampStop(
719 IxPerfProfAccXscalePmuEvtCnt *clkCount,
720 IxPerfProfAccXscalePmuSamplePcProfile *timeProfile)
722 * @brief Stops the time based sampling
724 * @param *clkCount @ref IxPerfProfAccXscalePmuEvtCnt [out] - pointer to the
725 * struct containing the final clock count and its overflow. It is the
726 * user's responsibility to allocate the memory for this pointer.
727 * @param *timeProfile @ref IxPerfProfAccXscalePmuSamplePcProfile [out] -
728 * pointer to the array of profiles for each program counter value;
729 * the user should set the size of the array to
730 * IX_PERFPROF_ACC_XSCALE_PMU_MAX_PROFILE_SAMPLES. It is the user's
731 * responsibility to allocate the memory for this pointer.
733 * This API stops the time based sampling. The results are stored in the
734 * pointers allocated by the user. It can only be called once
735 * ixPerfProfAccXscalePmuTimeSampStart has been called.
738 * - IX_PERFPROF_ACC_STATUS_SUCCESS if time based sampling is stopped
740 * - IX_PERFPROF_ACC_STATUS_XSCALE_PMU_START_NOT_CALLED if
741 * ixPerfProfAccXscalePmuTimeSampStart not called first
744 * @li ISR Callable : no
747 PUBLIC IxPerfProfAccStatus
748 ixPerfProfAccXscalePmuTimeSampStop(
749 IxPerfProfAccXscalePmuEvtCnt *clkCount,
750 IxPerfProfAccXscalePmuSamplePcProfile *timeProfile);
753 * @ingroup IxPerfProfAcc
755 * @fn ixPerfProfAccXscalePmuEventSampStart(
757 IxPerfProfAccXscalePmuEvent pmuEvent1,
759 IxPerfProfAccXscalePmuEvent pmuEvent2,
761 IxPerfProfAccXscalePmuEvent pmuEvent3,
763 IxPerfProfAccXscalePmuEvent pmuEvent4,
766 * @brief Starts the event based sampling
768 * @param numEvents UINT32 [in] - the number of PMU events that are
769 * to be monitored as specified by the user. The value should be
770 * between 1-4 events at a time.
771 * @param pmuEvent1 @ref IxPerfProfAccXscalePmuEvent [in] - the specific PMU
772 * event to be monitored by counter 1
773 * @param eventRate1 UINT32 [in] - sampling rate of counter 1. The rate is
774 * the number of events before a sample taken. If 0 is specified, the
775 * the full counter value (0xFFFFFFFF) is used. The rate must not be
776 * greater than the full counter value.
777 * @param pmuEvent2 @ref IxPerfProfAccXscalePmuEvent [in] - the specific PMU
778 * event to be monitored by counter 2
779 * @param eventRate2 UINT32 [in] - sampling rate of counter 2. The rate is
780 * the number of events before a sample taken. If 0 is specified, the
781 * full counter value (0xFFFFFFFF) is used. The rate must not be
782 * greater than the full counter value.
783 * @param pmuEvent3 @ref IxPerfProfAccXscalePmuEvent [in] - the specific PMU
784 * event to be monitored by counter 3
785 * @param eventRate3 UINT32 [in] - sampling rate of counter 3. The rate is
786 * the number of events before a sample taken. If 0 is specified, the
787 * full counter value (0xFFFFFFFF) is used. The rate must not be
788 * greater than the full counter value.
789 * @param pmuEvent4 @ref IxPerfProfAccXscalePmuEvent [in] - the specific PMU
790 * event to be monitored by counter 4
791 * @param eventRate4 UINT32 [in] - sampling rate of counter 4. The rate is
792 * the number of events before a sample taken. If 0 is specified, the
793 * full counter value (0xFFFFFFFF) is used. The rate must not be
794 * greater than the full counter value.
796 * Starts the event based sampling to determine the frequency with
797 * which events are being executed. The sampling rate is the number of events,
798 * as specified by the user, before a counter overflow interrupt is
799 * generated. A sample is taken at each counter overflow interrupt. At each
800 * sample,the value of the program counter determines the corresponding
801 * location in the code. Each of these occurrences are recorded to determine
802 * the frequency with which the Xscale code in each event is executed. This API
803 * has to be called before ixPerfProfAccXscalePmuEventSampStop can be called.
806 * - IX_PERFPROF_ACC_STATUS_SUCCESS if event based sampling is started
808 * - IX_PERFPROF_ACC_STATUS_FAIL if unable to start the sampling
809 * - IX_PERFPROF_ACC_STATUS_XSCALE_PMU_NUM_INVALID if the number of events
810 * specified is out of the valid range
811 * - IX_PERFPROF_ACC_STATUS_XSCALE_PMU_EVENT_INVALID if the value of the
812 * PMU event specified does not exist
813 * - IX_PERFPROF_ACC_STATUS_ANOTHER_UTIL_IN_PROGRESS - another utility is
817 * @li ISR Callable : no
820 PUBLIC IxPerfProfAccStatus
821 ixPerfProfAccXscalePmuEventSampStart(
823 IxPerfProfAccXscalePmuEvent pmuEvent1,
825 IxPerfProfAccXscalePmuEvent pmuEvent2,
827 IxPerfProfAccXscalePmuEvent pmuEvent3,
829 IxPerfProfAccXscalePmuEvent pmuEvent4,
833 * @ingroup IxPerfProfAcc
835 * @fn ixPerfProfAccXscalePmuEventSampStop(
836 IxPerfProfAccXscalePmuSamplePcProfile *eventProfile1,
837 IxPerfProfAccXscalePmuSamplePcProfile *eventProfile2,
838 IxPerfProfAccXscalePmuSamplePcProfile *eventProfile3,
839 IxPerfProfAccXscalePmuSamplePcProfile *eventProfile4)
841 * @brief Stops the event based sampling
843 * @param *eventProfile1 @ref IxPerfProfAccXscalePmuSamplePcProfile [out] -
844 * pointer to the array of profiles for each program counter value;
845 * the user should set the size of the array to
846 * IX_PERFPROF_ACC_XSCALE_PMU_MAX_PROFILE_SAMPLES. It is the
847 * users's responsibility to allocate memory for this pointer.
848 * @param *eventProfile2 @ref IxPerfProfAccXscalePmuSamplePcProfile [out] -
849 * pointer to the array of profiles for each program counter value;
850 * the user should set the size of the array to
851 * IX_PERFPROF_ACC_XSCALE_PMU_MAX_PROFILE_SAMPLES. It is the
852 * users's responsibility to allocate memory for this pointer.
853 * @param *eventProfile3 @ref IxPerfProfAccXscalePmuSamplePcProfile [out] -
854 * pointer to the array of profiles for each program counter value;
855 * the user should set the size of the array to
856 * IX_PERFPROF_ACC_XSCALE_PMU_MAX_PROFILE_SAMPLES. It is the
857 * users's responsibility to allocate memory for this pointer.
858 * @param *eventProfile4 @ref IxPerfProfAccXscalePmuSamplePcProfile [out] -
859 * pointer to the array of profiles for each program counter value;
860 * the user should set the size of the array to
861 * IX_PERFPROF_ACC_XSCALE_PMU_MAX_PROFILE_SAMPLES. It is the
862 * users's responsibility to allocate memory for this pointer.
864 * This API stops the event based sampling. The results are stored in the
865 * pointers allocated by the user. It can only be called once
866 * ixPerfProfAccEventSampStart has been called.
869 * - IX_PERFPROF_ACC_STATUS_SUCCESS if event based sampling is stopped
871 * - IX_PERFPROF_ACC_STATUS_XSCALE_PMU_START_NOT_CALLED if
872 * ixPerfProfAccEventSampStart not called first.
875 * @li ISR Callable : no
878 PUBLIC IxPerfProfAccStatus
879 ixPerfProfAccXscalePmuEventSampStop(
880 IxPerfProfAccXscalePmuSamplePcProfile *eventProfile1,
881 IxPerfProfAccXscalePmuSamplePcProfile *eventProfile2,
882 IxPerfProfAccXscalePmuSamplePcProfile *eventProfile3,
883 IxPerfProfAccXscalePmuSamplePcProfile *eventProfile4);
886 * @ingroup IxPerfProfAcc
888 * @fn ixPerfProfAccXscalePmuResultsGet(IxPerfProfAccXscalePmuResults *results)
890 * @brief Reads the current value of the counters and their overflow
892 * @param *results @ref IxPerfProfAccXscalePmuResults [out] - pointer to the
893 results struct. It is the user's responsibility to allocate memory
896 * This API reads the value of all four event counters and the clock counter,
897 * and the associated overflows. It does not give results associated with
898 * sampling, i.e. PC and their frequencies. This API can be called at any time
899 * once a process has been started. If it is called before a process has started
900 * the user should be aware that the values it contains are default values and
901 * might be meaningless. The values of the counters are stored in the pointer
902 * allocated by the client.
907 * @li ISR Callable : no
911 ixPerfProfAccXscalePmuResultsGet(IxPerfProfAccXscalePmuResults *results);
914 * @ingroup IxPerfProfAcc
916 * @fn ixPerfProfAccBusPmuStart(
917 IxPerfProfAccBusPmuMode mode,
918 IxPerfProfAccBusPmuEventCounters1 pecEvent1,
919 IxPerfProfAccBusPmuEventCounters2 pecEvent2,
920 IxPerfProfAccBusPmuEventCounters3 pecEvent3,
921 IxPerfProfAccBusPmuEventCounters4 pecEvent4,
922 IxPerfProfAccBusPmuEventCounters5 pecEvent5,
923 IxPerfProfAccBusPmuEventCounters6 pecEvent6,
924 IxPerfProfAccBusPmuEventCounters7 pecEvent7)
925 * @brief Initializes all the counters and selects events to be monitored.
927 * Function initializes all the counters and assigns the events associated
928 * with the counters. Users send in the mode and events they want to count.
929 * This API verifies if the combination chosen is appropriate
930 * and sets all the registers accordingly. Selecting HALT mode will result
931 * in an error. User should use ixPerfProfAccBusPmuStop() to HALT.
934 * @param mode @ref IxPerfProfAccStateBusPmuMode [in] - Mode selection.
935 * @param pecEvent1 @ref IxPerfProfAccBusPmuEventCounters1 [in] - Event for PEC1.
936 * @param pecEvent2 @ref IxPerfProfAccBusPmuEventCounters2 [in] - Event for PEC2.
937 * @param pecEvent3 @ref IxPerfProfAccBusPmuEventCounters3 [in] - Event for PEC3.
938 * @param pecEvent4 @ref IxPerfProfAccBusPmuEventCounters4 [in] - Event for PEC4.
939 * @param pecEvent5 @ref IxPerfProfAccBusPmuEventCounters5 [in] - Event for PEC5.
940 * @param pecEvent6 @ref IxPerfProfAccBusPmuEventCounters6 [in] - Event for PEC6.
941 * @param pecEvent7 @ref IxPerfProfAccBusPmuEventCounters7 [in] - Event for PEC7.
944 * - IX_PERFPROF_ACC_STATUS_SUCCESS - Initialization executed
946 * - IX_PERFPROF_ACC_STATUS_BUS_PMU_MODE_ERROR - Error in selection of
947 * mode. Only NORTH, SOUTH and SDRAM modes are allowed.
948 * - IX_PERFPROF_ACC_STATUS_BUS_PMU_PEC1_ERROR - Error in selection of
950 * - IX_PERFPROF_ACC_STATUS_BUS_PMU_PEC2_ERROR - Error in selection of
952 * - IX_PERFPROF_ACC_STATUS_BUS_PMU_PEC3_ERROR - Error in selection of
954 * - IX_PERFPROF_ACC_STATUS_BUS_PMU_PEC4_ERROR - Error in selection of
956 * - IX_PERFPROF_ACC_STATUS_BUS_PMU_PEC5_ERROR - Error in selection of
958 * - IX_PERFPROF_ACC_STATUS_BUS_PMU_PEC6_ERROR - Error in selection of
960 * - IX_PERFPROF_ACC_STATUS_BUS_PMU_PEC7_ERROR - Error in selection of
962 * - IX_PERFPROF_ACC_STATUS_ANOTHER_UTIL_IN_PROGRESS - another utility
964 * - IX_PERFPROF_ACC_STATUS_FAIL - Failed to start because interrupt
965 * service routine fails to bind.
968 * @li ISR Callable : no
972 IxPerfProfAccStatus ixPerfProfAccBusPmuStart (
973 IxPerfProfAccBusPmuMode mode,
974 IxPerfProfAccBusPmuEventCounters1 pecEvent1,
975 IxPerfProfAccBusPmuEventCounters2 pecEvent2,
976 IxPerfProfAccBusPmuEventCounters3 pecEvent3,
977 IxPerfProfAccBusPmuEventCounters4 pecEvent4,
978 IxPerfProfAccBusPmuEventCounters5 pecEvent5,
979 IxPerfProfAccBusPmuEventCounters6 pecEvent6,
980 IxPerfProfAccBusPmuEventCounters7 pecEvent7);
983 * @ingroup IxPerfProfAcc
985 * @fn ixPerfProfAccBusPmuStop(void)
986 * @brief Stops all counters.
988 * This function stops all the PECs by setting the halt bit in the ESR.
992 * - IX_PERFPROF_ACC_STATUS_SUCCESS - Counters successfully halted.
993 * - IX_PERFPROF_ACC_STATUS_FAIL - Counters could'nt be halted.
994 * - IX_PERFPROF_ACC_STATUS_BUS_PMU_START_NOT_CALLED - the
995 * ixPerfProfAccBusPmuStart() function is not called.
998 * @li ISR Callable : no
1001 PUBLIC IxPerfProfAccStatus
1002 ixPerfProfAccBusPmuStop (void);
1005 * @ingroup IxPerfProfAcc
1007 * @fn ixPerfProfAccBusPmuResultsGet (
1008 IxPerfProfAccBusPmuResults *busPmuResults)
1009 * @brief Gets values of all counters
1011 * This function is responsible for getting all the counter values from the
1012 * lower API and putting it into an array for the user.
1014 * @param *busPmuResults @ref IxPerfProfAccBusPmuResults [out]
1015 * - Pointer to a structure of arrays to store all counter values.
1019 * @li Reentrant : no
1020 * @li ISR Callable : no
1024 ixPerfProfAccBusPmuResultsGet (IxPerfProfAccBusPmuResults *BusPmuResults);
1027 * @ingroup IxPerfProfAcc
1029 * @fn ixPerfProfAccBusPmuPMSRGet (
1031 * @brief Get values of PMSR
1033 * This API gets the Previous Master Slave Register
1034 * value and returns it to the calling function. This value indicates
1035 * which master or slave accessed the north, south bus or sdram last.
1036 * The value returned by this function is a 32 bit value and is read
1037 * from location of an offset 0x0024 of the base value.
1039 * The PMSR value returned indicate the following:
1042 * *************************************************************************************
1043 * * Bit * Name * Description *
1045 * *************************************************************************************
1046 * * [31:18] *Reserved* *
1047 * *************************************************************************************
1048 * * [17:12] * PSS * Indicates which of the slaves on *
1049 * * * * ARBS was previously *
1050 * * * * accessed by the AHBS. *
1051 * * * * [000001] Expansion Bus *
1052 * * * * [000010] SDRAM Controller *
1053 * * * * [000100] PCI *
1054 * * * * [001000] Queue Manager *
1055 * * * * [010000] AHB-APB Bridge *
1056 * * * * [100000] Reserved *
1057 * *************************************************************************************
1058 * * [11:8] * PSN * Indicates which of the Slaves on *
1059 * * * * ARBN was previously *
1060 * * * * accessed the AHBN. *
1061 * * * * [0001] SDRAM Controller *
1062 * * * * [0010] AHB-AHB Bridge *
1063 * * * * [0100] Reserved *
1064 * * * * [1000] Reserved *
1065 * *************************************************************************************
1066 * * [7:4] * PMS * Indicates which of the Masters on *
1067 * * * * ARBS was previously *
1068 * * * * accessing the AHBS. *
1069 * * * * [0001] Gasket *
1070 * * * * [0010] AHB-AHB Bridge *
1071 * * * * [0100] PCI *
1072 * * * * [1000] APB *
1073 * *************************************************************************************
1074 * * [3:0] * PMN * Indicates which of the Masters on *
1075 * * * * ARBN was previously *
1076 * * * * accessing the AHBN. *
1077 * * * * [0001] NPEA *
1078 * * * * [0010] NPEB *
1079 * * * * [0100] NPEC *
1080 * * * * [1000] Reserved *
1081 * *************************************************************************************
1084 * @param *pmsrValue UINT32 [out] - Pointer to return PMSR value. Users need to
1085 * allocate storage for psmrValue.
1089 * @li Reentrant : no
1090 * @li ISR Callable : no
1094 ixPerfProfAccBusPmuPMSRGet (
1099 * The APIs below are specifically used for Xcycle module.
1103 * @ingroup IxPerfProfAcc
1105 * @fn ixPerfProfAccXcycleBaselineRun (
1106 UINT32 *numBaselineCycle)
1108 * @brief Perform baseline for Xcycle
1110 * @param *numBaselineCycle UINT32 [out] - pointer to baseline value after
1111 * calibration. Calling function are responsible for
1112 * allocating memory space for this pointer.
1117 * This function MUST be run before the Xcycle tool can be used. This
1118 * function must be run immediately when the OS boots up with no other
1119 * addition programs running.
1120 * Addition note : This API will measure the time needed to perform
1121 * a fix amount of CPU instructions (~ 1 second worth of loops) as a
1122 * highest priority task and with interrupt disabled. The time measured
1123 * is known as the baseline - interpreted as the shortest time
1124 * needed to complete the amount of CPU instructions. The baseline is
1125 * returned as unit of time in 66Mhz clock tick.
1128 * - IX_PERFPROF_ACC_STATUS_SUCCESS - successful run, result is returned
1129 * - IX_PERFPROF_ACC_STATUS_XCYCLE_PRIORITY_SET_FAIL - failed to change
1131 * - IX_PERFPROF_ACC_STATUS_XCYCLE_PRIORITY_RESTORE_FAIL - failed to
1132 * restore task priority
1133 * - IX_PERFPROF_ACC_STATUS_ANOTHER_UTIL_IN_PROGRESS - another utility
1135 * - IX_PERFPROF_ACC_STATUS_XCYCLE_MEASUREMENT_IN_PROGRESS - Xcycle
1136 * tool has already started
1138 * @li Reentrant : no
1139 * @li ISR Callable : no
1142 PUBLIC IxPerfProfAccStatus
1143 ixPerfProfAccXcycleBaselineRun(
1144 UINT32 *numBaselineCycle);
1147 * @ingroup IxPerfProfAcc
1149 * @fn ixPerfProfAccXcycleStart(
1150 UINT32 numMeasurementsRequested);
1152 * @brief Start the measurement
1154 * @param numMeasurementsRequested UINT32 [in] - number of measurements
1155 * to perform. Value can be 0 to
1156 * IX_PERFPROF_ACC_XCYCLE_MAX_NUM_OF_MEASUREMENTS.
1157 * 0 indicate continuous measurement.
1163 * Start the measurements immediately.
1164 * numMeasurementsRequested specifies number of measurements to run.
1165 * If numMeasurementsRequested is set to 0, the measurement will
1166 * be performed continuously until IxPerfProfAccXcycleStop()
1168 * It is estimated that 1 measurement takes approximately 1 second during
1169 * low CPU utilization, therefore 128 measurement takes approximately 128 sec.
1170 * When CPU utilization is high, the measurement will take longer.
1171 * This function spawn a task the perform the measurement and returns.
1172 * The measurement may continue even if this function returns.
1174 * IMPORTANT: Under heavy CPU utilization, the task spawn by this
1175 * function may starve and fail to respond to stop command. User
1176 * may need to kill the task manually in this case.
1178 * There are only IX_PERFPROF_ACC_XCYCLE_MAX_NUM_OF_MEASUREMENTS
1179 * storage available so storing is wrapped around if measurements are
1180 * more than IX_PERFPROF_ACC_XCYCLE_MAX_NUM_OF_MEASUREMENTS.
1184 * - IX_PERFPROF_ACC_STATUS_SUCCESS - successful start, a thread is created
1185 * in the background to perform measurement.
1186 * - IX_PERFPROF_ACC_STATUS_XCYCLE_PRIORITY_SET_FAIL - failed to set
1188 * - IX_PERFPROF_ACC_STATUS_XCYCLE_THREAD_CREATE_FAIL - failed to create
1189 * thread to perform measurement.
1190 * - IX_PERFPROF_ACC_STATUS_XCYCLE_NO_BASELINE - baseline is not available
1191 * - IX_PERFPROF_ACC_STATUS_XCYCLE_MEASUREMENT_REQUEST_OUT_OF_RANGE -
1192 * value is larger than IX_PERFPROF_ACC_XCYCLE_MAX_NUM_OF_MEASUREMENTS
1193 * - IX_PERFPROF_ACC_STATUS_XCYCLE_MEASUREMENT_IN_PROGRESS - Xcycle tool
1194 * has already started
1195 * - IX_PERFPROF_ACC_STATUS_ANOTHER_UTIL_IN_PROGRESS - another utility is
1198 * @li Reentrant : no
1199 * @li ISR Callable : no
1202 PUBLIC IxPerfProfAccStatus
1203 ixPerfProfAccXcycleStart (
1204 UINT32 numMeasurementsRequested);
1207 * @ingroup IxPerfProfAcc
1209 * @fn ixPerfProfAccXcycleStop(void);
1211 * @brief Stop the Xcycle measurement
1218 * Stop Xcycle measurements immediately. If the measurements have stopped
1219 * or not started, return IX_PERFPROF_STATUS_XCYCLE_MEASUREMENT_NOT_RUNNING.
1220 * Note: This function does not stop measurement cold. The measurement thread
1221 * may need a few seconds to complete the last measurement. User needs to use
1222 * ixPerfProfAccXcycleInProgress() to determine if measurement is indeed
1226 * - IX_PERFPROF_ACC_STATUS_SUCCESS - successful measurement is stopped
1227 * - IX_PERFPROF_STATUS_XCYCLE_MEASUREMENT_NOT_RUNNING - no measurement running
1229 * @li Reentrant : no
1230 * @li ISR Callable : no
1233 PUBLIC IxPerfProfAccStatus
1234 ixPerfProfAccXcycleStop(void);
1237 * @ingroup IxPerfProfAcc
1239 * @fn ixPerfProfAccXcycleResultsGet(
1240 IxPerfProfAccXcycleResults *xcycleResult )
1242 * @brief Get the results of Xcycle measurement
1244 * @param *xcycleResult @ref IxPerfProfAccXcycleResults [out] - Pointer to
1245 * results of last measurements. Calling function are
1246 * responsible for allocating memory space for this pointer.
1251 * Retrieve the results of last measurement. User should use
1252 * ixPerfProfAccXcycleInProgress() to check if measurement is completed
1253 * before getting the results.
1256 * - IX_PERFPROF_ACC_STATUS_SUCCESS - successful
1257 * - IX_PERFPROF_ACC_STATUS_FAIL - result is not complete.
1258 * - IX_PERFPROF_ACC_STATUS_XCYCLE_NO_BASELINE - baseline is performed
1259 * - IX_PERFPROF_ACC_STATUS_XCYCLE_MEASUREMENT_IN_PROGRESS - Xcycle
1260 * tool is still running
1262 * @li Reentrant : no
1263 * @li ISR Callable : no
1266 PUBLIC IxPerfProfAccStatus
1267 ixPerfProfAccXcycleResultsGet (
1268 IxPerfProfAccXcycleResults *xcycleResult);
1271 * @ingroup IxPerfProfAcc
1273 * @fn ixPerfProfAccXcycleInProgress (void)
1275 * @brief Check if Xcycle is running
1281 * Check if Xcycle measuring task is running.
1284 * - TRUE - Xcycle is running
1285 * - FALSE - Xcycle is not running
1287 * @li Reentrant : no
1288 * @li ISR Callable : no
1292 ixPerfProfAccXcycleInProgress(void);
1296 * @ingroup IxPerfProfAcc
1298 * @fn ixPerfProfAccXscalePmuTimeSampCreateProcFile
1300 * @brief Enables proc file to call module function
1307 * This function is declared globally to enable /proc directory system to call
1308 * and execute the function when the registered file is called. This function is not meant to
1309 * be called by the user.
1312 * - Length of data written to file.
1314 * @li Reentrant : no
1315 * @li ISR Callable : no
1319 ixPerfProfAccXscalePmuTimeSampCreateProcFile (char *buf, char **start, off_t offset,
1320 int count, int *eof, void *data);
1323 * @ingroup IxPerfProfAcc
1325 * @fn ixPerfProfAccXscalePmuEventSampCreateProcFile
1327 * @brief Enables proc file to call module function
1334 * This function is declared globally to enable /proc directory system to call
1335 * and execute the function when the registered file is called. This function is not meant to
1336 * be called by the user.
1339 * - Length of data written to file.
1341 * @li Reentrant : no
1342 * @li ISR Callable : no
1346 ixPerfProfAccXscalePmuEventSampCreateProcFile (char *buf, char **start, off_t offset,
1347 int count, int *eof, void *data);
1350 #endif /* ifdef __linux */
1352 #endif /* ndef IXPERFPROFACC_H */
1355 *@} defgroup IxPerfProfAcc