Software Drivers

xaxipmon.h File Reference

#include "xil_types.h"
#include "xil_assert.h"
#include "xstatus.h"
#include "xaxipmon_hw.h"

Classes

struct  XAxiPmon_Config
struct  XAxiPmon

Defines

#define XAXIPMON_H
#define XAxiPmon_IntrGlobalEnable(InstancePtr)
#define XAxiPmon_IntrGlobalDisable(InstancePtr)
#define XAxiPmon_IntrEnable(InstancePtr, Mask)
#define XAxiPmon_IntrDisable(InstancePtr, Mask)
#define XAxiPmon_IntrClear(InstancePtr, Mask)
#define XAxiPmon_IntrGetStatus(InstancePtr)
#define XAxiPmon_EnableGlobalClkCounter(InstancePtr)
#define XAxiPmon_DisableGlobalClkCounter(InstancePtr)
#define XAxiPmon_EnableFlag(InstancePtr, Flag)
#define XAxiPmon_DisableFlag(InstancePtr, Flag)
#define XAxiPmon_LoadSampleIntervalCounter(InstancePtr)
#define XAxiPmon_EnableSampleIntervalCounter(InstancePtr)
#define XAxiPmon_DisableSampleIntervalCounter(InstancePtr)
#define XAxiPmon_EnableMetricCounterReset(InstancePtr)
#define XAxiPmon_DisableMetricCounterReset(InstancePtr)
#define XAxiPmon_EnableIDFilter(InstancePtr)
#define XAxiPmon_DisableIDFilter(InstancePtr)
#define XAxiPmon_SampleMetrics(InstancePtr)   XAxiPmon_ReadReg((InstancePtr)->Config.BaseAddress, XAPM_SR_OFFSET);
Macro for Maximum number of Counters



#define XAPM_MAX_COUNTERS   10
#define XAPM_MAX_COUNTERS_PROFILE   48
Indices for Metric Counters and Sampled Metric Coounters used with

XAxiPmon_GetMetricCounter and XAxiPmon_GetSampledMetricCounter APIs



#define XAPM_METRIC_COUNTER_0   0
#define XAPM_METRIC_COUNTER_1   1
#define XAPM_METRIC_COUNTER_2   2
#define XAPM_METRIC_COUNTER_3   3
#define XAPM_METRIC_COUNTER_4   4
#define XAPM_METRIC_COUNTER_5   5
#define XAPM_METRIC_COUNTER_6   6
#define XAPM_METRIC_COUNTER_7   7
#define XAPM_METRIC_COUNTER_8   8
#define XAPM_METRIC_COUNTER_9   9
Indices for Incrementers and Sampled Incrementers used with

XAxiPmon_GetIncrementer and XAxiPmon_GetSampledIncrementer APIs



#define XAPM_INCREMENTER_0   0
#define XAPM_INCREMENTER_1   1
#define XAPM_INCREMENTER_2   2
#define XAPM_INCREMENTER_3   3
#define XAPM_INCREMENTER_4   4
#define XAPM_INCREMENTER_5   5
#define XAPM_INCREMENTER_6   6
#define XAPM_INCREMENTER_7   7
#define XAPM_INCREMENTER_8   8
#define XAPM_INCREMENTER_9   9
Macros for Metric Selector Settings



#define XAPM_METRIC_SET_0   0
#define XAPM_METRIC_SET_1   1
#define XAPM_METRIC_SET_2   2
#define XAPM_METRIC_SET_3   3
#define XAPM_METRIC_SET_4   4
#define XAPM_METRIC_SET_5   5
#define XAPM_METRIC_SET_6   6
#define XAPM_METRIC_SET_7   7
#define XAPM_METRIC_SET_8   8
#define XAPM_METRIC_SET_9   9
#define XAPM_METRIC_SET_10   10
#define XAPM_METRIC_SET_11   11
#define XAPM_METRIC_SET_12   12
#define XAPM_METRIC_SET_13   13
#define XAPM_METRIC_SET_14   14
#define XAPM_METRIC_SET_15   15
#define XAPM_METRIC_SET_16   16
#define XAPM_METRIC_SET_17   17
#define XAPM_METRIC_SET_18   18
#define XAPM_METRIC_SET_19   19
#define XAPM_METRIC_SET_20   20
#define XAPM_METRIC_SET_21   21
#define XAPM_METRIC_SET_22   22
#define XAPM_METRIC_SET_30   30
Macros for Maximum number of Agents



#define XAPM_MAX_AGENTS   8
Macros for Flags in Flag Enable Control Register



#define XAPM_FLAG_WRADDR   0x00000001
#define XAPM_FLAG_FIRSTWR   0x00000002
#define XAPM_FLAG_LASTWR   0x00000004
#define XAPM_FLAG_RESPONSE   0x00000008
#define XAPM_FLAG_RDADDR   0x00000010
#define XAPM_FLAG_FIRSTRD   0x00000020
#define XAPM_FLAG_LASTRD   0x00000040
#define XAPM_FLAG_SWDATA   0x00010000
#define XAPM_FLAG_EVENT   0x00020000
#define XAPM_FLAG_EVNTSTOP   0x00040000
#define XAPM_FLAG_EVNTSTART   0x00080000
#define XAPM_FLAG_GCCOVF   0x00100000
#define XAPM_FLAG_SCLAPSE   0x00200000
#define XAPM_FLAG_MC0   0x00400000
#define XAPM_FLAG_MC1   0x00800000
#define XAPM_FLAG_MC2   0x01000000
#define XAPM_FLAG_MC3   0x02000000
#define XAPM_FLAG_MC4   0x04000000
#define XAPM_FLAG_MC5   0x08000000
#define XAPM_FLAG_MC6   0x10000000
#define XAPM_FLAG_MC7   0x20000000
#define XAPM_FLAG_MC8   0x40000000
#define XAPM_FLAG_MC9   0x80000000
Macros for Read/Write Latency Start and End points



#define XAPM_LATENCY_ADDR_ISSUE   0
#define XAPM_LATENCY_ADDR_ACCEPT   1
#define XAPM_LATENCY_LASTRD   0
#define XAPM_LATENCY_LASTWR   0
#define XAPM_LATENCY_FIRSTRD   1
#define XAPM_LATENCY_FIRSTWR   1
Macros for Modes of APM



#define XAPM_MODE_TRACE   2
#define XAPM_MODE_PROFILE   1
#define XAPM_MODE_ADVANCED   0

Functions

XAxiPmon_ConfigXAxiPmon_LookupConfig (u16 DeviceId)
int XAxiPmon_CfgInitialize (XAxiPmon *InstancePtr, XAxiPmon_Config *ConfigPtr, u32 EffectiveAddr)
int XAxiPmon_ResetMetricCounter (XAxiPmon *InstancePtr)
void XAxiPmon_ResetGlobalClkCounter (XAxiPmon *InstancePtr)
int XAxiPmon_ResetFifo (XAxiPmon *InstancePtr)
void XAxiPmon_SetIncrementerRange (XAxiPmon *InstancePtr, u8 IncrementerNum, u16 RangeUpper, u16 RangeLower)
void XAxiPmon_GetIncrementerRange (XAxiPmon *InstancePtr, u8 IncrementerNum, u16 *RangeUpper, u16 *RangeLower)
void XAxiPmon_SetSampleInterval (XAxiPmon *InstancePtr, u32 SampleInterval)
void XAxiPmon_GetSampleInterval (XAxiPmon *InstancePtr, u32 *SampleInterval)
int XAxiPmon_SetMetrics (XAxiPmon *InstancePtr, u8 Slot, u8 Metrics, u8 CounterNum)
int XAxiPmon_GetMetrics (XAxiPmon *InstancePtr, u8 CounterNum, u8 *Metrics, u8 *Slot)
void XAxiPmon_GetGlobalClkCounter (XAxiPmon *InstancePtr, u32 *CntHighValue, u32 *CntLowValue)
u32 XAxiPmon_GetMetricCounter (XAxiPmon *InstancePtr, u32 CounterNum)
u32 XAxiPmon_GetSampledMetricCounter (XAxiPmon *InstancePtr, u32 CounterNum)
u32 XAxiPmon_GetIncrementer (XAxiPmon *InstancePtr, u32 IncrementerNum)
u32 XAxiPmon_GetSampledIncrementer (XAxiPmon *InstancePtr, u32 IncrementerNum)
void XAxiPmon_SetSwDataReg (XAxiPmon *InstancePtr, u32 SwData)
u32 XAxiPmon_GetSwDataReg (XAxiPmon *InstancePtr)
int XAxiPmon_StartEventLog (XAxiPmon *InstancePtr, u32 FlagEnables)
int XAxiPmon_StopEventLog (XAxiPmon *InstancePtr)
int XAxiPmon_StartCounters (XAxiPmon *InstancePtr, u32 SampleInterval)
int XAxiPmon_StopCounters (XAxiPmon *InstancePtr)
void XAxiPmon_EnableMetricsCounter (XAxiPmon *InstancePtr)
void XAxiPmon_DisableMetricsCounter (XAxiPmon *InstancePtr)
void XAxiPmon_SetLogEnableRanges (XAxiPmon *InstancePtr, u32 CounterNum, u16 RangeUpper, u16 RangeLower)
void XAxiPmon_GetLogEnableRanges (XAxiPmon *InstancePtr, u32 CounterNum, u16 *RangeUpper, u16 *RangeLower)
void XAxiPmon_EnableEventLog (XAxiPmon *InstancePtr)
void XAxiPmon_EnableMetricCounterTrigger (XAxiPmon *InstancePtr)
void XAxiPmon_DisableMetricCounterTrigger (XAxiPmon *InstancePtr)
void XAxiPmon_EnableEventLogTrigger (XAxiPmon *InstancePtr)
void XAxiPmon_DisableEventLogTrigger (XAxiPmon *InstancePtr)
const char * XAxiPmon_GetMetricName (u8 Metrics)
void XAxiPmon_SetWriteId (XAxiPmon *InstancePtr, u16 WriteId)
void XAxiPmon_SetReadId (XAxiPmon *InstancePtr, u16 ReadId)
u16 XAxiPmon_GetWriteId (XAxiPmon *InstancePtr)
u16 XAxiPmon_GetReadId (XAxiPmon *InstancePtr)
void XAxiPmon_SetWrLatencyStart (XAxiPmon *InstancePtr, u8 Param)
void XAxiPmon_SetWrLatencyEnd (XAxiPmon *InstancePtr, u8 Param)
void XAxiPmon_SetRdLatencyStart (XAxiPmon *InstancePtr, u8 Param)
void XAxiPmon_SetRdLatencyEnd (XAxiPmon *InstancePtr, u8 Param)
u8 XAxiPmon_GetWrLatencyStart (XAxiPmon *InstancePtr)
u8 XAxiPmon_GetWrLatencyEnd (XAxiPmon *InstancePtr)
u8 XAxiPmon_GetRdLatencyStart (XAxiPmon *InstancePtr)
u8 XAxiPmon_GetRdLatencyEnd (XAxiPmon *InstancePtr)
void XAxiPmon_SetWriteIdMask (XAxiPmon *InstancePtr, u16 WrMask)
void XAxiPmon_SetReadIdMask (XAxiPmon *InstancePtr, u16 RdMask)
u16 XAxiPmon_GetWriteIdMask (XAxiPmon *InstancePtr)
u16 XAxiPmon_GetReadIdMask (XAxiPmon *InstancePtr)
int XAxiPmon_SelfTest (XAxiPmon *InstancePtr)

Detailed Description


Define Documentation

#define XAPM_FLAG_EVENT   0x00020000

Last Read Flag

#define XAPM_FLAG_EVNTSTART   0x00080000

Last Read Flag

#define XAPM_FLAG_EVNTSTOP   0x00040000

Last Read Flag

#define XAPM_FLAG_FIRSTRD   0x00000020

First Read Flag

#define XAPM_FLAG_FIRSTWR   0x00000002

First Write Flag

#define XAPM_FLAG_GCCOVF   0x00100000

Global Clock Counter Overflow Flag

#define XAPM_FLAG_LASTRD   0x00000040

Last Read Flag

#define XAPM_FLAG_LASTWR   0x00000004

Last Write Flag

#define XAPM_FLAG_MC0   0x00400000

Metric Counter 0 Flag

#define XAPM_FLAG_MC1   0x00800000

Metric Counter 1 Flag

#define XAPM_FLAG_MC2   0x01000000

Metric Counter 2 Flag

#define XAPM_FLAG_MC3   0x02000000

Metric Counter 3 Flag

#define XAPM_FLAG_MC4   0x04000000

Metric Counter 4 Flag

#define XAPM_FLAG_MC5   0x08000000

Metric Counter 5 Flag

#define XAPM_FLAG_MC6   0x10000000

Metric Counter 6 Flag

#define XAPM_FLAG_MC7   0x20000000

Metric Counter 7 Flag

#define XAPM_FLAG_MC8   0x40000000

Metric Counter 8 Flag

#define XAPM_FLAG_MC9   0x80000000

Metric Counter 9 Flag

#define XAPM_FLAG_RDADDR   0x00000010

Read Address Flag

#define XAPM_FLAG_RESPONSE   0x00000008

Response Flag

#define XAPM_FLAG_SCLAPSE   0x00200000

Sample Counter Lapse Flag

#define XAPM_FLAG_SWDATA   0x00010000

Software-written Data Flag

#define XAPM_FLAG_WRADDR   0x00000001

Write Address Flag

#define XAPM_INCREMENTER_0   0

Metric Counter 0 Register Index

#define XAPM_INCREMENTER_1   1

Metric Counter 0 Register Index

#define XAPM_INCREMENTER_2   2

Metric Counter 0 Register Index

#define XAPM_INCREMENTER_3   3

Metric Counter 0 Register Index

#define XAPM_INCREMENTER_4   4

Metric Counter 0 Register Index

#define XAPM_INCREMENTER_5   5

Metric Counter 0 Register Index

#define XAPM_INCREMENTER_6   6

Metric Counter 0 Register Index

#define XAPM_INCREMENTER_7   7

Metric Counter 0 Register Index

#define XAPM_INCREMENTER_8   8

Metric Counter 0 Register Index

#define XAPM_INCREMENTER_9   9

Metric Counter 0 Register Index

#define XAPM_LATENCY_ADDR_ACCEPT   1

Address Acceptance as start point for Latency calculation

#define XAPM_LATENCY_ADDR_ISSUE   0

Address Issue as start point for Latency calculation

#define XAPM_LATENCY_FIRSTRD   1

First Read as end point for Latency calculation

#define XAPM_LATENCY_FIRSTWR   1

First Write as end point for Latency calculation

#define XAPM_LATENCY_LASTRD   0

Last Read as end point for Latency calculation

#define XAPM_LATENCY_LASTWR   0

Last Write as end point for Latency calculation

#define XAPM_MAX_AGENTS   8

Maximum number of Agents

#define XAPM_MAX_COUNTERS   10

Maximum number of Counters

#define XAPM_MAX_COUNTERS_PROFILE   48

Maximum number of Counters

#define XAPM_METRIC_COUNTER_0   0

Metric Counter 0 Register Index

#define XAPM_METRIC_COUNTER_1   1

Metric Counter 1 Register Index

#define XAPM_METRIC_COUNTER_2   2

Metric Counter 2 Register Index

#define XAPM_METRIC_COUNTER_3   3

Metric Counter 3 Register Index

#define XAPM_METRIC_COUNTER_4   4

Metric Counter 4 Register Index

#define XAPM_METRIC_COUNTER_5   5

Metric Counter 5 Register Index

#define XAPM_METRIC_COUNTER_6   6

Metric Counter 6 Register Index

#define XAPM_METRIC_COUNTER_7   7

Metric Counter 7 Register Index

#define XAPM_METRIC_COUNTER_8   8

Metric Counter 8 Register Index

#define XAPM_METRIC_COUNTER_9   9

Metric Counter 9 Register Index

#define XAPM_METRIC_SET_0   0

Write Transaction Count

#define XAPM_METRIC_SET_1   1

Read Transaction Count

#define XAPM_METRIC_SET_10   10

Num_WLasts

#define XAPM_METRIC_SET_11   11

Num_RLasts

#define XAPM_METRIC_SET_12   12

Minimum Write Latency

#define XAPM_METRIC_SET_13   13

Maximum Write Latency

#define XAPM_METRIC_SET_14   14

Minimum Read Latency

#define XAPM_METRIC_SET_15   15

Maximum Read Latency

#define XAPM_METRIC_SET_16   16

Transfer Cycle Count

#define XAPM_METRIC_SET_17   17

Packet Count

#define XAPM_METRIC_SET_18   18

Data Byte Count

#define XAPM_METRIC_SET_19   19

Position Byte Count

#define XAPM_METRIC_SET_2   2

Write Byte Count

#define XAPM_METRIC_SET_20   20

Null Byte Count

#define XAPM_METRIC_SET_21   21

Slv_Idle_Cnt

#define XAPM_METRIC_SET_22   22

Mst_Idle_Cnt

#define XAPM_METRIC_SET_3   3

Read Byte Count

#define XAPM_METRIC_SET_30   30

External event count

#define XAPM_METRIC_SET_4   4

Write Beat Count

#define XAPM_METRIC_SET_5   5

Total Read Latency

#define XAPM_METRIC_SET_6   6

Total Write Latency

#define XAPM_METRIC_SET_7   7

Slv_Wr_Idle_Cnt

#define XAPM_METRIC_SET_8   8

Mst_Rd_Idle_Cnt

#define XAPM_METRIC_SET_9   9

Num_BValids

#define XAPM_MODE_ADVANCED   0

APM in Advanced mode

#define XAPM_MODE_PROFILE   1

APM in Profile mode

#define XAPM_MODE_TRACE   2

APM in Trace mode

#define XAxiPmon_DisableFlag ( InstancePtr,
Flag   ) 
Value:
XAxiPmon_WriteReg((InstancePtr)->Config.BaseAddress, XAPM_FEC_OFFSET, \
                        XAxiPmon_ReadReg((InstancePtr)->Config.BaseAddress, \
                        XAPM_FEC_OFFSET) & ~(Flag));

This function disables the specified flag in Flag Control Register.

Parameters:
InstancePtr is a pointer to the XAxiPmon instance.
Flag is one of the XAPM_FLAG_* masks defined in xaxipmon.h*
Returns:
None
Note:
C-Style signature: void XAxiPmon_DisableFlag(XAxiPmon *InstancePtr);
#define XAxiPmon_DisableGlobalClkCounter ( InstancePtr   ) 
Value:
XAxiPmon_WriteReg((InstancePtr)->Config.BaseAddress, XAPM_CTL_OFFSET, \
                        XAxiPmon_ReadReg((InstancePtr)->Config.BaseAddress, \
                        XAPM_CTL_OFFSET) & ~(XAPM_CR_GCC_ENABLE_MASK));

This function disbles the Global Clock Counter.

Parameters:
InstancePtr is a pointer to the XAxiPmon instance.
Returns:
None
Note:
C-Style signature: void XAxiPmon_DisableGlobalClkCounter(XAxiPmon *InstancePtr);
#define XAxiPmon_DisableIDFilter ( InstancePtr   ) 
Value:
XAxiPmon_WriteReg((InstancePtr)->Config.BaseAddress, XAPM_CTL_OFFSET, \
                        XAxiPmon_ReadReg((InstancePtr)->Config.BaseAddress, \
                        XAPM_CTL_OFFSET) & ~(XAPM_CR_IDFILTER_ENABLE_MASK));

This function disbles the ID Filter masking.

Parameters:
InstancePtr is a pointer to the XAxiPmon instance.
Returns:
None
Note:
C-Style signature: void XAxiPmon_DisableIDFilter(XAxiPmon *InstancePtr);
#define XAxiPmon_DisableMetricCounterReset ( InstancePtr   ) 
Value:
XAxiPmon_WriteReg((InstancePtr)->Config.BaseAddress, XAPM_SICR_OFFSET, \
                        XAxiPmon_ReadReg((InstancePtr)->Config.BaseAddress, \
                        XAPM_SICR_OFFSET) & ~(XAPM_SICR_MCNTR_RST_MASK));

This disables the down count of the sample interval counter.

Parameters:
InstancePtr is a pointer to the XAxiPmon instance.
Returns:
None
Note:
C-Style signature: void XAxiPmon_DisableMetricCounterReset(XAxiPmon *InstancePtr);
#define XAxiPmon_DisableSampleIntervalCounter ( InstancePtr   ) 
Value:
XAxiPmon_WriteReg((InstancePtr)->Config.BaseAddress, XAPM_SICR_OFFSET, \
                        XAxiPmon_ReadReg((InstancePtr)->Config.BaseAddress, \
                        XAPM_SICR_OFFSET) & ~(XAPM_SICR_ENABLE_MASK));

This disables the down count of the sample interval counter.

Parameters:
InstancePtr is a pointer to the XAxiPmon instance.
Returns:
None
Note:
C-Style signature: void XAxiPmon_DisableSampleIntervalCounter(XAxiPmon *InstancePtr);
#define XAxiPmon_EnableFlag ( InstancePtr,
Flag   ) 
Value:
XAxiPmon_WriteReg((InstancePtr)->Config.BaseAddress, XAPM_FEC_OFFSET, \
                        XAxiPmon_ReadReg((InstancePtr)->Config.BaseAddress, \
                        XAPM_FEC_OFFSET) | Flag);

This function enables the specified flag in Flag Control Register.

Parameters:
InstancePtr is a pointer to the XAxiPmon instance.
Flag is one of the XAPM_FLAG_* masks defined in xaxipmon.h
Returns:
None
Note:
C-Style signature: void XAxiPmon_EnableFlag(XAxiPmon *InstancePtr);
#define XAxiPmon_EnableGlobalClkCounter ( InstancePtr   ) 
Value:
XAxiPmon_WriteReg((InstancePtr)->Config.BaseAddress, XAPM_CTL_OFFSET, \
                        XAxiPmon_ReadReg((InstancePtr)->Config.BaseAddress, \
                        XAPM_CTL_OFFSET) | XAPM_CR_GCC_ENABLE_MASK);

This function enables the Global Clock Counter.

Parameters:
InstancePtr is a pointer to the XAxiPmon instance.
Returns:
None
Note:
C-Style signature: void XAxiPmon_EnableGlobalClkCounter(XAxiPmon *InstancePtr);
#define XAxiPmon_EnableIDFilter ( InstancePtr   ) 
Value:
XAxiPmon_WriteReg((InstancePtr)->Config.BaseAddress, XAPM_CTL_OFFSET, \
                        XAxiPmon_ReadReg((InstancePtr)->Config.BaseAddress, \
                        XAPM_CTL_OFFSET) | XAPM_CR_IDFILTER_ENABLE_MASK);

This function enables the ID Filter Masking.

Parameters:
InstancePtr is a pointer to the XAxiPmon instance.
Returns:
None
Note:
C-Style signature: void XAxiPmon_EnableIDFilter(XAxiPmon *InstancePtr);
#define XAxiPmon_EnableMetricCounterReset ( InstancePtr   ) 
Value:
XAxiPmon_WriteReg((InstancePtr)->Config.BaseAddress, XAPM_SICR_OFFSET,\
                                                XAPM_SICR_MCNTR_RST_MASK);

This enables Reset of Metric Counters when Sample Interval Counter lapses.

Parameters:
InstancePtr is a pointer to the XAxiPmon instance.
Returns:
None
Note:
C-Style signature: void XAxiPmon_EnableMetricCounterReset(XAxiPmon *InstancePtr);
#define XAxiPmon_EnableSampleIntervalCounter ( InstancePtr   ) 
Value:
XAxiPmon_WriteReg((InstancePtr)->Config.BaseAddress, XAPM_SICR_OFFSET,\
                                                        XAPM_SICR_ENABLE_MASK);

This enables the down count of the sample interval counter.

Parameters:
InstancePtr is a pointer to the XAxiPmon instance.
Returns:
None
Note:
C-Style signature: void XAxiPmon_EnableSampleIntervalCounter(XAxiPmon *InstancePtr);
#define XAXIPMON_H
#define XAxiPmon_IntrClear ( InstancePtr,
Mask   ) 
Value:
XAxiPmon_WriteReg((InstancePtr)->Config.BaseAddress, XAPM_IS_OFFSET, \
                        XAxiPmon_ReadReg((InstancePtr)->Config.BaseAddress, \
                        XAPM_IS_OFFSET) | Mask);

This routine clears the specified interrupt(s).

Parameters:
InstancePtr is a pointer to the XAxiPmon instance.
Mask is the mask to clear. Bit positions of 1 will be cleared. This mask is formed by OR'ing XAPM_IXR_* bits defined in xaxipmon_hw.h.
Returns:
None.
Note:
C-Style signature: void XAxiPmon_IntrClear(XAxiPmon *InstancePtr, u32 Mask)
#define XAxiPmon_IntrDisable ( InstancePtr,
Mask   ) 
Value:
XAxiPmon_WriteReg((InstancePtr)->Config.BaseAddress, XAPM_IE_OFFSET, \
                        XAxiPmon_ReadReg((InstancePtr)->Config.BaseAddress, \
                        XAPM_IE_OFFSET) | Mask);

This routine disable interrupt(s). Use the XAPM_IXR_* constants defined in xaxipmon_hw.h to create the bit-mask to disable interrupts.

Parameters:
InstancePtr is a pointer to the XAxiPmon instance.
Mask is the mask to disable. Bit positions of 1 will be disabled. Bit positions of 0 will keep the previous setting. This mask is formed by OR'ing XAPM_IXR_* bits defined in xaxipmon_hw.h.
Returns:
None.
Note:
C-Style signature: void XAxiPmon_IntrEnable(XAxiPmon *InstancePtr, u32 Mask)
#define XAxiPmon_IntrEnable ( InstancePtr,
Mask   ) 
Value:
XAxiPmon_WriteReg((InstancePtr)->Config.BaseAddress, XAPM_IE_OFFSET, \
                        XAxiPmon_ReadReg((InstancePtr)->Config.BaseAddress, \
                        XAPM_IE_OFFSET) | Mask);

This routine enables interrupt(s). Use the XAPM_IXR_* constants defined in xaxipmon_hw.h to create the bit-mask to enable interrupts.

Parameters:
InstancePtr is a pointer to the XAxiPmon instance.
Mask is the mask to enable. Bit positions of 1 will be enabled. Bit positions of 0 will keep the previous setting. This mask is formed by OR'ing XAPM_IXR__* bits defined in xaxipmon_hw.h.
Returns:
None.
Note:
C-Style signature: void XAxiPmon_IntrEnable(XAxiPmon *InstancePtr, u32 Mask)
#define XAxiPmon_IntrGetStatus ( InstancePtr   ) 
Value:
XAxiPmon_ReadReg((InstancePtr)->Config.BaseAddress, \
                        XAPM_IS_OFFSET);

This routine returns the Interrupt Status Register.

Parameters:
InstancePtr is a pointer to the XAxiPmon instance.
Returns:
Interrupt Status Register contents
Note:
C-Style signature: void XAxiPmon_IntrClear(XAxiPmon *InstancePtr)
#define XAxiPmon_IntrGlobalDisable ( InstancePtr   ) 
Value:
XAxiPmon_WriteReg((InstancePtr)->Config.BaseAddress,            \
                                XAPM_GIE_OFFSET, 0)

This routine disables the Global Interrupt.

Parameters:
InstancePtr is a pointer to the XAxiPmon instance.
Returns:
None.
Note:
C-Style signature: void XAxiPmon_IntrGlobalDisable(XAxiPmon *InstancePtr)
#define XAxiPmon_IntrGlobalEnable ( InstancePtr   ) 
Value:
XAxiPmon_WriteReg((InstancePtr)->Config.BaseAddress,    \
                        XAPM_GIE_OFFSET, 1)

This routine enables the Global Interrupt.

Parameters:
InstancePtr is a pointer to the XAxiPmon instance.
Returns:
None.
Note:
C-Style signature: void XAxiPmon_IntrGlobalEnable(XAxiPmon *InstancePtr)
#define XAxiPmon_LoadSampleIntervalCounter ( InstancePtr   ) 
Value:
XAxiPmon_WriteReg((InstancePtr)->Config.BaseAddress, XAPM_SICR_OFFSET, \
                                                        XAPM_SICR_LOAD_MASK);

This function loads the sample interval register value into the sample interval counter.

Parameters:
InstancePtr is a pointer to the XAxiPmon instance.
Returns:
None
Note:
C-Style signature: void XAxiPmon_LoadSampleIntervalCounter(XAxiPmon *InstancePtr);
#define XAxiPmon_SampleMetrics ( InstancePtr   )     XAxiPmon_ReadReg((InstancePtr)->Config.BaseAddress, XAPM_SR_OFFSET);

This function samples Metric Counters to Sampled Metric Counters by reading Sample Register and also returns interval. i.e. the number of clocks in between previous read to the current read of sample register.

Parameters:
InstancePtr is a pointer to the XAxiPmon instance.
Returns:
Interval. i.e. the number of clocks in between previous read to the current read of sample register.
Note:
C-Style signature: u32 XAxiPmon_SampleMetrics(XAxiPmon *InstancePtr);

Function Documentation

int XAxiPmon_CfgInitialize ( XAxiPmon InstancePtr,
XAxiPmon_Config ConfigPtr,
u32  EffectiveAddr 
)

Functions in xaxipmon.c

This function initializes a specific XAxiPmon device/instance. This function must be called prior to using the AXI Performance Monitor device.

Parameters:
InstancePtr is a pointer to the XAxiPmon instance.
ConfigPtr points to the XAxiPmon 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.
Note:
The user needs to first call the XAxiPmon_LookupConfig() API which returns the Configuration structure pointer which is passed as a parameter to the XAxiPmon_CfgInitialize() API.
void XAxiPmon_DisableEventLogTrigger ( XAxiPmon InstancePtr  ) 

This function disables the External trigger pulse used to start Event Log on external trigger pulse for a Slot.

Parameters:
InstancePtr is a pointer to the XAxiPmon instance.
Returns:
None
Note:
None
void XAxiPmon_DisableMetricCounterTrigger ( XAxiPmon InstancePtr  ) 

This function disables the External trigger pulse used to start Metric Counters on external trigger pulse for a Slot.

Parameters:
InstancePtr is a pointer to the XAxiPmon instance.
Returns:
None
Note:
None
void XAxiPmon_DisableMetricsCounter ( XAxiPmon InstancePtr  ) 

This function disables the Metric Counters.

Parameters:
InstancePtr is a pointer to the XAxiPmon instance.
Returns:
None
Note:
None
void XAxiPmon_EnableEventLog ( XAxiPmon InstancePtr  ) 

This function enables Event Logging.

Parameters:
InstancePtr is a pointer to the XAxiPmon instance.
Returns:
None
Note:
None
void XAxiPmon_EnableEventLogTrigger ( XAxiPmon InstancePtr  ) 

This function enables External trigger pulse for Event Log so that Event Logging can be started on external trigger pulse for a Slot.

Parameters:
InstancePtr is a pointer to the XAxiPmon instance.
Returns:
None
Note:
None
void XAxiPmon_EnableMetricCounterTrigger ( XAxiPmon InstancePtr  ) 

This function enables External trigger pulse so that Metric Counters can be started on external trigger pulse for a Slot.

Parameters:
InstancePtr is a pointer to the XAxiPmon instance.
Returns:
None
Note:
None
void XAxiPmon_EnableMetricsCounter ( XAxiPmon InstancePtr  ) 

This function enables Metric Counters.

Parameters:
InstancePtr is a pointer to the XAxiPmon instance.
Returns:
None
Note:
None
void XAxiPmon_GetGlobalClkCounter ( XAxiPmon InstancePtr,
u32 *  CntHighValue,
u32 *  CntLowValue 
)

This function returns the contents of the Global Clock Counter Register.

Parameters:
InstancePtr is a pointer to the XAxiPmon instance.
CntHighValue is the user space pointer with which upper 32 bits of Global Clock Counter has to be filled
CntLowValue is the user space pointer with which lower 32 bits of Global Clock Counter has to be filled
Returns:
None.
Note:
None.
u32 XAxiPmon_GetIncrementer ( XAxiPmon InstancePtr,
u32  IncrementerNum 
)

This function returns the contents of the Incrementer Register.

Parameters:
InstancePtr is a pointer to the XAxiPmon instance.
IncrementerNum is the number of the Incrementer register to read.Use the XAPM_INCREMENTER_* defines for the Incrementer number.The valid values are 0 (XAPM_INCREMENTER_0) to 9 (XAPM_INCREMENTER_9).
IncrementerNum is the number of the specified Incrementer register
Returns:
RegValue is content of specified Metric Incrementer register.
Note:
None.
void XAxiPmon_GetIncrementerRange ( XAxiPmon InstancePtr,
u8  IncrementerNum,
u16 *  RangeUpper,
u16 *  RangeLower 
)

This function returns the Ranges of Incrementers Registers.

Parameters:
InstancePtr is a pointer to the XAxiPmon instance.
IncrementerNum specifies the Incrementer for which Ranges need to be returned.
RangeUpper specifies the user reference variable which returns the Upper Range Value of the specified Incrementer.
RangeLower specifies the user reference variable which returns the Lower Range Value of the specified Incrementer.
Returns:
None.
Note:
None
void XAxiPmon_GetLogEnableRanges ( XAxiPmon InstancePtr,
u32  CounterNum,
u16 *  RangeUpper,
u16 *  RangeLower 
)

This function returns the Ranges of specified Metric Counter Log Enable Register.

Parameters:
InstancePtr is a pointer to the XAxiPmon instance.
CounterNum is the Metric Counter number for which Ranges are to be returned.Use the XAPM_METRIC_COUNTER* defines for the counter number in xaxipmon.h. The valid values are 0 (XAPM_METRIC_COUNTER_0) to 9 (XAPM_METRIC_COUNTER_9).
RangeUpper specifies the user reference variable which returns the Upper Range Value of the specified Metric Counter Log Enable Register.
RangeLower specifies the user reference variable which returns the Lower Range Value of the specified Metric Counter Log Enable Register.
Note:
None.
u32 XAxiPmon_GetMetricCounter ( XAxiPmon InstancePtr,
u32  CounterNum 
)

This function returns the contents of the Metric Counter Register.

Parameters:
InstancePtr is a pointer to the XAxiPmon instance.
CounterNum is the number of the Metric Counter to be read. Use the XAPM_METRIC_COUNTER* defines for the counter number in xaxipmon.h. The valid values are 0 (XAPM_METRIC_COUNTER_0) to 47(XAPM_METRIC_COUNTER_47).
Returns:
RegValue is the content of specified Metric Counter.
Note:
None.
const char* XAxiPmon_GetMetricName ( u8  Metrics  ) 

This function returns a name for a given Metric.

Parameters:
Metrics is one of the Metric Sets. User has to use XAPM_METRIC_SET_* macros in xaxipmon.h for this parameter
Returns:
const char *
Note:
None
int XAxiPmon_GetMetrics ( XAxiPmon InstancePtr,
u8  CounterNum,
u8 *  Metrics,
u8 *  Slot 
)

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

Parameters:
InstancePtr is a pointer to the XAxiPmon instance.
CounterNum is the Counter Number. The valid values are 0 to 9.
Metrics is a reference parameter from application where metrics of specified counter is filled. Slot is a reference parameter in which slot Id of specified counter is filled
Returns:
XST_SUCCESS if Success XST_FAILURE if Failure
Note:
None.
u8 XAxiPmon_GetRdLatencyEnd ( XAxiPmon InstancePtr  ) 

This function returns Read Latency End point.

Parameters:
InstancePtr is a pointer to the XAxiPmon instance.
Returns:
Returns 0 - XAPM_LATENCY_LASTRD or 1 - XAPM_LATENCY_FIRSTRD.
Note:
None
u8 XAxiPmon_GetRdLatencyStart ( XAxiPmon InstancePtr  ) 

This function returns read Latency Start point.

Parameters:
InstancePtr is a pointer to the XAxiPmon instance.
Returns:
Returns 0 - XAPM_LATENCY_ADDR_ISSUE or 1 - XAPM_LATENCY_ADDR_ACCEPT
Note:
None
u16 XAxiPmon_GetReadId ( XAxiPmon InstancePtr  ) 

This function returns Read ID in ID register.

Parameters:
InstancePtr is a pointer to the XAxiPmon instance.
Returns:
ReadId is the required Read ID in ID register.
Note:
None.
u16 XAxiPmon_GetReadIdMask ( XAxiPmon InstancePtr  ) 

This function returns Read ID Mask in ID Mask register.

Parameters:
InstancePtr is a pointer to the XAxiPmon instance.
Returns:
RdMask is the required Read ID Mask in ID Mask register.
Note:
None.
u32 XAxiPmon_GetSampledIncrementer ( XAxiPmon InstancePtr,
u32  IncrementerNum 
)

This function returns the contents of the Sampled Incrementer Register.

Parameters:
InstancePtr is a pointer to the XAxiPmon instance.
IncrementerNum is the number of the Sampled Incrementer register to read.Use the XAPM_INCREMENTER_* defines for the Incrementer number.The valid values are 0 (XAPM_INCREMENTER_0) to 9 (XAPM_INCREMENTER_9).
IncrementerNum is the number of the specified Sampled Incrementer register
Returns:
RegValue is content of specified Sampled Incrementer register.
Note:
None.
u32 XAxiPmon_GetSampledMetricCounter ( XAxiPmon InstancePtr,
u32  CounterNum 
)

This function returns the contents of the Sampled Metric Counter Register.

Parameters:
InstancePtr is a pointer to the XAxiPmon instance.
CounterNum is the number of the Sampled Metric Counter to read. Use the XAPM_METRIC_COUNTER* defines for the counter number in xaxipmon.h. The valid values are 0 (XAPM_METRIC_COUNTER_0) to 47(XAPM_METRIC_COUNTER_47).
Returns:
RegValue is the content of specified Sampled Metric Counter.
Note:
None.
void XAxiPmon_GetSampleInterval ( XAxiPmon InstancePtr,
u32 *  SampleInterval 
)

This function returns the contents of Sample Interval Register

Parameters:
InstancePtr is a pointer to the XAxiPmon instance.
SampleInterval is a pointer where the Sample Interval Counter value is returned.
Returns:
None.
Note:
None.
u32 XAxiPmon_GetSwDataReg ( XAxiPmon InstancePtr  ) 

This function returns contents of Software-written Data Register.

Parameters:
InstancePtr is a pointer to the XAxiPmon instance.
Returns:
SwData.
Note:
None.
u16 XAxiPmon_GetWriteId ( XAxiPmon InstancePtr  ) 

This function returns Write ID in ID register.

Parameters:
InstancePtr is a pointer to the XAxiPmon instance.
Returns:
WriteId is the required Write ID in ID register.
Note:
None.
u16 XAxiPmon_GetWriteIdMask ( XAxiPmon InstancePtr  ) 

This function returns Write ID Mask in ID Mask register.

Parameters:
InstancePtr is a pointer to the XAxiPmon instance.
Returns:
WrMask is the required Write ID Mask in ID Mask register.
Note:
None.
u8 XAxiPmon_GetWrLatencyEnd ( XAxiPmon InstancePtr  ) 

This function returns Write Latency End point.

Parameters:
InstancePtr is a pointer to the XAxiPmon instance.
Returns:
Returns 0 - XAPM_LATENCY_LASTWR or 1 - XAPM_LATENCY_FIRSTWR.
Note:
None
u8 XAxiPmon_GetWrLatencyStart ( XAxiPmon InstancePtr  ) 

This function returns Write Latency Start point.

Parameters:
InstancePtr is a pointer to the XAxiPmon instance.
Returns:
Returns 0 - XAPM_LATENCY_ADDR_ISSUE or 1 - XAPM_LATENCY_ADDR_ACCEPT
Note:
None
XAxiPmon_Config* XAxiPmon_LookupConfig ( u16  DeviceId  ) 

Functions in xaxipmon_sinit.c

This function looks up the device configuration based on the unique device ID. The table XAxiPmon_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.
int XAxiPmon_ResetFifo ( XAxiPmon InstancePtr  ) 

This function resets Streaming FIFO of AXI Performance Monitor

Parameters:
InstancePtr is a pointer to the XAxiPmon instance.
Returns:
XST_SUCCESS
Note:
None.
void XAxiPmon_ResetGlobalClkCounter ( XAxiPmon InstancePtr  ) 

This function resets Global Clock Counter of AXI Performance Monitor

Parameters:
InstancePtr is a pointer to the XAxiPmon instance.
Returns:
None.
Note:
None.
int XAxiPmon_ResetMetricCounter ( XAxiPmon InstancePtr  ) 

This function resets all Metric Counters and Sampled Metric Counters of AXI Performance Monitor.

Parameters:
InstancePtr is a pointer to the XAxiPmon instance.
Returns:
XST_SUCCESS
Note:
None.
int XAxiPmon_SelfTest ( XAxiPmon InstancePtr  ) 

Functions in xaxipmon_selftest.c

Run a self-test on the driver/device. The test

  • Resets the device,
  • Writes a value into the Range Registers of Incrementer 0 and reads it back for comparison.
  • Resets the device again.
Parameters:
InstancePtr is a pointer to the XAxiPmon instance.
Returns:
  • XST_SUCCESS if the value read from the Range Register of Incrementer 0 is the same as the value written.
  • XST_FAILURE Otherwise
Note:
This is a destructive test in that resets of the device are performed. Refer to the device specification for the device status after the reset operation.
void XAxiPmon_SetIncrementerRange ( XAxiPmon InstancePtr,
u8  IncrementerNum,
u16  RangeUpper,
u16  RangeLower 
)

This function sets Ranges for Incrementers depending on parameters passed.

Parameters:
InstancePtr is a pointer to the XAxiPmon instance.
IncrementerNum specifies the Incrementer for which Ranges need to be set
RangeUpper specifies the Upper limit in 32 bit Register
RangeLower specifies the Lower limit in 32 bit Register
Returns:
None.
Note:
None
void XAxiPmon_SetLogEnableRanges ( XAxiPmon InstancePtr,
u32  CounterNum,
u16  RangeUpper,
u16  RangeLower 
)

This function sets the Upper and Lower Ranges for specified Metric Counter Log Enable Register.Event Logging starts when corresponding Metric Counter value falls in between these ranges

Parameters:
InstancePtr is a pointer to the XAxiPmon instance.
CounterNum is the Metric Counter number for which Ranges are to be assigned.Use the XAPM_METRIC_COUNTER* defines for the counter number in xaxipmon.h. The valid values are 0 (XAPM_METRIC_COUNTER_0) to 9 (XAPM_METRIC_COUNTER_9).
RangeUpper specifies the Upper limit in 32 bit Register
RangeLower specifies the Lower limit in 32 bit Register
Returns:
None
Note:
None.
int XAxiPmon_SetMetrics ( XAxiPmon InstancePtr,
u8  Slot,
u8  Metrics,
u8  CounterNum 
)

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

Parameters:
InstancePtr is a pointer to the XAxiPmon instance.
Slot is the slot ID for which specified counter has to be connected.
Metrics is one of the Metric Sets. User has to use XAPM_METRIC_SET_* macros in xaxipmon.h for this parameter
CounterNum is the Counter Number. The valid values are 0 to 9.
Returns:
XST_SUCCESS if Success XST_FAILURE if Failure
Note:
None.
void XAxiPmon_SetRdLatencyEnd ( XAxiPmon InstancePtr,
u8  Param 
)

This function sets Latency End point to calculate read latency.

Parameters:
InstancePtr is a pointer to the XAxiPmon instance.
Param is XAPM_LATENCY_LASTRD or XAPM_LATENCY_FIRSTRD in xaxipmon.h.
Returns:
None
Note:
Param can be 0 - XAPM_LATENCY_LASTRD or 1 - XAPM_LATENCY_FIRSTRD
void XAxiPmon_SetRdLatencyStart ( XAxiPmon InstancePtr,
u8  Param 
)

This function sets Latency Start point to calculate read latency.

Parameters:
InstancePtr is a pointer to the XAxiPmon instance.
Param is XAPM_LATENCY_ADDR_ISSUE or XAPM_LATENCY_ADDR_ACCEPT in xaxipmon.h.
Returns:
None
Note:
Param can be 0 - XAPM_LATENCY_ADDR_ISSUE or 1 - XAPM_LATENCY_ADDR_ACCEPT
void XAxiPmon_SetReadId ( XAxiPmon InstancePtr,
u16  ReadId 
)

This function sets Read ID in ID register.

Parameters:
InstancePtr is a pointer to the XAxiPmon instance.
ReadId is the Read ID to be written in ID register.
Returns:
None.
Note:
None.
void XAxiPmon_SetReadIdMask ( XAxiPmon InstancePtr,
u16  RdMask 
)

This function sets Read ID Mask in ID Mask register.

Parameters:
InstancePtr is a pointer to the XAxiPmon instance.
RdMask is the Read ID mask to be written in ID Mask register.
Returns:
None.
Note:
None.
void XAxiPmon_SetSampleInterval ( XAxiPmon InstancePtr,
u32  SampleInterval 
)

This function sets the Sample Interval Register

Parameters:
InstancePtr is a pointer to the XAxiPmon instance.
SampleInterval is the Sample Interval value to be set
Returns:
None
Note:
None.
void XAxiPmon_SetSwDataReg ( XAxiPmon InstancePtr,
u32  SwData 
)

This function sets Software-written Data Register.

Parameters:
InstancePtr is a pointer to the XAxiPmon instance.
SwData is the Software written Data.
Returns:
None.
Note:
None.
void XAxiPmon_SetWriteId ( XAxiPmon InstancePtr,
u16  WriteId 
)

This function sets Write ID in ID register.

Parameters:
InstancePtr is a pointer to the XAxiPmon instance.
WriteId is the Write ID to be written in ID register.
Returns:
None.
Note:
None.
void XAxiPmon_SetWriteIdMask ( XAxiPmon InstancePtr,
u16  WrMask 
)

This function sets Write ID Mask in ID Mask register.

Parameters:
InstancePtr is a pointer to the XAxiPmon instance.
WrMask is the Write ID mask to be written in ID register.
Returns:
None.
Note:
None.
void XAxiPmon_SetWrLatencyEnd ( XAxiPmon InstancePtr,
u8  Param 
)

This function sets Latency End point to calculate write latency.

Parameters:
InstancePtr is a pointer to the XAxiPmon instance.
Param is XAPM_LATENCY_LASTWR or XAPM_LATENCY_FIRSTWR in xaxipmon.h.
Returns:
None
Note:
Param can be 0 - XAPM_LATENCY_LASTWR or 1 - XAPM_LATENCY_FIRSTWR
void XAxiPmon_SetWrLatencyStart ( XAxiPmon InstancePtr,
u8  Param 
)

This function sets Latency Start point to calculate write latency.

Parameters:
InstancePtr is a pointer to the XAxiPmon instance.
Param is XAPM_LATENCY_ADDR_ISSUE or XAPM_LATENCY_ADDR_ACCEPT in xaxipmon.h.
Returns:
None
Note:
Param can be 0 - XAPM_LATENCY_ADDR_ISSUE or 1 - XAPM_LATENCY_ADDR_ACCEPT
int XAxiPmon_StartCounters ( XAxiPmon InstancePtr,
u32  SampleInterval 
)

This function enables the following in the AXI Performance Monitor:

  • Global clock counter
  • All metric counters
  • All sampled metric counters
Parameters:
InstancePtr is a pointer to the XAxiPmon instance. SampleInterval is the sample interval for the sampled metric counters
Returns:
XST_SUCCESS
Note:
None
int XAxiPmon_StartEventLog ( XAxiPmon InstancePtr,
u32  FlagEnables 
)

This function enables the following in the AXI Performance Monitor:

  • Event logging
Parameters:
InstancePtr is a pointer to the XAxiPmon instance.
FlagEnables is a value to write to the flag enables register defined by XAPM_FEC_OFFSET. It is recommended to use the XAPM_FEC_*_MASK mask bits to generate. A value of 0x0 will disable all events to the event log streaming FIFO.
Returns:
XST_SUCCESS
Note:
None
int XAxiPmon_StopCounters ( XAxiPmon InstancePtr  ) 

This function disables the following in the AXI Performance Monitor:

  • Global clock counter
  • All metric counters
Parameters:
InstancePtr is a pointer to the XAxiPmon instance.
Returns:
XST_SUCCESS
Note:
None
int XAxiPmon_StopEventLog ( XAxiPmon InstancePtr  ) 

This function disables the following in the AXI Performance Monitor:

  • Event logging
Parameters:
InstancePtr is a pointer to the XAxiPmon instance.
Returns:
XST_SUCCESS
Note:
None