XilinxProcessorIPLib/drivers/axipmon/src/xaxipmon.c
s32 XAxiPmon_StartCounters(XAxiPmon *InstancePtr, u32 SampleInterval)
{
	u32 RegValue;

	/*
	 * Assert the arguments.
	 */
	Xil_AssertNonvoid(InstancePtr != NULL);
	Xil_AssertNonvoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY);
	Xil_AssertNonvoid((InstancePtr->Mode == XAPM_MODE_PROFILE) ||
				((InstancePtr->Mode == XAPM_MODE_ADVANCED) &&
				(InstancePtr->Config.IsEventCount == 1U)));

	/* Read current register value */
	RegValue = XAxiPmon_ReadReg(InstancePtr->Config.BaseAddress,
							(u32)XAPM_CTL_OFFSET);
	/* Globlal Clock Counter is present in Advanced mode only */
	if(InstancePtr->Mode == XAPM_MODE_ADVANCED)
	{
		RegValue = RegValue | XAPM_CR_GCC_ENABLE_MASK;
	}

	/*
	 * Write the new value to the Control register to enable
	 * global clock counter and metric counters
	 */
	XAxiPmon_WriteReg(InstancePtr->Config.BaseAddress, (u32)XAPM_CTL_OFFSET,
              RegValue | XAPM_CR_MCNTR_ENABLE_MASK);

	/* Set, enable, and load sampled counters */
	XAxiPmon_SetSampleInterval(InstancePtr, SampleInterval);
	XAxiPmon_LoadSampleIntervalCounter(InstancePtr);
	XAxiPmon_EnableSampleIntervalCounter(InstancePtr);

	return XST_SUCCESS;
}
/*****************************************************************************/
/**
*
* This function enables the following in the AXI Performance Monitor:
*   - Global clock counter
*   - All metric counters
*   - All sampled metric counters
*
* @param    InstancePtr is a pointer to the XAxiPmon instance.
* @param    SampleInterval is the sample interval for the sampled metric
*           counters
*
* @return   XST_SUCCESS
*
* @note	    None
******************************************************************************/
This function enables the following in the AXI Performance Monitor:
Global clock counter
All metric counters
All sampled metric counters
This function enables the following in the AXI Performance Monitor : Global clock counter All metric counters All sampled metric counters
s32 XAxiPmon_StartCounters(XAxiPmon *InstancePtr, u32 SampleInterval)
{
	u32 RegValue;
	Xil_AssertNonvoid(InstancePtr != NULL);
	Xil_AssertNonvoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY);
	Xil_AssertNonvoid((InstancePtr->Mode == XAPM_MODE_PROFILE) ||
				((InstancePtr->Mode == XAPM_MODE_ADVANCED) &&
				(InstancePtr->Config.IsEventCount == 1U)));
	RegValue = XAxiPmon_ReadReg(InstancePtr->Config.BaseAddress,
							(u32)XAPM_CTL_OFFSET);
	if(InstancePtr->Mode == XAPM_MODE_ADVANCED)
	{
		RegValue = RegValue | XAPM_CR_GCC_ENABLE_MASK;
	}
	XAxiPmon_WriteReg(InstancePtr->Config.BaseAddress, (u32)XAPM_CTL_OFFSET,
              RegValue | XAPM_CR_MCNTR_ENABLE_MASK);
	XAxiPmon_SetSampleInterval(InstancePtr, SampleInterval);
	XAxiPmon_LoadSampleIntervalCounter(InstancePtr);
	XAxiPmon_EnableSampleIntervalCounter(InstancePtr);
	return XST_SUCCESS;
}
s32 XAxiPmon_StartCounters ( XAxiPmon * InstancePtr , u32 SampleInterval ) { u32 RegValue ; Xil_AssertNonvoid ( InstancePtr != NULL ) ; Xil_AssertNonvoid ( InstancePtr -> IsReady == XIL_COMPONENT_IS_READY ) ; Xil_AssertNonvoid ( ( InstancePtr -> Mode == XAPM_MODE_PROFILE ) || ( ( InstancePtr -> Mode == XAPM_MODE_ADVANCED ) && ( InstancePtr -> Config . IsEventCount == 1U ) ) ) ; RegValue = XAxiPmon_ReadReg ( InstancePtr -> Config . BaseAddress , ( u32 ) XAPM_CTL_OFFSET ) ; if ( InstancePtr -> Mode == XAPM_MODE_ADVANCED ) { RegValue = RegValue | XAPM_CR_GCC_ENABLE_MASK ; } XAxiPmon_WriteReg ( InstancePtr -> Config . BaseAddress , ( u32 ) XAPM_CTL_OFFSET , RegValue | XAPM_CR_MCNTR_ENABLE_MASK ) ; XAxiPmon_SetSampleInterval ( InstancePtr , SampleInterval ) ; XAxiPmon_LoadSampleIntervalCounter ( InstancePtr ) ; XAxiPmon_EnableSampleIntervalCounter ( InstancePtr ) ; return XST_SUCCESS ; }
This function enables the following in the AXI Performance Monitor:
 Global clock counter
 All metric counters
 All sampled metric counters
This function enables the following in the AXI Performance Monitor : Global clock counter All metric counters All sampled metric counters
/*
	 * Assert the arguments.
	 */ /* Read current register value */ /* Globlal Clock Counter is present in Advanced mode only */ /*
	 * Write the new value to the Control register to enable
	 * global clock counter and metric counters
	 */ /* Set, enable, and load sampled counters */