pmonpsv: Pmonpsv_v1_0

| pmonpsv Xilinx SDK Drivers API Documentation

- Overview
- Data Structures
- APIs
- File List

Data Structures | Macros | Functions | Variables
Pmonpsv_v1_0

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

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

## Functions
s32 | XpsvPmon_CfgInitialize (XpsvPmon *InstancePtr, const XPmonpsv_Config *ConfigPtr, UINTPTR EffectiveAddr)
| This function initializes a specific XpsvPmon device/instance. More...
u32 | XpsvPmon_ResetCounter (const XpsvPmon *InstancePtr, u32 Domain, u32 CounterNum)
| This function resets the specified counter. More...
u32 | XpsvPmon_SetMetrics (const XpsvPmon *InstancePtr, u32 StatPeriod, u32 Domain, u32 CounterNum)
| This function sets Metrics for specified Counter in the corresponding Metric Selector Register. More...
s32 | XpsvPmon_GetMetrics (const XpsvPmon *InstancePtr, u32 CounterNum, u8 *MainCtl, u8 *StatPeriod, u32 Domain)
| This function returns Metrics in the specified Counter from the corresponding Metric Selector Register. More...
s32 | XpsvPmon_GetWriteCounter (const XpsvPmon *InstancePtr, u32 *WriteRequestValue, u32 *WriteRespValue, u32 Domain, u32 CounterNum)
| This function returns the contents of the Write response and request Counter Register. More...
s32 | XpsvPmon_RequestCounter (XpsvPmon *InstancePtr, u32 Domain, u32 *CounterNum)
| This function returns success if a free counter was found and request was granted. More...
s32 | XpsvPmon_GetReadCounter (const XpsvPmon *InstancePtr, u32 *ReadRequestValue, u32 *ReadRespValue, u32 Domain, u32 CounterNum)
| This function returns the contents of the Read response and request Counter Register. More...
s32 | XpsvPmon_EnableCounters (const XpsvPmon *InstancePtr, u32 Domain, u32 CounterNum)
| This function enables the following in the Performance Monitor: More...
s32 | XpsvPmon_Unlock (const XpsvPmon *InstancePtr)
| This function unlocks the Pmonpsv. More...
s32 | XpsvPmon_Lock (const XpsvPmon *InstancePtr)
| This function locks the Pmonpsv. More...
s32 | XpsvPmon_StopCounter (const XpsvPmon *InstancePtr, u32 Domain, u32 CounterNum)
| This function disables the following in the Performance Monitor: More...
s32 | XpsvPmon_SetSrc (const XpsvPmon *InstancePtr, u32 SrcSel, u32 Domain, u32 CounterNum)
| This function selects the Source to be monitored. More...
s32 | XpsvPmon_SetPort (const XpsvPmon *InstancePtr, u32 PortSel, u32 Domain, u32 CounterNum)
| This function selects the Port to be monitored. More...
XPmonpsv_Config * | XpsvPmon_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 XpsvPmon_Lock(), and XpsvPmon_Unlock().

#define XpsvPmon_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 XpsvPmon_GetMetrics(), XpsvPmon_GetReadCounter(), and XpsvPmon_GetWriteCounter().

#define XpsvPmon_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 XpsvPmon_EnableCounters(), XpsvPmon_Lock(), XpsvPmon_ResetCounter(), XpsvPmon_SetMetrics(), XpsvPmon_SetPort(), XpsvPmon_SetSrc(), XpsvPmon_StopCounter(), and XpsvPmon_Unlock().

## Function Documentation

s32 XpsvPmon_CfgInitialize | ( | XpsvPmon * | InstancePtr,
|  | const XPmonpsv_Config * | ConfigPtr,
|  | UINTPTR | EffectiveAddr
| ) |  |

This function initializes a specific XpsvPmon 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 XpsvPmon instance.
  ConfigPtr | points to the XpsvPmon 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 on initialization completion

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

References XPmonpsv_Config::BaseAddress, XpsvPmon::Config, XPmonpsv_Config::DeviceId, XpsvPmon::IsReady, and XpsvPmon::RequestedCounters.

s32 XpsvPmon_EnableCounters | ( | const XpsvPmon * | InstancePtr,
|  | u32 | Domain,
|  | u32 | CounterNum
| ) |  |

This function enables the following in the Performance Monitor:

- Global clock counter

Parameters

  InstancePtr | is a pointer to the XpsvPmon 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 XpsvPmon::IsReady, XpsvPmon::RequestedCounters, and XpsvPmon_WriteReg.

s32 XpsvPmon_GetMetrics | ( | const XpsvPmon * | 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 XpsvPmon 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 XpsvPmon::IsReady, XpsvPmon::RequestedCounters, and XpsvPmon_ReadReg.

s32 XpsvPmon_GetReadCounter | ( | const XpsvPmon * | 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 XpsvPmon 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 XpsvPmon::IsReady, XpsvPmon::RequestedCounters, and XpsvPmon_ReadReg.

s32 XpsvPmon_GetWriteCounter | ( | const XpsvPmon * | 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 XpsvPmon 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 XpsvPmon::IsReady, XpsvPmon::RequestedCounters, and XpsvPmon_ReadReg.

s32 XpsvPmon_Lock | ( | const XpsvPmon * | InstancePtr | ) |

This function locks the Pmonpsv.

Parameters

  InstancePtr | is a pointer to the XpsvPmon instance.

Returns
  XST_SUCCESS

References XpsvPmon::IsReady, PMONPSV_APM0_LAR, and XpsvPmon_WriteReg.

XPmonpsv_Config * XpsvPmon_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.

s32 XpsvPmon_RequestCounter | ( | XpsvPmon * | 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 XpsvPmon 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 XpsvPmon::IsReady, and XpsvPmon::RequestedCounters.

u32 XpsvPmon_ResetCounter | ( | const XpsvPmon * | InstancePtr,
|  | u32 | Domain,
|  | u32 | CounterNum
| ) |  |

This function resets the specified counter.

Parameters

  InstancePtr | is a pointer to the XpsvPmon 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 XpsvPmon::IsReady, XpsvPmon::RequestedCounters, and XpsvPmon_WriteReg.

u32 XpsvPmon_SetMetrics | ( | const XpsvPmon * | 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 XpsvPmon 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 XpsvPmon::RequestedCounters, and XpsvPmon_WriteReg.

s32 XpsvPmon_SetPort | ( | const XpsvPmon * | InstancePtr,
|  | u32 | PortSel,
|  | u32 | Domain,
|  | u32 | CounterNum
| ) |  |

This function selects the Port to be monitored.

Parameters

  InstancePtr | is a pointer to the XpsvPmon 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 XpsvPmon::IsReady, XpsvPmon::RequestedCounters, and XpsvPmon_WriteReg.

s32 XpsvPmon_SetSrc | ( | const XpsvPmon * | InstancePtr,
|  | u32 | SrcSel,
|  | u32 | Domain,
|  | u32 | CounterNum
| ) |  |

This function selects the Source to be monitored.

Parameters

  InstancePtr | is a pointer to the XpsvPmon 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 XpsvPmon::IsReady, XpsvPmon::RequestedCounters, and XpsvPmon_WriteReg.

s32 XpsvPmon_StopCounter | ( | const XpsvPmon * | InstancePtr,
|  | u32 | Domain,
|  | u32 | CounterNum
| ) |  |

This function disables the following in the Performance Monitor:

- Global clock counter

Parameters

  InstancePtr | is a pointer to the XpsvPmon 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 XpsvPmon::IsReady, XpsvPmon::RequestedCounters, and XpsvPmon_WriteReg.

s32 XpsvPmon_Unlock | ( | const XpsvPmon * | InstancePtr | ) |

This function unlocks the Pmonpsv.

Parameters

  InstancePtr | is a pointer to the XpsvPmon instance.

Returns
  XST_SUCCESS

References XpsvPmon::IsReady, PMONPSV_APM0_LAR, and XpsvPmon_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.