pmonpsv
Xilinx SDK Drivers API Documentation
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_ConfigXpsvPmon_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
InstancePtrcontains Instance pointer.
RegOffsetis 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
InstancePtrcontains Instance pointer contains the Baseaddress.
RegOffsetis the offset of the register to write.
Datais 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
InstancePtris a pointer to the XpsvPmon instance.
ConfigPtrpoints to the XpsvPmon device configuration structure.
EffectiveAddris 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
InstancePtris a pointer to the XpsvPmon instance. SampleInterval is the sample interval for the sampled metric counters
Domainis one of the counter like lpd_main or r5_domain
CounterNumis 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
InstancePtris a pointer to the XpsvPmon instance.
CounterNumis the Counter Number. The valid values are 0 to 9.
MainCtlis a reference parameter from application where mainctrl of specified counter is filled.
StatPeriodis the reference parameter from application where the StatPeriod is filled.
Domainis 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
InstancePtris a pointer to the XpsvPmon instance.
ReadRequestValueis the user space pointer with which the value of Write Request Count has to be filled
ReadRespValueis the user space pointer with which the value of Write Response Count has to be filled
Domainis one of the counter like lpd_main or r5_domain
CounterNumis 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
InstancePtris a pointer to the XpsvPmon instance.
WriteRequestValueis the user space pointer with
  • which the value of Write Request Count has to be filled
WriteRespValueis the user space pointer with
  • which the value of Write Response Count has to be filled
Domainis one of the counter like lpd_main or r5_domain
CounterNumis 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
InstancePtris 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
DeviceIdcontains 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
InstancePtris a pointer to the XpsvPmon instance. which the value of Write Request Count has to be filled
Domainis one of the counter like lpd_main or r5_domain
CounterNumpointer 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
InstancePtris a pointer to the XpsvPmon instance.
Domainis one of the counter like lpd_main or r5_domain eg XPMONPSV_R5_DOMAIN, XPMONPSV_LPD_MAIN_DOMAIN
CounterNumis 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
InstancePtris a pointer to the XpsvPmon instance.
StatPeriodis the period for which specified counter has to be connected.
Domainis one of the counter like lpd_main or r5_domain
CounterNumis 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
InstancePtris a pointer to the XpsvPmon instance.
PortSelis 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
Domainis one of the counter like lpd_main or r5_domain
CounterNumis 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
InstancePtris a pointer to the XpsvPmon instance.
SrcSelis the value of the sourceselect.
Domainis one of the counter like lpd_main or r5_domain
CounterNumis 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
InstancePtris a pointer to the XpsvPmon instance.
Domainis one of the counter like lpd_main or r5_domain
CounterNumis 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
InstancePtris 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.