XilinxProcessorIPLib/drivers/aienginev2/src/pm/xaie_clock.c
AieRC XAie_PmRequestTiles(XAie_DevInst *DevInst, XAie_LocType *Loc,
		u32 NumTiles)
{
	XAie_BackendTilesArray TilesArray;

	if((DevInst == XAIE_NULL) ||
		(DevInst->IsReady != XAIE_COMPONENT_IS_READY)) {
		XAIE_ERROR("Invalid Device Instance\n");
		return XAIE_INVALID_ARGS;
	}

	if(NumTiles > (DevInst->NumRows * DevInst->NumCols)) {
		XAIE_ERROR("Invalid NumTiles\n");
		return XAIE_INVALID_ARGS;
	}

	if (NumTiles != 0 && Loc == NULL) {
		XAIE_ERROR("NumTiles is not 0, but Location array is empty.\n");
		return XAIE_INVALID_ARGS;
	}

	/* Check validity of all tiles in the list passed to this API */
	for(u32 j = 0; j < NumTiles; j++) {
		if(Loc[j].Row >= DevInst->NumRows ||
			Loc[j].Col >= DevInst->NumCols) {
			XAIE_ERROR("Invalid Loc Col:%d Row:%d\n", Loc[j].Col, Loc[j].Row);
			return XAIE_INVALID_ARGS;
		}
	}

	TilesArray.NumTiles = NumTiles;
	TilesArray.Locs = Loc;

	return XAie_RunOp(DevInst, XAIE_BACKEND_OP_REQUEST_TILES,
			(void *)&TilesArray);
}
/*****************************************************************************/
/***************************** Macro Definitions *****************************/
/************************** Function Definitions *****************************/
/*****************************************************************************/
/**
* This API enables clock for all the tiles passed as argument to this API.
*
* @param	DevInst: Device Instance
* @param	Loc: Location of AIE tile
* @param	NumTiles: Number of tiles requested for use.
*
* @return	XAIE_OK on success.
*
* @note		As all the tiles are gated when the system boots, this function
*		needs to be called after device instance is initialized and
*		before any other AI engine operations. Otherwise, the other
*		AI engine functions may access gated tiles.
*
*******************************************************************************/
Macro Definitions
Function Definitions

This API enables clock for all the tiles passed as argument to this API.
Macro Definitions Function Definitions This API enables clock for all the tiles passed as argument to this API .
AieRC XAie_PmRequestTiles(XAie_DevInst *DevInst, XAie_LocType *Loc,
		u32 NumTiles)
{
	XAie_BackendTilesArray TilesArray;
	if((DevInst == XAIE_NULL) ||
		(DevInst->IsReady != XAIE_COMPONENT_IS_READY)) {
		XAIE_ERROR("Invalid Device Instance\n");
		return XAIE_INVALID_ARGS;
	}
	if(NumTiles > (DevInst->NumRows * DevInst->NumCols)) {
		XAIE_ERROR("Invalid NumTiles\n");
		return XAIE_INVALID_ARGS;
	}
	if (NumTiles != 0 && Loc == NULL) {
		XAIE_ERROR("NumTiles is not 0, but Location array is empty.\n");
		return XAIE_INVALID_ARGS;
	}
	for(u32 j = 0; j < NumTiles; j++) {
		if(Loc[j].Row >= DevInst->NumRows ||
			Loc[j].Col >= DevInst->NumCols) {
			XAIE_ERROR("Invalid Loc Col:%d Row:%d\n", Loc[j].Col, Loc[j].Row);
			return XAIE_INVALID_ARGS;
		}
	}
	TilesArray.NumTiles = NumTiles;
	TilesArray.Locs = Loc;
	return XAie_RunOp(DevInst, XAIE_BACKEND_OP_REQUEST_TILES,
			(void *)&TilesArray);
}
AieRC XAie_PmRequestTiles ( XAie_DevInst * DevInst , XAie_LocType * Loc , u32 NumTiles ) { XAie_BackendTilesArray TilesArray ; if ( ( DevInst == XAIE_NULL ) || ( DevInst -> IsReady != XAIE_COMPONENT_IS_READY ) ) { XAIE_ERROR ( " \n " ) ; return XAIE_INVALID_ARGS ; } if ( NumTiles > ( DevInst -> NumRows * DevInst -> NumCols ) ) { XAIE_ERROR ( " \n " ) ; return XAIE_INVALID_ARGS ; } if ( NumTiles != 0 && Loc == NULL ) { XAIE_ERROR ( " \n " ) ; return XAIE_INVALID_ARGS ; } for ( u32 j = 0 ; j < NumTiles ; j ++ ) { if ( Loc [ j ] . Row >= DevInst -> NumRows || Loc [ j ] . Col >= DevInst -> NumCols ) { XAIE_ERROR ( " \n " , Loc [ j ] . Col , Loc [ j ] . Row ) ; return XAIE_INVALID_ARGS ; } } TilesArray . NumTiles = NumTiles ; TilesArray . Locs = Loc ; return XAie_RunOp ( DevInst , XAIE_BACKEND_OP_REQUEST_TILES , ( void * ) & TilesArray ) ; }
Macro Definitions
Function Definitions
Macro Definitions Function Definitions
/* Check validity of all tiles in the list passed to this API */