XilinxProcessorIPLib/drivers/aiengine/src/tile/xaietile_core.c
u8 XAieTile_CoreWaitStatus(XAieGbl_Tile *TileInstPtr, u32 TimeOut, u32 Status)
{
	u64 RegAddr;
	u32 Mask;
	u32 Value;
	u8 Ret;

	XAie_AssertNonvoid(TileInstPtr != XAIE_NULL);
	XAie_AssertNonvoid(Status == XAIETILE_CORE_STATUS_DONE ||
				Status == XAIETILE_CORE_STATUS_DISABLE);

	if(Status == XAIETILE_CORE_STATUS_DONE) {
		Mask = CoreStsReg.Done.Mask;
		Value = XAIETILE_CORE_STATUS_DONE << CoreStsReg.Done.Lsb;
	} else {
		Mask = CoreStsReg.En.Mask;
		Value = XAIETILE_CORE_STATUS_DISABLE << CoreStsReg.En.Lsb;
	}

	/* Get the Core status register address */
	RegAddr = TileInstPtr->TileAddr + CoreStsReg.RegOff;

	if(TimeOut == 0U) {
		/* Set timeout to default value */
		TimeOut = XAIETILE_CORE_STATUS_DEF_WAIT_USECS;
	}

	if (XAieGbl_MaskPoll(RegAddr, Mask, Value, TimeOut) == XAIE_SUCCESS) {
		Ret = Status;
	} else {
		Ret = !Status;
	}

	return Ret;
}
/*****************************************************************************/
/**
*
* This API implements a blocking wait function to check for the core status
* to be disabled or done. API comes out of the wait loop when core status
* changes to done/disable or the timeout elapses, whichever happens first.
*
* @param	TileInstPtr - Pointer to the Tile instance.
* @param	TimeOut - TimeOut in usecs. If set to 0, the default timeout
*               will be set to 500 usecs.
* @param        Status - 1 for Core_done and 0 for Disable
*               Use macros XAIETILE_CORE_STATUS_DONE/XAIETILE_CORE_STATUS_DISABLE
*
* @return	The requested status if wait completes successful, or !Status.
*
* @note		None.
*
*******************************************************************************/
This API implements a blocking wait function to check for the core status
to be disabled or done. API comes out of the wait loop when core status
changes to done/disable or the timeout elapses, whichever happens first.
This API implements a blocking wait function to check for the core status to be disabled or done . API comes out of the wait loop when core status changes to done / disable or the timeout elapses whichever happens first .
u8 XAieTile_CoreWaitStatus(XAieGbl_Tile *TileInstPtr, u32 TimeOut, u32 Status)
{
	u64 RegAddr;
	u32 Mask;
	u32 Value;
	u8 Ret;
	XAie_AssertNonvoid(TileInstPtr != XAIE_NULL);
	XAie_AssertNonvoid(Status == XAIETILE_CORE_STATUS_DONE ||
				Status == XAIETILE_CORE_STATUS_DISABLE);
	if(Status == XAIETILE_CORE_STATUS_DONE) {
		Mask = CoreStsReg.Done.Mask;
		Value = XAIETILE_CORE_STATUS_DONE << CoreStsReg.Done.Lsb;
	} else {
		Mask = CoreStsReg.En.Mask;
		Value = XAIETILE_CORE_STATUS_DISABLE << CoreStsReg.En.Lsb;
	}
	RegAddr = TileInstPtr->TileAddr + CoreStsReg.RegOff;
	if(TimeOut == 0U) {
		TimeOut = XAIETILE_CORE_STATUS_DEF_WAIT_USECS;
	}
	if (XAieGbl_MaskPoll(RegAddr, Mask, Value, TimeOut) == XAIE_SUCCESS) {
		Ret = Status;
	} else {
		Ret = !Status;
	}
	return Ret;
}
u8 XAieTile_CoreWaitStatus ( XAieGbl_Tile * TileInstPtr , u32 TimeOut , u32 Status ) { u64 RegAddr ; u32 Mask ; u32 Value ; u8 Ret ; XAie_AssertNonvoid ( TileInstPtr != XAIE_NULL ) ; XAie_AssertNonvoid ( Status == XAIETILE_CORE_STATUS_DONE || Status == XAIETILE_CORE_STATUS_DISABLE ) ; if ( Status == XAIETILE_CORE_STATUS_DONE ) { Mask = CoreStsReg . Done . Mask ; Value = XAIETILE_CORE_STATUS_DONE << CoreStsReg . Done . Lsb ; } else { Mask = CoreStsReg . En . Mask ; Value = XAIETILE_CORE_STATUS_DISABLE << CoreStsReg . En . Lsb ; } RegAddr = TileInstPtr -> TileAddr + CoreStsReg . RegOff ; if ( TimeOut == 0U ) { TimeOut = XAIETILE_CORE_STATUS_DEF_WAIT_USECS ; } if ( XAieGbl_MaskPoll ( RegAddr , Mask , Value , TimeOut ) == XAIE_SUCCESS ) { Ret = Status ; } else { Ret = ! Status ; } return Ret ; }
This API implements a blocking wait function to check for the core status
to be disabled or done.
This API implements a blocking wait function to check for the core status to be disabled or done .
/* Get the Core status register address */ /* Set timeout to default value */