axipmon
Vitis Drivers API Documentation
 All Data Structures Files Functions Variables Macros Groups Pages
xaxipmon_polled_example.c File Reference

Overview

Demonstrates the AXI Performance Monitor driver APIs in polled mode.

Note
Global Clock Counter and Metric Counters are enabled. The Application for which Metrics need to be computed should be run and then the Metrics collected.
MODIFICATION HISTORY:
Ver   Who    Date     Changes


1.00a bss 02/29/12 First release 2.00a bss 06/23/12 Updated to support v2_00a version of IP. 3.00a bss 09/03/12 Deleted XAxiPmon_SetAgent API to support v2_01a version of IP. 3.01a bss 10/25/12 Deleted XAxiPmon_EnableCountersData API to support new version of IP. 6.5 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 12/12/25 Update Doxygen comments to include SDT flow details. 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

#include "xaxipmon.h"
#include "xparameters.h"
#include "xstatus.h"
#include "stdio.h"

Functions

int AxiPmonPolledExample (UINTPTR BaseAddress, u32 *Metrics, u32 *ClkCntHigh, u32 *ClkCntLow)
 Runs a test on the AXI Performance Monitor device using the driver APIs. More...
 
int main (void)
 Invokes the AXI Performance Monitor polled example. More...
 

Function Documentation

int AxiPmonPolledExample ( UINTPTR  BaseAddress,
u32 *  Metrics,
u32 *  ClkCntHigh,
u32 *  ClkCntLow 
)

Runs a test on the AXI Performance Monitor device using the driver APIs.

This function does the following tasks:

  • Initiate the AXI Performance Monitor device driver instance
  • Run self-test on the device
  • Sets Metric Selector to select Slave Agent Number 1 and first set of Metrics
  • Enables Global Clock Counter and Metric Counters
  • Calls Application for which Metrics need to be computed
  • Disables Global Clock Counter and Metric Counters
  • Read Global Clock Counter and Metric Counter 0
Parameters
[in]BaseAddressBase address of the device.
[out]MetricsReference variable in which computed metrics are filled.
[out]ClkCntHighReference variable in which the upper 32 bits of the Global Clock Counter are filled.
[out]ClkCntLowReference variable in which the lower 32 bits of the Global Clock Counter are filled.
Returns
  • XST_SUCCESS if the example has completed successfully.
  • XST_FAILURE if the example has failed.
Note
In XSCT/classic flow, DeviceId is used to look up the device configuration.

References XAxiPmon_Config::BaseAddress, XAPM_INCREMENTER_0, XAPM_METRIC_COUNTER_0, XAPM_METRIC_SET_0, XAxiPmon_CfgInitialize(), XAxiPmon_DisableGlobalClkCounter, XAxiPmon_DisableMetricsCounter(), XAxiPmon_EnableGlobalClkCounter, XAxiPmon_EnableMetricsCounter(), XAxiPmon_GetGlobalClkCounter(), XAxiPmon_GetMetricCounter(), XAxiPmon_LookupConfig(), XAxiPmon_SelfTest(), XAxiPmon_SetIncrementerRange(), and XAxiPmon_SetMetrics().

Referenced by main().

int main ( void  )

Invokes the AXI Performance Monitor polled example.

Returns
  • XST_SUCCESS if the example has completed successfully.
  • XST_FAILURE if the example has failed.

References AxiPmonPolledExample().