![]() |
axipmon
Vitis Drivers API Documentation
|
Measures OCM traffic metrics using the AXI Performance Monitor driver.
This file contains a design example that shows how to use the AXI Performance Monitor driver APIs. The example measures the following metrics captured at OCM of Zynq MP:
MODIFICATION HISTORY:
Ver Who Date Changes
1.00a bss 04/01/15 First release 6.5 sg 11/02/16 Updated device ID to OCM PSU APM ID ms 01/23/17 Modified xil_printf statement in main function to ensure that "Successfully ran" and "Failed" strings are available in all examples. This is a fix for CR-965028. 6.10 ht 06/23/23 Added support for system device-tree flow. 6.14 vlt 01/27/26 Fixed codespell issues 6.15 vn 07/30/26 Fix Doxygen warnings 6.15 vn 09/08/26 Align Doxygen comments with AMD standards 6.15 vn 09/30/26 Update Doxygen comments to AMD standards
Macros | |
| #define | SAMPLE_INTERVAL 0x100 |
| Sampling interval. More... | |
OCM test addresses | |
| #define | OCM_WRITE_ADDRESS 0xFFFE0000 |
| OCM write test address. More... | |
| #define | OCM_READ_ADDRESS 0xFFFF0000 |
| OCM read test address. More... | |
Functions | |
| int | ApmCheck (u32 *BufferPtr, u16 Wtx, u16 Wbc, u16 Rtx, u16 Rbc) |
| Checks the metrics passed to this function are same as collected by APM. More... | |
| void | OcmTransaction () |
| Generates write and read transactions to OCM and reads metrics captured by APM. More... | |
| int | ApmMetricConfig (XAxiPmon *InstancePtr, u8 slot, u8 Metric1, u8 Metric2) |
| Sets Counter 0 and Counter 1 for collecting the passed metrics. More... | |
| void | ReadMetrics (XAxiPmon *InstancePtr, u32 *BufferPtr, u8 Counter1, u8 Counter2) |
| Reads metrics from APM counters to buffer. More... | |
| int | main (void) |
| Invokes the AXI Performance Monitor OCM example. More... | |
Variables | |
| u32 | MetricsBuffer [6] |
| Buffer for the collected metrics. More... | |
| #define OCM_READ_ADDRESS 0xFFFF0000 |
OCM read test address.
Referenced by OcmTransaction().
| #define OCM_WRITE_ADDRESS 0xFFFE0000 |
OCM write test address.
Referenced by OcmTransaction().
| #define SAMPLE_INTERVAL 0x100 |
Sampling interval.
Referenced by ApmMetricConfig().
| int ApmCheck | ( | u32 * | BufferPtr, |
| u16 | Wtx, | ||
| u16 | Wbc, | ||
| u16 | Rtx, | ||
| u16 | Rbc | ||
| ) |
Checks the metrics passed to this function are same as collected by APM.
| [in] | BufferPtr | Pointer to buffer containing captured metrics. |
| [in] | Wtx | Write transaction count value to be checked. |
| [in] | Wbc | Write byte count value to be checked. |
| [in] | Rtx | Read transaction count value to be checked. |
| [in] | Rbc | Read byte count value to be checked. |
Referenced by main().
| int ApmMetricConfig | ( | XAxiPmon * | InstancePtr, |
| u8 | slot, | ||
| u8 | Metric1, | ||
| u8 | Metric2 | ||
| ) |
Sets Counter 0 and Counter 1 for collecting the passed metrics.
| [in] | InstancePtr | Pointer to APM instance. |
| [in] | slot | APM slot. |
| [in] | Metric1 | Metric to be captured by Counter 1. |
| [in] | Metric2 | Metric to be captured by Counter 2. |
References SAMPLE_INTERVAL, XAPM_METRIC_COUNTER_0, XAPM_METRIC_COUNTER_1, XAxiPmon_EnableMetricsCounter(), XAxiPmon_ResetGlobalClkCounter(), XAxiPmon_ResetMetricCounter(), XAxiPmon_SetMetrics(), and XAxiPmon_StartCounters().
Referenced by OcmTransaction().
| int main | ( | void | ) |
Invokes the AXI Performance Monitor OCM example.
References ApmCheck(), XAxiPmon_Config::BaseAddress, MetricsBuffer, OcmTransaction(), XAxiPmon_CfgInitialize(), XAxiPmon_DisableMetricsCounter(), and XAxiPmon_LookupConfig().
| void OcmTransaction | ( | ) |
Generates write and read transactions to OCM and reads metrics captured by APM.
References ApmMetricConfig(), MetricsBuffer, OCM_READ_ADDRESS, OCM_WRITE_ADDRESS, ReadMetrics(), XAPM_METRIC_COUNTER_0, XAPM_METRIC_COUNTER_1, XAPM_METRIC_SET_0, XAPM_METRIC_SET_1, XAPM_METRIC_SET_2, and XAPM_METRIC_SET_3.
Referenced by main().
| void ReadMetrics | ( | XAxiPmon * | InstancePtr, |
| u32 * | BufferPtr, | ||
| u8 | Counter1, | ||
| u8 | Counter2 | ||
| ) |
Reads metrics from APM counters to buffer.
| [in] | InstancePtr | Pointer to APM instance. |
| [out] | BufferPtr | Pointer to buffer. |
| [in] | Counter1 | Counter number. |
| [in] | Counter2 | Counter number. |
References XAxiPmon_GetMetricCounter(), and XAxiPmon_StopCounters().
Referenced by OcmTransaction().
| u32 MetricsBuffer[6] |
Buffer for the collected metrics.
Referenced by main(), and OcmTransaction().