| pmonpsv Vitis Drivers API Documentation

- Overview
- Data Structures
- APIs
- File List
- Examples

Data Structures | Macros | Functions | Variables
Overview

## Data Structures
struct | XPmonPsv_Config
| This typedef contains configuration information for the Performance Monitor device. More...
struct | XPmonPsv
| The driver's instance data. More...

## Macros
#define | PMONPSV_APM0_LAR 0x0FB0U
| Performance Monitor Register offsets. More...
#define | XPmonPsv_ReadReg(InstancePtr, RegOffset) (Xil_In32((InstancePtr->Config.BaseAddress) + (RegOffset)))
| Read a register of the Performance Monitor device. More...
#define | XPmonPsv_WriteReg(InstancePtr, RegOffset, Data) (Xil_Out32( InstancePtr->Config.BaseAddress + (RegOffset), (Data)))
| Write a register of the Performance Monitor device. More...

## Functions
u32 | XPmonPsv_CfgInitialize (XPmonPsv *InstancePtr, const XPmonPsv_Config *ConfigPtr, UINTPTR EffectiveAddr)
| This function initializes a specific XPmonPsv device/instance. More...
u32 | XPmonPsv_ResetCounter (const XPmonPsv *InstancePtr, u32 Domain, u32 CounterNum)
| This function resets the specified counter. More...
u32 | XPmonPsv_SetMetrics (const XPmonPsv *InstancePtr, u32 StatPeriod, u32 Domain, u32 CounterNum)
| This function sets Metrics for specified Counter in the corresponding Metric Selector Register. More...
u32 | XPmonPsv_GetMetrics (const XPmonPsv *InstancePtr, u32 CounterNum, u8 *MainCtl, u8 *StatPeriod, u32 Domain)
| This function returns Metrics in the specified Counter from the corresponding Metric Selector Register. More...
u32 | XPmonPsv_GetWriteCounter (const XPmonPsv *InstancePtr, u32 *WriteRequestValue, u32 *WriteRespValue, u32 Domain, u32 CounterNum)
| This function returns the contents of the Write response and request Counter Register. More...
u32 | XPmonPsv_RequestCounter (XPmonPsv *InstancePtr, u32 Domain, u32 *CounterNum)
| This function returns success if a free counter was found and request was granted. More...
u32 | XPmonPsv_GetReadCounter (const XPmonPsv *InstancePtr, u32 *ReadRequestValue, u32 *ReadRespValue, u32 Domain, u32 CounterNum)
| This function returns the contents of the Read response and request Counter Register. More...
u32 | XPmonPsv_EnableCounters (const XPmonPsv *InstancePtr, u32 Domain, u32 CounterNum)
| This function enables the following in the Performance Monitor: More...
void | XPmonPsv_Unlock (const XPmonPsv *InstancePtr)
| This function unlocks the PmonPsv. More...
void | XPmonPsv_Lock (const XPmonPsv *InstancePtr)
| This function locks the PmonPsv. More...
u32 | XPmonPsv_StopCounter (const XPmonPsv *InstancePtr, u32 Domain, u32 CounterNum)
| This function disables the following in the Performance Monitor: More...
u32 | XPmonPsv_SetSrc (const XPmonPsv *InstancePtr, u32 SrcSel, u32 Domain, u32 CounterNum)
| This function selects the Source to be monitored. More...
u32 | XPmonPsv_SetPort (const XPmonPsv *InstancePtr, u32 PortSel, u32 Domain, u32 CounterNum)
| This function selects the Port to be monitored. More...
XPmonPsv_Config * | XPmonPsv_LookupConfig (u16 DeviceId)
| Functions in xpmonpsv_sinit.c. More...

## Variables
XPmonPsv_Config | XPmonPsv_ConfigTable [XPAR_XPMONPSV_NUM_INSTANCES]
| This table contains configuration information for each System Monitor/ADC device in the system. More...
XPmonPsv_Config | XPmonPsv_ConfigTable [XPAR_XPMONPSV_NUM_INSTANCES]
| This table contains configuration information for each System Monitor/ADC device in the system. More...

## Macro Definition Documentation

#define PMONPSV_APM0_LAR 0x0FB0U

Performance Monitor Register offsets.

Referenced by XPmonPsv_Lock(), and XPmonPsv_Unlock().

#define XPmonPsv_ReadReg | ( |  | InstancePtr,
|  |  | RegOffset
| ) |  | (Xil_In32((InstancePtr->Config.BaseAddress) + (RegOffset)))

Read a register of the Performance Monitor device.

This macro provides register access to all registers using the register offsets defined above.

Parameters

  InstancePtr | contains Instance pointer.
  RegOffset | is the offset of the register to read.

Returns
  The contents of the register.

Referenced by XPmonPsv_GetMetrics(), XPmonPsv_GetReadCounter(), and XPmonPsv_GetWriteCounter().

#define XPmonPsv_WriteReg | ( |  | InstancePtr,
|  |  | RegOffset,
|  |  | Data
| ) |  | (Xil_Out32( InstancePtr->Config.BaseAddress + (RegOffset), (Data)))

Write a register of the Performance Monitor device.

This macro provides register access to all registers using the register offsets defined above.

Parameters

  InstancePtr | contains Instance pointer contains the Baseaddress.
  RegOffset | is the offset of the register to write.
  Data | is the value to write to the register.

Returns
  None.

Referenced by XPmonPsv_EnableCounters(), XPmonPsv_Lock(), XPmonPsv_ResetCounter(), XPmonPsv_SetMetrics(), XPmonPsv_SetPort(), XPmonPsv_SetSrc(), XPmonPsv_StopCounter(), and XPmonPsv_Unlock().

## Function Documentation

u32 XPmonPsv_CfgInitialize | ( | XPmonPsv * | InstancePtr,
|  | const XPmonPsv_Config * | ConfigPtr,
|  | UINTPTR | EffectiveAddr
| ) |  |

This function initializes a specific XPmonPsv device/instance.

Functions in xpmonpsv.c.

This function must be called prior to using the Performance Monitor device.

Parameters

  InstancePtr | is a pointer to the XPmonPsv instance.
  ConfigPtr | points to the XPmonPsv device configuration structure.
  EffectiveAddr | is the device base address in the virtual memory address space. If the address translation is not used then the physical address is passed. Unexpected errors may occur if the address mapping is changed after this function is invoked.

Returns
  - XST_SUCCESS if successful.
  - XST_DEVICE_IS_STARTED if the device is already started.

Note
  The user needs to first call the XPmonPsv_LookupConfig() API which returns the Configuration structure pointer which is passed as a parameter to the XPmonPsv_CfgInitialize() API.

References XPmonPsv_Config::BaseAddress, XPmonPsv::Config, XPmonPsv_Config::DeviceId, XPmonPsv::IsReady, and XPmonPsv::RequestedCounters.

u32 XPmonPsv_EnableCounters | ( | const XPmonPsv * | InstancePtr,
|  | u32 | Domain,
|  | u32 | CounterNum
| ) |  |

This function enables the following in the Performance Monitor:

- Global clock counter

Parameters

  InstancePtr | is a pointer to the XPmonPsv instance. SampleInterval is the sample interval for the sampled metric counters
  Domain | is one of the counter like lpd_main or r5_domain
  CounterNum | is the Counter Number to be enabled.

Returns
  XST_SUCCESS on success XST_FAILURE on failure

Note
  None

Setting register field GlobalEn to 1 enables the tracing and statistics collection subsystems of the packet probe.

References XPmonPsv::IsReady, XPmonPsv::RequestedCounters, and XPmonPsv_WriteReg.

u32 XPmonPsv_GetMetrics | ( | const XPmonPsv * | InstancePtr,
|  | u32 | CounterNum,
|  | u8 * | MainCtl,
|  | u8 * | StatPeriod,
|  | u32 | Domain
| ) |  |

This function returns Metrics in the specified Counter from the corresponding Metric Selector Register.

Parameters

  InstancePtr | is a pointer to the XPmonPsv instance.
  CounterNum | is the Counter Number. The valid values are 0 to 9.
  MainCtl | is a reference parameter from application where mainctrl of specified counter is filled.
  StatPeriod | is the reference parameter from application where the StatPeriod is filled.
  Domain | is one of the counter like lpd_main or r5_domain

Returns
  XST_SUCCESS if Success

References XPmonPsv::IsReady, XPmonPsv::RequestedCounters, and XPmonPsv_ReadReg.

u32 XPmonPsv_GetReadCounter | ( | const XPmonPsv * | InstancePtr,
|  | u32 * | ReadRequestValue,
|  | u32 * | ReadRespValue,
|  | u32 | Domain,
|  | u32 | CounterNum
| ) |  |

This function returns the contents of the Read response and request Counter Register.

Parameters

  InstancePtr | is a pointer to the XPmonPsv instance.
  ReadRequestValue | is the user space pointer with which the value of Write Request Count has to be filled
  ReadRespValue | is the user space pointer with which the value of Write Response Count has to be filled
  Domain | is one of the counter like lpd_main or r5_domain
  CounterNum | is the Counter Number. The valid values are 0 to 9.

Returns
  XST_SUCCESS on success XST_FAILURE on failure

References XPmonPsv::IsReady, XPmonPsv::RequestedCounters, and XPmonPsv_ReadReg.

u32 XPmonPsv_GetWriteCounter | ( | const XPmonPsv * | InstancePtr,
|  | u32 * | WriteRequestValue,
|  | u32 * | WriteRespValue,
|  | u32 | Domain,
|  | u32 | CounterNum
| ) |  |

This function returns the contents of the Write response and request Counter Register.

Parameters

  InstancePtr | is a pointer to the XPmonPsv instance.
  WriteRequestValue | is the user space pointer with which the value of Write Request Count has to be filled
  WriteRespValue | is the user space pointer with which the value of Write Response Count has to be filled
  Domain | is one of the counter like lpd_main or r5_domain
  CounterNum | is the Counter Number. The valid values are 0 to 9.

Returns
  XST_SUCCESS on success XST_FAILURE on failure

Note
  None.

References XPmonPsv::IsReady, XPmonPsv::RequestedCounters, and XPmonPsv_ReadReg.

void XPmonPsv_Lock | ( | const XPmonPsv * | InstancePtr | ) |

This function locks the PmonPsv.

Parameters

  InstancePtr | is a pointer to the XPmonPsv instance.

Returns
  None

References XPmonPsv::IsReady, PMONPSV_APM0_LAR, and XPmonPsv_WriteReg.

XPmonPsv_Config * XPmonPsv_LookupConfig | ( | u16 | DeviceId | ) |

Functions in xpmonpsv_sinit.c.

This function looks up the device configuration based on the unique device ID.

The table XPmonPsv_ConfigTable contains the configuration info for each device in the system.

Parameters

  DeviceId | contains the ID of the device for which the device configuration pointer is to be returned.

Returns
  - A pointer to the configuration found.
  - NULL if the specified device ID was not found.

Note
  None.

u32 XPmonPsv_RequestCounter | ( | XPmonPsv * | InstancePtr,
|  | u32 | Domain,
|  | u32 * | CounterNum
| ) |  |

This function returns success if a free counter was found and request was granted.

Parameters

  InstancePtr | is a pointer to the XPmonPsv instance. which the value of Write Request Count has to be filled
  Domain | is one of the counter like lpd_main or r5_domain
  CounterNum | pointer to get Counter Number.

Returns
  Granted counter number. XST_FAILURE otherwise.

References XPmonPsv::IsReady, and XPmonPsv::RequestedCounters.

u32 XPmonPsv_ResetCounter | ( | const XPmonPsv * | InstancePtr,
|  | u32 | Domain,
|  | u32 | CounterNum
| ) |  |

This function resets the specified counter.

Parameters

  InstancePtr | is a pointer to the XPmonPsv instance.
  Domain | is one of the counter like lpd_main or r5_domain eg XPMONPSV_R5_DOMAIN, XPMONPSV_LPD_MAIN_DOMAIN
  CounterNum | is the Counter Number. The valid values are 0 to 9.

Returns
  XST_SUCCESS on success XST_FAILURE on failure

Note
  None.

References XPmonPsv::IsReady, XPmonPsv::RequestedCounters, and XPmonPsv_WriteReg.

u32 XPmonPsv_SetMetrics | ( | const XPmonPsv * | InstancePtr,
|  | u32 | StatPeriod,
|  | u32 | Domain,
|  | u32 | CounterNum
| ) |  |

This function sets Metrics for specified Counter in the corresponding Metric Selector Register.

Parameters

  InstancePtr | is a pointer to the XPmonPsv instance.
  StatPeriod | is the period for which specified counter has to be connected.
  Domain | is one of the counter like lpd_main or r5_domain
  CounterNum | is the Counter Number. The valid values are 0 to 9.

Returns
  XST_SUCCESS on success XST_FAILURE on failure

Note
  None.

References XPmonPsv::RequestedCounters, and XPmonPsv_WriteReg.

u32 XPmonPsv_SetPort | ( | const XPmonPsv * | InstancePtr,
|  | u32 | PortSel,
|  | u32 | Domain,
|  | u32 | CounterNum
| ) |  |

This function selects the Port to be monitored.

Parameters

  InstancePtr | is a pointer to the XPmonPsv instance.
  PortSel | is the value of the portselect. eg:for lpd_main 0: lpd_fpd_axi 1: prot_xppu for r5_domain 0 : lpd_afifs_axi 1 : lpd_ocm 2 : lpd_ocmext 3 : lpd_pmc_rpu_axi0
  Domain | is one of the counter like lpd_main or r5_domain
  CounterNum | is the Counter Number. The valid values are 0 to 9.

Returns
  XST_SUCCESS on success XST_FAILURE on failure

References XPmonPsv::IsReady, XPmonPsv::RequestedCounters, and XPmonPsv_WriteReg.

u32 XPmonPsv_SetSrc | ( | const XPmonPsv * | InstancePtr,
|  | u32 | SrcSel,
|  | u32 | Domain,
|  | u32 | CounterNum
| ) |  |

This function selects the Source to be monitored.

Parameters

  InstancePtr | is a pointer to the XPmonPsv instance.
  SrcSel | is the value of the sourceselect.
  Domain | is one of the counter like lpd_main or r5_domain
  CounterNum | is the Counter Number. The valid values are 0 to 9.

Returns
  XST_SUCCESS on success XST_FAILURE on failure

Set the source 000 - OFF Counter disabled. 001 - CYCLE8 Probe clock cycles. 002 - IDLE Idle cycles during which no packet data is observed. 003 - XFER Transfer cycles during which packet data is transferred. 004 - BUSY Busy cycles during which the packet data is made available by the transmitting agent but the receiving agent is not ready to receive it. 005 - WAIT Wait cycles during a packet in which the transmitting agent suspends the transfer of packet data. 006 - PKT Packets. 007 - LUT1 Packets selected by the LUT. 008 - BYTE2 Total number of payload bytes.

References XPmonPsv::IsReady, XPmonPsv::RequestedCounters, and XPmonPsv_WriteReg.

u32 XPmonPsv_StopCounter | ( | const XPmonPsv * | InstancePtr,
|  | u32 | Domain,
|  | u32 | CounterNum
| ) |  |

This function disables the following in the Performance Monitor:

- Global clock counter

Parameters

  InstancePtr | is a pointer to the XPmonPsv instance.
  Domain | is one of the counter like lpd_main or r5_domain
  CounterNum | is the Counter Number. The valid values are 0 to 9.

Returns
  XST_SUCCESS on success XST_FAILURE on failure

References XPmonPsv::IsReady, XPmonPsv::RequestedCounters, and XPmonPsv_WriteReg.

void XPmonPsv_Unlock | ( | const XPmonPsv * | InstancePtr | ) |

This function unlocks the PmonPsv.

Parameters

  InstancePtr | is a pointer to the XPmonPsv instance.

Returns
  None

References XPmonPsv::IsReady, PMONPSV_APM0_LAR, and XPmonPsv_WriteReg.

## Variable Documentation

XPmonPsv_Config XPmonPsv_ConfigTable[XPAR_XPMONPSV_NUM_INSTANCES]

This table contains configuration information for each System Monitor/ADC device in the system.

XPmonPsv_Config XPmonPsv_ConfigTable[XPAR_XPMONPSV_NUM_INSTANCES]

Initial value:
=
{
{
XPAR_PSU_CORESIGHT_FPD_ATM_DEVICE_ID,
XPAR_PSU_CORESIGHT_FPD_ATM_S_AXI_BASEADDR
},
{
XPAR_PSU_CORESIGHT_LPD_ATM_DEVICE_ID,
XPAR_PSU_CORESIGHT_LPD_ATM_S_AXI_BASEADDR
}
}

This table contains configuration information for each System Monitor/ADC device in the system.