XilinxProcessorIPLib/drivers/aiengine/src/lib/xaielib.c
XAieLib_MemInst *XAieLib_MemInit(u8 idx)
{
#ifdef __AIESIM__
	return 0;
#elif defined __AIEBAREMTL__
	XAieLib_MemInst *XAieLib_MemInstPtr;

	XAieLib_MemInstPtr = malloc(sizeof(*XAieLib_MemInstPtr));
	if (!XAieLib_MemInstPtr)
		return NULL;
	XAieLib_MemInstPtr->Vaddr = (u64)malloc(XAIELIB_BAREMTL_DEF_MEM_SIZE);
	if (!XAieLib_MemInstPtr->Vaddr) {
		free(XAieLib_MemInstPtr);
		return NULL;
	}
	XAieLib_MemInstPtr->Paddr = XAieLib_MemInstPtr->Vaddr;
	XAieLib_MemInstPtr->Size = XAIELIB_BAREMTL_DEF_MEM_SIZE;

	return XAieLib_MemInstPtr;
#else
	return (XAieLib_MemInst *)XAieIO_MemInit(idx);
#endif
}
/*****************************************************************************/
/**
*
* This is the memory function to initialize the platform specific memory
* instance.
*
* @param	idx: Index of the memory to initialize.
*
* @return	Pointer to the initialized memory instance. Null or 0 if not
* supported.
*
* @note		None.
*
*******************************************************************************/
This is the memory function to initialize the platform specific memory
instance.
This is the memory function to initialize the platform specific memory instance .
XAieLib_MemInst *XAieLib_MemInit(u8 idx)
{
#ifdef __AIESIM__
	return 0;
#elif defined __AIEBAREMTL__
	XAieLib_MemInst *XAieLib_MemInstPtr;
	XAieLib_MemInstPtr = malloc(sizeof(*XAieLib_MemInstPtr));
	if (!XAieLib_MemInstPtr)
		return NULL;
	XAieLib_MemInstPtr->Vaddr = (u64)malloc(XAIELIB_BAREMTL_DEF_MEM_SIZE);
	if (!XAieLib_MemInstPtr->Vaddr) {
		free(XAieLib_MemInstPtr);
		return NULL;
	}
	XAieLib_MemInstPtr->Paddr = XAieLib_MemInstPtr->Vaddr;
	XAieLib_MemInstPtr->Size = XAIELIB_BAREMTL_DEF_MEM_SIZE;
	return XAieLib_MemInstPtr;
#else
	return (XAieLib_MemInst *)XAieIO_MemInit(idx);
#endif
}
XAieLib_MemInst * XAieLib_MemInit ( u8 idx ) { #ifdef __AIESIM__ return 0 ; #elif defined __AIEBAREMTL__ XAieLib_MemInst * XAieLib_MemInstPtr ; XAieLib_MemInstPtr = malloc ( sizeof ( * XAieLib_MemInstPtr ) ) ; if ( ! XAieLib_MemInstPtr ) return NULL ; XAieLib_MemInstPtr -> Vaddr = ( u64 ) malloc ( XAIELIB_BAREMTL_DEF_MEM_SIZE ) ; if ( ! XAieLib_MemInstPtr -> Vaddr ) { free ( XAieLib_MemInstPtr ) ; return NULL ; } XAieLib_MemInstPtr -> Paddr = XAieLib_MemInstPtr -> Vaddr ; XAieLib_MemInstPtr -> Size = XAIELIB_BAREMTL_DEF_MEM_SIZE ; return XAieLib_MemInstPtr ; #else return ( XAieLib_MemInst * ) XAieIO_MemInit ( idx ) ; #endif }
This is the memory function to initialize the platform specific memory
instance.
This is the memory function to initialize the platform specific memory instance .